closing a window.

This is a discussion on "closing a window." within the JavaScript Forum section. This forum, and the thread "closing a window. are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 24th, 2003, 19:23
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
closing a window.

my site:www.caption.tk

The main problem is that session variables do not work under the .tk domain, so I need to get them to my site under its real address. the only way I could figure to do this was to open a window with the new address and then close the old one. The code I used for it is below. However for most people is does not close the window. So does anyone have suggestions why the script does not work, or another solution to my problem?

Thanks

Hatsu

<html>
<head>
<script language="javascript" type="text/javascript">
<!--
Newsite= window.open("http://caption.dfs.uh-hosting.co.uk/main.asp","newsite");
// -->

</script>

<script>window.close();</script>

</head>
<body>


Re-direct failed. Click to continue to


<center>Caption contest</center>

</body>

</html>

  #2 (permalink)  
Old Nov 24th, 2003, 19:35
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Why not use cookies instead of session variables?
  #3 (permalink)  
Old Nov 24th, 2003, 20:38
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
When someone visits the .tk domain redirect them without a new window.

Use can use javascript or a straight forward meta refresh to do this.

Sometimes the simple ways, are the best ways. :wink:
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #4 (permalink)  
Old Nov 25th, 2003, 17:25
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I use session variables as important details are kept about the user such as security levels that I do no want them to change easily. Also not all people have cookies enabled.

If I do a redirect it still keeps the www.caption.tk
  #5 (permalink)  
Old Nov 25th, 2003, 17:42
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Session variables won't work without cookies, as the server sets a cookie to identify the session. So if disabled cookies are a concern then you'll have a problem either way.
  #6 (permalink)  
Old Nov 25th, 2003, 18:14
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Hatsu.... I am not understanding you.

You say you dont want them at the .tk domain... you want them at the other site where you can unleash session variables.... If I am understanding you this far, then I am lost as to why you cannot redirect them. Redirecting is easy, and I cant understand why they still stay at the .tk domain.

Please can you explain a little more clearly what exactly you want to happen?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #7 (permalink)  
Old Nov 25th, 2003, 18:17
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Ok, another approach is pass the state in a querystring as a single char.. on the next page, you can then set a cookie, or session var.

Your application I have to say could use a little re-working if you are having to jump thru so many hoops to keep state.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #8 (permalink)  
Old Nov 27th, 2003, 20:41
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Well the problem with a .tk is that what ever page you link to it will stay, as www.caption.tk, even is the link is off the site> I think it has to do with the frame that in, so the only way I get around the frame is by creating a new window.
  #9 (permalink)  
Old Nov 27th, 2003, 22:23
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Hatsu.. sounds like your problem is exactly what your saying it is... I dont know about .tk's but I know that the short redirects that I use put your site in a frame. Then no matter what you click and where you go your still inside that frame. The only way to get around this is to open up a new window, there is nothing you can do.

For those of you that dont understand this please continue reading...
What happens is you buy a very low priced domain, OR... you get a free shortcut.. And all that they do is setup a homepage for you and make the full homepage a frame. The content that goes in this frame is your page. So you are stuck in a frame and can't get out of it unless you open up a new window. All of the content is then also loaded into this same frame if you click on a link to get there. That's all there is to it. Hope yall can help further after reading this message.
  #10 (permalink)  
Old Nov 29th, 2003, 09:59
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
godaddy's .biz sells for just USD4! try it instead... offers dns so you can set it to any nameserver u want!
  #11 (permalink)  
Old Nov 29th, 2003, 10:03
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Hatsu

Well the problem with a .tk is that what ever page you link to it will stay, as www.caption.tk, even is the link is off the site> I think it has to do with the frame that in, so the only way I get around the frame is by creating a new window.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Have you ever heard of target= _top

This will break outta the frames.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #12 (permalink)  
Old Nov 30th, 2003, 19:41
New Member
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I tried to write a javascript to do it, but I couldn't work out where to add the tag, as I'm only modifying examples. Would someone br kind enough to write a snippet for me?
Closed Thread

Tags
closing, window

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing tags in the validator geyids Web Page Design 11 Jan 14th, 2008 07:00
[SOLVED] Closing Div Popup Window Monie JavaScript Forum 4 Dec 13th, 2007 06:42
[SOLVED] open new window from main window AdRock Other Programming Languages 1 Nov 1st, 2007 02:45
closing an application kal JavaScript Forum 4 Dec 13th, 2005 13:20
Closing a window ( created using start,stopdrag) gwx03 Flash & Multimedia Forum 6 Dec 12th, 2003 01:44


All times are GMT. The time now is 23:57.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43