Link to home
Start Free TrialLog in
Avatar of doctor069
doctor069Flag for Canada

asked on

jquery load from amazon s3

Is it possible to have html files on amazon s3 and use jquery.load('http://amazonurl/test.html) into a div on the page

I tried and the html does not load onto the page

Firebug says it loaded ok but does not show html...

Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of Greg Alexander
Greg Alexander
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doctor069

ASKER

Thanks my guess was it was a cross domain issue. unfortunately it is straight html no back end server
You are correct... glad to help
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow, I stand corrected!
Not really @galexander07, not really ;-)

YQL is something like an online proxy by Yahoo!
It allow you to convert (change format) of the data too
by "online" I mean "not your own"
@leakim971 Ahhh I see now
Tried http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/ but could not get it to work

I was thinking... is it possible to wrap the html code (just a div and some text) in a jsonp and return it

Just not sure how to do it...if its even possible without server side code...
could you provide your amazon s3 url
just playing with it now...

http://a172e321.s3.amazonaws.com/1.html
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One more note for anyone who was to try this:

you need to use encodeURIComponent and decodeURIComponent to have the html render properly.

In hindsight I don't think it is worth all the trouble. Especially if you html changes often... encoding and removing white space makes the html  impossible to read. Remember: don't use with secure data!

There are some advantages. Mostly taking as much load as possible off your server and using amazon to do the work.

But it does work and the techie in me likes that part!

Thanks everyone for your help