#333 enhancement
Christopher Thomas

Cross domain ajax using JSONP

Reported by Christopher Thomas | September 10th, 2008 @ 12:40 AM | in 1.7

we should definitely look at how to port jquery's getJSON() method because it's just a very simple and easy way to obtain information from another website, without messing around building your own script handler.

I believe there was an attempt to make a <script> transport for prototype, to a degree, it worked, however it lacked the ability to use a callback when the contents of the tag were finally loaded (when usually you'd expect an onload event, there is none, so the callback method for JSONP allows you to insert a callback so when it executes, it's because the contents has loaded (otherwise the callbac wouldnt run either). The sample implementation that I tried was this:


but it is not foolproof and with some work, it could provide us with a

The security problems this causes are merely in the hands of the developer if they should choose to use it, like in jquery, it's a gun, you point it at your website, or at your head, where you pull the trigger, is up to you. But I think this feature would really rock.<\/p>

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The Prototype JavaScript library.

Shared Ticket Bins