为什么我的ajax函数没有使用get方法提交这两个值
<script language="javascript" type="text/javascript">
<!--
//Browser Support Code
function ajaxFunction( ){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.getElementById("emailconfirm").innerHTML= ajaxRequest.responseText;
}
}
ajaxRequest.open("GET", "Atest.php?<?php echo $PDFPassingArray ?>?Email="+ document.getElementById("email").value, true);
ajaxRequest.send(null);
}
我希望函数提交数组$ pdfpassingArray,这是一个html_build_query和表单中的Email elemment id。目前我只能反转$ pdfPassingarray值,而不是电子邮件值。所以我的问题,我做了这个部分吗
ajaxRequest.open("GET", "Atest.php?<?php echo $PDFPassingArray ?>?Email="+ document.getElementById("email").value, true);
我的表格
<form name='myForm'>
<input name="email" id="email"type="text" />
<input name="button" onclick="ajaxFunction()" type="button" />
</form>
答案 0 :(得分:3)
您的网址字符串中有两个?
,
它的格式应为url.php?a=1&b=2