hyperlink parameter is not workin

Hi all,

The following is my sample ajax testing code . In the below code the "onchange" event of combobox is working and the ajax function is getting executed i.e.; the value of text box is set. But the same doesn't work with hyperlink.

Also the code works good with MAC and not with windows. Can anyone help on this.

<html>

<head>

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="javascript">

var url;

var httpRequest;

function callThisPage2(getfileid)

{

var t = getfileid;

alert(t);

url ='http://192.168.2.199:7001/beapf/SimpleCounter';

alert(url);

if(window.ActiveXObject){

httpRequest =new ActiveXObject("Microsoft.XMLHTTP");

alert(httpRequest.status);

}

else{

httpRequest =new XMLHttpRequest();

}

alert(url);

alert(httpRequest.status);

httpRequest.open("GET", url,true);

httpRequest.onreadystatechange = function()

{

processRequest();

}

httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded" );

httpRequest.send(null);

}

function processRequest()

{

if (httpRequest.readyState == 4)

{

if(httpRequest.status == 200)

{

alert(httpRequest.status);

document.form1.chktf.value='test';

//window.location.href = url;

}

else

{

alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);

}

}

}

</script>

</head>

<body>

<form name="form1" method="post">

<select name="select" onChange="callThisPage2(2)">

<option value="1">test1</option>

<option value="2">test2</option>

</select>

<a href="http://192.168.2.199:7001/beapf/test1.txt" onClick="callThisPage2(2)">test</a>

<input type="text" name="chktf"/>

</form>

</body>

</html>

Message was edited by:

rameshr

[3487 byte] By [rameshra] at [2007-11-27 9:51:02]
# 1
try something like this....<a href="#" onClick="callThisPage2(2)">test</a>
vinayak_ra at 2007-7-13 0:20:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...