javascript - Can jQuery ready() function be used twice for the same element? -


i want use jquery ready() function document element. here scripts:

1st page:

$(document).ready(function(){             $('form#haberekle').ajaxform(options); }); 

2nd page:

    $(document).ready(function() {      var options = {          success:showresponse,         beforesubmit:showrequest,         resetform:true     };     $('#haberresmiekleform').ajaxform(options);  }); 

these 2 pages included in same main page <!--#include file=""-->

can these 2 functions work properly, or block each other? according experience seem work properly.

for example: onclick function of button one.

you can have many .ready() calls want, jquery designed in mind , it's absolutely ok.

so yes, ok, , won't have problems...this happens time.

think of event handler, .click(), how behaves (well, strictly speaking, not exactly, purposes this). can have many want.

one more note may of interest, handlers pass .ready() are pushed via .done() readylist, means they'll execute in order called them in page. same order behavior true (though via array, different method) in earlier versions of jquery.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -