Displaying HTML content in a Field in blackberry

做~自己de王妃 提交于 2019-12-13 03:39:50

问题


I am getting JSON response from the server..Inside that JSON string i am having HTML content which i need to display in a field..

Can anyone help..


回答1:


You can just eval the JSON response, though for better security adding JSON parsing support is fairly simple, try the json2.js library. Then just use normal JS notation to extract your HTML string and insert it into your text field.

Note that:

  1. The Blackberry browser didn't support XMLHttpRequest until 4.6, for example the Curve 8310 does not support it.
  2. Javascript is not enabled by default on the Blackberry browser, if you have corporate setup you can enable it through an MDS policy rule
  3. If you've got the above two covered, be careful with Javascript libraries as you can easily exhaust the device memory simply interpreting them (with less than 300k of JS IMX)



回答2:


See this question for more detail on how to display HTML content in a BlackBerry field by using a V4.5.0 BrowserContent class.



来源:https://stackoverflow.com/questions/1339384/displaying-html-content-in-a-field-in-blackberry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!