I am just starting out with XML. I've been playing with XML and XSLT,
very nice indeed. I particularly like the filtering/ordering functions.
Anyway, I have started to have a look at scripting, and would like to
use JavaScript as then I use Firefox as well as IE (tried some
VBScript, fine in IE of course but no go in Firefox). I have copied an
example from "XML Unleashed", but when I try it, I get the following
error;
A Runtime Error has occured
Do you wish to Debug?
Line: 12
Error: Object doesn't support this property or method
twice, then twice with line 43. Firefox JavaScript console gives the
following;
Error: ActiveXObject is not defined
Source File: file:///S:/Forms/XML/ReadyChecker.ht m
Line: 11
Its something to do with microsoft.xmldo m, and I've googled all over
for this but I only found one post on Tek Tips that seemed relevant but
the link it pointed to on the Microsoft site is no longer there. I know
nothing of JavaScript, so I have obviously missed something simple but
I am really stuck here! Can anyone help me out? The full source is
here;
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>XML Ready Checker</title>
<link rel="stylesheet " href="XML_style .css" type="text/css"
media="screen">
<script language="JavaS cript">
<!--
var xmldoc;
function LoadDoc() {
xmldoc = new ActiveXObject ("microsoft.xml dom");
READYINFO.inner HTML += "<br>" + "Tracking ready states:" + "<br>"
xmldoc.onreadys tagechange = TrackReadyState ;
xmldoc.load(URL .value);
DocInfo();
}
function TrackReadyState () {
var state = xmldoc.readySta te;
READYINFO.inner HTML += "Ready state = " + state + "<br>"
if (state == 4) {
var err = xmldoc.parseErr or;
if (err.errorCode !=0)
READYINFO.inner HTML += err.reason + "<br>"
else
READYINFO.inner HTML += "Document loaded successfully." + "<br><br>"
}
}
function DocInfo() {
DOCINFO.innerHT ML += "Document URL: " + xmldoc.url + "<br>";
DOCINFO.innerHT ML += "Document typr: " + xmldoc.doctype. name +
"<br>";
}
//-->
</script>
</head>
<body>
<h1>SCSD Finance Department</h1>
<h2>XML Ready Checker</h2>
<p>Please enter a XML document URL:
<br>
<input type="text" size="50" id="URL">
<input type="button" value="Load XML Document" onclick="LoadDo c()">
<div id="READYINFO" style="colour:b lue;"></div>
<div id="DOCINFO" style="colour:g reen;"></div>
</p>
<div class="footer"> Produced by <a
href="mailto:lu ***********@cal derdale.gov.uk" >lu***********@ calderdale.gov. uk</a>
Finance Technician, Finance Dept., SCSD, Ext.: 2597.
</div>
</body>
</html>
Thanks for looking. 3 18828
reclusive monkey wrote: I am just starting out with XML. I've been playing with XML and XSLT, very nice indeed. I particularly like the filtering/ordering functions. Anyway, I have started to have a look at scripting, and would like to use JavaScript as then I use Firefox as well as IE (tried some VBScript, fine in IE of course but no go in Firefox). https://sourceforge.net/projects/sarissa/
reclusive monkey wrote: I am just starting out with XML. I've been playing with XML and XSLT, very nice indeed. I particularly like the filtering/ordering functions. Anyway, I have started to have a look at scripting, and would like to use JavaScript as then I use Firefox as well as IE (tried some VBScript, fine in IE of course but no go in Firefox).
It doesn't really matter what you use with IE (Windows) as the objects
used for scripting XML and XSLT are not part of the core JavaScript
language but are simply ActiveX objects you use from J(ava)Script or
VBscript. These objects are not accessible from script in Firefox, not
even on the Windows platform.
For scripting XSLT in Firefox/Mozilla, see
<http://www.mozilla.org/projects/xslt/js-interface.html>
though if you are new to all that then you might be better of with
Sarissa, an attempt to provide one scripting interface usable with both
MSIE/Win and with Mozilla browsers:
<http://sarissa.sourcef orge.net/doc/>
A Runtime Error has occured Do you wish to Debug? Line: 12 Error: Object doesn't support this property or method
xmldoc = new ActiveXObject ("microsoft.xml dom"); READYINFO.inner HTML += "<br>" + "Tracking ready states:" + "<br>" xmldoc.onreadys tagechange = TrackReadyState ;
Seems to be a typo
xmldoc.onreadys tatechange = ...
while you have
xmldoc.onreadys tagechange
--
Martin Honnen http://JavaScript.FAQTs.com/
Thanks for the reply Martin, I understand the objects issue a little
more now. I've downloaded Sarissa and will take a look at that
tomorrow. Also, thanks to your "eagle eye". Once you've read something
through a few times, I don't think you really see it any more. I would
of probably never spotted the typo! Once again, many thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: BCM |
last post by:
In ASP 3, I once did a page using javascript and XMLDOM that loaded up xml
files, displayed their data, and automatically refreshed that data at 10
second intervals (not a whole page refresh: just the data in the particular
node I wanted to display). The javascript looked something like:
function GetData()
{
|
by: jfizer |
last post by:
I have a web app that uses a form with its fields populated from XML
using Microsoft.XMLDOM. The problem is that Microsoft.XMLDOM functions
seem to run on their own thread, so I dont know when the fields are
done populating.
Can anyone think of a way for me to check when the following function
finishes?
function importXML(xmlQuery,xmlSrc,xmlTarget)
{
|
by: Robert Zurer |
last post by:
Hello all,
I want to load an in-memory XmlDocument from the server to the client and
create an XMLDOM object using javascript.
I can do it from a url by calling this Javascript from the client.
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.load("url of the persisted file");
|
by: Mr. x |
last post by:
Hello,
How can I use xmlpath technogy by xmldom.
(or there is another technique, but not xmldom).
I need some code samples, please.
Thanks :)
|
by: vikram |
last post by:
How to do the same task described below using xmldocument
in asp.net :
var xmlDoc
var xslDoc
xmlDoc = new ActiveXObject('Microsoft.XMLDOM')
xmlDoc.async = false;
| |
by: Robert Zurer |
last post by:
Hello all,
I want to load an in-memory XmlDocument from the server to the client and
create an XMLDOM object using javascript.
I can do it from a url by calling this Javascript from the client.
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.load(url);
|
by: tydbowl |
last post by:
I have a problem where the below code chunk causes handle leaks on some
machines. The leak APPEARS to be handles to the registry key:
HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\ZoneMap
The below code runs on a timer running several times per second and
after about 15-30 minutes or so, it runs out of handles and crashes IE.
I found an article on msdn discussing how setting properties in this
|
by: kurtrips |
last post by:
I am trying to use M$'s XMLDOM's save method but it is doing absolutely
nothing.
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("bestscores.xml");
xmlDoc.save('123.xml');
(The code is in Javascript.)
I've tried relative paths/absolute paths/all sorts of permutations, but
|
by: xq386 |
last post by:
Question: In the XSL file below I put a part of the code
(concerning the euro-sign) in comment. If I remove the
comment then it doesn't work anymore. How can this be solved?
I run Test.html with Internet Explorer on Window-XP.
Below I give all the files I'm using.
Look at following code:
File: Test.html
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |