HI,
I m using the following script to call a onload function but it does not works in IE
("#body").attr({onload : "calFact();"});
HI,
I m using the following script to call a onload function but it does not works in IE
("#body").attr({onload : "calFact();"});
You'll probably want to do this instead:
$('#body').ready(function(){
calFact();
});
You cannot set onload event handlers on anything other than the window. (Well, you can, but it will have no effect.) If you want calFact to run at the onload event, you should use $(window).load(calFact);. But generally it is more useful to call things at the DOMready event: $(document).ready(calFact); or just $(calFact); for short. The difference is that onload happens when everything loaded (including images, which are slow to load), and DOMready happens when the DOM tree is loaded (but images not necessarily yet).
Also, there is not much point in assigning an id of body to the body when there is only one of it anyway; you can just use $('body').