Java Script

Javascript open the url in new tab

cross-browser compatibility
  • defenceguruindia

    Hi Sumith,

    I am a blogspot user. Note my URL: http://indiafoodnet.blogspot.in/ which I am presently testing.
    In the home page I have aggregated a couple of links, when the user clicks on a particular link the event to take him to an external URL on a new tab. I am currently using the code mentioned below, but it is opening in the native tab itself. Kindly help me to fine tune this code so that a new tab with the external URL will be opened.

    window.location = “http://externallink.com/”;

    Thanking you,

    Also please visit my current blog: http://defenceguruindia.blogspot.in/