|
From: laredotornado on 14 Jul 2008 17:19 Hi, I'm inserting some text on a JSF page using var treeModel = {identifier: 'id',label: 'label', items: <h:outputText value='#{AddApplicationPage.applications}' escape='false'/> where the "getApplication" method returns the "toString()" method of a JSONArray object: JSONArray applications; /* applications var is populated */ rtn = applications.toString().replaceAll("\"", ""); return rtn; Problem is, if that object contains apostrophes, the Javascript above parses incorrectly. For example, here is an output block: var treeModel = {identifier: 'id',label: 'label', items: [{id: 'app8',label: 'DAVE_TEST',description: 'dave's test',loginURL: 'http://url1.com/login.html',logoutURL: 'http:// url2.com/login.html?logout=true'}] }; Any suggestions on a clean way to escape the apostraphes above? Thanks, - Dave
|
Pages: 1 Prev: Portable Directory Meanings in Java SE Next: JDO and metadata annotations |