|
I used the code from this article http://www.interspire.com/content/articles/10/1 & it works great but not in Firefox. Instead of a list it is all over the place. Can anyone help me?
I just finished a class on design & now signed up for CSS stylesheet. DHTML will be the class after that.
Thanks
Cacbeary
|
|
|
<html>
<head>
<script type="text/javascript">
var dhtmlDoc;
function loadDHTML()
{
//load DHTML file
// code for IE
if (window.ActiveXObject)
{
dhtmlDoc=new ActiveXObject("Microsoft.XMLDOM");
dhtmlDoc.async=false;
dhtmlDoc.load("note.html");
getmessage();
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
dhtmlDoc=document.implementation.createDocument("","",null);
dhtmlDoc.load("note.html");
dhtmlDoc.onload=getmessage;
}
else
{
alert('Your browser cannot handle this script');
}
}
function getmessage()
{
document.getElementById("to").innerHTML=dhtmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
document.getElementById("from").innerHTML=dhtmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
document.getElementById("message").innerHTML=dhtmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;
}
</script>
</head>
<body onload="loadDHTML()">
Write here yr code of DHTML
</body>
</html>
note.html is your file name.. try this and see it should work!!!
|
|
|
Thanks a bunch. But I was planning on using this in a template for several pages. Instead of note.html could I use this.html instead?
I guess I could make the change from note.html to whatever the page is but this would be a lot easier if it just worked from the template.
Thank you again.
|
|
|
Here is the address of my code http://www.moriel.org/Carol/design_composite.htm
I put the code in & it says I have an error. I just don't know what I am doing.
This is a ministry. Hope it don't offend you. We're all volunteers here.
Thanks again.
|
|
|
Hi Carol,
can u paste the code here, which is working fine in IE and not firefox.
|
|
|
Here is the code including your added code.
<script language="JavaScript" type="text/JavaScript">
<!--
var last_expanded = '';
function showHide(id)
{
var obj = document.getElementById(id);
var status = obj.className;
if (status == 'hide') {
if (last_expanded != '') {
var last_obj = document.getElementById(last_expanded);
last_obj.className = 'hide';
}
obj.className = 'show';
last_expanded = id;
} else {
obj.className = 'hide';
}
}
//-->
</script>
<script type="text/javascript">
var dhtmlDoc;
function loadDHTML()
{
//load DHTML file
// code for IE
if (window.ActiveXObject)
{
dhtmlDoc=new ActiveXObject("Microsoft.XMLDOM");
dhtmlDoc.async=false;
dhtmlDoc.load("/forum/design_composite.htm");
getmessage();
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
dhtmlDoc=document.implementation.createDocument("","",null);
dhtmlDoc.load("/forum/design_composite.htm");
dhtmlDoc.onload=getmessage;
}
else
{
alert('Your browser cannot handle this script');
}
}
function getmessage()
{
document.getElementById("to").innerHTML=dhtmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
document.getElementById("from").innerHTML=dhtmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
document.getElementById("message").innerHTML=dhtmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;
}
</script>
Duh! They had other people write in tweaking the code & I used the last code someone wrote in. But it didn't work in Firefox no matter what I did.
Thanks for the help.
Carol
|
|
|
|
|
Thank you Sunil.
I'm still getting error messages, don't know what I'm doing wrong. I'm afraid this is all over my head. I am code deficient! In the design class I was told to make floats for the navigation. I don't know anything about CSS or any code.
I signed up for a CSS class & starts the end of April. Unfortunately, you learn floats in the second class, LOL! Everything is just going to have to be put on hold for about 6 months I guess until I learn it. What a bummer.
Anyway, thanks you for all the help you have given me and for your patience.
Carol
|
|
|
|
|
Thanks for the article. When I'm in CSS class, I will be talking about the compatibility problems with all of this.
I think the main problem is time. You have your work, your life, & volunteering to do this site - there just isn't enough hours in the day. You just make time for what you want when you can. The plus side is they are paying for the classes & knowledge is power!
Carol
|
|
|