显示HTML内容的场黑莓 [英] Displaying HTML content in a Field in blackberry

查看:186
本文介绍了显示HTML内容的场黑莓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到来自server..Inside JSON响应,我有HTML内容的JSON字符串,我需要在一个字段显示..

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..

谁能帮..

推荐答案

您可以只评估 JSON响应,但为了更好的安全性增加的 JSON解析的支持是相当简单的,尝试的 json2.js 库。然后,只需使用普通的JS符号来提取您的HTML字符串,并将其插入到文本字段中。

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.

需要注意的是:


  1. 黑莓浏览器不支持 XMLHtt prequest 直到4.6,例如 8310 的不支持吧。

  2. 默认情况下不会对黑莓浏览器中启用
  3. Javascript中,如果有企业设置,您可以通过<一个启用href=\"http://docs.blackberry.com/en/admin/deliverables/7229/MDS_Browser_JavaScript_Enabled_204041_11.jsp\"相对=nofollow> MDS策略规则

  4. 如果你有以上两个覆盖,要小心使用JavaScript库,你可以很容易耗尽设备内存只是间preting他们(含小于300k JS IMX的)

  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)

这篇关于显示HTML内容的场黑莓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆