by http://webgeektutorials.blogspot.com
Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Tuesday, July 10, 2012

Reload / Refresh Page in jQuery

Here is the code to refresh the page when u click on a button component. Its just like you press "F5" button to refresh page.
=======================Code begins =========================
<!doctype html>
<html lang="en-us">
<head>
<title>Reload/Refresh a Page in jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"> </script>

<script type="text/javascript">
$(document).ready(function() {
$('#Refresh').click(function() {
$("p").append("<strong>Now Refreshing page..</strong>");
location.reload();
});
});
</script>

Monday, May 21, 2012

jQuery: Disable context menu on right click

Using jQuery you can disable context menu when you right click on any HTML page. To do so add a very small   script in <HEAD> section of HTML page after linking it to jQuery.

Here is the script : 

<script type="text/javascript">
 $(function(){
 $("form").form();
 $(this).bind("contextmenu", function(e) {
e.preventDefault();
 });
});
</script> 

Friday, May 4, 2012

How to : jQuery UI Autocomplete - Combobox ( dropdown )

Convert your <select> into beautiful jQuery UI Combobox. Its been fun with jQuery and UI is really cool. This is what i got when finished. ( final output )


You can customize the widget as you want. for this you need jQuery UI , I downloaded my own jQueryUI Theme using Theamroller. You can download default theme or customize it as per your project need, just download it from here.  To do this cool widget i follow following steps.

Step 1:Add Javascripts and CSS to your page
Here i have downloaded 1.8.20 version and using same for this tutorial. For this widget i added few scripts and css style in header section of HTML page.

Tuesday, October 18, 2011

Adding Calendar control using jQuery

The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.
By default, the datepicker calendar opens in a small overlay onFocus and closes automatically onBlur or when a date is selected. For an inline calendar, simply attach the datepicker to a div or span.
You can use keyboard shortcuts to drive the datepicker:
  • page up/down - previous/next month
  • ctrl+page up/down - previous/next year
  • ctrl+home - current month or open when closed
  • ctrl+left/right - previous/next day
  • ctrl+up/down - previous/next week
  • enter - accept the selected date
  • ctrl+end - close and erase the date
  • escape - close the datepicker without selection

DEMO: How to Add Calendar using jQuery.


Click on textbox to select date

Source code:

<!DOCTYPE html>
    <html>
    <head>

Tuesday, July 5, 2011

jQuery Mobile

Touch-Optimized Web Framework for Smartphones & Tablets

jQuery mobile framework takes the "write less, do more" mantra to the next level: Instead of writing unique apps for each mobile device or OS, the jQuery mobile framework will allow you to design a single highly branded and customized web application that will work on all popular smartphone and tablet platforms, it supports
  • IOS
  • Android 
  • Black Berry
  • Bada
  • Windows phone
  • Symbian
  • Meego etc.
Cross-platform & cross-device 
jQuery mobile framework takes the "write less, do more" mantra to the next level: Instead of writing unique apps for each mobile device or OS, the jQuery mobile framework will allow you to design a single highly branded and customized web application that will work on all popular smartphone and tablet platforms.

Touch-optimized layouts & UI widgets
Their aim is to provide tools to build dynamic touch interfaces that will adapt gracefully to a range of device form factors. The system will include both layouts (lists, detail panes, overlays) and a rich set of form controls and UI widgets (toggles, sliders, tabs)

Monday, January 10, 2011

jQuery a Quick Intro

jQuery is JavaScript Library created by John Resig in 2006 with a great idea, and idea was :

Write less, do more

jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is a framework built using JavaScript capabilities. So you can use all the functions and other capabilities available in JavaScript.Here is the list of important core features supported by jQuery:

DOM manipulation: The jQuery made it easy to select DOM elements, traverse them and modifying their content by using cross-browser open source selector engine called Sizzle.
Event handling: The jQuery offers an elegant way to capture a wide variety of events, such as a user clicking on a link, without the need to clutter the HTML code itself with event handlers.
AJAX Support: The jQuery helps you a lot to develop a responsive and feature-rich site using AJAX technology.
Animations: The jQuery comes with plenty of built-in animation effects which you can use in your websites.
Lightweight: The jQuery is very lightweight library - about 19KB in size ( Minified and gzipped ).
Cross Browser Support: The jQuery has cross-browser support, and works well in IE 6.0+, FF 2.0+, Safari 3.0+, Chrome and Opera 9.0+