Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Create a Bookmark Javascript in PHP


Recommended Posts

I want to add my Javascript code into the main index definition for people to be able to bookmark my site but I cant get it to incorporate into the PHP code.


Here's my code:


<script language="JavaScript">


var bookmarkurl="http://www.DOMAIN.com";var bookmarktitle="Bookmark Us!";

function addbookmark(){

if (document.all);window.external.AddFavorite(bookmarkurl,bookmarktitle)





I need to post the above code in a spot like the head tag -->


I need to put the code below in the main body tag.


<!--[if IE]>

<script language="JavaScript">

if (document.all)

document.write('<a href="java script:addbookmark()">Bookmark Us!</a>')





Link to comment
Share on other sites

the AddFavorite function adds the url but you need to pass the arguments to it. Your jscript function addbookmark does not get any arguments and even when you call it you do not pass them to the arguments stack.


AddFavorite(?http://mysite321.com?, ?Some slogan here?);

Link to comment
Share on other sites

Please?!? I want to make some sort of code so that customers can click on it and automatically add a bookmark of my site. When I enter my regular HTML code it doesnt work in PHP. Thanks.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...