텍스트 입력란과 입력란이 있습니다. 제출 버튼을 클릭하면 입력 필드와 관련된 URL을 받아야합니다. 하지만 Uncaught TypeError: undefined is not a function
이 나옵니다. 자바 스크립트에서왜 두 문자열을 연결하면 오류가 발생합니까?
<script>
$(document).ready(function(e) {
$('#search_btn').click(function() {
console.log($('#thisiswhatineed').val()); // this is working perfectly
console.log("<?php echo BASE_URL; ?>/ads/search/"); // this is also working perfectly
var url_to_go = "<?php echo BASE_URL; ?>/ads/search/" . $('#thisiswhatineed').val();
console.log(url_to_go); // this is not working and giving me the error mentioned above
});
});
</script>
javascript에서 연결하는 것은 +로하고 a로하지 않습니다. PHP – JohannesB
@ Rsauxil과 같이 대답을 추가해야합니다 :) (걱정하지 말고, 쓰레기도 너를 때려) –
어쨌든, 어쨌든, 문제는 해결되었으므로 지금 누가 신경 써야합니까 : P – JohannesB