我现在又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

解决方案 »

  1.   

    var s="http://www.xxx.com/aaa.html?dne=hiejs&jco=snncl";
    var postfix=s.split('?')[1]
    alert(postfix)
      

  2.   


    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];
    }
      

  3.   

    hookee哥,帮忙看看我的问题,

    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事件如何不冒泡?