使用 jQuery 检索 HTML 格式的内容

retrieving html formatted content with jquery

本文关键字:格式 HTML jQuery 检索 使用      更新时间:2023-09-26

我想知道将html格式的数据从外部服务器传递到jquery手机差距应用程序是否首先是好主意,其次是安全的

例如,我从PhoneGap应用程序向服务器发出请求,它返回格式如下的数据。

<ul> 
    <li> David Addoteye <p>Age: 30years</p>
    <p>Location: ghana</p> <p>Accra Ghana</p> 
     <img src="icons/status-up.png"> 
    </li>
    <li> Samuel Anim <p>Age: 20years</p>
    <p>Location: USA</p> <p>New York</p> 
    <img src="icons/status-up.png">  </li>  
     <li> Grace Better <p>Age: 30years</p>
     <p>Location: UK</p> <p>London</p>
      <img src="icons/status-up.png"> </li>
</ul>

谢谢

到安全,无论格式如何,数据都可以被拦截 - 因此格式或纯文本并不重要。我已经将XML格式的数据用于各种应用程序。(但是,如果您正在寻找更具体的答案,在您的情况下,可能需要更多信息来确定您使用的安全性和最佳实践