> var url = 'http://www.myurl.com/xmlneeded.php';
> var ajax = new Ajax.Request(url, {

The url would violate cross-site scripting limitations built into the 
XMLHttpRequest object.  Any ajax request has to be on the same domain as the 
page making the request.



Thomas Woodham
Data Editor - The Greenville News
864.298.4302

[BECAUSE THE NEWS NEVER STOPS]


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf 
Of polomasta
Sent: Monday, December 03, 2007 11:49 AM
To: Ruby on Rails: Spinoffs
Subject: [Rails-spinoffs] Re: Ajax.PeriodicalUpdater


As I read more I noticed this too, so I've switched to Ajax.Request .
However, it keeps failing. Here are some more details as to my project.

I am creating a windows sidebar gadget that needs to connect to a page on a 
remote server that uses php to generate XML content. I then need to parse 
through that content to find a specific xml tag, then iterate through the child 
elements of that tag, extracting the content from each child node and place it 
in a separate div for each child.

My ajax request keeps failing, and I am guessing this is because the url i'm 
requesting is on a remote server (while the gadget is more or less a local html 
page). Any ideas on how to work around this and then perform the rest of what 
is needed? Below is my code thus far..

function init()
{

var url = 'http://www.myurl.com/xmlneeded.php';
var ajax = new Ajax.Request(url, {
     method: 'get',
     onSuccess: updateDisplay,
     onFailure: alert("FAILED")})
}

var updateDisplay = function(transport) {
     var xmlResponse = transport.responseText;
     //now i need to find <myParent> in the XML and iterate through the child 
nodes to extract info }




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to