在这种情况下,当我点击按钮然后显示
错误未捕获的ReferenceError:未定义country2。
你能帮我解决这个错误吗?
var country2 = document.getElementById("cntry1").value;
var state2 = document.getElementById("state1").value;
$.ajax({
url: "ajax.php",
type: "POST",
data: {
get_data: 'get_data',
name: name,
number: number,
address: address,
hobbies: hobbies,
redio: redio,
country12: country2,
state12: state2
},
dataType: "text",