Hey guys I am trying to do something very simple but its not works as i want it to.
What I want to do is if the url in the browser mach http://www.MYSITE.com/live/category/0?live then I want to have jquery activate the checkbox with the id of only_live. currently this script is on a loop for some reason. please help me.
Here is my html
Here is my Jquery
What I want to do is if the url in the browser mach http://www.MYSITE.com/live/category/0?live then I want to have jquery activate the checkbox with the id of only_live. currently this script is on a loop for some reason. please help me.
Here is my html
Code:
<td> <input type="checkbox" id="only_live" name="only_live" onclick="this.form.submit();" value="true" /> </td> <td> SOME TEXT</td>
Code:
<script type="text/javascript"> $(function() { if(window.location == "http://www.MYSITE.com/live/category/0?live") { if($('#only_live').is(':checked'==false)) { $('input[name=only_live]').attr('checked', true); } } }); </script>
Comment