aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript not working in IE7 but working in firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JavaScript not working in IE7 but working in firefox" Watch "JavaScript not working in IE7 but working in firefox" New topic
Author

JavaScript not working in IE7 but working in firefox

carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

hi my javascript is


function getCode()
{
for(i=0;i<document.areacodeform.areacoderadio.length;i++)
{
if(document.areacodeform.areacoderadio[i].checked)
{
opener.document.createplotform.sacode.value = document.areacodeform.areacoderadio[i].value;
opener.document.createplotform.sacode.focus();
self.close();
}
}
}

var skipcycle = false;


var xmlHttp;
function createXmlHttpRequest()
{


if(window.ActiveXObject)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(err1)
{
xmlHttp=new ActiveXObject("Msml2.XMLHTTP");
}
}

else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
return xmlHttp;
}


function matchAreacode()
{
createXmlHttpRequest();
var u1=document.areacodeform.isacode.value;
//var u1=str;
xmlHttp.open("GET","http://localhost:8080/Matchcode?code="+u1,true);
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.send(null);

}

function handleStateChange()
{


if(xmlHttp.readyState==4)
{
var l = "<table>";
if(xmlHttp.status==200)
{

var alength=xmlHttp.responseXML.getElementsByTagName("addcode");

for(i=0;i<alength.length;i++)
{
var message= new Array(alength.length);
message[i] = xmlHttp.responseXML.getElementsByTagName("addcode")[i].childNodes[0].nodeValue;
l =l+"<tr><td><input type='radio' name='areacoderadio' value='"+message[i]+"'>"+message[i]+"</td></tr>";
//alert("Response Generated\n"+i+" "+message[i]);




}
l=l+"</table>";
document.getElementById('displayareacode').innerHTML=l;

}

else
{
alert("Error loading page"+ xmlHttp.status +
":"+xmlHttp.statusText);
}


}
}



I have a jsp that on click of button calls servlet this servlet presents a child window in which i have a input field onkeyup in this input field fires ajax calls and calls another servlet that fetch data from database and present the data in child window on selecting given data from child window the selected value should pass to the parent jsp file that initiating the whole process.
This is working well and good in firefox but in IE7 its not working in the child window i am unable to select the value and the values are not getting passed to the parent jsp.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61215
    
  66

Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the .


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript not working in IE7 but working in firefox