RSS

Category Archives: Javascript

Disable HTML Right-click, Copy & Paste using Javascript

//below javascript is used for Disabling right-click on HTML page
document.oncontextmenu=new Function(“return false”);//Disabling right-click

//below javascript is used for Disabling text selection in web page
document.onselectstart=new Function (“return false”); //Disabling text selection in web page
if (window.sidebar){
document.onmousedown=new Function(“return false”);
document.onclick=new Function(“return true”) ;

//Disable Cut into HTML form using Javascript
document.oncut=new Function(“return false”);

//Disable Copy into HTML form using Javascript
document.oncopy=new Function(“return false”);

//Disable Paste into HTML form using Javascript
document.onpaste=new Function(“return false”);
}

http://teqsnacks.com/2014/01/27/disable-html-copy-paste-javascript/
http://www.ondeweb.in/disable-right-click-and-copy-paste-using-javascript/

Advertisements
 
Leave a comment

Posted by on July 2, 2015 in Javascript

 

Create api categories and sub categories

<?php
//http://www.brenelz.com/blog/how-to-create-a-simple-api-with-php-and-mysql/
//isc_shopping_comparison_categories
//Create Database connection
header(‘Content-Type: application/json’);
include’conn.php’;

$sql = mysql_query(“select * from isc_categories where catparentid=0”);
// parent categories node
$categories = array(“Categories” => array());

//print_r($categories);

while ($row = mysql_fetch_array($sql,MYSQL_ASSOC)) {
$cat_id = $row[‘categoryid’];
//print_r($row);
$ssql = mysql_query(“select * from isc_categories where catparentid=’$cat_id'”);

// single category node
$category = array(); // temp array
$category[“categoryid”] = $row[“categoryid”];
$category[“name”] = $row[“catname”];
$category[“sub_categories”] = array(); // subcategories again an array

while ($srow=mysql_fetch_array($ssql,MYSQL_ASSOC)) {
$subcat = array(); // temp array
$subcat[“categoryid”] = $srow[‘categoryid’];
$subcat[“name”] = $srow[‘catname’];
// pushing sub category into subcategories node
array_push($category[“sub_categories”], $subcat);
}

array_push($categories[“Categories”], $category);

//print_r($category);

}echo ((isset($_GET[‘callback’])) ? $_GET[‘callback’] : “”) . ‘(‘ . json_encode($categories) . ‘)’;

?>

 

3rd leval categories

 

<?php

header(‘Content-Type: application/json’);
include’conn.php’;

$sql = mysql_query(“select * from isc_categories where catparentid=0 and catvisible=’1′”);
// parent categories node
$categories = array(“Categories” => array());

//print_r($categories);

while ($row = mysql_fetch_array($sql,MYSQL_ASSOC)) {
$cat_id = $row[‘categoryid’];
//print_r($row);
$ssql = mysql_query(“select * from isc_categories where catparentid=’$cat_id'”);

// single category node
$category = array(); // temp array
$category[“categoryid”] = $row[“categoryid”];
$category[“name”] = $row[“catname”];
$category[“sub_categories”] = array(); // subcategories again an array

while ($srow=mysql_fetch_array($ssql,MYSQL_ASSOC)) {
$subcat = array(); // temp array

$sid=$srow[‘categoryid’];
$subcat[“categoryid”] = $srow[‘categoryid’];
$subcat[“name”] = $srow[‘catname’];

$subcat[“sub_categories_3rd”] = array();
// $subcat[“sub_categories_3rd”] = array(‘Front’, ‘Rear’ );
$ssql12 = mysql_query(“select * from isc_categories where catparentid=’$sid'”);
while ($srow1=mysql_fetch_array($ssql12,MYSQL_ASSOC)) {
$subcat_3rd = array(); // temp array
$subcat_3rd[“categoryid”] = $srow1[‘categoryid’];
$subcat_3rd[“name”] = $srow1[‘catname’];
array_push( $subcat[“sub_categories_3rd”], $subcat_3rd);

}

/*$tssql = mysql_query(“select * from isc_categories where catparentid='”.$srow[‘categoryid’].”‘”);

while ($tsrow=mysql_fetch_array($tssql,MYSQL_ASSOC)) {
$thirdsub = array(); // temp array
$thirdsub[“status”] = $tsrow[‘catname’];

} array_push( $subcat, $thirdsub);
*/

// pushing sub category into subcategories node
array_push($category[“sub_categories”], $subcat);
}

array_push($categories[“Categories”], $category);

//print_r($category);

}echo ((isset($_GET[‘callback’])) ? $_GET[‘callback’] : “”) . ‘(‘ . json_encode($categories) . ‘)’;

?>

 

 

 

http://www.9lessons.info/2012/07/ecommerce-menu-design-with-json-data.html

http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

 
Leave a comment

Posted by on November 24, 2014 in Javascript

 

5 Star Rating plugin in PHP Script with Ajax

5 Star Rating plugin in PHP Script with Ajax

 
Leave a comment

Posted by on November 3, 2014 in Javascript

 

Mobile

http://jquerymobile.com/

http://www.sencha.com

 
Leave a comment

Posted by on May 29, 2014 in Javascript

 

How can I run multiple Skype accounts on Windows desktop?

https://support.skype.com/en/faq/FA829/how-can-i-run-multiple-skype-accounts-on-windows-desktop

 
Leave a comment

Posted by on May 2, 2014 in Javascript

 

Full Page Image slideshow

 
Leave a comment

Posted by on May 1, 2014 in Dynamic drive, Javascript

 

Customer Relationship Management (CRM)

http://zurmo.org/

 
Leave a comment

Posted by on April 27, 2014 in Javascript