[php] 북마크, 즐겨찾기 스크립트
본문
Step 1: Add the below code to
the <head> section of your page:
<script type="text/javascript">
/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
Step 2: Create either an image or text link that will be used as the Bookmark Site link. For the href attribute, use the following code:
<a href="javascript:bookmarksite('Dynamic Drive', 'http://www.dynamicdrive.com')">Bookmark this site!</a>
<a href="javascript:bookmarksite('<?=$g4['title']?>', '<?=$g4['url']?>')">Bookmark this site!</a>
<script type="text/javascript">
/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
Step 2: Create either an image or text link that will be used as the Bookmark Site link. For the href attribute, use the following code:
<a href="javascript:bookmarksite('Dynamic Drive', 'http://www.dynamicdrive.com')">Bookmark this site!</a>
<a href="javascript:bookmarksite('<?=$g4['title']?>', '<?=$g4['url']?>')">Bookmark this site!</a>
추천0
관련링크
댓글목록 0
등록된 댓글이 없습니다.