Returning false on link click jquery

后端 未结 4 1544
孤街浪徒
孤街浪徒 2021-01-24 22:33

I wish to have a link which opens popup when clicked however I wish it to open a page in a new window if the user doesn\'t have JS enabled.

The following doesn\'t seem t

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 22:55

    You simply missed the # indicating it's an id and not a node name.

    $('#tac-link')
    


    PS - I wouldn't recommend using eval, why not just store all the page variables in an object?

    var pages = {};
    
    function popUp( url ) {
        var id = +new Date;
        pages[id] = window.open( url );
    }
    

提交回复
热议问题