Say,how to implement these three steps:
1.fetch a html source from server side
2.use the above source to create a DIV
3.append it to <body>
Element
Say,how to implement these three steps:
1.fetch a html source from server side
2.use the above source to create a DIV
3.append it to <body>
Element
add a with class name to end of body say "append" with nothing in it.
then
$('.append').load('url of content');
Kindness,
Dan
$('<div></div>').load("/url/to/load.html").appendTo('body');
will create a div on the fly then make an ajax call (this must be a local file here), then append it to your body.
Additionnaly you can give your div more attributes :
$('<div class="cssname"><span>hello</span></div>')
Plus, you can also specifies a certain div of your page to load :
$('<div></div>').load("/url/to/load.html #onlythis .block")
There's no limit and keep in mind that if you want to create something that don't exist in your page, just do :
$('<element></element>')
and don't forget to append it
HF !