By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

MY WAY OR THE HIGHWAY

P: n/a
Hi,

There is a website which links to my website. But they put my website
in an <IFRAME> with their logo above.

My solution:

<script language="JavaScript">
if(top.location!=self.location)top.location.replac e("http://www.website.com")
</script>

This script will load page in the top location.

Now there is something else.
If somebody links to my website, and they open a new window for that.
I want to close the previous window (the window with the link)

Is this possible?
With javascript, html, asp, php or something else???????

-Martijn
Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
rf

"Martijn" <m_*******@hotmail.com> wrote in message
news:c9**************************@posting.google.c om...
Hi,

There is a website which links to my website. But they put my website
in an <IFRAME> with their logo above.

My solution:

<script language="JavaScript">
if(top.location!=self.location)top.location.replac e("http://www.website.com"
) </script>

This script will load page in the top location.

Now there is something else.
If somebody links to my website, and they open a new window for that.
I want to close the previous window (the window with the link)

Is this possible?
With javascript, html, asp, php or something else???????


No.

Cheers
Richard.
Jul 20 '05 #2

P: n/a
rf wrote:
Is this possible?
With javascript, html, asp, php or something else???????

No.

Cheers
Richard.


Thank God ;)

Jul 20 '05 #3

P: n/a
In article <c9**************************@posting.google.com >,
m_*******@hotmail.com says...
Now there is something else.
If somebody links to my website, and they open a new window for that.
I want to close the previous window (the window with the link)


Why? What if a visitor finds that your site is crap and they want to
return to the previous site?

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
Jul 20 '05 #4

P: n/a
"rf" <ma**********@the.time> wrote in message
news:MA********************@news-server.bigpond.net.au...
<snip>
If somebody links to my website, and they open a new
window for that. I want to close the previous window
(the window with the link) Is this possible?
With javascript, html, asp, php or something else???????


No.


Though if the new window is opened with JavaScript it may be possible to
navigate the opener to the URL of the opened window with something
like:-

if(window.opener &&
!window.opener.closed &&
window.opener.location){
window.opener.location = window.location.href;
/*and maybe:
if(window.opener.focus)window.opener.focus{};
-and/or-
if(window.close)window.close();
*/
}

(Untested)

Which might server to discourage people from using JavaScript to open
other sights in new windows. But still cannot catch people using
TARGET="_blank" and the like in their HTML.

If the site that was opening the window became aware of the script they
might try setting the opener property of the window reference returned
from window.open to null so it could not navigate it's opener.

Richard.
Jul 20 '05 #5

P: n/a
Hywel Jenkins <hy**********@hotmail.com> wrote in message news:<MP************************@news.individual.n et>...
In article <c9**************************@posting.google.com >,
m_*******@hotmail.com says...
Now there is something else.
If somebody links to my website, and they open a new window for that.
I want to close the previous window (the window with the link)


Why? What if a visitor finds that your site is crap and they want to
return to the previous site?


You stupid cunt.
Jul 20 '05 #6

P: n/a

"Martijn" <m_*******@hotmail.com> wrote in message
news:c9**************************@posting.google.c om...
Hi,

There is a website which links to my website. But they put my website
in an <IFRAME> with their logo above.

My solution:

<script language="JavaScript">
if(top.location!=self.location)top.location.replac e("http://www.website.com"
) </script>

This script will load page in the top location.

Now there is something else.
If somebody links to my website, and they open a new window for that.
I want to close the previous window (the window with the link)

Is this possible?
With javascript, html, asp, php or something else???????

-Martijn


I've read the other posts where folk say it can't be done - I'm a newbie at
Javascript so I'm not going to go over their heads, however I've seen your
problem before...

Friends of mine had created a website for a radio station in Ireland - It so
happened that another radio station in Beiruit had the same FM or whatever
band... and the Beiruit radio station used the images from the Irish radio
station without permission (and using expensive bandwidth).

It was funny (though perhaps not very professional) but their result was to
move the real web site to another location (or changed the names of the
images - something like that). The original URL for the images of the Irish
radio station were replaced with Gadafi smoking pot and other images that,
after a short few days meant the folk hijacking someone elses hardwork and
bandwidth moved their attentions elsewhere.

So... well... perhaps that might give you some food for thought with regards
to whoever is frameing your website without your permission....

Mind you - again - I'm green around the gills when it comes to javascript
but can you not have your website perform a delayed link of a second or two,
to your home page using target=_parent or something? That would remove
their parent frame, would it not?
Jul 20 '05 #7

P: n/a
In article <75**************************@posting.google.com >,
mr***********@yahoo.co.uk says...
Hywel Jenkins <hy**********@hotmail.com> wrote in message news:<MP************************@news.individual.n et>...
In article <c9**************************@posting.google.com >,
m_*******@hotmail.com says...
Now there is something else.
If somebody links to my website, and they open a new window for that.
I want to close the previous window (the window with the link)


Why? What if a visitor finds that your site is crap and they want to
return to the previous site?


You stupid cunt.


If you are judging me by your standards you must right at the bottom of
the food chain. Millions of years of eveolution and that's the best
insult you could think of? You're a genius, and I'm sure you couldn't
have addressed the point I raised more eloquently. Now, go finish
shagging your brother.

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
Jul 20 '05 #8

P: n/a
Hywel Jenkins <hy**********@hotmail.com> wrote in message news:<MP************************@news.individual.n et>...
In article <75**************************@posting.google.com >,
mr***********@yahoo.co.uk says...
Hywel Jenkins <hy**********@hotmail.com> wrote in message news:<MP************************@news.individual.n et>...
In article <c9**************************@posting.google.com >,
m_*******@hotmail.com says...
> Now there is something else.
> If somebody links to my website, and they open a new window for that.
> I want to close the previous window (the window with the link)

Why? What if a visitor finds that your site is crap and they want to
return to the previous site?


You stupid cunt.


If you are judging me by your standards you must right at the bottom of
the food chain. Millions of years of eveolution and that's the best
insult you could think of? You're a genius, and I'm sure you couldn't
have addressed the point I raised more eloquently. Now, go finish
shagging your brother.

You stupid boring cunt.
Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.