我有一个表格,我需要将信息发布到外部网站,但由于某种原因,我收到了一个错误:
错误:[异常...“拒绝访问受限 URI”代码:“1012”nsresult:“0x805303f4 (NS_ERROR_DOM_BAD_URI)”位置:“jquery.core.1-3-2.min.js 行:19”] 源文件:jquery.core.1-3-2.min.js 行:19
这是我用来执行表单的代码(或尝试这样做):
<script type="text/javascript" language="javascript">
$(function() {
$(".FormButtons").click(function() {
var name = $("input#contactDataFirstName").val();
var lname = $("input#contactLastName").val();
var gender = $("input#contactDataGender").val();
var dobd = $("input#contactDataDateOfBirthday").val();
var dobm = $("input#contactDataDateOfBirthmonth").val();
var doby = $("input#contactDataDateOfBirthyear").val();
var mobile = $("input#contactDataMobilePhoneNumber").val();
var street = $("input#contactDataStreetAddress").val();
var suburb = $("input#contactDataSuburbTownCity").val();
var postcode = $("input#contactDataPostcode").val();
var country = $("input#contactDataCountry").val();
var state = $("input#contactDataCountrySubdivisionIDNew").val();
var password = $("input#contactDataPassword").val();
var email = $("input#contactDataEmail").val();
var remail = $("input#contactDataReceiveEmail").val();
var rmail = $("input#contactDataReceiveMail").val();
var rsms = $("input#contactDataReceiveSMS").val();
var dataString = 'contactDataFirstName='+ name + '&contactLastName=' + lname + '&contactDataGender=' + gender + '&contactDataDateOfBirthday=' + dobd + '&contactDataDateOfBirthmonth=' + dobm + '&contactDataDateOfBirthyear=' + doby + '&contactDataMobilePhoneNumber=' + mobile + '&contactDataStreetAddress=' + street + '&contactDataSuburbTownCity=' + suburb + '&contactDataPostcode=' + postcode + '&contactDataCountry=' + country + '&contactDataCountrySubdivisionIDNew=' + state + '&contactDataPassword=' + password + '&contactDataEmail=' + email + '&contactDataReceiveEmail=' + remail + '&contactDataReceiveMail=' + rmail + '&contactDataReceiveSMS=' + rsms;
$.ajax({
type: "POST",
url: "path_to_url",
//dataType: "jsonp",
data: dataString,
success: function() {
$('#contact_form').html("<div id=\"message\"></div>");
$('#message').html("<h2>Contact Form Submitted!</h2>")
.append("<p>We will be in touch soon.</p>")
.hide()
/*.fadeIn(1500, function() {
$('#message').append("<img id='checkmark' src='images/check.png' />");
});*/
}
});
return false;
});
});
</script>
有人可以帮我将我的数据发布到外部网站:)