|
Author |
Message |
Gandalf
WebHelper
Joined: 08 Jan 2002
Posts: 52
Location: Israel
|
Posted:
Thu Feb 28, 2002 12:26 am (22 years, 2 months ago) |
|
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. |
|
|
|
WebSketcher
WebHelper
Joined: 14 Jan 2002
Posts: 95
Location: Canada
|
Posted:
Thu Feb 28, 2002 1:29 am (22 years, 2 months ago) |
|
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 |
|
|
|
|
Robert Wellock
WebHelper
Joined: 18 Jan 2002
Posts: 61
Location: Yorkshire - UK
|
Posted:
Thu Feb 28, 2002 12:18 pm (22 years, 1 month ago) |
|
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 |
|
|
|
Gandalf
WebHelper
Joined: 08 Jan 2002
Posts: 52
Location: Israel
|
Posted:
Thu Feb 28, 2002 12:56 pm (22 years, 1 month ago) |
|
Andrew wrote: |
That has got to us JavaScript... I hate javascipt
|
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. |
|
|
|
Garth Farley
WebHelper
Joined: 08 Jan 2002
Posts: 69
Location: Ireland
|
Posted:
Thu Feb 28, 2002 4:23 pm (22 years, 1 month ago) |
|
Gandalf wrote: |
Andrew wrote: |
That has got to us JavaScript... I hate javascipt
|
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 |
|
|
|
|
WebSketcher
WebHelper
Joined: 14 Jan 2002
Posts: 95
Location: Canada
|
Posted:
Thu Feb 28, 2002 4:33 pm (22 years, 1 month ago) |
|
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
Gandalf wrote: | Give me PHP or give me Death! |
Had bad experience or what ? LoL |
|
|
|
|
|
|
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.158959 seconds :: 19 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |