call jquery fom php script -


<script type="text/javascript">     <!--//     // on dom ready     $(document).ready(function (){         $("#current_rev").html("v"+$.jnotify.version);         $("a.example").bind("click", function (e){             // prevent default behavior             e.preventdefault();              var $ex = $($(this).attr("href")), code = $.trim($ex.text());              // execute sample code             $.globaleval(code);         });          // style switcher         $("button.css_switcher").click(function (){             switchcss(this.title);         });     });        //-->     </script> 

instead of using click events <a href="#example-1" class="example">[run]</a> , <a href="#example-2" class="example">[run]</a>

how can call events if condition true or false?

<?php if (true){ <a href="#example-1" class="example">[run]</a>}else{ <a href="#example-2" class="example">[run]</a>} ?> 

you mean "trigger" events? question bit confusing.

you can add $("#example-1").trigger("click") document.ready function. if condition true on server side on client side when page gets sent user.

make sure attach click event before trigger it.


Comments

Popular posts from this blog

c# - BasicHttpBinding equivalent CustomBinding using WCF Client and PHP WebService -

sql server - python to mssql encoding problem -

java - SNMP4J General Variable Binding Error -