knowing if in in favorites

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

knowing if in in favorites

Post by Guy »

is there a way to know if my site is in the favorites(for ie) and bookmarks(for mozilla)
and if it is set to homepage?
Guy
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Security

Post by []InTeR[] »

I think this is impossable to do.
Maybe if there is a sercurity bug.

You can set a cookie the first time you try to add this to the browser.
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

Post by Guy »

they to in it google - if you have google in your favorites you don't have the "add to favorites"
and the same with the make homepage
but I don't have a clue how they are doing it.
Guy
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Google

Post by []InTeR[] »

I didn't know that, nice to know.

So i search for some qlue's how they did it.

If found this:

Code: Select all

<span id=hp style="behavior:url(#default#homepage)"></span>
<script>
//<!--
if (!hp.isHomePage('http://www.google.com/')) &#123;document.write("<p><a href="/mgyhp.html" onClick="style.behavior='url(#default#homepage)';setHomePage('http://www.google.com/');">Make Google Your Homepage!</a>");&#125;
//-->
</script>
User avatar
Guy
Forum Commoner
Posts: 53
Joined: Sun Jan 12, 2003 3:34 am

thanks

Post by Guy »

- except I cant make it to really work.
dont know why.
Guy
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Maybe the rest of the script is needed. (It's in the <HEAD> part.)

I didn't test it yet.

Code: Select all

<style><!--
body,td,a,p,.h&#123;font-family:arial,sans-serif;&#125;
.h&#123;font-size: 20px;&#125;
.q&#123;text-decoration:none; color:#0000cc;&#125;
//-->
</style>
<script>
<!--
function sf()&#123;document.f.q.focus();&#125;
function c(p,l,e)&#123;var f=document.f;if (f.action && document.getElementById) &#123;var hf=document.getElementById("hf");if (hf) &#123;var t = "<input type=hidden name=tab value="+l+">";hf.innerHTML=t;&#125;f.action = 'http://'+p;e.cancelBubble=true;f.submit();return false;&#125;return true;&#125;
// -->
</script>
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

very cool javascript snipplet. :o
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

I got it from http://www.google.com
Post Reply