Jump to content

Why I doesn't work!?!?


studiofaca
 Share

Recommended Posts

<%'Load XMLset xml = Server.CreateObject("Microsoft.XMLDOM")xml.async = falsexml.load("http://www.w3schools.com/xsl/cdcatalog.xml")'Load XSLset xsl = Server.CreateObject("Microsoft.XMLDOM")xsl.async = falsexsl.load("http://www.w3schools.com/xsl/cdcatalog.xsl")'Transform fileResponse.Write(xml.transformNode(xsl))%>How I can load XML file with another server?The some problem with...<html><body><script type="text/javascript">// Load XML var xml = new ActiveXObject("Microsoft.XMLDOM")xml.async = falsexml.load("http://www.w3schools.com/xsl/cdcatalog.xml")// Load XSLvar xsl = new ActiveXObject("Microsoft.XMLDOM")xsl.async = falsexsl.load("http://www.w3schools.com/xsl/cdcatalog.xsl")// Transformdocument.write(xml.transformNode(xsl))</script></body></html>P.S. Only on local computer it works!?!?Can you help me? Thank you forward.

Link to comment
Share on other sites

Depends on what you mean by "another server".JavaScript can't access resources on another server. It's a security feature.Server side scripting languages like ASP (the first examlpe you gave) can. So what's the problem? That first example doesn't work on your IIS server or do you mean how can you achieve the same effect with another server side scripting language?

Link to comment
Share on other sites

Aham. Ok.> Depends on what you mean by "another server".Example:You host test.asp on this server. On another server you will host .xml files and you like to use something like that """"xml.load("http://www.w3schools.com/xsl/cdcatalog.xm"")"""".> JavaScript can't access resources on another server. It's a security feature.Meybe this is.Thank you! :)

Link to comment
Share on other sites

I said JavaScript... on the client side... you're using ASP... server side=> you can do it.As for why it doesn't work... I don't know. I'm not much into ASP.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...