Why isn't my javascript working on a local HTML file using UIWebView loadRequest:?

Posted by Raphael on Stack Overflow See other posts from Stack Overflow or by Raphael
Published on 2010-05-12T21:58:26Z Indexed on 2010/05/12 22:04 UTC
Read the original article Hit count: 201

Filed under:
|

Hi Everyone,

I have a script that generates a temporary HTML file that has links to external Javascript files that it requires to run.

<script src="file:///Users/raphaeldefranco/Library/Application Support/iPhone Simulator/User/Applications/BA9E724E-76BD-4F28-B224-54B4C73786D6/LogTen.app/Reports/Time by Year/../../Tools/PlotKit/Base.js" type="text/javascript"></script>

The links are absolute and they are to the right place (There is a CSS link as well that uses the same method and it works fine). I've been using the following, which finds images and CSS just fine but for some reason won't run the .js.

[webView loadRequest:requestObj]; 

I've tried changing the encoding of the files. I had a problem getting the CSS to work until the file was in unicode, but so far no luck. All the Script files are bundled with my project etc.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about JavaScript