2013-10-25 40 views
0

在wordpress中,我使用fancybox進行顯示聯繫,現在我必須使用ajax提交此表單,但ajax不是在wordpress中調用的。我在wordpress包之外嘗試它的工作正常。 請幫忙解決這個問題。Fancybox和Ajax的Wordpress

<script> 
function sendMail() 
{ 
    alert("call"); 
var name1=document.getElementById("txtName").value; 
var surname1=document.getElementById("txtSurname").value; 
var contact1=document.getElementById("txtContact").value; 
var email1=document.getElementById("txtEmail").value; 
var comment1=document.getElementById("txtComment").value; 
var subject1=document.getElementById("txtSubject").value; 
jQuery.ajax({ 
type: "POST", 
url: "sendMail.php", 
data: { name: name1, surname:surname1,contact:contact1,email:email1,comment:comment1,subject:subject1,oper:"send" } 
}).done(function(msg) 
{  
alert("Data Saved: " + msg); 
}); 
} 

這是我apply.php文件,該文件打開花哨的盒子,我用按一下按鈕,但其在外界的WordPress不是WordPress的工作,請幫我解決這個

由於調用這個函數

回答

0

一種可能性是當時Jquery沒有加載。瀏覽器控制檯中有錯誤嗎?在鉻上按F12鍵。

+0

感謝您回覆成功加載 –

+0

使用失敗方法檢查錯誤。 – baltov