我现在又url
http://www.xxx.com/aaa.html?dne=hiejs&jco=snncl
http://www.xxx.com/aaa.do?dne=hiejs&jco=snncl
http://www.xxx.com/aaa.action?dne=hiejs&jco=snncl请问怎么去的url的后缀
html do action
http://www.xxx.com/aaa.html?dne=hiejs&jco=snncl
http://www.xxx.com/aaa.do?dne=hiejs&jco=snncl
http://www.xxx.com/aaa.action?dne=hiejs&jco=snncl请问怎么去的url的后缀
html do action
var postfix=s.split('?')[1]
alert(postfix)
s = "http://www.xxx.com/aaa.html?dne=hiejs&jco=snncl";
alert(doit(s));
s = "http://www.xxx.com/aaa.do?dne=hiejs&jco=snncl";
alert(doit(s));
s = "http://www.xxx.com/xx/123.aaa.action?dne=hiejs&jco=snncl";
alert(doit(s));function doit(s){
var re = /\.([^\/\.\?]+?)(\?|$)/;
m = re.exec(s);
if(m !=null) return m[1];
}
用
function div_hover(){
$("div").hover(
function(e){
$(this).addClass("hover");
event.cancelBubble=true;
},
function(e){
$(this).removeClass("hover");
event.cancelBubble=true;
}
);
}
或 function div_hover(){
$("div").hover(
function(e){
e.stopPropagation();
$(this).addClass("hover");
},
function(e){
e.stopPropagation();
$(this).removeClass("hover");
}
);
}
都不行
jquery hover事件如何不冒泡?