title: What causes the "jqGrid is not a function " error?
body: <p>I have problems after upgrading:</p>
  
  <ul>
  <li>jqGrid from 3.5.3 to 3.8.2</li>
  <li>jquery from 1.3.2 to 1.4.4</li>
  <li>jquery-ui from 1.7.2 to 1.8.8</li>
  </ul>
  
  <p>My application has jqueryui tabs. The third tab has a jqGrid control.
  If I do a reload while I'm on the third tab then the grid works correctly. However, if do a reload on the first tab and then click the third tab then to grid does not show.</p>
  
  <p>Firebug shows me the "jqGrid is not a function " error.</p>
  
  <p>Searching in the forums suggest the problem is an incorrect pathtojsfiles in grid.loader.js</p>
  
  <p>I prefix mine with document.URL like this:</p>
  
  <pre><code>function jqGridInclude()
  {
    var pathtojsfiles = document.URL + "script/jqGrid/src/"; // need to be ajusted
    ...
  }
  </code></pre>
  
  <p>If you set pathtojsfiles to the wrong value you see 'file not found' errors in Firebug. It all loads fine.</p>
  
  <p><a href="http://forum.jquery.com/topic/jqgrid-is-not-a-function" rel="nofollow">http://forum.jquery.com/topic/jqgrid-is-not-a-function</a></p>
  
  <p>This thread has a dead end:
  @milenaa: "I thought that it was a path problem at first, as I already had it before, but it works like this:  I have a menu which calls some server-side controllers that returns some data or I send some data for them.
  When I click on the link that calls the controller that later calls the jqgrid function it works. But, if first I call the other function, jqgrid doesn't work. And the page includes all the js needed for both cases.
  Its just like the other function doesn't let jqgrid work ... But I don't know why..."</p>
  
  <p>Reading this makes my think I have a similar problem.
  I have to admit that I'm not familiar with the execution model of Javascript.
  Any ideas on how to solve or debug this?</p>