SyntaxError: expected expression, got '<'
Solved
Hello,
I’d like to include an external file on my page with Ajax. I’ve managed to make the request, I can see the result in Firefox’s console, but I can’t display it; the following error message appears in the console:
SyntaxError: expected expression, got '<'
[Text...]
And my Ajax code: $.ajax({ type: "GET", url: "http://example.com/", data: data, crossDomain: true, dataType: 'jsonp', success: function(msg){ $('#resultat').html(msg); } }); Thanks for your help, hcp7kuz2 answers
-
Problem solved: in my Ajax request, I had set dataType: 'jsonp' instead of dataType: 'html'.
-
Which line is the problem on? Because I don’t see any relation between your function and this message.
-
-
-
@Anonymous userThe file has nothing to do with it; it simply returns a snippet of HTML code that I’d like to insert into my page.
-