Cenzic 232 Patent
Paid Advertising
sla.ckers.org is
ha.ckers sla.cking
Sla.ckers.org
Bug reports, feature enhancements or other complaints with the site, with us or just tell us what a miserable existance you have. No death threats or poetry please. Just kidding, no poetry please. 
Go to Topic: PreviousNext
Go to: Forum ListMessage ListNew TopicSearchLog In
Any alternative to load function of XML DOM.
Posted by: shivkumarlal
Date: August 06, 2008 11:07PM

Hi all,
I am stuck with a problem related to XML DOM . I was trying to parse the RSS feed given by BBC and display the feeds in my webpage thats running on localhost .
This is the code snippet

var xmlDoc=null;
if (window.ActiveXObject)
{// code for IE
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
else if (document.implementation.createDocument)
{// code for Mozilla, Firefox, Opera, etc.
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}

if (xmlDoc!=null)
{
xmlDoc.async=false;
xmlDoc.load("http://en-US.fxfeeds.mozilla.com/en-US/firefox/headlines.xml");

}

On doing so I get an error in firebug as "uncaught exception: Permission denied to call method XMLDocument.load" .
I also understand that load() has restrictions that the file that you want to load and the program thats loading it must be on the same server . I want to know is there any alternative to load() that I can use to get things running .

Shivkumar Lal

Options: ReplyQuote
Re: Any alternative to load function of XML DOM.
Posted by: Matt Presson
Date: August 07, 2008 09:05AM

What you need is another script, servlet, or page (PHP, Java, .Net) that opens an HttpConnection to the URL you are passing to the load function and have it return the XML. These things are simple enough to write. Then, you would point the load function to the url of that page and you would be set.

-----------------------------------------------------------------------
(ú=(θ='',[µ=!(Φ=!θ+{})+θ,Θ=Φ[ø=+!θ]+Φ[+θ],ĩ=µ[ø],Ø=µ[º=ø+++ø],Ç=Φ[º+ø],à=ú[Φ[º+º]+Φ[+θ]+Ç+ĩ]][Ø+Ç+Θ])())[ĩ+à('•êí')](Ç+à('Á«)'))

Options: ReplyQuote
Re: Any alternative to load function of XML DOM.
Posted by: PaPPy
Date: August 07, 2008 02:42PM

what i think he is trying to say
firefox doesnt allow you to do a connection to outside your site
but say you create a php page called fetch.php
and did something like this
<?php
$fetch = file_get_contents("http://en-US.fxfeeds.mozilla.com/en-US/firefox/headlines.xml");
//(you should do some cleaning of it, so if a hacker comprimsed that page they could inject what ever on to your site, thats why this is just an example

echo $fetch;
?>

then in your javascript instead of
xmlDoc.load("http://en-US.fxfeeds.mozilla.com/en-US/firefox/headlines.xml");
it would be
xmlDoc.load("fetch.php");

i hope that helps explain a little better. if im wrong sorry, im not a pro at this stuff yet

http://www.xssed.com/archive/author=PaPPy/

Options: ReplyQuote
Re: Any alternative to load function of XML DOM.
Posted by: Matt Presson
Date: August 07, 2008 04:34PM

Exactly what I was saying. I was just using Java terminology since I develop quite a bit in Java, although I have been known to do PHP too.

-----------------------------------------------------------------------
(ú=(&#952;='',[µ=!(&#934;=!&#952;+{})+&#952;,&#920;=&#934;[ø=+!&#952;]+&#934;[+&#952;],&#297;=µ[ø],Ø=µ[º=ø+++ø],Ç=&#934;[º+ø],à=ú[&#934;[º+º]+&#934;[+&#952;]+Ç+&#297;]][Ø+Ç+&#920;])())[&#297;+à('&#149;êí')](Ç+à('Á«)'))

Options: ReplyQuote
Re: Any alternative to load function of XML DOM.
Posted by: dotnet_1
Date: February 03, 2009 11:22AM

this is why hackers cant just instantiate an IFrame in their pages pointing to yahoo or gmail and steel ur login with javascript.

javascript can't read cross domain pages, just if u use windows mobile 4 or 5 i dont remember lol

Options: ReplyQuote


Sorry, only registered users may post in this forum.