On Mar 11, 11:10 pm, Meir Rotstein <[email protected]> wrote:
> Could you please be more clear with your idea? this area is new for me and
> I'm not sure I've understand you correctly, a simple code sample will be
> great too.
I don't have a simple code sample - the things I do like this are more
integrated - but if I did it'd be something like this:
function fetchXml(url, callback) {
if (url.indexOf('http') === 0) {
_IG_FetchXmlContent(url, callback);
} else {
if (window.XMLHttpRequest)
var requestor = new XMLHttpRequest();
else
var requestor = new ActiveXObject("Microsoft.XMLHTTP");
requestor.open('GET', url, true);
requestor.onreadystatechange = function () {
if (myFetcher.readyState == 4) {
callback(requestor.responseXML);
}
}
requestor.send(null);
};
};
The idea here is that during development, you call this function with
a relative URL and it'll use the browser's native XHR. When you move
to live, you swap the URL for an absolute one, and it'll use
_IG_FetchXmlContent() instead. Warning: I just wrote the above code ad-
hoc, it's not been tested (or even syntax-checked). Use it as a guide,
don't expect it to function perfectly as is.
> also, is there's any official way to read local files with javascript based
> on the google desktop frwk (it sounds like a very basic ability..)?
No idea, I'm not up on desktop gadgets - it's a completely different
API. You'd probably have more luck asking that in
http://groups.google.com/group/Google-Desktop-Developer; this group's
for the iGoogle API.
String
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iGoogle Developer Forum" 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/Google-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---