Window.open. Works in ie6. Does not work in firefox

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

    Window.open. Works in ie6. Does not work in firefox


    Hello,

    I'm building a little web with php and javascript. I have inside HEAD
    the following function:

    This function receives as parameters a url and a string. In the url it
    changes "aaaa" chars, inserting the value received in the string.

    <script type="text/javascript">
    function abrir(url,caden a){
    nuevaurl=url.re place("aaaa",ca dena);
    window.open(nue vaurl);
    }
    </script>

    I call it with these lines:
    <INPUT onclick='abrir( "<? echo$row_lista['url'];?>",unico.valu e)'
    type=button value=OK name=button_nam eprod>

    My problem is that it works perfectly with ie6, but not with firefox.
    I push the button and it happens nothing.

    Any suggestion? Is it something related to my use of window.open?
    Thanks a lot!

  • Bart Friederichs

    #2
    Re: Window.open. Works in ie6. Does not work in firefox

    dlf wrote:
    Hello,
    >
    I'm building a little web with php and javascript. I have inside HEAD
    the following function:
    >
    This function receives as parameters a url and a string. In the url it
    changes "aaaa" chars, inserting the value received in the string.
    >
    <script type="text/javascript">
    function abrir(url,caden a){
    nuevaurl=url.re place("aaaa",ca dena);
    window.open(nue vaurl);
    }
    </script>
    Works fine here.
    >
    I call it with these lines:
    <INPUT onclick='abrir( "<? echo$row_lista['url'];?>",unico.valu e)'
    type=button value=OK name=button_nam eprod>
    Is 'unico.value' set?
    >
    My problem is that it works perfectly with ie6, but not with firefox.
    I push the button and it happens nothing.
    What version are you using? Install 'firebug': it's a perfect tool for
    debugging things like this:



    Bart

    Comment

    • Evertjan.

      #3
      Re: Window.open. Works in ie6. Does not work in firefox

      dlf wrote on 09 jun 2008 in comp.lang.javas cript:
      >
      Hello,
      >
      I'm building a little web with php and javascript. I have inside HEAD
      the following function:
      >
      This function receives as parameters a url and a string. In the url it
      changes "aaaa" chars, inserting the value received in the string.
      >
      <script type="text/javascript">
      function abrir(url,caden a){
      nuevaurl=url.re place("aaaa",ca dena);
      replace() needs a regular expression, not a string.

      You should mention the error text and the error line number,
      and do some debugging.
      window.open(nue vaurl);
      >}
      </script>
      >
      I call it with these lines:
      <INPUT onclick='abrir( "<? echo$row_lista['url'];?>",unico.valu e)'
      type=button value=OK name=button_nam eprod>
      >
      My problem is that it works perfectly with ie6, but not with firefox.
      I push the button and it happens nothing.
      >
      Any suggestion? Is it something related to my use of window.open?
      Thanks a lot!
      >


      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)

      Comment

      • =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=

        #4
        Re: Window.open. Works in ie6. Does not work in firefox

        Try:
        function abrir(url,caden a){
        nuevaurl=url.re place("aaaa",ca dena);
        var nuevaurl = url.replace(/aaaa/, cadena);
        window.open(nue vaurl);
        The "var" keyword makes the variable local to the funcion.
        Also, replace()'s first argument must be a regular expression.


        --
        -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
        -- Mi sitio sobre programación web: http://bits.demogracia.com
        -- Mi web de humor al baño María: http://www.demogracia.com
        --

        Comment

        • dlf

          #5
          Re: Window.open. Works in ie6. Does not work in firefox

          On 9 jun, 17:46, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
          dlf wrote on 09 jun 2008 in comp.lang.javas cript:
          >
          >
          >
          Hello,
          >
          I'm building a little web with php and javascript. I have inside HEAD
          the following function:
          >
          This function receives as parameters a url and a string. In the url it
          changes "aaaa" chars, inserting the value received in the string.
          >
          <script type="text/javascript">
          function abrir(url,caden a){
          nuevaurl=url.re place("aaaa",ca dena);
          >
          replace() needs a regular expression, not a string.
          >
          You should mention the error text and the error line number,
          and do some debugging.
          >
          window.open(nue vaurl);
          }
          </script>
          >
          I call it with these lines:
          <INPUT onclick='abrir( "<? echo$row_lista['url'];?>",unico.valu e)'
          type=button value=OK name=button_nam eprod>
          >
          My problem is that it works perfectly with ie6, but not with firefox.
          I push the button and it happens nothing.
          >
          Any suggestion? Is it something related to my use of window.open?
          Thanks a lot!
          >
          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)
          Hi,

          Thanks a lot for your responses. I will check firebug.

          unico.value is set, yes.

          In fact i don't receive any error. The window simply does not appear :-
          (

          Regards,
          David

          Comment

          • Evertjan.

            #6
            Re: Window.open. Works in ie6. Does not work in firefox

            dlf wrote on 09 jun 2008 in comp.lang.javas cript:
            <script type="text/javascript">
            function abrir(url,caden a){
            nuevaurl=url.re place("aaaa",ca dena);
            >>
            >replace() needs a regular expression, not a string.
            >>
            >You should mention the error text and the error line number,
            >and do some debugging.
            >>
            window.open(nue vaurl);
            >}
            </script>
            >>
            [please do not quote signatures on usenet]
            Thanks a lot for your responses. I will check firebug.
            >
            unico.value is set, yes.
            >
            In fact i don't receive any error. The window simply does not appear :-
            If there is no error, You should set a breakpoint:

            nuevaurl=url.re place("aaaa",ca dena);
            alert(nuevaurl) // breakpoint
            window.open(nue vaurl);

            Then you probably would see the open() statement is not the culprit.

            That is what debugging is about.

            --
            Evertjan.
            The Netherlands.
            (Please change the x'es to dots in my emailaddress)

            Comment

            Working...