Click to See Complete Forum and Search --> : OK how bout this one...
d2tw4all
03-28-2003, 10:19 AM
I have frames set up for a kiosk that load a main page, however we have found links that want to open the page in the current window, which removes my frames and becomes a real problem. I need to find out if there is a way to code it so that if a page wants to load a new page over the main page, instead it forces it to open in a new window. It's kind of hard to explain but I hope this is understood...
Tom
havik
03-28-2003, 10:25 AM
<a href="url" target="attribute">
allowable attributes
TARGET="_blank"
This target will cause the link to always be loaded in a new blank window. This window is not named.
TARGET="_self"
This target causes the link to always load in the same window the anchor was clicked in. This is useful for overriding a globally assigned BASE target.
TARGET="_parent"
This target makes the link load in the immediate FRAMESET parent of this document. This defaults to acting like "_self" if the document has no parent.
TARGET="_top"
This target makes the link load in the full body of the window. This defaults to acting like "_self" if the document is already at the top. It is useful for breaking out of an arbitrarily deep FRAME nesting.
TARGET="window_name"
This target makes the link load in the full body of the window being referenced, should you know the handle of the window
Hope this helps
Havik
d2tw4all
03-28-2003, 10:35 AM
I'm not sure, I forwarded the info on to my brother who is helping, but if you remember the situation I'm in, I can't change the code of the site that the actual link is on, but it's in a frame of html I do control. I was hoping there was a way for the frame javascript code to "detect" if a page was trying to change to a new location over-riding the frames. Basically what happens now is that if you go to a link that says to open in the same window but forces the change to the new site, it closes my frames and everything and goes right to the site. I have code in the frame page that detects if it's closed and reopens it, which gets set off when a link hijacks the page, but it then opens full screen and you can't close it because it uses the same attributes as the frame page, which is locked down full screen... Am I making sense, did the suggestions you make apply to this? Thanks for the help by the way...
Tom
havik
03-28-2003, 10:47 AM
I remember now. I was wondering if I could see the problem. Because I don't know how I can help in this case. If the links on the pages were set to target="_parent" then that would make things easier, but like you said you have no control of those pages.
Here are a few links that you might find useful:
http://developer.irt.org/script/frame.htm
http://developer.irt.org/script/window.htm
Again, do you have the url?
Havik
d2tw4all
03-28-2003, 11:02 AM
I can give you the URL to the site in question, but not my html because it's local code on the kiosks, not published. The kiosk loads the local html which loads a frame full screen and then loads www.cvs.com in the main part of the screen. There are parts of cvs.com that open the current window to a new page, closing all the frames as a result, I need to stop that from happening maybe by somehow "detecting" that the page is being redirected. The command that is being used to redirect is:
window.location.url='http://mysite.com/newpage'
This basically hijacks the current window and closes anything that is open in it, including my frames. I need some javascript to detect this before the site changes and redirect it to a new window maybe, something like that, or even if it just opened the new link in the current frame that would work, any ideas?
Tom
d2tw4all
03-28-2003, 11:04 AM
We found no solution to the prior problem from yesterday and instead built a custom VB app that watches for any popups and lets you switch to them, kind of like a restricted task switcher utility that always runs in the bottom right corner of the screen... Just in case you were wondering what I came up with on the problem from yesterday...
Thanks...
Tom
d2tw4all
03-28-2003, 01:06 PM
any ideas at all on this one?
Tom
havik
03-28-2003, 01:31 PM
Sorry, I haven't been able to give it much thought lately. My boss has decided to pile a month-end rush job on me. I'll keep it in mind but now I welcome anyone else to join in.
Havik
d2tw4all
03-28-2003, 02:09 PM
Thanks for the effort, we might be onto something using the html we have control over, as the main frame window is actually a child of another window we might be able to fix it so that when the child window changes we can detect that and dynamically correct... Keep it in mind though, if we come to a firm conclusion I will post...
Tom