a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

New Window - problem in IE7

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> New Window - problem in IE7
Page: [1]
 
RickP

 

Posts: 693
Joined: 11/13/2004
From: Kent, U.K.
Status: offline

 
New Window - problem in IE7 - 12/19/2006 7:05:34   
I have been using HTML 4.01 strict for some time but still wanted to open some links in a new window - "target=_blank" being non-valid for the strict doctype. I found a simple easy to use js option as follows:

<a href="http://www.webpage.com"
onclick="window.open(this.href); 
return false">www.webpage.com</a>


This has worked fine on all browsers I tested previously but now in IE7 the new window opens but the initial page also follows the link - rather defeating the object of course!

Any ideas for the simplest work around - other than people saying "you should never open a new window!"

Thanks


_____________________________

Regards, Rick
On-The-Web-Now!
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 7:43:30   
Use target _blank and set the doctype for that page to transitional.

Of course, you should NEVER........ :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to RickP)
Tailslide

 

Posts: 6368
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 8:24:25   
You could either try this:

<a href="some.html" onclick="return ! window.open(this.href);"> some place</a>

(don't know if this will work any better than the original method as I'm not sure why your IE7 is doing this. This method works locally for me. It may depend on how you've set up your options.

or use this method which is I suppose the "preferred" method for doing this:

http://www.sitepoint.com/article/standards-compliant-world/3

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to jaybee)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 8:46:31   
but if you use the sitepoint one, make sure you have something that says it's opening a new window as their script doesn't.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
RickP

 

Posts: 693
Joined: 11/13/2004
From: Kent, U.K.
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 9:46:17   
Thanks Jaybee & Tailside

quote:

Use target _blank and set the doctype for that page to transitional.


Seems the easy option but I was trying to avoid reverting to transitional.

quote:

You could either try this:

<a href="some.html" onclick="return ! window.open(this.href);"> some place</a>


The above behaved exactly the same on my PC.

quote:

It may depend on how you've set up your options


Yes, you may be right Tailside. Just checked on another PC with IE7 and the new window links behave fine. I can't think what I've changed on the settings here that would affect this - I just tried resetting my tabbed browsing options back to defaults and that didn't make any difference... ??? I don't think I've altered any jscript options, and clearly a new window still opens anyhow... ???:)

Would anyone/everyone mind checking the links on the right of this page in IE7 for me - thanks.

Will look at 'preferred method' but was also trying to avoid anything that meant... well, extra work... I mean... unnecessary code :)


_____________________________

Regards, Rick
On-The-Web-Now!

(in reply to jaybee)
Tailslide

 

Posts: 6368
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 9:51:54   
It opened a new window for me in IE7.

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to RickP)
RickP

 

Posts: 693
Joined: 11/13/2004
From: Kent, U.K.
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 9:56:11   
quote:

It opened a new window for me in IE7.


You mean, without the initial page (the one which has the link) also following the link?

_____________________________

Regards, Rick
On-The-Web-Now!

(in reply to Tailslide)
Tailslide

 

Posts: 6368
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 10:36:23   
Yes

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to RickP)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 10:57:41   
Yep, new window for me too and the original page stayed where it was.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Tailslide)
RickP

 

Posts: 693
Joined: 11/13/2004
From: Kent, U.K.
Status: offline

 
RE: New Window - problem in IE7 - 12/19/2006 11:11:43   
Okay - thanks both - must be something I'm doing wrong here!:)

_____________________________

Regards, Rick
On-The-Web-Now!

(in reply to jaybee)
RickP

 

Posts: 693
Joined: 11/13/2004
From: Kent, U.K.
Status: offline

 
RE: New Window - problem in IE7 - 1/10/2007 5:05:23   
Epliogue...

For the benefit of anyone else who experiences this problem with IE7 and new windows...

I have checked on a couple of other machines, which also did not exhibit this buggy behaviour and so conclude it is just a bug on this one PC for some reason. The problem has been solved on this PC by using the following in IE7:

TOOLS > INTERNET OPTIONS > ADVANCED > RESET

This resets IE7 back to when it was first installed and before any settings were changed. FYFI, installed toolbars and add-ons are removed, favourites are untouched.

Hope this helps some other poor mystified soul! :)

_____________________________

Regards, Rick
On-The-Web-Now!

(in reply to RickP)
gablagost

 

Posts: 1
Joined: 1/12/2007
Status: offline

 
RE: New Window - problem in IE7 - 1/12/2007 13:44:17   
i have the same problem as you have
but i did not install ie7
i use ie7 as stand alone

your solution
quote:

TOOLS > INTERNET OPTIONS > ADVANCED > RESET

didn't work for me =(:)

(in reply to RickP)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: New Window - problem in IE7 - 1/12/2007 13:56:06   
Standalone is a problem as it's a tweaked version.

The only thing I can suggest is uninstall IE7 and IE6. Install the full MS version of IE7 then go and get Multiple IEs

That will install IE6, 5.5, 5, 4 and 3 as well if you want them, to run alongside IE7. It all works fine for me.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to gablagost)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> General Web Development >> New Window - problem in IE7
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts