変数を ajax に渡す際に問題が発生しています。
これは動作します: url: 'testing.php?id=1',
これは機能しません: url: 'testing.php?id=theid',
動作する完全なコードは次のとおりです。
function myfunc(theid) {
$.ajax({
url: 'testing.php?user_id=1',
success: function() {
alert('this worked' + venueid);
}
});
}
そして、このコードは変数値を渡しません:
function myfunc(theid) {
$.ajax({
url: 'testing.php?user_id=theid',
success: function() {
alert('this worked' + venueid);
}
});
}
これは構文の問題ですか? 私はここで間違っていますか?