title: How do you use $('document').ready(function()) in jQuery?
body: <p>I have a piece of code that is working fine in IE, but it doesn’t run in Firefox. I think the problem is that I have not been able to implement <code>$('document').ready(function)</code>. The structure of my json is like [{"options":"smart_exp"},{"options":"user_intf"},{"options":"blahblah"}].
  I will be very thankful if someone can see my code &amp; help me in correctly implementing it. Here is my code:</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;
       &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2
       /jquery.min.js"&gt;&lt;/script&gt;
       &lt;script type="text/javascript" language="javascript"&gt;
       $(document).ready(function() { 
       $.getJSON("http://127.0.0.1/conn_mysql.php", function (jsonData) {
       $.each(jsonData, function (i, j) {
       document.form1.fruits.options[i] = new Option(j.options);
       });});
       });
       &lt;/script&gt;&lt;/head&gt;
       &lt;body&gt;&lt;form name="form1"&gt;
       My favourite fruit is :
       &lt;select name="fruits" id="fruits" /&gt;&lt;/form&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>