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.
|
|
|
|
|
![]() |
||
closing a window.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
Why not use cookies instead of session variables?
|
|
#3
|
||||
|
||||
|
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:
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#4
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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?
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#7
|
||||
|
||||
|
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.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#8
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
godaddy's .biz sells for just USD4! try it instead... offers dns so you can set it to any nameserver u want!
|
|
#11
|
||||
|
||||
|
<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.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#12
|
|||
|
|||
|
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?
|
![]() |
| Tags |
| closing, window |
| Thread Tools | |
|
|
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 |