Link to home
Start Free TrialLog in
Avatar of supportoranges
supportorangesFlag for United States of America

asked on

MM_openBrWindow not working in Safari or Firefox or Internet Explorer

I'm just going to post some code that refuses to open a window.  This webpage worked years ago not sure what is going on.  party.htm is not opening.  code didn't change it is just old


            <tr>
              <td valign="top" class="namescapital">&nbsp;</td>
              <td valign="top" class="namescapital"><strong><font size="3" face="Arial, Helvetica, sans-serif"><font size="2">December
                2nd, 2005</font></font></strong></td>
              <td valign="top" class="directors"><p><font size="3"><font size="2">Holiday
                  Party </font><font size="2"><br>
                  </font></font><font size="3"><font size="2">I <a href="#" onClick="MM_openBrWindow('events/holiday2005/party.htm','Party','scrollbars=yes,resizable=yes,width=660,height=620')">More
                  &gt;&gt; </a></font></font></p></td>
            </tr>
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of supportoranges

ASKER

// -->

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

found the above in an old version of the code,  it looks like a third party menuing tool may have wiped out the function in what is now the production code -- anyway, are there not comments around both of these?   sorry it's been years since i've worked with javascript....
I must have stepped on the function definition during a copy/paste.  thanks for helping.   i wasn't sure if this was built-in.
>>  are there not comments around both of these?  <<

Those are HTML comments not Javascript comments.  The browser will parse the script if it handles Javascript.  The HTML comments are there for browsers that can't handle Javascript but that is pretty much non-existent now.

To comment out Javascript you would use something like (see snippet).

I am glad I could help.  Thanks for the grade, the points and the fun question.

bol
// using 2 slashes will comment out the rest of the line
//   this is not processes by Javascript and is a comment
 
// -->
/*  This will start a multiline comment
     which end with the characters used in reverse (see below)
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
*/  // that is the end of the comment
//-->

Open in new window