Category: web development

  • Drag and Drop div area with pure javascript – Step 2

    After reading my previous post Drag and Drop div area with pure javascript – Step 1, you have created javascript file draganddrop.js. Means you can add this javascript file to html page. so create a file index.html file and put below content in the head tag : And put below code inside the body tag:…

  • Drag and Drop div area with pure javascript – Step 1

    Today I have to work on drag and drop functionality and I found that on mostly sites it provides using Jquery but I have to develop with pure javascript. so I found best code for it. and this was the solution : First create a file draganddrop.js and put below code in this file: var…

  • show the div area in middle on screen using jquery

    If you want to show any div area in the middle on click any link or button then follow these steps: 1. First download and add JQuery js in your file. 2. now create a function If you want to show any div area in the middle on click any link or button then follow…

  • Remove side space in string

    Javascript Trim Functions Use the code below to make trim a method of all Strings. These are useful to place in a global Javascript file included by all your pages. String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,””); } String.prototype.ltrim = function() { return this.replace(/^\s+/,””); } String.prototype.rtrim = function() { return this.replace(/\s+$/,””); } // example of using…

  • Calling a static block in phtml template file

    First create a static block from admin >> CMS >> static blocks and write this code in your phtml file : Tweet This Post

  • Remember me box on login page in magento

    Steps for Remember me functionality in login.phtml Step 1: Please find the following path http:\\yourdomain\app\code\core\Mage\Customer\controllers\AccountController.php Step2: Find following function: public function loginPostAction() and Replace with: public function loginPostAction() { if ($this->_getSession()->isLoggedIn()) { $this->_redirect(’*/*/’); return; } $session = $this->_getSession(); if ($this->getRequest()->isPost()) { $login = $this->getRequest()->getPost(’login’); if (!empty($login[’username’]) && !empty($login[’password’])) { try { $_SESSION[’user_name’] = $login[’username’]; $_SESSION[’user_password’]…

  • Product Thumbnail sizes in Magento

    If you want to show product thumbnail on any page in your requirement size then At the showing page : <img src=”<?php echo $this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(100, 100) ?>” border=”0″ alt=”<?php echo $this->htmlEscape($_product->getName()) ?>” /> Change 100, 100 to your X, Y Where X : your requirement width and Y : Requirement height. Tweet This Post

  • Changing window.location in IE 6

    window.location and window.location.href will support to all browsers but it will not support to IE6. For this I have a solution: Suppose you code is : window.location = “http://naveenos.com/”; // Not working??? // Also this does not working?? window.location.href =”http://naveenos.com/”; Then do this, setTimeout(function() { window.location = “http://naveenos.com/”; }, 0); Tweet This Post

  • Create multilanguage site

    To create a site in multiple languages you should do two main things : Write this code after connection created in database file : mysql_query ( ‘SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary;’, $connectionID ); And write below code in common file which use in complete site : header(‘Content-Type: text/html; charset=ISO-8859-1’); Tweet This Post