Home >Web Front-end >JS Tutorial >How to eliminate javascript warning box

How to eliminate javascript warning box

coldplay.xixi
coldplay.xixiOriginal
2020-10-21 14:02:074320browse

Method to eliminate the javascript warning box: first open the code to rewrite the alert method; then the rewritten syntax is [old method = function (parameter) {content of new method}], and the return value is false That’s it.

How to eliminate javascript warning box

Method to eliminate the javascript warning box:

Rewrite the "alert" method, the rewritten syntax is: : "Old method = function (parameter) {content of new method}", the return value should be "false", which means no operation is performed.

Specific code:

<script LANGUAGE="JavaScript">
<!--
window.alert = function(str){
return ;
}
alert("不能弹出警示框");//-->
</script>

Related free learning recommendations: javascript video tutorial

The above is the detailed content of How to eliminate javascript warning box. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn