Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1256
  • Last Modified:

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>
0
supportoranges
Asked:
supportoranges
  • 2
  • 2
1 Solution
 
b0lsc0ttIT ManagerCommented:
supportoranges,

Look for a Javascript error.  Provide details on the error if you get one.

There should be more to it.  Otherwise that is why it doesn't work.  Look for some place that has the MM_openBrWindow() function.  We will need to see it.  It isn't just a built in function or part of Javascript so it should be somewhere.

Keep in mind that many current browsers have very good pop up blockers.  The solution is to not use popup windows in many cases and use target="_blank" or some hidden div, etc.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
supportorangesAuthor Commented:
// -->

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....
0
 
supportorangesAuthor Commented:
I must have stepped on the function definition during a copy/paste.  thanks for helping.   i wasn't sure if this was built-in.
0
 
b0lsc0ttIT ManagerCommented:
>>  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

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now