4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Open links in a new window... or not
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Gandalf
WebHelper
WebHelper


Joined: 08 Jan 2002
Posts: 52
Location: Israel

PostPosted: Thu Feb 28, 2002 12:26 am (15 years, 8 months ago) Reply with QuoteBack to Top

Some time ago I visited a web site which had the following feature:
At the top of the page there was a check box that, if the surfer checked it, would make all the links open up in new browser windows. However, if it was left unchecked, all the links would open up in the current window. Any idea how that's accomplished, and whether it makes for valid HTML? Or, if there's a PHP-based solution that will do the same (changing variable values without reloading the page, maybe)?

________________________________
Everything should be made as simple as possible, but no simpler.
OfflineView User's ProfileFind all posts by GandalfSend Personal MessageICQ Number
WebSketcher
WebHelper
WebHelper


Joined: 14 Jan 2002
Posts: 95
Location: Canada

PostPosted: Thu Feb 28, 2002 1:29 am (15 years, 8 months ago) Reply with QuoteBack to Top

May be he uses frames !

I don't have the code but I think it is not too complicated, it may be a mix of java and php.

If I find something, I'll let you know Wink
OfflineView User's ProfileFind all posts by WebSketcherSend Personal MessageSend email
Robert Wellock
WebHelper
WebHelper


Joined: 18 Jan 2002
Posts: 61
Location: Yorkshire - UK

PostPosted: Thu Feb 28, 2002 12:18 pm (15 years, 8 months ago) Reply with QuoteBack to Top

Typically JavaScript could be used for such actions by using else statements and the document write so that if the user checks the box either they are transported to another page or the client-side script will write a line stating that the links will open in a new browser window i.e.

<script type="text/javascript">
<!-- Begin
function xyz(Light)
{
lanturn=window.open(Light,'name','width=150,height=150');
if(window.focus) {lanturn.focus()}
}
// End -->
</script>


<a href="javascript:xyz('abc.htm')">Click</a>

Concerning valid HTML then obviously the page would pass validation assuming the script is hidden using the correct deliminators, however, you'd have to assume the user had JavaScript enabled on their browser.

________________________________
};-) http://www.xhtmlcoder.com/

Last edited by Robert Wellock on Mon May 19, 2003 4:15 pm, edited 1 time in total
OfflineView User's ProfileFind all posts by Robert WellockSend Personal MessageVisit Poster's Website
Gandalf
WebHelper
WebHelper


Joined: 08 Jan 2002
Posts: 52
Location: Israel

PostPosted: Thu Feb 28, 2002 12:56 pm (15 years, 8 months ago) Reply with QuoteBack to Top

Andrew wrote:

That has got to us JavaScript... I hate javascipt Twisted Evil


Me too. Well, if it's achieved with javascript then I don't want anything to do with it. Give me PHP or give me Death! (or, at least, give me server-side includes)

________________________________
Everything should be made as simple as possible, but no simpler.
OfflineView User's ProfileFind all posts by GandalfSend Personal MessageICQ Number
Garth Farley
WebHelper
WebHelper


Joined: 08 Jan 2002
Posts: 69
Location: Ireland

PostPosted: Thu Feb 28, 2002 4:23 pm (15 years, 8 months ago) Reply with QuoteBack to Top

Gandalf wrote:

Andrew wrote:

That has got to us JavaScript... I hate javascipt Twisted Evil


Me too. Well, if it's achieved with javascript then I don't want anything to do with it. Give me PHP or give me Death! (or, at least, give me server-side includes)


What is so wrong with JavaScript? It makes your life easier, even posting the smilies on these boards. Sure I know it's the cause of pop-ups but it does have it's useful purposes.

There really should be a browser that allows you to select which Javascript comands/functions you want to disable, like in php.ini. Anyone here work for Microsoft, that's an excellent idea for IE7.

Garth Farley
OfflineView User's ProfileFind all posts by Garth FarleySend Personal Message
WebSketcher
WebHelper
WebHelper


Joined: 14 Jan 2002
Posts: 95
Location: Canada

PostPosted: Thu Feb 28, 2002 4:33 pm (15 years, 8 months ago) Reply with QuoteBack to Top

Garth Farley wrote:
What is so wrong with JavaScript? It makes your life easier, even posting the smilies on these boards. Sure I know it's the cause of pop-ups but it does have it's useful purposes.

I totally agree Wink

Gandalf wrote:
Give me PHP or give me Death!

Had bad experience or what ? LoL Laughing Laughing
OfflineView User's ProfileFind all posts by WebSketcherSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.057772 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme