| Author |
jquery - ajax call to another site and parse result
|
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
I'm trying to link to JavaBlackBelt as described here. They provide a URL that returns JavaScript that writes to the document.
This code works fine.
However, it slows down the page. I wanted to do something asynchronously so it wouldn't interfere with the page. The jbbURL returns code that writes to the document. I can't just call the function because it reloads the page with just the image. I was thinking I could store the results of the webpage and parse it. That gives an error. (but no message.) I guess this isn't allowed?
Am I doing something wrong? Any other ideas for what I am trying to accomplish?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
One way could be to override document.write. Is this the best approach ? I don't know !
|
[My Blog]
All roads lead to JavaRanch
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
JavaScript has a same origin policy, you can not make Ajax calls to another domain. Well you can, with CORS, but we are not going there.
If the code has document.write, you basically can not do anything with it to load it after the page has loaded.
Eric
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
Eric: Right. I forgot about that. The workaround is to call a URL on our server that calls the java black belt server's URL and translates the result.
Christophe: That's a really interesting approach, but it scares me with side effects.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26184
|
|
|
I'm overcomplicating this. It was just pointed out to me that I should be using an iframe rather than AJAX.
|
 |
 |
|
|
subject: jquery - ajax call to another site and parse result
|
|
|