Solved

MM_openBrWindow not working in Safari or Firefox or Internet Explorer

Posted on 2008-06-11
4
1,212 Views
Last Modified: 2010-05-18
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
Comment
Question by:supportoranges
  • 2
  • 2
4 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 21765785
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
 
LVL 1

Author Comment

by:supportoranges
ID: 21767788
// -->

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
 
LVL 1

Author Comment

by:supportoranges
ID: 21768380
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
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21770725
>>  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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now