日期:2014-05-16 浏览次数:20562 次
$.ajax({
type: "POST",
url: "index.php",
data: "location=img_png_src",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
<?php echo $_POST["location"]; ?>
<?php
if($_SERVER['REQUEST_METHOD'] == "POST") {
print_r($_POST);
exit();
}
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script>
$(function() {
$.ajax({
type: "POST",
// url: "index.php",
data: "location=img_png_src",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
});
</script>