SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help for Firefox Error: window.opener.broadcast has no properties

    Hi to all , i'm a newbies, having this problem in firefox (it works fine in IE).

    The error occurs in the popout window when i try to do a window.opener on the parent window.

    Error Console:
    Code:
    window.opener.broadcast has no properties line 14.
    The error is on line 14:
    Code:
    if (window.opener.broadcast.destination.value=="")
    Full code:
    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    <link href="../../HTML/eng/text.css" rel="stylesheet" type="text/css">
    </head>
    <Script language="Javascript">
    function adduser(ownername)
    {
     if (window.opener.broadcast.destination.value=="")
     {
       window.opener.broadcast.destination.value=ownername;
     }
     else
     {
        window.opener.broadcast.destination.value=window.opener.broadcast.destination.value+','+ownername;
     }
     return false;
    }
    </Script>
    <body bgcolor="#FFFFFF" text="#000000">
    Add user into receiver: <br>
     <br> 
    
    <table width="80%" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000">
      <tr bgcolor="#F2F2F2">
        <td width="40%">User Name</td>
        <td>Action</td>
      </tr>
      <tr bgcolor="#FFFFFF">
        <td>&nbsp; 
          test
        </td>
    
        <td>
        <a onclick="adduser('test');return false;" href="#">Add</a></td>
      </tr>
    </table>
    
    <p><a href="adduser.php?&curpagenum=1">1</a>&nbsp;&nbsp;</p>
    </body>
    </html>
    I'm new to Javascript, would really appreciate any help. Thank you.

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2007
    Posts
    566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    window.opener.broadcast has no properties line 14.
    Because the standard window.opener object (which is a document object, if I'm right) have no broadcast property natively.

    But, as you can add any property you want on any object you want dynamically with javascript, there is surely something wrong in what is done before that call, which don't set the property on the opener object.

  3. #3
    SitePoint Member
    Join Date
    Dec 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, i think i managed to solve it:

    What is broadcast in the parent window? Presumably a form. I.E. tolerates direct referencing but for anything else you need:
    Code:
    //if broadcast is a name:
    window.opener.document.forms.broadcast.
    
    //if broadcast  is an ID:
    window.opener.document.getElementById('broadcast').
    [/QUOTE]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •