Too much recursion in JavaScript -


i have javascript opens new page:

$(document).ready(function () {     //$('a[id$="lnkhidden"]').trigger("click");    // not sure if necessary      $('table[id$="datatable"]').find("tbody").on("click", "tr", function () {         $(this).find('a[id$="lnkhidden"]').trigger("click");     }); }); 

this button called js script:

<h:commandlink id="lnkhidden" action="#{bean.pageredirect}" style="text-decoration:none; color:white; display:none">  </h:commandlink> 

after click on table row error message:

too recursion [break on error] ...,c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=‌​[],... 

can me fix this?

you can cut infinite loop changes original code

  • add second argument trigger. call becomes .trigger("click", [ true ])
  • name arguments in event handler : function(event, simulated)
  • use simulated argument set true trigger : simulated || $(this).find('a[id$="lnkhidden"]').trigger("click", [ true ]);

however event triggering , kind of selectors not recommended.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -