I have a text field and an input type submit. When I click on the submit button I should get a url related to the input field. But I am getting Uncaught TypeError: undefined is not a function
. Here's my code that explains more better:
<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>