Remote Load

Discussion in 'JavaScript' started by deuterium, Dec 30, 2009.

  1. #1
    Hello, you know that modern day browsers have security defaults, whereby you can't use JS load command to load content on an external domain, so is there a way around this?

    Obviously, this doesn't work
    $("#versioning").load("http://verizon.domain.net/?var=rscms&tan=0.9");

    I'd rather not have to iframe the content - although I don't really need the content to be indexed either.
     
    deuterium, Dec 30, 2009 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    proxy it--write a local php/asp whatever based fetch script (using fopen or curl or whatever) that your js CAN access.

    if the content you're fetching is json or xml, there are other options. for instance, JSONP can happily load cross-domain and fetch data (basically, embedding as a remote .js file with a callback function that runs locally and passes back output to your script as arguments to the callback function, supported fairly across all browsers).
     
    dimitar christoff, Dec 30, 2009 IP