hi everyone
i want to run a function in javascript when page loads. but after loading the page nothing happens! but if i manually refresh the page the function runs! i used these two methods but i dont know where is my problemo! :
$(window).bind("load", function() {
});
and this:
window.onload = showOnEdit;// showOnEdit is my function name
or you can do it by calling onload on the body and then your javascript function. you seem to be missing the "" and the () when you call the function. this sould work fine:
hi everyone i want to run a function in javascript when page loads. but after loading the page nothing happens! but if i manually refresh the page the function runs! i used these two methods but i dont know where is my problemo! :
and this: window.onload = showOnEdit;// showOnEdit is my function name
you can look for when the document is ready:
or you can do it by calling onload on the body and then your javascript function. you seem to be missing the "" and the () when you call the function. this sould work fine:
hope this helped..
@CarlRosell thanks Carl, i will test "document ready" but i cant test the second one because my site is WordPress.
No prob.