Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MM_openBrWindow not working in Safari or Firefox or Internet Explorer

Posted on 2008-06-11
4
Medium Priority
?
1,243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

670 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