javascript - 为什么jquery追加在phonegap ios中不起作用

标签 javascript jquery ios cordova

我想向 div 添加一些 html 并使用此代码(在 document.ready 函数中):

var html= "<h2>Name:"+JSONObject.name+"</h2>" 
html += "<h2>Address:" +JSONObject.address+"</h2>";  
html += "<h2>Age:" +JSONObject.age+"</h2>";  
html += "<h2>Phone No.:"+JSONObject.phone+"</h2>";  
html += "<h2>Mobile No.:"+JSONObject.MobileNo+"</h2>";
$('#locationresultholder').append(html);

现在在 html 文件的正文中我有:

<div id="locationresultholder"></div>

现在,如果我启动 ios 模拟器,我看不到我想要附加的 HTML。有谁知道怎么做吗?

最佳答案

首先要检查是否包含jquery的文件~~ 例如进行测试:

$(function(){
alert("jquery");
})

你可以使用firebug检查jquery文件路径,检查404错误, 这是我所知道的,希望对你有用

关于javascript - 为什么jquery追加在phonegap ios中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11718553/

相关文章:

javascript - 如何优化 canActive Angular 代码

javascript - 正则表达式的乐趣 - 找到一些但跳过其他

jquery制作一个复选框

javascript - CometD v3.0.9 - 服务器端断开连接未在消息上设置成功标志( channel /元/断开连接)

ios - 可达性更改通知适用于 iOS5,但不适用于 iOS4

ios - 在上下文之间传递objectID时未触发多对多故障

javascript - Hyperledger - Fabric Node SDK - 曲线属性错误

javascript - 数组中对象的 setState

javascript - 在特定列表项之后添加元素

ios - prepareForSegue : how can I set an if-condition?