Email conversation
From | Anonymous |
To | Me |
Subject | Problem with XML/RSS-parser with FireFox for Mac |
Date | 13 November 2004 19:11 |
Hi,
First I want to say I like your site very much, it explains the relative
difficult javascript in an easy way. Besides that, everything is free. Great
work!
Here's my question:
First, I tried your script and modified it (*without any php*) for my
startpage so my startpage displays some RSS-feeds.. In Safari. But now, I
want to use FireFox.. But my (Safari-compatible) startpage doesn't load the
RSS in FireFox.. So I tried the script @ your site (with the BBC-example and
some other rss-feeds) and it works flawlessly in FireFox for mac. So I
downloaded rss.zip with the rss.html; importxml.js and rssLocal.php; but I
really don't get any headlines.. Can you tell me what's the problem here? I
tried your search but couldn't really find the solution.. :(
My final goal is to use your RSS-script *without* the PHP-file (this works
in Safari, but not in FireFox).. Is this possible?
Big thanks in advance,
Anonymous
From | Me |
To | Anonymous |
Subject | Re: Problem with XML/RSS-parser with FireFox for Mac |
Date | 16 November 2004 08:42 |
Anonymous,
Checking the Mozilla DOM documentation, they have placed a cross domain
restriction on using XMLHttpRequest (this will include trying to access any
http:// feeds from file:// URLs. I quote from the mozilla site:
file:// documents can access http:// documents but you need to enable
UniversalBrowserRead privilege in your scripts - see the JavaScript Security:
Signed Scripts document
(http://www.mozilla.org/projects/security/components/signed-scripts.html#privs)
for more details. Normally your files should reside on a webserver so this
shouldn't pose a problem (there you do not need that line either).
Additionally, 'foo.com:80' and 'foo.com:313' are considered different hosts
for security purposes. You cannot open a connection to a different host.
So in other words, the first lines in the script should be:
if(window.netscape) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesRead');
}
Every time you load this page, you will be prompted to allow the security
to be lowered for that page.
This is why I use my rssLocal passthru script (which would need to be
hosted on a PHP capable server).
Hope this explains it.
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Anonymous |
To | Me |
Subject | Re: Problem with XML/RSS-parser with FireFox for Mac |
Date | 16 November 2004 3:44 |
Ey Mark,
Okay, thanks for your feedback. I've activated the PHP-module on my Apache
webserver (Mac OS X 10.3) and when I load the script with http://localhost,
it simply works with FireFox. Thanks again for your explanation.
Anonymous