Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with more than one pop up window

Status
Not open for further replies.

MrCroquet

Programmer
Dec 20, 2006
13
CA
Rather than cluttering my page with a bunch of technical stuff, I have created a table with javascript links to open a specific html page in a new window. The first link opens a new window perfectly but the 4 remaining links, coded the same, do nothing. Here is the code used on the first AND all subsequent links. Each link is in its own table cell.

<td style="font-family: Arial; font-weight: bold;" valign="middle" width="140" align="left" height="">
<valign="top">
<div style="text-align: center;"><a href="javascript: void(0)" onclick="window.open('', 'windowname1', 'width=300, height=500'); return false;"><font size="1">LEARN<br/>MORE</font></a>
</div></valign="top"></td>

Suggestions on how to open windows 2 through 5?
 
Tables aside, you are much better off using this syntax for links, as it will mean people without JavaScript enabled can still use [this portion of] your site:

Code:
<a href="[URL unfurl="true"]http://shop.oakleywoods.com/SelectHeightPup.html"[/URL] onclick="window.open(this.href, 'windowname1', 'width=300,height=500'); return (false);">Learn more</a>

Also, the FONT element has been out-of-use for a long time now - you should learn CSS and get rid of its use and the use of tables for laying out non-tabular data, should you wish to forward your web development skills.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
P.S. If the code I posted doesn't work either, I suggest:

1. Validating your markup. You may well have missed off a closing tag somewhere.

2. Ensure your JS code doesn't have line breaks in the middle of the 'window.open' call - the code you posted above had one right before the closing single-quote of the window URL!

3. Posting the code for all 5 links, or better still, a URL to the page in question.

Dan





Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi Dan,

Thanks for the code correcting. It works just fine now. To respond to your (appreciated) finger-wagging about my coding skills, I agree completely.

I am in the process of setting up a new shopping cart and have decided to learn CSS in the process. So, I am still a novice when it comes to that. It's a step up from reliance on FrontPage to generate my coding.

My skills are more focused on my woodworking shop where I and my shop assistants make some pretty fine croquet equipment. If you ever find yourself surfing, check out then you may want to spend some time outdoors hitting a ball around the backyard.

Thanks again.
 
You might also want to fix the character encoding of your pages. Take this example:


It probably looks fine you you (I'm guessing you're using IE), but take a look in Firefox - all the single and double quotes appear as big '?' icons.

Why? Probably because you've pasted the copy in from Word (or similar Microsoft software) which gives you 'smart quotes'. They may be smart when it comes to Microsoft software viewing them, but not really cross-browser OR cross-OS (perhaps 'smart' is their attempt at irony?).

You can either replace them with regular straight single and double quotes, or use the appropriate HTML character entity code (e.g. &rsquo; &ldquo;, etc).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Many cross-browser problems can be solved by using a full and valid doctype and ensuring that you code is standards compliant. See
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Hi Dan,

As a matter of fact, it DOES look fine and I use Firefox. It is current to version 3.0.1 I have also downloaded to developer tools to help esp in the learning process. I regularly use Firebug & Webdeveloper.

As to your suggestion, I'm not sure what you're getting at. I looked for the single/double quotes and the ?. Couldn't see anything out of order. Can you explain what to look for or what the problem is? Some of those pages on Toequet were written by an unknown as I bought the company & website from a man in Indiana.

Thanks again for your time and help.
 
As to your suggestion, I'm not sure what you're getting at. I looked for the single/double quotes and the ?. Couldn't see anything out of order.

That's odd - the page looks bad for me on my system at home (XP, Fx 3.0.11), at work (Vista, Fx 3.0.11), and other PCs at work (Ubuntu, Fx 3.0.11).

Ah well - I guess if you can't see it, it's hard to know if you've fixed it... but if we're seeing it here on 3 different PCs, many others will also see it.

Perhaps try upgrading your Fx from 3.0.1 to 3.0.12 at 3.0.1 is quite old now.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top