I’ve got the following problem: I am sending a AJAX request to a service which returns HTML code. There are unicode characters in this code, which will be escaped with the usual \u….
The problem is, that this response is very long and jQuery split those jsonp functions into a few functions. This is not the problem, besides the fact, when those escaped characters will be splitted inside, like jsonp463827("...blabhalbha\ud0");jsonp546114("0x8blablabla...");
Then it gives me an error which says Hexcode expected, because it cannot split those escaped characters.
Is there any solution to prevent this?
What exactly is being passed back? Example address?
I don’t think jQuery is doing the splitting here. It is the nature of JSONP must return a block of JavaScript statements for direct execution in a
<script>tag. The client-side can’t get hold of that content to split or otherwise process it because that would be a cross-site-scripting hole, the very issue JSONP is designed to get around.I think you’ll probably need to look at that service. I’m not sure why it would be trying to split a response into several function calls as there is no limit on the length of the string passed in. The limit that you might hit is Firefox’s script parser stack limit (see bug 420869), but that applies to the whole of the returned script block, so splitting into several function calls won’t help.