Jquery onclick event to change to onload -
I am using the following code that works when I click on link 1, what do I want to do I should automatically fire the pageload event on the talk, how to do it?
& lt; Head & gt; & Lt; Title & gt; JQuery Test Page & lt; / Title & gt; & Lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Function load communication (element selector, source url) {$ ("+ + element selector +" ".log (" http://abc.com/ "+ sourceUrl +" ");} & lt; / script & gt; & Lt; / head & gt; body & gt; & lt; a href = "javascript: loadContent ('# content', 'displayimages.php');" & gt; link 1 & lt; / a & Gt; & lt; div id = "content" & gt; content will be loaded here & lt; / div & gt; & lt; / body & gt; & lt; / html & gt;
Just call the method on page load
$ (document) .ready (Function () {loadContent ('# content', 'displayimages.php');});
Comments
Post a Comment