SyntaxError: expected expression, got '<'
Solved
hcp7kuz
Posted messages
238
Registration date
Status
Member
Last intervention
-
hcp7kuz Posted messages 238 Registration date Status Member Last intervention -
hcp7kuz Posted messages 238 Registration date Status Member Last intervention -
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
Which line is the problem on? Because I don’t see any relation between your function and this message.
hcp7kuz
Posted messages
238
Registration date
Status
Member
Last intervention
23
Line 1 of the file I want to include.
Anonymous user
So it comes from the file, so we need the code of the file to understand the error.
hcp7kuz
Posted messages
238
Registration date
Status
Member
Last intervention
23
>
Anonymous user
The file has nothing to do with it; it simply returns a snippet of HTML code that I’d like to insert into my page.