Reply
load XML failure in FireFOX
Old 03-11-2008, 10:39 AM load XML failure in FireFOX
Novice Talker

Posts: 10
Name: Muhammad Abrar
following code does not work for me.
xmlDoc=document.implementation.createDocument(""," ",null);
xmlDoc.async=false;
xmlDoc.onload= Test();
xmlDoc.load("books.xml");
function Test()
{
alert('tested');
}
If any one having any idea then please give me a chance of thanks.
AbrarNazeer is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-11-2008, 11:42 AM Re: load XML failure in FireFOX
willcode4beer's Avatar
Webmaster Talker

Posts: 693
Name: Paul Davis
Location: San Francisco
Try changing
Quote:
Originally Posted by AbrarNazeer View Post
xmlDoc.onload= Test();
to
Code:
xmlDoc.onload= Test;
__________________
Paul Davis
willCode4Beer.com (coding for all the right reasons)
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 02:45 AM Re: load XML failure in FireFOX
Novice Talker

Posts: 10
Name: Muhammad Abrar
Thanks for ur Time willcode4beer!

this issue has been resolved, but now there is error msg
"Error: uncaught exception: Permission denied to call method
Location.toString"
on line
"xmlDoc.load".
Not on same Domain but on Cross Domain Only.
AbrarNazeer is offline
Reply With Quote
View Public Profile
 
Old 03-13-2008, 01:05 PM Re: load XML failure in FireFOX
willcode4beer's Avatar
Webmaster Talker

Posts: 693
Name: Paul Davis
Location: San Francisco
That one is caused by the security model in the browser. It is designed to prevent calls to other domains.
The easiest way around that is to proxy the request (in other words, have a page on your server that retrieves the file from the other server), that way, the call looks like the same domain to the browser
__________________
Paul Davis
willCode4Beer.com (coding for all the right reasons)
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-14-2008, 03:29 AM Re: load XML failure in FireFOX
Novice Talker

Posts: 10
Name: Muhammad Abrar
On client machine (Cross Domain) , how can i put my web page which will "read file from the other server". Client only puts my "Script code" on his page.
AbrarNazeer is offline
Reply With Quote
View Public Profile
 
Old 03-14-2008, 10:00 AM Re: load XML failure in FireFOX
willcode4beer's Avatar
Webmaster Talker

Posts: 693
Name: Paul Davis
Location: San Francisco
Quote:
Originally Posted by AbrarNazeer View Post
On client machine (Cross Domain) , how can i put my web page which will "read file from the other server". Client only puts my "Script code" on his page.
I thought I explained that.

The data needs to come from the same domain as the page loaded.

So, if your javascript is going in other peoples web pages, then they will need to proxy the external data.
__________________
Paul Davis
willCode4Beer.com (coding for all the right reasons)
willcode4beer is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to load XML failure in FireFOX
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13900 seconds with 13 queries