This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Mozilla XML > May 2005 > xml/html/js code works in IE but not in Mozilla based browsers
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
xml/html/js code works in IE but not in Mozilla based browsers
|
|
| David Schele 2005-05-13, 11:31 pm |
| My architectural practice uses a program that allows us to publish our
drawings to our web site www.feldergrp.com (button: Projects now bidding.)
An html document drives the page; an XML document stores the variables such
as thumbnails, drawing files, and summary information; and several
javascript routines build the page contents from the XML document. This
combination works fine in IE but not in any Mozilla based browser; and the
developer seems to have no interest in making it work in any other browser
than IE.
The html code (abbreviated) looks like this:
</head>
<xml id="adsk_ptw_xml" src="acwebpublish.xml"></xml>
<body class="IMAGE">
<table >
<tr>
<td><div id="adsk_ptw_page_description"></div></td>
</tr>
</table>
<script src="adsk_ptw_page_description.js" language="javascript"
type="text/javascript"></script>
</body>
The javascript code attempts to retrieve the data from the XML document
through code like this:
function adsk_ptw_page_description_main() {
var xmle=adsk_ptw_xml.getElementsByTagName("publish_to_web").item(0);
Mozilla based browsers throw the error "adsk_ptw_xml is undefined" in
adsk_ptw_page_description.js" and halt. I tried moving the <xml> declaration
into the <body>, but there was no change.
Apparently, the initial <xml> declaration in the html code is where the
problem begins. It is recognized by the javascript in IE but not in Mozilla.
I know some html and a very little javascript, but I am clueless as to how
to fix this and would appreciate any help.
| |
| Lucky 2005-05-13, 11:31 pm |
| David Schele wrote:
> My architectural practice uses a program that allows us to publish our
> drawings to our web site www.feldergrp.com (button: Projects now bidding.)
> An html document drives the page; an XML document stores the variables such
> as thumbnails, drawing files, and summary information; and several
> javascript routines build the page contents from the XML document. This
> combination works fine in IE but not in any Mozilla based browser; and the
> developer seems to have no interest in making it work in any other browser
> than IE.
>
>
>
> The html code (abbreviated) looks like this:
>
> </head>
>
>
>
> <xml id="adsk_ptw_xml" src="acwebpublish.xml"></xml>
>
>
>
> <body class="IMAGE">
> <table >
> <tr>
> <td><div id="adsk_ptw_page_description"></div></td>
> </tr>
> </table>
> <script src="adsk_ptw_page_description.js" language="javascript"
> type="text/javascript"></script>
>
> </body>
>
> The javascript code attempts to retrieve the data from the XML document
> through code like this:
>
> function adsk_ptw_page_description_main() {
> var xmle=adsk_ptw_xml.getElementsByTagName("publish_to_web").item(0);
>
> Mozilla based browsers throw the error "adsk_ptw_xml is undefined" in
> adsk_ptw_page_description.js" and halt. I tried moving the <xml> declaration
> into the <body>, but there was no change.
>
>
>
> Apparently, the initial <xml> declaration in the html code is where the
> problem begins. It is recognized by the javascript in IE but not in Mozilla.
> I know some html and a very little javascript, but I am clueless as to how
> to fix this and would appreciate any help.
>
>
>
>
For starters there is no <xml/> element in the HTML 4.01 spec
http://www.w3.org/TR/html401/index/elements.html
and wait, um.. nope
none in xhtml either :(
yea, i'm a bit bummed to, is a very sweet simple task to embed the xml
in your page.
i'm quite positive you should be able to make something work either by
pulling in the code with javascript, or -moz-binding: some xbl to
understand the <xml/> tag?
| |
| Martin Honnen 2005-05-14, 7:51 am |
|
David Schele wrote:
> My architectural practice uses a program that allows us to publish our
> drawings to our web site www.feldergrp.com (button: Projects now bidding.)
> An html document drives the page; an XML document stores the variables such
> as thumbnails, drawing files, and summary information; and several
> javascript routines build the page contents from the XML document. This
> combination works fine in IE but not in any Mozilla based browser; and the
> developer seems to have no interest in making it work in any other browser
> than IE.
>
>
>
> The html code (abbreviated) looks like this:
>
> </head>
>
>
>
> <xml id="adsk_ptw_xml" src="acwebpublish.xml"></xml>
That is an XML data island in an HTML document, a feature only supported
by IE/Windows.
If you want to load XML cross browser then do it with script,
XMLHttpRequest can do that, see
<http://www.faqts.com/knowledge_base...d/17226/fid/616>
<http://www.faqts.com/knowledge_base...id/6826/fid/616>
--
Martin Honnen
http://JavaScript.FAQTs.com/
| |
| David Schele 2005-05-16, 7:43 pm |
| Excellent. Many thanks for the direction. I found your site last night,
and wondered if the XMLHttpRequest was a possible solution. I'll work on it
again tonight.
"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:d64lgj$6ks1@ripley.netscape.com...
>
> That is an XML data island in an HTML document, a feature only supported
> by IE/Windows.
> If you want to load XML cross browser then do it with script,
> XMLHttpRequest can do that, see
> <http://www.faqts.com/knowledge_base...d/17226/fid/616>
> <http://www.faqts.com/knowledge_base...id/6826/fid/616>
>
| |
| Heikki Toivonen 2005-05-21, 4:17 am |
| David Schele wrote:
> Excellent. Many thanks for the direction. I found your site last night,
> and wondered if the XMLHttpRequest was a possible solution. I'll work on it
> again tonight.
See http://www.mozilla.org/xmlextras/ and specifically the Documentation
section. We have some documents that show how to make Mozilla do XML
data islands using XMLHttpRequest etc.
--
Heikki Toivonen
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|