• Hi, I am using a plugin called “HTML- javascript adder” which allowed me to put a javascript code in my sidebar. The javascript code I have translates whatever you have marked on the website to swedish using google translate.

    The problem I have is that I don’t know how to get it to open in a new window since i am not familiar with javascript.

    Anyone know how to update this code to make it open in an new window? (same as if you were to use target=_blank” in html)

    I have tried alot of different things but nothing have worked so far.

    <A HREF=”javascript:if(typeof yzxypZ==typeof alert)yzxypZ();var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=”){location.href=’https://translate.google.com/?text=’+t+’&hl=sv&langpair=auto|sv&tbb=1&ie=’+e;}else{location.href=’https://translate.google.com/translate?u=’+encodeURIComponent(location.href)+’&hl=sv&langpair=auto|sv&tbb=1&ie=’+e;};
    ” >Klicka h?r f?r att ?vers?tta det du markerat till svenska

    Any help is greatly appreciated. I hope someone out there knows some javascript ??

  • The topic ‘Need help getting Javascript opening in a new window’ is closed to new replies.