我在定义变量时遇到语法错误,我不知道为什么。我对编码非常陌生,因此不胜感激。
<script type="text/javascript">
jQuery("#submitSample").click(function(){
var fullName = jQuery("#fullName" ).val();
var eMail = jQuery("#eMail" ).val();
var mailingAddress = jQuery("#mailingAddress" ).val();
var specialRequests = jQuery("#specialRequests").val();
var inkOne = jQuery("#inkOne" ).val();
var inkTwo = jQuery("#inkTwo" ).val();
var inkThree = jQuery("#inkThree" ).val();
var inkFour = jQuery("#inkFour" ).val();
var designOne = jQuery("#designOne" ).val();
var designTwo = jQuery("#designTwo" ).val();
var designThree = jQuery("#designThree" ).val();
data = "fullName=" + fullName +
"&eMail=" + eMail +
"&mailingAddress=" + mailingAddress +
"&specialRequests=" + specialRequests +
"&inkOne=" + inkOne +
"&inkTwo=" + inkTwo +
"&inkThree=" + inkThree +
"&inkFour=" + inkFour +
"&designOne=" + designOne +
"&designTwo=" + designTwo +
"&designThree=" + designThree;
jQuery.ajax({ type: "POST",
url: "http://www.famousartistprints.com/sample_form.php",
data: data,
success: function() {
jQuery("#couturePaypal").click();
}
});
});
</script>
我在 Chrome 中打开它,这就是我得到的,我不确定它是什么意思。
SyntaxError: Unexpected token <
arguments: Array[1]
0: "<"
length: 1
__proto__: Array[0]
get message: function () { [native code] }
get stack: function () { [native code] }
set message: function () { [native code] }
set stack: function () { [native code] }
type: "unexpected_token"
__proto__: Error