This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Microsoft XML > February 2004 > why the file cannot be loaded?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
why the file cannot be loaded?
|
|
| Quentin Huo 2004-02-24, 7:30 pm |
| Hi,
I tried to access a XML file, and I wrote:
var rssDoc = new ActiveXObject("Microsoft.XMLDOM");
rssDoc.async=false;
rssDoc.load("http://www.yahoo.com/partRefresh/qrss.xml"); //just for
example here
The file could not be loaded.
But if I downloaded this XML file and put it in my server, and I modified
the code as:
var rssDoc = new ActiveXObject("Microsoft.XMLDOM");
rssDoc.async=false; //Enforce download of XML file first. IE only.
rssDoc.load("qrss.xml");
It worked.
How can I fix this? Where the problem is?
Thanks
Q.
| |
| Á¤¼ºÅ 2004-02-24, 9:29 pm |
| may be, you write a script in IE Applicaiton.
it will issue an error message "Access Denied". because, try to access to
other sites which is not identical of domain part of url in IE is not
permitted.
you can solve this problem in another way that an asp file which is access
to other site's XML file should be located in your server, and your script
in IE make a query the asp file in your server.
--
======= .NETXpert ==========
url: http://www.dotnetxpert.com
eml : kevin@dotnetxpert.com
msn: kevin025@magicn.com
==========================
"Quentin Huo" <q.huo@manyworlds.com> wrote in message
news:OFuzoxy#DHA.2292@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I tried to access a XML file, and I wrote:
>
> var rssDoc = new ActiveXObject("Microsoft.XMLDOM");
> rssDoc.async=false;
> rssDoc.load("http://www.yahoo.com/partRefresh/qrss.xml"); //just for
> example here
>
> The file could not be loaded.
>
> But if I downloaded this XML file and put it in my server, and I modified
> the code as:
>
> var rssDoc = new ActiveXObject("Microsoft.XMLDOM");
> rssDoc.async=false; //Enforce download of XML file first. IE only.
> rssDoc.load("qrss.xml");
>
> It worked.
>
> How can I fix this? Where the problem is?
>
> Thanks
>
> Q.
>
>
>
>
| |
|
| That's cross-domain security issue. You can't do that in client-side script
directly. Let the server script do that instead and call it from
client-side.
--
Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
Have a nice day.
"Quentin Huo" <q.huo@manyworlds.com> wrote in message
news:OFuzoxy%23DHA.2292@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I tried to access a XML file, and I wrote:
>
> var rssDoc = new ActiveXObject("Microsoft.XMLDOM");
> rssDoc.async=false;
> rssDoc.load("http://www.yahoo.com/partRefresh/qrss.xml"); //just for
> example here
>
> The file could not be loaded.
>
> But if I downloaded this XML file and put it in my server, and I modified
> the code as:
>
> var rssDoc = new ActiveXObject("Microsoft.XMLDOM");
> rssDoc.async=false; //Enforce download of XML file first. IE only.
> rssDoc.load("qrss.xml");
>
> It worked.
>
> How can I fix this? Where the problem is?
>
> Thanks
>
> Q.
>
>
>
>
| |
|
| Glad to meet you here Seongtae Jung. By the way, no one can see your hanguel
name properly here except you and me. You had better set your name as
English in OE tools menu.
--
Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
Have a nice day.
"Á¤¼ºÅÂ" <kevin25@hanmail.net.korea> wrote in message
news:ucTxxcz%23DHA.3232@TK2MSFTNGP10.phx.gbl...
> may be, you write a script in IE Applicaiton.
>
> it will issue an error message "Access Denied". because, try to access to
> other sites which is not identical of domain part of url in IE is not
> permitted.
>
> you can solve this problem in another way that an asp file which is access
> to other site's XML file should be located in your server, and your script
> in IE make a query the asp file in your server.
>
> --
> ======= .NETXpert ==========
> url: http://www.dotnetxpert.com
> eml : kevin@dotnetxpert.com
> msn: kevin025@magicn.com
> ==========================
>
>
>
> "Quentin Huo" <q.huo@manyworlds.com> wrote in message
> news:OFuzoxy#DHA.2292@TK2MSFTNGP12.phx.gbl...
modified[color=darkred]
>
>
| |
| Quentin Huo 2004-02-25, 3:30 pm |
| Hi,
Thanks.
I have tried this:
1. I created a JS file (getXML.js) from my server which is used to access
XML file by using XMLDOM.
2. in another portal, I created a page which includes the JS file by:
<script language=JavaScript src="http://myServerURL/getXML.js"></script>
But still couldnot get the data. Any idea?
In fact, I wanted to have a XML file in my server to let people in other
sites share with it if they include the URL of the XML file in their pages.
When visitors visit their sites, visitors will see the information coming
from my XML file. So I don't want them to spend time (in fact, they won't)
to create a server-side component to access the XML file. Any suggestion?
Maybe XML is not a solution.
Thanks again.
Q.
"Á¤¼ºÅÂ" <kevin25@hanmail.net.korea> wrote in message
news:ucTxxcz%23DHA.3232@TK2MSFTNGP10.phx.gbl...
> may be, you write a script in IE Applicaiton.
>
> it will issue an error message "Access Denied". because, try to access to
> other sites which is not identical of domain part of url in IE is not
> permitted.
>
> you can solve this problem in another way that an asp file which is access
> to other site's XML file should be located in your server, and your script
> in IE make a query the asp file in your server.
>
> --
> ======= .NETXpert ==========
> url: http://www.dotnetxpert.com
> eml : kevin@dotnetxpert.com
> msn: kevin025@magicn.com
> ==========================
>
>
>
> "Quentin Huo" <q.huo@manyworlds.com> wrote in message
> news:OFuzoxy#DHA.2292@TK2MSFTNGP12.phx.gbl...
modified[color=darkred]
>
>
| |
| Buddy Ackerman 2004-02-26, 4:30 pm |
| I think what he meant was to create an ASP page on YOUR server that gets the
XML feed from the site you're interested in. Then your client side
JavaScript will request that ASP page from YOUR server. The ASP page would
look like this:
<%
dim docReceived
set docReceived = CreateObject("MSXML2.domdocument.3.0")
docReceived.async = False
docReceived.load http://interestingsite/siteRSS.xml"
response.contenttype = "text/xml"
response.write(request.servervariables(docReceived.xml))
%>
This ASP acts as a proxy for the RSS feed from the source site.
--Buddy
"Quentin Huo" <q.huo@manyworlds.com> wrote in message
news:eJt$tE9%23DHA.1796@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> Thanks.
>
> I have tried this:
> 1. I created a JS file (getXML.js) from my server which is used to access
> XML file by using XMLDOM.
> 2. in another portal, I created a page which includes the JS file by:
>
> <script language=JavaScript src="http://myServerURL/getXML.js"></script>
>
> But still couldnot get the data. Any idea?
>
> In fact, I wanted to have a XML file in my server to let people in other
> sites share with it if they include the URL of the XML file in their
pages.
> When visitors visit their sites, visitors will see the information coming
> from my XML file. So I don't want them to spend time (in fact, they won't)
> to create a server-side component to access the XML file. Any suggestion?
> Maybe XML is not a solution.
>
> Thanks again.
>
> Q.
>
>
> "Á¤¼ºÅÂ" <kevin25@hanmail.net.korea> wrote in message
> news:ucTxxcz%23DHA.3232@TK2MSFTNGP10.phx.gbl...
to[color=darkred]
access[color=darkred]
script[color=darkred]
> modified
>
>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|