开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜