Categories
jQuery

Difference between .closest() and .parents()

Using jQuery closest and parents, you can set or get the first or all ancestor element that matches the selector and traversing up through its ancestors in the DOM tree. The ancestor may be a parent, grandparent, great grandparent, and so on. For example: $(“div”).closest(“p”).css({“color”: “red”}); If it doesn’t match the selector, then it will […]

Categories
jQuery

Using Delegate and Undelegate in jQuery

Using delegate and undelegate in jQuery, you can bind or remove a handler from the event for all elements that matches the current selector. Basically, these methods achieve the same thing as the jQuery .live() and .die() methods but they just use a different syntax. Syntax of Delegate: $(selector).delegate(childSelector,event,data,function) Example of jQuery Delegate: $(“table”).delegate(“td”, “hover”, […]

Categories
Creative blog

5 important blogging tips for college students

For a collage student, blogging tips are very important who write in blog. Most of the time they spend their time by researching rather attend classes. We could not have imagined that blogging will become a major way for making money. In the recent years there are incredible increase in the number of bloggers specially […]

Categories
Creative blog

Free contest on your blog can increase more readers

Running a blog contest can be benefit for your blog. Here are some tips how a blog owner get benefits by organizing a giveaway. You can see somehow that many blogs are running a contest like “Comment and win an IPOD” or “Get $100 for first 10 subscribers” etc as this is an old technique […]

Categories
Creative blog Technology

5 Free Tools For Real Time Website Visitors Tracking

Use these 5 online free tools for real time website statistics and how many visitors are on your website right now. Website visitor tracking software basically works by installing a script on your site which collects the website visitor data directly. Website Visitor Behavior Tracking Software. Web site visitor tracking gives us detailed understanding of […]

Categories
jQuery

Include multiple js files using jQuery $.getScript() method

The jQuery getScript() method is used to Include multiple js files i.e. load and execute a JavaScript from the server using an AJAX HTTP GET request. The method returns XMLHttpRequest object and the callback is fired once the script has been loaded, but not necessarily executed. Syntax of getScript: $(selector).getScript(url,success(response,status)) $.getScript( “test.js”, function( data, textStatus, […]

Categories
jQuery

Parse json data with jquery

jQuery parseJSON() takes a well formed JSON string and then returns the resulting JavaScript value. Prior to jQuery 1.9 version, $.parseJSON returned null value rather than throwing an error if this was passed an empty string, null, or undefined, even though those are not valid JSON. Here are some basic things about JSON: JSON is […]

Categories
Php

PHP thumb creation and image merge

PHP thumb uses the GD library to create thumbnails from images (jpeg, gif, png etc) on run time. You can configure the output size and source will be entire image or a portion of original image. PHP uses imagejpeg function which output image to browser or file. Syntax: bool imagejpeg ( resource $image [, string […]

Categories
jQuery

Download a HTML content as pdf using javascript – jsPDF

Using jsPDF library, you can download the div containing graphs, tables, contents as a PDF. This is a HTML5 client-side solution for generating PDFs. Simply include library in your <head>, generate your PDF using the many built-in functions, then create a button to trigger the download. <script type=”text/javascript” src=”http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js”></script> Create a object: var doc = […]

Categories
jQuery

jQuery Makes Parsing XML Easy

jQuery.parseXML uses native parsing function of the browser to create a valid XML document. After that this document can then be passed to jQuery for creating a typical jQuery object which can be traversed and manipulated then. This is a easy technique of parsing JSON with jQuery and thought i’d pick this up and show […]