I am building a html file which is stored in
[[PROJ UserDirectory] stringByAppendingPathComponent:@"tmp_Form_File.html"]
and inside of the file "tmp_FOrm_File.html" it is being dynamically built. Body shows up correctly but the JS will not execute.
I was trying to do:
NSString * cordova_path = [[NSBundle mainBundle] oathForResource:@"cordova-2.2.0" ofType:@"js" inDirectory:@"html"]
NSString = [[@"<script type=\"text/javascript\" src=\"" stringByAppendingString:cordova_path] stringByAppendingString:@"\"></script>"];
and similarly for jquery.
My issue is that i dont think that when I load the htmlfile into a webView that it gets the data accordingly.
I tested the strings, and they look sound:
<script type="text/javascript" src="/var/mobile/Applications/[DATA]/PROJ.app/html/cordova-2.2.0.js"></script><script type="text/javascript" src="/var/mobile/Applications/[DATA]/PROJ.app/html/jquery-1.7.2.min.js"></script><script type="text/javascript">$(function(){ alert("test"); });</script>
1) Am i doing it wrong? if So, how do i resolve this?
2) Would it be better to through ios copy the html directory in the bundle to Documents? If so, how?
Edit: Temporarily removed the jquery references, jquery and cordova. just used pure javascript, and it will alert correctly. So that means there is something wrong with the src being in the Bundle.