0

I use my web space in a non-Professional way though I own a web page with some links and use Javascript to automatically load the url.

http://samuel.dumont.pagesperso-orange.fr/

I wanted JS to open in _self or _blank.
It's ok with regular href links for both target even with the "block popup" feature of the browser but on select box (with onChange event) _blank is only granted with this feature off. Does href encode url differently from a select box value ?
Is there a wizard tips to locally overcome this feature ?

  • Possible duplicate: http://stackoverflow.com/questions/5141910/javascript-location-href-to-open-in-new-window-tab – Daniel W. Sep 20 '13 at 09:41
  • this will help u: http://www.cs.tut.fi/~jkorpela/forms/navmenu.html –  Sep 20 '13 at 09:46

1 Answers1

2

Fixed your function, tested on my localhost, link opens in new tab.

<a href="Javascript:GoTowww('http://goggle.com/')">Google</a>


function GoTowww(url) {     
  window.open(url,'_blank');
} 

I find a solution for your checkboxes

Here's a Fiddle

<select onchange="window.open(this.options[this.selectedIndex].value,'_blank')">
  <option value="">Choose</option>
  <option value="http://www.yahoo.com/">Yahoo</option>
  <option value="http://www.google.com/">Google</option>
  <option value="http://www.stackoverflow.com/">Stackoverflow</option>
</select>

more resource Here

Milan and Friends
  • 5,560
  • 1
  • 20
  • 28
  • I didn't know of your solution sooner.I should visit my Stackoverflow more often. Yet, Expert ideas are always good to know. Thank you – Samuel Dumont Dec 30 '13 at 21:06