Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy would one $(document).ready(function() { prevent another from running?
    primarykey
    data
    text
    <p>I understand that I am SUPPOSED to be able to run and many $(document).ready(function() { as I like, but the fact is, on my page, I CAN NOT. While I appreciate people letting me know that I should be able to do that, I am really hoping that someone might be able to tell me why one of these functions is preventing the other from running.</p> <p>I am running two separate $(document).ready(function() { on the same page. One is used to update a drop down meny when a search result is selected. The other is used to call a calendar function when a user clicks in the "date" text box. The date function works fine unless I call the name search function. If I do call the name search function, the Date function just doesn't run at all. I am a php hack, and really know almost nothing a javascript. </p> <p>The two functions are included in different "js" pages. Here are the two functions:</p> <pre><code>&lt;script language="JavaScript" src="&lt;?php echo MAIN_BASE_PATH?&gt;/includes/utils.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ jquery_date('date'); }); &lt;/script&gt; function jquery_date(name){ $("input[name='"+name+"']").datepicker({ dateFormat: 'mm-dd-yy' }); } </code></pre> <hr> <pre><code>&lt;link rel="stylesheet" type="text/css" href="../jquery.autocomplete.css" /&gt; &lt;script type="text/javascript" src="../jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="../jquery.autocomplete.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $("#student_search").autocomplete("autocomplete_student.php", { selectFirst: true }); $("#student_search").result(function(event, data, formatted) { $("#student_menu_&lt;?php echo $field_name;?&gt;").val(data[1]); }); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload