jQuery facebook autocomplete live demo
Following are the code snippet example for Autocomplete (similar the facebook autocomplete).
Code Example:
JQuery Autocomplete similar to facebook
We are Web Technology Experts Team who provide you Important information on Web Development, Interview Questions and Answers, live project problem and their solution and online free tutorials.
JQuery Autocomplete similar to facebook
1) jQuery(this);// Current object
2) jQuery("p");// Select all the P tag
3)jQuery("p.abc");//Select all the P tag having class abc 4) jQuery("ul li:first");//select the first li of ul 5)jQuery("p").hide();// Hide the p tag 6) jQuery(document).ready(function(){ jQuery("button").click(function(){ jQuery("div.toggle").toggle(); }); });:
/*When you click the button first time, it will hide the div having class toggle and when click again will show.*/ 7)jQuery("div#intro .head"); // select the class having "head" under div having id "intro" 8)jQuery("[hrefjQuery='.jpg']"); //select all href having link ending with jpg 9)jQuery("p.abc").append("greatinformations");;// Add the text "greatinformations" end the div having class abc 10) jQuery("p.abc").after("greatinformations"); /*Add the text "greatinformations" after the ending the div having class abc Enter code here. Please note: Although no board code and smiley buttons are shown, they are still usable.*/ 11)jQuery("div").animate({height:300},"slow"); //change all the div height to 300px 12) jQuery(this).css("background-color"); //get the background color of current html object 13)jQuery(this).css("background-color", 'blue' ); //set the background-color to blue of current html object 14)jQuery("div").animate({left:"100px"},"slow"); // Move the div to 100px 15)/*jQuery Callback:A callback function is executed after the current work is done eg. */ jQuery("button").click(function(){ jQuery("div.class").show(300,function(){ alert("The div is display now "); });. 16) jQuery("button.a").click(function(){ jQuery("div").load('abc.txt'); }); /* when click on button having class a will load the data from abc.text and upload to div */ 17) jQuery("div").load('abc.txt','',function(){alert('hi')}); // after loading file abc.txt, alert the "hi"
Async=true
Async=falseAjax request does not execute independently, Its response can comes when earlier request finished.
//serialize ajax Data var formData = $('form#formId').serialize(); $.ajax({ url: '/my/site', data: formData, type: 'post', success: function(result) { console.log(result); } });
$.getJSON("http://twitter.com/status/user_timeline/padraicb.json?count=10&callback=?", function(result){ //Now result have response of ajax call console.log(result); });
if(!empty($_POST)){ echo " "; print_r($_POST); echo ""; /** You can write your code here **/ /** You can write your code here **/ die; }
Array ( [formsubmit] => 1 [first_name] => Raj [last_name] => sinha [email] => raj@no-spam.ws [phone] => 789797522 [city_id] => 1 )
if(!empty($_POST)){ echo " "; print_r($_POST); echo ""; /** You can write your code here **/ /** You can write your code here **/ die; }
Array ( [formsubmit] => 1 [first_name] => Raj [last_name] => sinha [email] => raj@no-spam.ws [phone] => 789797522 [city_id] => 1 )