applescript application in xcode with web view problem

I have created a web view in xcode written in applescript, everything works fine however when the website attempts to run a javascript alert(); or opens a new window in safari nothing happens. Does anybody have a solution for a beginner to understand and implement?

Thanks :slight_smile:

couple hours with google got me these codes however i dont know if or how they work . . . . :frowning:

  • (void)webViewDidFinishLoad:(UIWebView *)webView
    [webView stringByEvaluatingJavaScriptFromString:@β€œ{ var a = document.getElementsByTagName("a"); for (var i=0; i<a.length; i++) { a[i].target = "_self"; } }”];
    [webView stringByEvaluatingJavaScriptFromString:@β€œ = function( inurl, blah, blah2 ) { document.location = inurl; }”];

(void)webViewDidFinishLoad:(UIWebView *)webView

[webView stringByEvaluatingJavaScriptFromString:@"{\
				 var a = document.getElementsByTagName(\"a\"); \
				 for (var i=0; i<a.length; i++) \
				 a[i].target = \"_self\";\