title: JQuery in html file from different baseUrl in iphone/ipad UIWebview
body: <p>my app is creating html file from a string and inject it into my UIWebview using loadData.</p>
  
  <p>my assets (images and js files) are downloaded from remote server into my device, and i give their baseUrl into the loadData method (documents/pics/assets).</p>
  
  <p>in this directory i also have 2 files of jquery.</p>
  
  <p>my problem is that the uiwebview can not use the jquery, i don't know why. my html finds the other assets in the same dir (images) but it seems it can't find the jquery.</p>
  
  <p>when i try using it on the regular safari, it works. when inserting the js code into the html file, it works. but using the files localy not working on my ipad.</p>
  
  <p>this is my code in app:</p>
  
  <pre><code>NSArray *docDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
  NSString *imagePath = [NSString stringWithFormat:@"%@/pics", [docDir objectAtIndex:0]];
  NSString *imagePath = [NSString stringWithFormat:@"%@/pics", [docDir objectAtIndex:0]];
  imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
  imagePath = [imagePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
  
  NSData *htmlDataPortrait = [_stringFromData dataUsingEncoding:NSUnicodeStringEncoding allowLossyConversion:YES];
  
  [_portraitWebview loadData:htmlDataPortrait MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString: [NSString stringWithFormat:@"file:/%@//",imagePath]]];
  </code></pre>
  
  <p>and this is the code i'm trying to use in my html file:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;head&gt;
  
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  
      &lt;style type="text/css"&gt;
  
          body {
  
              margin-left: 0px;
  
              margin-top: 0px;
  
              margin-right: 1024px;
  
              margin-bottom: 606px;
  
              background-repeat: no-repeat;
  
              background-color: transparent;
  
          }
  
      &lt;/style&gt;
  
      &lt;script type="text/javascript" src="assets/jquery.min.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" src="assets/func.js"&gt;&lt;/script&gt;
  
     &lt;script&gt;
  
          $('body').ready(function(){
  
              reOrderArtWithImgOpt('1');
  
              $('div#fullpage').css('visibility', 'visible');
  
              imgNum = $('img[width!=0]').length;
  
              imgIndex = 0;
  
              $('img').load(function(){
  
                  ++imgIndex;
  
                  if (imgIndex == imgNum) {
  
                      setTimeout("setEventDone()", 50);
  
                  }
  
              });
  
          });
  
          function setEventDone(){
  
              window.location.href = 'myapp://loaded';
  
          }
  
      &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
      touchMove = function(event){
  
          // Prevent scrolling on this element
  
          event.preventDefault();
  
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>the "assets/..." dir is in the documents/pics dir.</p>
  
  <p>the code is not entering:</p>
  
  <pre><code>$('body').ready(function(){
  </code></pre>
  
  <p>thanks.</p>