to convert a plain js function to jQuery
i have a js function and this is working when the page loads but i tried to convert into jQuery & not working now. please help me out and describe why isn't this working.
window.onload = function updatePreviewHTML() {
alert("hello"); }
as i converted this into jQuery but it's not working
$(document).ready(func开发者_开发知识库tion() {
alert("Hello"); });
Thanks for your time.
@ jfriend00's guessing was right and i noticed that the js file is included above the jQuery's js files and that is why i was getting error.
I included my js file just below the jQuery files and it starts running well.
精彩评论