Loading ...
Sorry, an error occurred while loading the content.

newWindow is not defined

Expand Messages
  • dodong
    Hello guys, I am new here, I have this problem in Javascript that has an error newWindow is not defined . function code:
    Message 1 of 4 , May 12, 2010
    • 0 Attachment
      Hello guys,

      I am new here, I have this problem in Javascript that has an error
      "newWindow is not defined".

      function code:

      <script type="text/javascript">
      function newWindow(page, iWidth, iHeight)
      {
      if (!iWidth)
      iWidth = 400;

      if (!iHeight)
      iHeight = 300;

      OpenWin = this.open(page, "tsWindow" + parseInt(Math.random() *
      150) ,
      "toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizab\
      le=yes,height=" + iHeight + ",width=" + iWidth + ",left=100,top=80");
      OpenWin.focus();
      }
      </script>


      HTML code:

      <tr class="Row">
      <td class="LabelCol" width="25%"><%=
      pageVals("labels")("headfrontcolor") %>:</td>
      <td class="ValueCol" width="50%">
      <input type="TEXT" name="prj_cssTHeadFGColor"
      id="prj_cssTHeadFGColor" size="33" value="<%=
      formVals("prj_cssTHeadFGColor") %>" style="background: <%=
      formVals("prj_cssTHeadFGColor") %>;" onChange="checkColor(this.form,
      this)" />
      <a style="font-size: 9px;"
      href="javascript:newWindow('ColorPicker.asp?textbox=prj_cssTHeadFGColor'\
      , 310, 67)"><%= pageVals("labels")("colorpicker") %></a>
      </td>
      <td class="HelpCol" width="25%"> </td>
      </tr>


      ColorPicker.asp code:

      <script type="text/javascript">
      function showColor(val)
      {
      <% textBox = request.querystring("textbox") %>
      var frm = opener.document.forms[0];
      frm.<%= textBox %>.value = val;
      frm.<%= textBox %>.style.background = val;
      opener.focus();
      self.close();
      }
      </script>

      <style type="text/css">
      body { margin-left: 0; margin-top: 0; margin-bottom: 0;
      margin-right: 0;}
      </style>
      </head>

      <body>
      <center>
      <map name="colmap">
      <area shape="rect" coords="1,1,7,10"
      href="javascript:showColor('#00FF00')">
      <area shape="rect" coords="9,1,15,10"
      href="javascript:showColor('#00FF33')">
      <area shape="rect" coords="17,1,23,10"
      href="javascript:showColor('#00FF66')">
      </map>
      <span style="font-size: x-small; font-weight: bold;
      font-family: Arial"><%= content("title") %></span>
      <a><img usemap="#colmap" src="/Admin/images/colortable.gif"
      border=0 width=289 height=67></a>
      <br />
      <br />
      </center>
      </body>
      </html>

      The problem here, when I clicked the Color Picker link in Firefox it has
      an error newWindow is not defined and in IE is object is expected. Hope
      you can help me on this. Thanks.





      [Non-text portions of this message have been removed]
    • Balaji Perumal
      Hi, you can use this OpenWin = window.open(page, tsWindow + parseInt(Math.random() * 150) ,
      Message 2 of 4 , May 19, 2010
      • 0 Attachment
        Hi,

        you can use this
        OpenWin = window.open(page, "tsWindow" + parseInt(Math.random() *
        150) ,
        "toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizab\
        le=yes,height=" + iHeight + ",width=" + iWidth + ",left=100,top=80");

        instead of this


        OpenWin = this.open(page, "tsWindow" + parseInt(Math.random() *
        150) ,
        "toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizab\
        le=yes,height=" + iHeight + ",width=" + iWidth + ",left=100,top=80");

        Thanks,
        P.Balaji





        ________________________________
        From: dodong <afortaliza@...>
        To: JavaScript_Official@yahoogroups.com
        Sent: Thu, May 13, 2010 6:03:54 AM
        Subject: [JavaScript] newWindow is not defined




        Hello guys,

        I am new here, I have this problem in Javascript that has an error
        "newWindow is not defined".

        function code:

        <script type="text/javascript">
        function newWindow(page, iWidth, iHeight)
        {
        if (!iWidth)
        iWidth = 400;

        if (!iHeight)
        iHeight = 300;

        OpenWin = this.open(page, "tsWindow" + parseInt(Math.random() *
        150) ,
        "toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizab\
        le=yes,height=" + iHeight + ",width=" + iWidth + ",left=100,top=80");
        OpenWin.focus();
        }
        </script>

        HTML code:

        <tr class="Row">
        <td class="LabelCol" width="25%"><%=
        pageVals("labels")("headfrontcolor") %>:</td>
        <td class="ValueCol" width="50%">
        <input type="TEXT" name="prj_cssTHeadFGColor"
        id="prj_cssTHeadFGColor" size="33" value="<%=
        formVals("prj_cssTHeadFGColor") %>" style="background: <%=
        formVals("prj_cssTHeadFGColor") %>;" onChange="checkColor(this.form,
        this)" />
        <a style="font-size: 9px;"
        href="javascript:newWindow('ColorPicker.asp?textbox=prj_cssTHeadFGColor'\
        , 310, 67)"><%= pageVals("labels")("colorpicker") %></a>
        </td>
        <td class="HelpCol" width="25%"> </td>
        </tr>

        ColorPicker.asp code:

        <script type="text/javascript">
        function showColor(val)
        {
        <% textBox = request.querystring("textbox") %>
        var frm = opener.document.forms[0];
        frm.<%= textBox %>.value = val;
        frm.<%= textBox %>.style.background = val;
        opener.focus();
        self.close();
        }
        </script>

        <style type="text/css">
        body { margin-left: 0; margin-top: 0; margin-bottom: 0;
        margin-right: 0;}
        </style>
        </head>

        <body>
        <center>
        <map name="colmap">
        <area shape="rect" coords="1,1,7,10"
        href="javascript:showColor('#00FF00')">
        <area shape="rect" coords="9,1,15,10"
        href="javascript:showColor('#00FF33')">
        <area shape="rect" coords="17,1,23,10"
        href="javascript:showColor('#00FF66')">
        </map>
        <span style="font-size: x-small; font-weight: bold;
        font-family: Arial"><%= content("title") %></span>
        <a><img usemap="#colmap" src="/Admin/images/colortable.gif"
        border=0 width=289 height=67></a>
        <br />
        <br />
        </center>
        </body>
        </html>

        The problem here, when I clicked the Color Picker link in Firefox it has
        an error newWindow is not defined and in IE is object is expected. Hope
        you can help me on this. Thanks.

        [Non-text portions of this message have been removed]







        [Non-text portions of this message have been removed]
      • David Smart
        Can t see anything obvious. I think you re going to need to post the whole code from the module. Regards, Dave S ... From: dodong To:
        Message 3 of 4 , May 19, 2010
        • 0 Attachment
          Can't see anything obvious. I think you're going to need to post the whole
          code from the module.

          Regards, Dave S

          ----- Original Message -----
          From: "dodong" <afortaliza@...>
          To: <JavaScript_Official@yahoogroups.com>
          Sent: Thursday, May 13, 2010 10:33 AM
          Subject: [JavaScript] newWindow is not defined


          >
          >
          > Hello guys,
          >
          > I am new here, I have this problem in Javascript that has an error
          > "newWindow is not defined".
          >
          > function code:
          >
          > <script type="text/javascript">
          > function newWindow(page, iWidth, iHeight)
          > {
          > if (!iWidth)
          > iWidth = 400;
          >
          > if (!iHeight)
          > iHeight = 300;
          >
          > OpenWin = this.open(page, "tsWindow" + parseInt(Math.random() *
          > 150) ,
          > "toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizab\
          > le=yes,height=" + iHeight + ",width=" + iWidth + ",left=100,top=80");
          > OpenWin.focus();
          > }
          > </script>
          >
          >
          > HTML code:
          >
          > <tr class="Row">
          > <td class="LabelCol" width="25%"><%=
          > pageVals("labels")("headfrontcolor") %>:</td>
          > <td class="ValueCol" width="50%">
          > <input type="TEXT" name="prj_cssTHeadFGColor"
          > id="prj_cssTHeadFGColor" size="33" value="<%=
          > formVals("prj_cssTHeadFGColor") %>" style="background: <%=
          > formVals("prj_cssTHeadFGColor") %>;" onChange="checkColor(this.form,
          > this)" />
          > <a style="font-size: 9px;"
          > href="javascript:newWindow('ColorPicker.asp?textbox=prj_cssTHeadFGColor'\
          > , 310, 67)"><%= pageVals("labels")("colorpicker") %></a>
          > </td>
          > <td class="HelpCol" width="25%"> </td>
          > </tr>
          >
          >
          > ColorPicker.asp code:
          >
          > <script type="text/javascript">
          > function showColor(val)
          > {
          > <% textBox = request.querystring("textbox") %>
          > var frm = opener.document.forms[0];
          > frm.<%= textBox %>.value = val;
          > frm.<%= textBox %>.style.background = val;
          > opener.focus();
          > self.close();
          > }
          > </script>
          >
          > <style type="text/css">
          > body { margin-left: 0; margin-top: 0; margin-bottom: 0;
          > margin-right: 0;}
          > </style>
          > </head>
          >
          > <body>
          > <center>
          > <map name="colmap">
          > <area shape="rect" coords="1,1,7,10"
          > href="javascript:showColor('#00FF00')">
          > <area shape="rect" coords="9,1,15,10"
          > href="javascript:showColor('#00FF33')">
          > <area shape="rect" coords="17,1,23,10"
          > href="javascript:showColor('#00FF66')">
          > </map>
          > <span style="font-size: x-small; font-weight: bold;
          > font-family: Arial"><%= content("title") %></span>
          > <a><img usemap="#colmap" src="/Admin/images/colortable.gif"
          > border=0 width=289 height=67></a>
          > <br />
          > <br />
          > </center>
          > </body>
          > </html>
          >
          > The problem here, when I clicked the Color Picker link in Firefox it has
          > an error newWindow is not defined and in IE is object is expected. Hope
          > you can help me on this. Thanks.
          >
          >
          >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          > ------------------------------------
          >
          > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
          >
          >
          >


          --------------------------------------------------------------------------------



          No virus found in this incoming message.
          Checked by AVG - www.avg.com
          Version: 8.5.437 / Virus Database: 271.1.1/2881 - Release Date: 05/18/10
          06:26:00
        • Balaji Perumal
          Hi, Just replace this function. Then it will work. Thanks, P.Balaji ________________________________ From: David Smart To:
          Message 4 of 4 , May 20, 2010
          • 0 Attachment
            Hi,

            Just replace this function.

            Then it will work.

            Thanks,
            P.Balaji





            ________________________________
            From: David Smart <smartware.consulting@...>
            To: JavaScript_Official@yahoogroups.com
            Sent: Wed, May 19, 2010 5:50:26 PM
            Subject: Re: [JavaScript] newWindow is not defined


            Can't see anything obvious. I think you're going to need to post the whole
            code from the module.

            Regards, Dave S

            ----- Original Message -----
            From: "dodong" <afortaliza@...>
            To: <JavaScript_Official@yahoogroups.com>
            Sent: Thursday, May 13, 2010 10:33 AM
            Subject: [JavaScript] newWindow is not defined

            >
            >
            > Hello guys,
            >
            > I am new here, I have this problem in Javascript that has an error
            > "newWindow is not defined".
            >
            > function code:
            >
            > <script type="text/javascript">
            > function newWindow(page, iWidth, iHeight)
            > {
            > if (!iWidth)
            > iWidth = 400;
            >
            > if (!iHeight)
            > iHeight = 300;
            >
            > OpenWin = this.open(page, "tsWindow" + parseInt(Math.random() *
            > 150) ,
            > "toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,resizab\
            > le=yes,height=" + iHeight + ",width=" + iWidth + ",left=100,top=80");
            > OpenWin.focus();
            > }
            > </script>
            >
            >
            > HTML code:
            >
            > <tr class="Row">
            > <td class="LabelCol" width="25%"><%=
            > pageVals("labels")("headfrontcolor") %>:</td>
            > <td class="ValueCol" width="50%">
            > <input type="TEXT" name="prj_cssTHeadFGColor"
            > id="prj_cssTHeadFGColor" size="33" value="<%=
            > formVals("prj_cssTHeadFGColor") %>" style="background: <%=
            > formVals("prj_cssTHeadFGColor") %>;" onChange="checkColor(this.form,
            > this)" />
            > <a style="font-size: 9px;"
            > href="javascript:newWindow('ColorPicker.asp?textbox=prj_cssTHeadFGColor'\
            > , 310, 67)"><%= pageVals("labels")("colorpicker") %></a>
            > </td>
            > <td class="HelpCol" width="25%"> </td>
            > </tr>
            >
            >
            > ColorPicker.asp code:
            >
            > <script type="text/javascript">
            > function showColor(val)
            > {
            > <% textBox = request.querystring("textbox") %>
            > var frm = opener.document.forms[0];
            > frm.<%= textBox %>.value = val;
            > frm.<%= textBox %>.style.background = val;
            > opener.focus();
            > self.close();
            > }
            > </script>
            >
            > <style type="text/css">
            > body { margin-left: 0; margin-top: 0; margin-bottom: 0;
            > margin-right: 0;}
            > </style>
            > </head>
            >
            > <body>
            > <center>
            > <map name="colmap">
            > <area shape="rect" coords="1,1,7,10"
            > href="javascript:showColor('#00FF00')">
            > <area shape="rect" coords="9,1,15,10"
            > href="javascript:showColor('#00FF33')">
            > <area shape="rect" coords="17,1,23,10"
            > href="javascript:showColor('#00FF66')">
            > </map>
            > <span style="font-size: x-small; font-weight: bold;
            > font-family: Arial"><%= content("title") %></span>
            > <a><img usemap="#colmap" src="/Admin/images/colortable.gif"
            > border=0 width=289 height=67></a>
            > <br />
            > <br />
            > </center>
            > </body>
            > </html>
            >
            > The problem here, when I clicked the Color Picker link in Firefox it has
            > an error newWindow is not defined and in IE is object is expected. Hope
            > you can help me on this. Thanks.
            >
            >
            >
            >
            >
            > [Non-text portions of this message have been removed]
            >
            >
            >
            > ------------------------------------
            >
            > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
            >
            >
            >

            ----------------------------------------------------------

            No virus found in this incoming message.
            Checked by AVG - www.avg.com
            Version: 8.5.437 / Virus Database: 271.1.1/2881 - Release Date: 05/18/10
            06:26:00







            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.