在iOS中更改JavaScript警报对话框标题 [英] Change JavaScript alert dialog title in iOS

查看:102
本文介绍了在iOS中更改JavaScript警报对话框标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在iPhone中的 UIWebview 中更改JavaScript提醒标题?

Is it possible to change the JavaScript alert title in a UIWebview in iPhone?

推荐答案

基本上你不能改变标题,但最近我找到了一种方法来显示没有标题的警告对话框。

Basically you cannot change the title, but recently I have found a way to show an alert dialog with no title.

var iframe = document.createElement("IFRAME");
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
window.frames[0].window.alert('hello');
iframe.parentNode.removeChild(iframe);

这篇关于在iOS中更改JavaScript警报对话框标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆