"add this site to your bookmarks" in firefox
Is it possible to have a link so users can add my site to their bookmarks via a link? I have found out how to do it using IE but it doesn't work with Firefox.
Cheers for anyhelp.
MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
Thats a nice little script cheers! I'll try it out soon. :)
MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
To 'interact' between javascript and PHP, you have to either use PHP to create javascript code, or use XMLHTTP requests in javascript to access PHP scripts and then handle the output if neccessary.
You cannot write javscript code that directly invokes PHP code. javscript is processed on a client's computer; PHP is processed at the server as a page is requested. Javscript only ever runs after the PHP processor has done its work (and removed all PHP blocks from its output files)
That doesn't mean that you cant create javascript code based on or affected by a PHP process; it just means that the javascript in a PHP file will do what the PHP code tells it to do.
So, by the time javascript runs; this PHP code:
addBookmark('mysite',<? echo 'http://mysite'; ?>)
will always end up as this javscript code:
addBookmark('mysite',http://mysite);
And that code wont work because of quoting.
But this PHP code:
addBookmark('mysite','<? echo 'http://mysite'; ?>');
Generates this code:
addBookmark('mysite','http://mysite');
Which should work.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64