简体   繁体   中英

why jquery append doesn't work in phonegap ios

I want to add some html to a div and use this code (in the document.ready function):

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);

now in the body of the html file I have:

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

now if I start the ios simulator I don't see the HTML which I wanted to append. Anyone know how?

first you should check that whether including the file of the jquery~~ the make a test for example :

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

you can use the firebug check the jquery file path,check the 404 error, this is what i know,i hope it is useful for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM