我有onbeforeunload的处理程序
window.onbeforeunload = unloadMess;
function unloadMess(){
var conf = confirm("Wait! Before you go, please share your stories or experiences on the message forum.");
if(conf){
window.location.href = "http://www.domain.com/message-forum";
}
}
Run Code Online (Sandbox Code Playgroud)
但我不知道如何知道他们点击页面上的网址是否在网站内.
我只是希望他们提醒他们是否会离开网站.
我想'wildcard %'在MySQL中匹配这个.
我尝试使用逃生\%,它无法正常工作.