請在點擊事件
研究的Ajax調用,學習!啓動從here
$(document).ready(function(){
$(".cecutient-btn").click(function(){
event.preventDefault();
$(this).parent().find(".more-info-open")
.slideToggle("slow")
.toggleClass("active");
$.ajax({
type: "GET",
url: "yourFile.php", //your file .php
data: data,
success: function(data) {
}
});
});
});
AJAX調用,而不jQuery的[info here]
function loadXMLDoc() {
var xmlhttp;
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if(xmlhttp.status == 200){
document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
}
else if(xmlhttp.status == 400) {
alert('There was an error 400')
}
else {
alert('something else other than 200 was returned')
}
}
}
xmlhttp.open("GET", "ajax_info.txt", true);
xmlhttp.send();
}
你需要使用AJAX – vaso123 2014-12-19 10:42:53
那麼你不能從客戶端,因爲按鈕的點擊執行PHP代碼jquery是客戶端和PHP是服務器端。您需要學習並嘗試使用ajax ..http://api.jquery.com/jquery.ajax/ – 2014-12-19 10:43:09
您無法從按鈕運行php。你可以對一個php頁面進行Ajax調用,使其運行在網絡上運行 – 2014-12-19 10:43:24