Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XMLHttpRequest in widgets



Blake Patterson wrote:

I am currently pulling two remote .js files containing document.writes only that render HTML via SCRIPT tags in the main body of my widget. I need to refresh these two files based on a timer and find that doing a window.location.reload() breaks the flip animation. So it seemed to me that XMLHttpRequest would be a good way to go, as it can pull raw text strings in addition to individual pieces of an XML feed. The thing is, there is a restriction, stated in Apple's docs:

( http://developer.apple.com/internet/webcontent/xmlhttpreq.html )

This page is a good starting point, but you can learn more from the existing Widgets which use the XMLHttpRequest.



" Second, the domain of the URL request destination must be the same as the one that serves up the page containing the script. This means, unfortunately, that client-side scripts cannot fetch web service data from other sources, and blend that data into a page. Everything must come from the same domain. Under these circumstances, you don't have to worry about security alerts frightening your users. "

This restriction is valid for Safari and I think also Firefox, not the Dashboard Widgets. But you will have to set |AllowNetworkAccess to true in the |Info.plist file as described in http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_Tutorial/index.html (chapter on Security).


You can learn

Regards,

Harald
---
www.bitwalker.nl

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >XMLHttpRequest in widgets (From: Blake Patterson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.