gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 04:31:15 26 4
gpt4 key购买 nike

我想向 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com