Hi guys,

I'm using ajax to display the xml file. On my html i put

<body onload="sendRequest(Display)">

so everytime users go to the main.html, all the information in xml will be displayed after transformed by XSL

Now the problem is it gets the error

Display is not defined

While i did define it in js file

this is what I do in js;

var xhr = createRequest();
function sendRequest(data)
	if(xhr) {
		xhr.open("GET","product.php?id=" + Number(new Date) +"&value=" + data, true);
		xhr.onreadystatechange = function() {
		if (xhr.readyState == 4 && xhr.status == 200) {
			var divtag = document.getElementById("product");
			divtag.innerHTML = xhr.responseText;

xhr has another file for it*

in php file;

switch($_GET['value']) {
	case 'Display':
		$xsl = new DOMDocument;

		$processor = new XSLTProcessor;


		$xml = new DOMDocument('1.0');

		$transformedXml = $processor->transformToXml($xml);


in my xsl;

<xsl:for-each select="items/item">
	  <xsl:value-of select ="manufacturer" />

Can anyone tell me what's wrong with the code?

Thanks in advanced.

<body onload="sendRequest(Display)">

<body onload="sendRequest('Display')">

<body onload="sendRequest('Display')">

stupid mistakee!
thxxx fxm