Category: AJAX

  • Auto save form using PHP, jQuery

    This blog is regarding how to auto save form using PHP, jQuery. There are many tutorial available but it is very simple method. HTML Form : <form id=”auto-save-form”> Name : <input name=”name” type=”text” /> Email : <input name=”email” type=”text”> <input name=”submit” type=”submit”/> </form> JQuery Code: /*Form Auto Submit Logic*/ var changeFlag = false; var focusFlag…

  • Rotate Image using Jquery & PHP

    Many Library available for rotating the image object. But, here we are rotating the image object using Jquery, Ajax and PHP. Here using PHP GD library for rotating the image object. There are many options to rotate the image object. But, here we using simple method. Note: In this example We used jpeg format Image.…

  • how to use json in php?

    //test.php <script type=”text/javascript” src=”http://code.jquery.com/jquery-2.1.0.min.js”></script> <input type=”button” name=”show” id=”show” value=”Click TO Show Data ” /> <br> Json Encode Data : <div id=”json_output” style=”border:#000 1px solid;width:337px;height:337px;overflow:auto”> </div> Json Output Data of output variable : <div id=”json_output_variable” style=”border:#000 1px solid;width:337px;height:337px;overflow:auto”> </div> <script type=”text/javascript”> $(“#show”).click(function (){ var datastr=’format=json&id=37′; $.ajax({ type:’POST’, data:datastr, url:’json.php’, success:function(html) { $(“#json_output”).html(html); var obj=JSON.parse(html);//decode the json…

  • how to Change browser url without page reloading with ajax request using JavaScript, HTML5 history API, jQuery, PHP like Facebook, Github navigation menu?

    Consider a page that has the following links to three menu items and a div to display the ajax content. <div id=”menu”>  <a href=”m1.php” rel=”tab”>menu1</a> |  <a href=”m2.php” rel=”tab”>menu2</a> |  <a href=”m3.php” rel=”tab”>menu3</a> </div> To override the default action for the link(anchor tag), use the following jQuery code snippet. $(function(){   $(“a[rel=’tab’]”).click(function(e){     //code for the link…

  • AJAX-Passing the multiple value to another page.

    function searchDoc1(str,str1) { if (str==””) { document.getElementById(“list”).innerHTML=””; return; } if (str1==””) { document.getElementById(“list”).innerHTML=””; return; } if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //alert(xmlhttp.responseText); document.getElementById(“list”).innerHTML=xmlhttp.responseText; } else if(xmlhttp.readyState==3)//waiting Module { document.getElementById(“list”).innerHTML = “waiting”;// or “using the image tag to display image” } } var url1=”list_out.php”…