473,406 Members | 2,713 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,406 software developers and data experts.

Basic XML and javascript

Hello ,
I am very new to XML and javascript . I want to display data from a XML file using javascript . My XML file is named as first.xml . My html file is as below :

<html>
<body>
<script langauge = "text/javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.load('first.xml');
xmlObj=xmlDoc.documentElement;
alert(xmlObj.xml);
</script>
</body>
</html>

But this does not work ? Can anyone help me ?
Oct 24 '08 #1
2 1561
Dormilich
8,658 Expert Mod 8TB
first:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
second:
like in ajax use a try-catch construct because not everyone will use IE (and FF doesn't support ActiveXObject)
third:
are there any error messages?

tip of the day: developer.mozilla.org (very comprehensive references)

regards
Oct 24 '08 #2
jkmyoung
2,057 Expert 2GB
You need to check if that object is supported. Eg check
if (window.ActiveXObject)
if not, check if (document.implementation
&& document.implementation.createDocument)

A related page is found here:
http://www.w3schools.com/xsl/xsl_client.asp
Oct 24 '08 #3

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

Similar topics

1
by: Florin | last post by:
Hi, How to return a variable from javaScript to the visual basic? The script is loaded into the webbrowser control as a html page. THX
7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
2
by: bbxrider | last post by:
i'm new to javascript but have programmed lots in vb, cobol, basic, etc jscript seems much more object oriented to me, much more direct manipulation of properties at least, than vb, don't know...
1
by: bj | last post by:
I have several pages that I want to allow the same kind of activity, so my basic question is how best to structure the interaction (and I have one related subquestion as well). Scenario: The...
2
by: Eli | last post by:
Hi gurus, My question is about exchanging data on a basic HTML page between a JavaScript piece of code and a Java client-side <APPLET> residing on the same webpage. To demonstrate the idea of...
21
by: Philipp | last post by:
Hey, did anyone have a good paper about the opject orianteted concept? wishes
10
by: trippeer | last post by:
I have the source code to an old BASIC program that a friend of mine would like to run online. I am a beginner at JS, but I think that it would be a good choice for the project. My background is in...
43
by: Bill H | last post by:
25 years ago every computer came with some form of Basic interpreter so you could use yoru computer without having to buy more software. Is Javascript (teamed with HTML) set to become the new...
12
by: sheldonlg | last post by:
This is kind of basic, and I googled but didn't find much help. I have an array of text element fields. They all need to have the same name. So, let the name be either all with a or build...
7
by: rmurgia | last post by:
When a variable is created using Javascript, should it then be able to be read immediately using embedded VB code or does the submit command have to be entered or are the variables between...
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
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.