Jump to content

Get content of html over url in XML


AJ75

Recommended Posts

Hi!Following Element of an XML-File is given:

<element media="1" url="./folder1/1/2/2/index.html"/>

Now I´m trying to get the content in the index.html (the <p>-Tags) and write the result into an new xml-element.With

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");  var objNodeList;  xmlDoc.async = false;  xmlDoc.load("my.xml"); 	 if (xmlDoc.parseError.errorCode != 0) {      var myErr = xmlDoc.parseError;       alert("You have error " + myErr.reason); 	 } else { 	 objNodeList = xmlDoc.getElementsByTagName("element");      for (var i=0; i<objNodeList.length; i++) {      alert(objNodeList.item(i).xml);      }	}

I get the tag element, but how do I get the content of the index.html dynamically ?Thanx for any help!AJ

Link to comment
Share on other sites

You can pass html content to an XML file by using POST method. Then you need a seperate server page where xml content is displayed. for example:

xmlDoc.open("POST","your server page","true");xmlDoc.setRequestHeader("content-type","application/x-www-form-urlencoded");xmlDoc.onreadystatechange=handlesent;var param="media=1";xmlDoc.sent(param);

Hope this helpsJane

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
×
×
  • Create New...