Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery $.post unexpected token <

Tags:

jquery

token

I'm about to give up,

Whats wrong with this code?

<script type="text/javascript">
    $(document).ready(function() {
    $.post('php/taglist.php',{},function(response) {
    var arr = $.parseJSON(response);
    console.log(arr);
    });
    });
</script>

That's what I get in my console log:

Uncaught SyntaxError: Unexpected token < jquery.min.js:3
b.extend.parseJSON jquery.min.js:3
(anonymous function)
c jquery.min.js:3
p.fireWith jquery.min.js:3
k jquery.min.js:5
r jquery.min.js:5 
like image 349
shultz Avatar asked Feb 27 '26 03:02

shultz


1 Answers

I think you dont need '{}' in line

  it should be like      $.post('php/taglist.php',function(data) {

in your code ..

like image 122
user2485618 Avatar answered Mar 01 '26 16:03

user2485618



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!