2

私はこのフォームを持っています:

<form id="form1" name="form1" method="post" action="#" onsubmit="window.open('http://www.google.com','Google','width=800,height=500,top=5000,left=6000,status=yes,resizable=yes,scrollbars=yes');">
<input type="submit" name="submit" onclick="doSubmit();" id="submit" value="Submit" />
</form>

そしてそれに属するjavascriptは次のとおりです。

<script type="text/javascript">
    function doSubmit () {
        form1.submit();
    }
</script>

ネイティブサファリアプリでテストすると、すべてうまくいき、onsubmitアクションで新しいタブが開きますが、UIWebViewでテストすると、onsubmitは起動されません。

フォームは送信され、に登録されます

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

そして、すべてのメソッドはポップアップをインターセプトするように設定されています

[webView stringByEvaluatingJavaScriptFromString:@"window.open = function( inurl, blah, blah2 ) {  document.location = 'newTab:'+inurl; }"];

適切なUIWebViewデリゲートメソッドで。

なぜそれが発火しないのかについて何か考えはありますか?

ありがとう!

4

0 に答える 0