Search code examples
javascriptfirefoxonclickwindow.open

onclick window.open (Firefox)


I have this line working just fine in Chrome but not in Firefox. Any ideas why?

<button class="mdl-button mdl-js-button mdl-button--icon mdl-button--colored">                  
<i class="fa fa-edge" onclick='window.open("http://www.cnn.com");return false;'></i>


Solution

  • As @Pete suggested in the comments, put the "onclick" on the button.

    Do this, I've tested it and it works:

    <button class="mdl-button mdl-js-button mdl-button--icon mdl-button--colored" onclick='javascript:window.open("http://www.cnn.com", "cnn_name"); return false;'>                  
    <i class="fa fa-edge"></i>