473,387 Members | 1,465 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,387 software developers and data experts.

Cross browser

Dheeraj Joshi
1,123 Expert 1GB
Hi guys. I want to do the client side validation using java script..
I am writing the cross browser app.

Code looks like.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <script type="text/javascript">
  4. function loadXMLDoc(dname) 
  5. {
  6. var xmlDoc;
  7. if(window.XMLHttpRequest)
  8. {
  9.       xmlDoc=new window.XMLHttpRequest();
  10.  
  11.       xmlDoc.open("GET",dname,false);
  12.  
  13.       xmlDoc.send("");
  14.  
  15.       return xmlDoc.responseXML;
  16. }
  17. else if (ActiveXObject("Microsoft.XMLDOM"))
  18. {
  19.           xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  20.  
  21.           xmlDoc.async=false;
  22.  
  23.          xmlDoc.load(dname);
  24.  
  25.         return xmlDoc;
  26. }
  27. alert("Error loading document");
  28. return null;
  29. }
  30.  
  31. <script type="text/javascript">
  32. var txt;
  33. xmlDoc=loadXMLDoc("test.xml");
  34. document.write(xmlDoc);
  35. txt=xmlDoc.getElementsByTagName("employee")[0].getAttribute("age");
  36.  
  37. document.write(txt);
  38. </script> -->
  39. </body>
  40. </html>
I wont work for Firefox.

Why is that?

Code looks correct

Regards
Dheeraj Joshi
Jul 27 '09 #1
4 1720
Dormilich
8,658 Expert Mod 8TB
are there any error messages (Console, FireBug) ?

FF might complain when you try to print a full XML document inside HTML (there are better methods than document.write(), check out DOM for that)
Jul 27 '09 #2
Dheeraj Joshi
1,123 Expert 1GB
No error messages.

It just wont display anything..
Jul 27 '09 #3
sukil
3
Did you get a solution? I have the same issue but cant find the solution!
Aug 3 '09 #4
Dheeraj Joshi
1,123 Expert 1GB
Its working fine....

Now no issues with it.
Aug 4 '09 #5

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

Similar topics

4
by: Simba | last post by:
In some pages of my website I use a code like the following: for (var n = 0; n < getTagsArray("SPAN").length; n++){ //SPAN is just an example. I also use other tags tag =...
5
by: HchC | last post by:
Not looking for a special or fancy css stylesheet. For a HTML beginner, stylesheet is still far away from now. Not even said thinking about cross browser. But, an XHTML page without stylesheet look...
17
by: Mark Rae | last post by:
Hi, I'm interested in your opinion concerning how far you would consider it necessary to code for cross-browser compatibility these days, especially for public-facing Internet sites... ...
2
by: Eric Caron | last post by:
Hi everybody, I was doing some cross-browser tests today and I found out that if you specify the width and height for a button type control, asp.net doesn't output the style information when...
2
by: Questman | last post by:
Good afternoon, Does anyone have any code that implements, or approaches implementing, a cross-browser DHTML/JS solution to provide an Excel-like Grid on a web page - I'm trying to convert an...
9
by: permanent.tourist | last post by:
I'm having a hell of a job getting this to work in Safari: the only thing I can think of is that one can't use reload() across to another frame for security reasons. Does anyone have a concrete...
15
by: CMM | last post by:
So I'm half way through overseeing a large project in ASP.NET 2.0. My superiors have decided that it would be nice if we ensured the site worked on all the major platforms (as they see it: IE,...
1
by: Rancid Buttchutney | last post by:
I've tried searching the web but I've had little success finding a cross-browser(IE, Firefox and Opera anyway) implementation of a restricted text INPUT that works in realtime before a character...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
13
by: Jeff | last post by:
We have an intranet website that currently uses ActiveX but we need to make it cross-browser compatible and also get around the problems we've been having with making it work with IE7 and Vista. We...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.