Friday, June 20, 2014

Loading PHP file in any html or PHP file with Json

<html lang="en">
<meta charset="utf-8">
<title>load demo</title>
body{ font-size: 12px; font-family: Arial; }
<script src="jquery.js"></script>
<b>Successful Response (should be blank):</b>
<div id="success"></div>
<b>Error Response:</b>
<div id="error"></div>
var browser=navigator.userAgent;
//if (browser.lastIndexOf("Chrome")>=5)
$("#success").load("index.php", function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#error").html(msg + xhr.status + " " + xhr.statusText);
Post a Comment

Add Choice