Exp*_*ion 1 javascript jquery userscripts
有一个网站会根据您在页面中所做的操作用文本提醒您。
我想用JavaScript阅读该消息,因此我可以根据页面在弹出文本中显示的内容编写一些代码。
alert("message");
Run Code Online (Sandbox Code Playgroud)
我只需要知道“消息”是什么!
我试图从中获取消息的网站是用asp.net编码的。如果无法用JS读取消息,该怎么办。
alert()是全局函数,即window.alert()可以覆盖。
最有可能的是,您仍然需要警报,因此您可以在覆盖之前对其进行记录,并给出:
window.old_alert = window.alert;
window.alert = function(msg) {
// Process the msg here
console.log(msg);
// still show the original alert
old_alert(msg);
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
879 次 |
| 最近记录: |