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 
couple hours with google got me these codes however i dont know if or how they work . . . . 
- (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:@βwindow.open = 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\";\
}"];
}