Rails: How to use “_blank” or “_new” in Rails

后端 未结 4 941
再見小時候
再見小時候 2020-12-16 12:43

In HTML, if I wanted a link to open in a new window, I\'d adopt target=\"_blank\" like this:



        
4条回答
  •  甜味超标
    2020-12-16 13:23

    you can remove the default action of the link in js as

    $('#button-id').click(function(e){
      e.preventDefault();      
    });
    

    The preventDefault() function prevents the default action of the event

提交回复
热议问题