473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

ActiveXObject is not working in IE

Hi i have html page with on button,textbox and i need to validate user ID with books.xml file,the fuction is working in FF browser but not in IE8,Crome,here is the code
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html>
  4. <head>
  5. <script type="text/javascript" >
  6. function loadXMLDoc(dname)
  7. {
  8.  
  9. if(window.XMLHttpRequest)
  10. {
  11. xhttp=new XMLHttpRequest();
  12. }
  13.  
  14. else 
  15. {
  16. xhttp=new ActiveXObject("Msxml2.XMLHTTP");    
  17.  
  18. }
  19.  
  20. xhttp.open("GET","books.xml",false);
  21. xhttp.send();
  22. xmlDoc=xhttp.responseXML;
  23.  
  24.  
  25. /*<script type="text/javascript">
  26. function validate(dname)
  27. {
  28. var xmlDoc=loadXMLDoc("books.xml");*/
  29.  
  30. var x=xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue;
  31. alert(x);
  32.  
  33. /*var hint=document.write(x[0].childNodes[0].nodeValue);*/
  34. y=document.getElementById('fname').value;
  35.  
  36. if (x===y)
  37. {
  38. return true;
  39. }
  40. else
  41. {
  42. alert("Wrong ID,please try again...!!!");
  43. return false;
  44. }
  45.  
  46. }
  47. </script>
  48. </head>
  49. <body style="background-color:#FAFFF6">
  50.  
  51. <form action="content1.htm" method="post" >
  52. <table align="center" style="border:solid;color:brown;font-family:tahoma;font-weight:bold;"> 
  53. <tr>
  54. <td>Enter Employee ID</td>
  55. <td><input type="text" id="fname"></td>
  56. </tr>
  57. <tr>
  58. <td></td>
  59. <td ><input type="submit" value="Enter" style="font-family:tahoma;font-weight:bold;border:solid;" onclick="return loadXMLDoc()"/></td>
  60. </tr>
  61. </table>
  62. </form>
  63. </body>
  64. </html>
  65.  
Attached Files
File Type: txt login.txt (1.3 KB, 303 views)
Apr 11 '11 #1
1 3018
acoder
16,027 Expert Mod 8TB
What doesn't work? What do you expect to happen and what happens instead in Chrome, IE, etc.?
Apr 14 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Sandra | last post by:
Hi All, What is wrong with my code....The function "function ValidaProdutos()" is not working....I need to execute the procedure to insert data in a Database.... What can I do to have this code...
2
by: Marcin Zmyslowski | last post by:
Hello all! I have installed MSDE on my local computer - Windows 2000 Professional. I have created a function which runs me a link whose path is placed in the input field. This function looks...
1
by: Sharon | last post by:
Hi! I have this function to add some parameters to my XSL and then retransform my XML with it, resulting in a neatly filtered table. It works great, but as soon as I take out the alert, it doesn't...
2
by: duncansinclair | last post by:
The following code works in IE, but in Forefox (1.0.7 & 1.5) the Asyncronous function (testA) works fine but the Synchronous one (testS) does not. It just doesn't work & I get no errors. ...
5
by: Danny R | last post by:
I have the following javascript which works in either IE or Firefox but not on both. When I set the code to http_request.open('POST', url, true) - Works in IE only http_request.open('GET',...
4
by: windandwaves | last post by:
Hi Folk Can you please have a look at http://www.friars.co.nz/map.php and let me know if the map is working on IE6 (just do a simple search). Unfortunately, I do not have IE6 anymore and so I...
3
by: rjones326 | last post by:
Hi, I'm stupendously mystified by this strange activity. I cannot for the life of me figure out why this will not work in mozilla. I've spent hours mucking around with it. The php file is...
8
by: benoypaul | last post by:
I have the following javascripts which is working in IE, but not working in Firefox and opera. var xmlhttp=null; function showCustomer(str) { xmlhttp=getxmlhttp(); if (xmlhttp==null) {...
7
RMWChaos
by: RMWChaos | last post by:
Bizarro, that's all I can say. Aren't FF2.0.0.8 and NN9 both Mozilla 2 based browsers? So why would the exact same code work in one and not the other? To add insult to injury, it works just fine in...
5
by: mukeshrasm | last post by:
Hi I am using AJAX to display the value in selection/list box. this code is working fine in Firefox Mozila browser but it is not working in Internet Explorer so please tell me how this will work...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.