Login   Register  
PHP Classes
elePHPant
Icontem

File: script.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Er. Rochak Chauhan  >  PHP Online Bookmarking Class  >  script.php  >  Download  
File: script.php
Role: Auxiliary script
Content type: text/plain
Description: JavaScript Code
Class: PHP Online Bookmarking Class
Code to implement online bookmarking in a page.
Author: By
Last change: Fixed bug to make this class work in IE.
Date: 5 years ago
Size: 596 bytes
 

Contents

Class file image Download
<?php header("Content-type: text/javascript"); ?>
window.onload=init;
var w=screen.width;
var h=screen.height;
var title="";
var link="";
function init() {
    title=document.title;
    link=document.URL;
}
function phpOnlineBookmarkingClass(url){
    link=encodeURIComponent(link);    
    title=encodeURIComponent(title);
    var url=url.replace('{PERMALINK}',link);
    var url=url.replace('{TITLE}',title);
    openWindow(url);
}
function openWindow(url) {
   window.open(url,'PhpOnlineBookmarkingClass','width='+w+',height='+h+',menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes');
}