Tuesday 15 July 2014

jquery - document.ready for multiple forms with single JavaScript file -



jquery - document.ready for multiple forms with single JavaScript file -

i referencing javascript follows on html page:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script> </script> <script type="text/javascript" src="js/application.js"></script> <script type="text/javascript"> $('document').ready(function() { // phone call function specific page alert("this alert show particuar page"); }); </script>

my question have lot of functions bootstrap/jquery plugin functions go within document.ready(). result, there lot of javascript code in html pages. how can port functions need executed within document.ready shared file application.js? know can write giant document.ready within application.js has dom ready functions html files within it. there improve option? give thanks help.

edit:

sorry if not clear. meaning say: if there 2 html pages: html1, html2 how tell shared javascript file execute document.ready functions html1 , not html2. if understand correctly, functions within document.ready executed every time page loads.

similar situation here

you can utilize script defer attribute, create scripts load after html renderer. it's equal set scripts under document ready. here link:

http://www.w3schools.com/tags/att_script_defer.asp

javascript jquery html

No comments:

Post a Comment