$('body').load(
// Handler for .load() called.
amazingfunction("#chairleg");
);
function amazingfunction(str){
// do ajax stuff with the variable
// this bit works fine. I just want to auto load the element into this.
}
Can someone please help? I am trying to take the html content of #chairleg immediately the page loads, and call the function ‘amazingfunction’ straightaway whilst passing the variable.
I seem to be getting nowhere. I also tried it with the following instead of line 3, but no luck still:
$("#chairleg").html;
Strangely, I also seem to be getting errors when i have a semi colon like ‘ ; ‘ at the end of line 3. any ideas about these two issues? I guess they are linked and issue 2 will be solved once issue 1 is solved?
Try this: