I have this JQuery function:
function addSomeHTML()
{
$("#mysection").html("<div id='myid'>some content here</div>");
}
I basically need this part: <div id='myid'>some content here</div>
to be read from an external file.
Can anyone help please?
Thanks
I have this JQuery function:
function addSomeHTML()
{
$("#mysection").html("<div id='myid'>some content here</div>");
}
I basically need this part: <div id='myid'>some content here</div>
to be read from an external file.
Can anyone help please?
Thanks
Share Improve this question asked Apr 17, 2011 at 22:23 Satch3000Satch3000 49.5k90 gold badges225 silver badges349 bronze badges1 Answer
Reset to default 5Use the AJAX load()
method.
$('#mysection').load('yourfile.html');
Of course the URL can also point to a PHP script etc.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744696963a4588551.html
评论列表(0条)