function foo(data)
{
// do stuff with JSON
}
var script = document.createElement('script');
script.src="https://example.com/path/to/jsonp?callback=foo"
document.getElementsByTagName('head')[0].appendChild(script);
// or document.head.appendChild(script) in modern browsers