Q:

Stop encoding of '?' during JSON cross domain request

How can I prevent a cross domain jQuery getJSON request from encoding the callback question mark:
$.getJSON(searchResultsURL, {
        token: jSONAPItoken,
        callback: '?'
    }, function(data){
        ……
    })

Ends up sending a request:
http://example.com/xxx?token=tokenxxx&callback=%3F
Where is it encoding the ? to %3f. How can I prevent this?

A:

You're mis-using getJSON.
$.getJSON requires that the callback parameter be in the URL, not the data argument.
You need to add ?callback=? to the URL string; jQuery will then replace the ? with an auto-generated callback function name.

