I'm working with a script which seems to use Ext.Ajax.request
(with ExtJS 3) to send cross-domain requests - some of them POST requests. Considerations are being made to move away from ExtJS3 (perhaps move away from ExtJS in general) but a quick attempt at using XMLHttpRequest
didn't work; how can I find out what technique is being used to send those cross domain requests?
I'm currently using ExtJS 3.3.1, I haven't made the switch to 4 yet but will most likely when a new project comes about. Without looking at the Ext source I can tell you they are using JSONP to accomplish this task, it is the only way to make a cross-domain AJAX call because JavaScript has to abide by the same-origin policy.
Are you trying to do a pure JS implementation of JSONP? Or are you using a JS library already?
Edit
Per our comments... they are making POST requests. That's not possible with JSONP. So as far as I can tell, they are using iframe
trickery similar. It's the same trick used to "AJAX" upload files on older browsers.
This link explains it in more detail.
Also, the same method (iframe to, POST, upload a file) is used in Valum's file uploader. It's much easier to follow then the ExtJS source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With