LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-11-2005, 07:47 AM   #1
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
Javascript - what to use rather than window.close() then window.open()


I've got a bit of code which displays a disclaimer to a site, unless there's a cookie there to prove the user's been there already.

Just now, it opens a new window when the cookie is accepted, using:

Quote:
function page()
{
writeCookie('comply','1',30);
window.open ('ats_index.htm');
window.close()
}
I'd like, however, to just forward the user to the index page in the same browser window - rather than in a 'new' browser window. I presume this is easy enough if you know how(!)

Anyone know?

Dave
 
Old 04-11-2005, 07:53 AM   #2
ralvez
Member
 
Registered: Oct 2003
Location: Canada
Distribution: ArchLinux && Slackware 10.1
Posts: 298

Rep: Reputation: 30
If you want to re-direct use "location.href='http://the_url_you_want.com'"';

Hope this helps.

Rick
 
Old 04-11-2005, 08:28 AM   #3
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Original Poster
Rep: Reputation: 30
Thanks Ralvez, that was exactly what I was looking for...!

You've saved a lot of time for me,

Dave
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why NOT this Tiny Window Close ? bedi-beparwah Suse/Novell 2 06-19-2005 05:04 AM
X crashes when i close a window slackinblack Linux - Software 1 12-05-2004 09:32 AM
close a window with script box_l Programming 0 07-27-2004 07:57 AM
Close Mozilla window taoweijia Programming 1 12-17-2003 12:09 PM
Javascript: New Window Script trickykid Programming 1 03-22-2001 01:58 PM


All times are GMT -5. The time now is 10:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration