Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

Search:

Online AI coding exercises

Project ideas


Javascript Ajax (More)



How do you link to an Ajax page?

(or indeed to any Javascript-modified page, Ajax or not)





Security - Same origin policy



Elsewhere - JSONP as workaround to same-origin policy



Security - CSRF



CORS - Cross-origin Ajax

  


CORS proxies

Even if the server does not cooperate, you can use a CORS proxy like corsproxy.io to fetch arbitrary resources off the Internet:


var url  = ...   // some resource on a normal website  

var curl = "https://corsproxy.io/?" + encodeURIComponent ( url );   // CORS-enabled URL 

$.get ( curl, function ( data ) 
{
  // we have got the data 
});




ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.