Open a website in new window..?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • EnjoyNews

    Open a website in new window..?

    A simple question probably...

    With this script:
    <script>
    function select_onchange (obj)
    {
    window.open(obj .value);
    }
    </script>

    I open a website in a blank window in a select form like this.

    <select name="something " onchange="selec t_onchange(this )">
    <option value="www.some thing.dk">somet hing</option>


    It works fine, but when I click on it the browser ask me to aprove popups
    from this website...
    I do know why it does that, but isn't there a way to open a website in a new
    browser windows from a select option without the browser seeing it as a
    popup ?


  • SAM

    #2
    Re: Open a website in new window..?

    EnjoyNews a écrit :
    A simple question probably...
    >
    With this script:
    <script>
    function select_onchange (obj)
    {
    window.open(obj .value);
    }
    </script>
    >
    I open a website in a blank window in a select form like this.
    >
    <select name="something " onchange="selec t_onchange(this )">
    <option value="www.some thing.dk">somet hing</option>
    >
    >
    It works fine, but when I click on it the browser ask me to aprove popups
    from this website...
    It depends ... mine doesn't it (or not each time).
    I do know why it does that, but isn't there a way to open a website in a new
    browser windows from a select option without the browser seeing it as a
    popup ?
    If it is a popup, it is a popup, no ?

    Try with an iframe.
    or try to launch the new url in a popup yet opened

    <script type="text/javascript">
    truc = false;
    function select_onchange (obj)
    {
    if(!truc || truc.closed) truc = window.open();
    truc.location = obj.value;
    truc.focus();
    }
    </script>

    --
    sm

    Comment

    • little susane

      #3
      Re: Open a website in new window..?

      On Aug 18, 5:27 pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
      wrote:
      EnjoyNews a écrit :
      >
      >
      >
      >
      >
      A simple question probably...
      >
      With this script:
      <script>
          function select_onchange (obj)
          {
             window.open(obj .value);
          }
      </script>
      >
      I open a website in a blank window in a select form like this.
      >
      <select name="something " onchange="selec t_onchange(this )">
                <option value="www.some thing.dk">somet hing</option>
      >
      It works fine, but when I click on it the browser ask me to aprove popups
      from this website...
      >
      It depends ... mine doesn't it (or not each time).
      >
      I do know why it does that, but isn't there a way to open a website in a new
      browser windows from a select option without the browser seeing it as a
      popup ?
      >
      If it is a popup, it is a popup, no ?
      >
      Try with an iframe.
      or try to launch the new url in a popup yet opened
      >
      <script type="text/javascript">
      truc = false;
           function select_onchange (obj)
           {
              if(!truc || truc.closed) truc = window.open();
              truc.location = obj.value;
              truc.focus();
           }
      </script>
      >
      --
      sm- Hide quoted text -
      >
      - Show quoted text -
      isn't it just in your INTERNET PROPERTIES? Have you blocked pop-ups?
      I am sure you can owerite Window properties with your JS code.
      But I would poke properties first.

      Comment

      Working...