473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Window opener works in Firefox, but not IE.

9
Hi.

I am just wanting to enable users to load a larger image from a thumbnail on a web page.

I use (in the header) something like:
Expand|Select|Wrap|Line Numbers
  1. <script language="Javascript" type="text/javascript">
  2. <!--
  3. function MM_openBrWindow(theURL,winName,features) { //v2.0
  4.   window.open(theURL,winName,features);
  5. }
  6. //-->
  7. </script>
Then in the main body I use say:
Expand|Select|Wrap|Line Numbers
  1. <a href="#" onclick="MM_openBrWindow('images/add01.jpg','image 1','scrollbars=no,resizable=no,width=168,height=184')"><img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge"/></a>
This works perfectly in the superior firefox, but in the inferior IE it does not load.

Can anyone help?

Thanks.

APB.
Aug 9 '07 #1
14 2367
pbmods
5,821 Expert 4TB
Heya, APB. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Does IE generate an error, or does it just not do anything?

Also, I'm curious why you have a wrapper for window.open that doesn't do anything.

In other words, the following statements are identical, except that the second statement causes more overhead:
Expand|Select|Wrap|Line Numbers
  1. window.open( ... );
  2. MM_openBrWindow( ... );
  3.  
P.S.,

Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as, 'problem' actually get FEWER responses?).

I'm going to go ahead and move this thread to the JavaScript forum, where our resident Experts will be better able to help you out.
Aug 9 '07 #2
bigapb
9
Hi.

Thanks for the welcome.

Nothing happens when clicking on a thumbnail when in IE7 (have not tried other versions of IE.

Sorry about the duplication in code, I have man-flu at present!

Thanks.

APB.



Heya, APB. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Does IE generate an error, or does it just not do anything?

Also, I'm curious why you have a wrapper for window.open that doesn't do anything.

In other words, the following statements are identical, except that the second statement causes more overhead:
Expand|Select|Wrap|Line Numbers
  1. window.open( ... );
  2. MM_openBrWindow( ... );
  3.  
P.S.,

Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as, 'problem' actually get FEWER responses?).

I'm going to go ahead and move this thread to the JavaScript forum, where our resident Experts will be better able to help you out.
Aug 9 '07 #3
pbmods
5,821 Expert 4TB
Heya APB.

I wonder if it would work if you were to try this:
Expand|Select|Wrap|Line Numbers
  1. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open('images/add01.jpg','image 1','scrollbars=no,resizable=no,width=168,height=184');" style="cursor:pointer;" />
  2.  
Aug 9 '07 #4
bigapb
9
Hi.

Nope does still work in firefox, not IE!!!

GRRRRRGH!!!!

Heya APB.

I wonder if it would work if you were to try this:
Expand|Select|Wrap|Line Numbers
  1. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open('images/add01.jpg','image 1','scrollbars=no,resizable=no,width=168,height=184');" style="cursor:pointer;" />
  2.  
Aug 9 '07 #5
pbmods
5,821 Expert 4TB
Hm.

Does this do anything:
Expand|Select|Wrap|Line Numbers
  1. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="alert('Ok, at least this works!');" style="cursor:pointer;" />
  2.  
Aug 9 '07 #6
bigapb
9
That comes up with the correct message in both firefox and IE.
Aug 9 '07 #7
bigapb
9
The code and call function is within a table, but that should not make a difference as far as I can see.
Aug 9 '07 #8
pbmods
5,821 Expert 4TB
Ok. So the problem is opening a new window.

Do you have a pop-up blocker installed for IE by any chance?

Maybe the problem is one of the parameters passed to window.open:
Expand|Select|Wrap|Line Numbers
  1. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open();" style="cursor:pointer;" />
  2.  
  3. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open('images/add01.jpg');" style="cursor:pointer;" />
  4.  
  5. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open('images/add01.jpg', 'image 1');" style="cursor:pointer;" />
  6.  
  7. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open('images/add01.jpg', 'image 1', 'scrollbars=no,resizable=no,width=168,height=184');" style="cursor:pointer;" />
  8.  
Aug 9 '07 #9
bigapb
9
Got it.

The code that names the
Expand|Select|Wrap|Line Numbers
  1. winName
in this case
Expand|Select|Wrap|Line Numbers
  1. image 1
is no good as it has a space and IE does not recognise this when it is a space.

Therefore the following works (almost):

Expand|Select|Wrap|Line Numbers
  1. <img src="images/thumb1.jpg" width="75" height="75" border="0" alt="click to enlarge" onclick="window.open('images/add01.jpg', 'image_1', 'scrollbars=no,resizable=no,width=168,height=184')  ;" style="cursor:pointer;" />
I just need to know the command to exclude the menu bar in IE when the new window opens. Do you know it I have forgotten it?

Many thanks.

APB
Aug 9 '07 #10
pbmods
5,821 Expert 4TB
Heya, APB.

Have a look at this document.
Aug 9 '07 #11
bigapb
9
Hi.

Ah, that is why IE 7 still shows the toolbar etc.... even when I try to block it.

So now that IE 7 forces the URL to be shown and firefox 3 will also force this as well.

So it is ridiculous when we are designing pop ups etc.... and pop up forms etc.... as all settings programmed in can or will be over-ridden by default.

Therefore we (designers - and I am more of a php, Perl, MySQL and linux server security bod reluctantly learning Flash, AJAX etc.... as needs must) need to adopt a policy of telling clients this form now on, and we need not bother making windows pop up to the relevant size of an image or for a contact form.

I suggest that we 'designers' just bung each image/form, in a table, in a new window, and use css to centre the form/image and then centre the table as well (a retrograde step using tables -- but never mind).

The screen can then be scrollable, resizeable etc... and when designing we do not to bother with javascript or other commands that hide url's etc.....

This can of course have implications on security, as hackers will now know directories via the URL now being shown and forced to be shown on complex online DB's that we have designed, where it is preferable that some URL's remain hidden.

Great! Give hackers a head start why don't we!!!

Thanks anyway, it now works, with IE 7 displaying the toolbar and URL etc... despite me asking for it to be turned off!!!

A simple increase of an image now looks messy!

Thanks for your help.

APB.
Aug 9 '07 #12
pbmods
5,821 Expert 4TB
Heya, APB.

This is why the pop-up window is dying out, to be replaced by 'floating' DIVs and other elements commonly categorized under Web 2.0 ~_^
Aug 9 '07 #13
bigapb
9
Hi.

We have been using css for years and floating divs etc.... we are familiar with.

However, when we design a website, we design for firefox, because firefox, opera, netscape etc.... all agreed a common set of protocols with css on margins, width settings, padding etc....

Bill Gates however, decided no, he would use his own set of protocols!

That was until they changed to IE 7 which mainly adopts the protocols of firefox etc....

So now, as a web designer, with over 30% of people using firefox as their preferred browser (an increase of around 12% last year), we have to design for:

firefox 2;
opera;
netscape;
(the rest we do not care about)
all of which use the same protocols, but we also have to then do the fixes for:

IE 6 AND IE 7 which both use different protocols to one another!

This is why we prefer linux servers; PHP, Perl, and MySQL. They are as well, we feel more secure as an architecture and more manageable and our own clients online database applications are built using this infrastructure rather than anything that MS empire produces.

I am also about to trial 'Ubantu' the Linux OS and test it's compatability with my other in house server based DB's that use MS Access and MS VB!

But designing a website is way beyond pretty pictures, flash and javascript now.

It does not need to be made yet more tedious by MS deciding that he will use a different means of communicating via a media that is owned and managed by the world at large.

Thanks anyway, the code now all works (except that the new window when enlarged will contain the URL bar and toolbar no matter what we do).

Thanks again.

APB.
Aug 9 '07 #14
pbmods
5,821 Expert 4TB
Heya, APB.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Aug 9 '07 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit"...
2
by: Bostonasian | last post by:
I am trying to append options to dropdown in parent window from option items in child window. In parent window, I have following code: <script language="javascript"> function...
5
by: Derek Erb | last post by:
I am banging my head against the wall with this one. The following code snippets work perfectly fine in MSIE6. But produce an error in Firefox and do not work at all. BROWSER.HTM <HTML> .......
7
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
3
by: alison | last post by:
I am trying to redirect the parent page when the user clicks an html button in an aspx page by using the javascript: window.opener.location.href="EditOrders.aspx"; This works fine on IE for...
2
by: Kien | last post by:
Hello, Haven't been back to this group for over 3 years... I know opening a window is an evil thing, but this is convenient for my site. The design is like this -User clicks a link -up pops...
4
by: badaczewski | last post by:
The following javascript appears on a popup window. <script language="javascript" type="text/javascript"> function InsertContact(value) { window.opener.CallBackContact(value); window.close();...
3
by: Asterix | last post by:
Hi Guys, I know this is probably an easy one, but I am having issues. Basically, I have a pop-up (child) that controls the parent window. Clicking on a link on the child window should redirect...
29
Frinavale
by: Frinavale | last post by:
I have 2 FireFox (version 2) browser windows opened. One is the child of the other. When the user is finished with the child window, a method in the parent window is called to refresh a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.