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

FireFox & simple Javascript

Hi everybody

Wonder if you could help me out.

I created a simple JavaScript routine to enable a user to click backwards
and forwards between small news articles. This routine works fine in IE and
Safari, but in the latest FireFox I get no title or article, but do see the
prev and next links and the article number.

My HTML and JS simple routine is as follows:

<DIV CLASS="LatestNewsTitle" ID="NewsTitle" NAME="NewsTitle">&nbsp;</DIV>
<DIV CLASS="LatestNewsText" ID="NewsText" NAME="NewsText">&nbsp;</DIV>

<SPAN NAME="NewsPrev" ID="NewsPrev"><A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage-=1)">Prev</A></SPAN>

<SPAN NAME="NewsNext" ID="NewsNext"><A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage+=1)">Next</A></SPAN>

<SCRIPT LANGUAGE="javascript">
<!--
var thepage = 1;

var thePrevEnabled = '<A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage-=1)">Prev</A>';
var thePrevDisabled = '&nbsp;';

var theNextEnabled = '<A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage+=1)">Next</A>';
var theNextDisabled = '&nbsp;';

var theTitleText = new Array(1);
var theParaText = new Array(1);
theTitleText[1]='';
theTitleText[1]+='e-mail warning';
theParaText[1]='';
theParaText[1]+='An e-mail from su*****@mydomain.co.uk is not from us.';

function NewsStartText() {
self.NewsPrev.innerHTML = thePrevDisabled;
self.NewsNext.innerHTML = theNextDisabled;

self.NewsTitle.innerHTML = theTitleText[thepage];
self.NewsText.innerHTML = theParaText[thepage];
}

function NewsNextPrev(thepage) {
self.NewsPrev.innerHTML = thePrevDisabled;
self.NewsNext.innerHTML = theNextDisabled;
self.NewsTitle.innerHTML = theTitleText[thepage];
self.NewsText.innerHTML = theParaText[thepage];
return true;
}

NewsStartText()

//-->
</SCRIPT>

As it has stumped as to why Safari works OK and not FireFox when I thought
they 'fire off the same bat', do you have any idea as to what I'm doing
wrong?

Thanks

Robbie

PS: My Javascript functionality checkbox is ticked and it seems to be this
specific script rather than JS in general.

Jul 23 '05 #1
9 2079
Astra wrote:
Hi everybody

Wonder if you could help me out.

I created a simple JavaScript routine to enable a user to click backwards
and forwards between small news articles. This routine works fine in IE and
Safari, but in the latest FireFox I get no title or article, but do see the
prev and next links and the article number.

My HTML and JS simple routine is as follows:

<DIV CLASS="LatestNewsTitle" ID="NewsTitle" NAME="NewsTitle">&nbsp;</DIV>
<DIV CLASS="LatestNewsText" ID="NewsText" NAME="NewsText">&nbsp;</DIV>

<SPAN NAME="NewsPrev" ID="NewsPrev"><A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage-=1)">Prev</A></SPAN>

<SPAN NAME="NewsNext" ID="NewsNext"><A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage+=1)">Next</A></SPAN>

<SCRIPT LANGUAGE="javascript">
<!--
var thepage = 1;

var thePrevEnabled = '<A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage-=1)">Prev</A>';
var thePrevDisabled = '&nbsp;';

var theNextEnabled = '<A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage+=1)">Next</A>';
var theNextDisabled = '&nbsp;';

var theTitleText = new Array(1);
var theParaText = new Array(1);
theTitleText[1]='';
theTitleText[1]+='e-mail warning';
theParaText[1]='';
theParaText[1]+='An e-mail from su*****@mydomain.co.uk is not from us.';

function NewsStartText() {
self.NewsPrev.innerHTML = thePrevDisabled;
self.NewsNext.innerHTML = theNextDisabled;

self.NewsTitle.innerHTML = theTitleText[thepage];
self.NewsText.innerHTML = theParaText[thepage];
}

function NewsNextPrev(thepage) {
self.NewsPrev.innerHTML = thePrevDisabled;
self.NewsNext.innerHTML = theNextDisabled;
self.NewsTitle.innerHTML = theTitleText[thepage];
self.NewsText.innerHTML = theParaText[thepage];
return true;
}

NewsStartText()

//-->
</SCRIPT>

As it has stumped as to why Safari works OK and not FireFox when I thought
they 'fire off the same bat', do you have any idea as to what I'm doing
wrong?

Thanks

Robbie

PS: My Javascript functionality checkbox is ticked and it seems to be this
specific script rather than JS in general.

Robbie

To start NEVER use javascript: in the href of an anchor. Instead do the
following.

<a href="#" onclick="YourFunctionCall(); return false">foo</a>

And I assume you are only using an anchor because it woks with the CSS
a:hover {} else you could have just used a span/div. Why? you ask hold
the shift key and click the link.

Also all tags and attribs should be in lower case.

change <SCRIPT LANGUAGE="javascript"> to <script type="text/javascript">

I fail see why you are creating strings of html that for enabled and
disabled. You can just change the disabled property of the anchor.

Also can i suggest you use this to change the Text content of the div's

var eNewsText = document.getElementById("NewsText");
eNewsText.replaceChild( document.createTextNode("The Content"),
eNewsText.firstChild );

If you use propper DOM methods to reference and change the DOM you will
have ALOT less issues x-browser.

HTH
Andy

Jul 23 '05 #2
Astra wrote:
<snip>
<SPAN NAME="NewsPrev" ID="NewsPrev">
<A HREF="javascript:void(0)"
Executing a javascript pseudo-protocol HREF that does not replace the
current page is the scripting equivalent of kicking the browser really
hard. What will and will not function after you have done that is
anyone's guess. Web browsers are fragile, they should not be kicked.
OnClick="NewsNextPrev(thepage-=1)">Prev</A></SPAN>
If the onclick handler cancelled the navigation, by returning false, the
HREF would never be activated and so would not be able to have harmful
side effects. That would also make the contents of the HREF irrelevant
to script supporting browser, and available to facilitate fall-back for
script disabled browsers. It might, for example, contain the URL of the
pertinent news article proper so the script incapable/disabled browser
would navigate to that article (which seems quite an acceptable
fall-back in this situation) and it would even allow users to employ
that common context menu option of opening a link in a new browser
window (if they wanted to; giving the user the choice is good).

<snip> <SCRIPT LANGUAGE="javascript">
In valid HTML 4 the TYPE attribute is required in a SCRIPT element, and
proving it renders the deprecated LANGUAGE attribute redundant.
<!--
The 'hide scripts from older browsers' stuff is for the benefit of
browser so old that nobody will still be using them (as they will not
function at all with any of the modern internet). Stop doing it.

<snip> function NewsNextPrev(thepage) {
self.NewsPrev.innerHTML = thePrevDisabled;

<snip> ^^^^^^^^

The premise here is that a reference to an IDed DOM element is available
as a named property of the window object in web browsers. That is a
facility that Microsoft introduced, and others copied, but it is not
part of any formal specification and not implemented in numerous
browsers (including Mozilla/Firefox/Netscape/Gecko).

This is covered in this group's FAQ:-

<URL: http://www.jibbering.com/faq/ >

Richard.
Jul 23 '05 #3
Andrew Scott wrote:
<snip>
And I assume you are only using an anchor because it
woks with the CSS a:hover {} else you could have just
used a span/div. Why? you ask hold the shift key and
click the link.
It is not possible to keyboard navigate to a SPAN or a DIV [1], but it
is possible to keyboard navigate to an A element.

[1] Without providing a huge amount of additional code to monitor,
contextualise and respond to keyboard input.
Also all tags and attribs should be in lower case.

<snip>

HTML element names and attributes may be in any case, including mixed
case (and this is not an XHTML document, where lower case is required
for official XHTML DTD-specified element names and attributes).

Richard.
Jul 23 '05 #4
Down below :0)

"Andrew Scott" <An****@compan.net> wrote in message
news:11*************@corp.supernews.com...
Astra wrote:
Hi everybody

Wonder if you could help me out.

I created a simple JavaScript routine to enable a user to click backwards
and forwards between small news articles. This routine works fine in IE
and
Safari, but in the latest FireFox I get no title or article, but do see
the
prev and next links and the article number.

My HTML and JS simple routine is as follows:

<DIV CLASS="LatestNewsTitle" ID="NewsTitle" NAME="NewsTitle">&nbsp;</DIV>
<DIV CLASS="LatestNewsText" ID="NewsText" NAME="NewsText">&nbsp;</DIV>

<SPAN NAME="NewsPrev" ID="NewsPrev"><A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage-=1)">Prev</A></SPAN>

<SPAN NAME="NewsNext" ID="NewsNext"><A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage+=1)">Next</A></SPAN>

<SCRIPT LANGUAGE="javascript">
<!--
var thepage = 1;

var thePrevEnabled = '<A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage-=1)">Prev</A>';
var thePrevDisabled = '&nbsp;';

var theNextEnabled = '<A HREF="javascript:void(0)"
OnClick="NewsNextPrev(thepage+=1)">Next</A>';
var theNextDisabled = '&nbsp;';

var theTitleText = new Array(1);
var theParaText = new Array(1);
theTitleText[1]='';
theTitleText[1]+='e-mail warning';
theParaText[1]='';
theParaText[1]+='An e-mail from su*****@mydomain.co.uk is not from us.';

function NewsStartText() {
self.NewsPrev.innerHTML = thePrevDisabled;
self.NewsNext.innerHTML = theNextDisabled;

self.NewsTitle.innerHTML = theTitleText[thepage];
self.NewsText.innerHTML = theParaText[thepage];
}

function NewsNextPrev(thepage) {
self.NewsPrev.innerHTML = thePrevDisabled;
self.NewsNext.innerHTML = theNextDisabled;
self.NewsTitle.innerHTML = theTitleText[thepage];
self.NewsText.innerHTML = theParaText[thepage];
return true;
}

NewsStartText()

//-->
</SCRIPT>

As it has stumped as to why Safari works OK and not FireFox when I thought
they 'fire off the same bat', do you have any idea as to what I'm doing
wrong?

Thanks

Robbie

PS: My Javascript functionality checkbox is ticked and it seems to be this
specific script rather than JS in general.

Robbie

To start NEVER use javascript: in the href of an anchor. Instead do the
following.

<a href="#" onclick="YourFunctionCall(); return false">foo</a>

And I assume you are only using an anchor because it woks with the CSS
a:hover {} else you could have just used a span/div. Why? you ask hold
the shift key and click the link.

Also all tags and attribs should be in lower case.

change <SCRIPT LANGUAGE="javascript"> to <script type="text/javascript">

I fail see why you are creating strings of html that for enabled and
disabled. You can just change the disabled property of the anchor.

Also can i suggest you use this to change the Text content of the div's

var eNewsText = document.getElementById("NewsText");
eNewsText.replaceChild( document.createTextNode("The Content"),
eNewsText.firstChild );

If you use propper DOM methods to reference and change the DOM you will
have ALOT less issues x-browser.

HTH
Andy

-----------------------------------

Hi Andy

Many thanks for the help. Having used the above getElement... I can now get
the title and text to appear OK, but I can't get my prev and next links to
work.

I've changed the anchors to:

<A HREF="#" OnClick="NewsNextPrev(thepage+=1);return false">Next</A>
<A HREF="#" OnClick="NewsNextPrev(thepage-=1);return false">Prev</A>

and changed the JS to:

var eNewsPrev = document.getElementById("NewsPrev");
var eNewsNext = document.getElementById("NewsNext");
eNewsPrev.replaceChild(
document.createTextNode(thePrevDisabled),eNewsPrev .firstChild );
eNewsNext.replaceChild(document.createTextNode(the NextEnabled),eNewsNext.firstChild);but all I appear to get is the HTML as standard plain text rather thanactually show the HTML, eg instead of showing a Next link I'm seeing <AHREF="#" OnClick="NewsNextPrev(thepage+=1);return false">Next</A> on thepage.Can this not be done via getEleement.... ?What was this anchor disabling that you were talking about?All I want to do is enable/disable the Next and Prev links as and when thereare news 'pages' to see.Rgds Robbie

Jul 23 '05 #5
Richard Cornford wrote:
Andrew Scott wrote:
<snip>
And I assume you are only using an anchor because it
woks with the CSS a:hover {} else you could have just
used a span/div. Why? you ask hold the shift key and
click the link.

It is not possible to keyboard navigate to a SPAN or a DIV [1], but it
is possible to keyboard navigate to an A element.

[1] Without providing a huge amount of additional code to monitor,
contextualise and respond to keyboard input.

Also all tags and attribs should be in lower case.


<snip>

HTML element names and attributes may be in any case, including mixed
case (and this is not an XHTML document, where lower case is required
for official XHTML DTD-specified element names and attributes).

Richard.


Richard

Are suggesting that's the only reason Robbie used an anchor was to
enable keyboard navigation of the page?

To quote him "enable a user to click"

And indeed XHTML is the only DOCTYPE where case is a requirement. But
have said that it's always good to be consistant with the case.

And IMHO it's best to learn to use lowercase asap if ever the event
arises, which it did for me, that you need to change to use strict XHTML
DOCTYPE it's just a matter of changeing the DOCTYPE and ensuring the
arribs and elements are valid.

Reduce that tagsoup...

Andy

Jul 23 '05 #6
Andrew Scott wrote:
Richard Cornford wrote:
Andrew Scott wrote: <snip>
And I assume you are only using an anchor because it
woks with the CSS a:hover {} else you could have just
used a span/div. Why? you ask hold the shift key and
click the link.

It is not possible to keyboard navigate to a SPAN or a DIV
[1], but it is possible to keyboard navigate to an A element. <snip>
Also all tags and attribs should be in lower case.


<snip>

HTML element names and attributes may be in any case,
including mixed case (and this is not an XHTML document,
where lower case is required for official XHTML DTD-specified
element names and attributes).

<snip> Are suggesting that's the only reason Robbie used an anchor
was to enable keyboard navigation of the page?
I am pointing out that your proposed changes will result in a less
accessible outcome because it will not be useable via a keyboard, at
least not without considerable additional work.
To quote him "enable a user to click"
That the OP may have a pointing-device oriented mindset is not a good
reason for encouraging them to make changes that will potentially make
things worse for some visitors to their site. It is also possible that
the OP is living within a jurisdiction where a public information source
in the form of a web site must be accessible by law (like the UK).
And indeed XHTML is the only DOCTYPE where case is a
requirement. But have said that it's always good to
be consistant with the case.
Style advice can be given in a way that does not imply that its
conclusions are required or necessary. There are many things that
'should' or 'must' be done when authoring HTML, but using only lowercase
characters in element and attribute names is not one of them.
And IMHO it's best to learn to use lowercase asap if ever
the event arises, which it did for me, that you need to
change to use strict XHTML DOCTYPE it's just a matter of
changeing the DOCTYPE and ensuring the arribs and elements
are valid.
'Just a matter of changing the DOCTYPE'? You might just about get away
with that in an HTML newsgroup, but this is a scripting newsgroup and we
know that scripting XHTML involves using a different DOM, with its own
requirements, characteristics and idiosyncrasies and so that most
scripts would require large scale re-writing for use with XHTML.

But yes, most of us will not have to deal with XHTML for a long time as
we are working in a commercial context, where its use is made non-viable
by the predominance of IE 6.
Reduce that tagsoup...


You have set your own pit trap, are you now going to walk into it?

Richard.
Jul 23 '05 #7
Richard Cornford wrote:
Andrew Scott wrote:
Richard Cornford wrote:
Andrew Scott wrote:
<snip>
And I assume you are only using an anchor because it
woks with the CSS a:hover {} else you could have just
used a span/div. Why? you ask hold the shift key and
click the link.
It is not possible to keyboard navigate to a SPAN or a DIV
[1], but it is possible to keyboard navigate to an A element.
<snip>
Also all tags and attribs should be in lower case.

<snip>

HTML element names and attributes may be in any case,
including mixed case (and this is not an XHTML document,
where lower case is required for official XHTML DTD-specified
element names and attributes).


<snip>
Are suggesting that's the only reason Robbie used an anchor
was to enable keyboard navigation of the page?

I am pointing out that your proposed changes will result in a less
accessible outcome because it will not be useable via a keyboard, at
least not without considerable additional work.

To quote him "enable a user to click"

That the OP may have a pointing-device oriented mindset is not a good
reason for encouraging them to make changes that will potentially make
things worse for some visitors to their site. It is also possible that
the OP is living within a jurisdiction where a public information source
in the form of a web site must be accessible by law (like the UK).

And indeed XHTML is the only DOCTYPE where case is a
requirement. But have said that it's always good to
be consistant with the case.

Style advice can be given in a way that does not imply that its
conclusions are required or necessary. There are many things that
'should' or 'must' be done when authoring HTML, but using only lowercase
characters in element and attribute names is not one of them.

And IMHO it's best to learn to use lowercase asap if ever
the event arises, which it did for me, that you need to
change to use strict XHTML DOCTYPE it's just a matter of
changeing the DOCTYPE and ensuring the arribs and elements
are valid.

'Just a matter of changing the DOCTYPE'? You might just about get away
with that in an HTML newsgroup, but this is a scripting newsgroup and we
know that scripting XHTML involves using a different DOM, with its own
requirements, characteristics and idiosyncrasies and so that most
scripts would require large scale re-writing for use with XHTML.

But yes, most of us will not have to deal with XHTML for a long time as
we are working in a commercial context, where its use is made non-viable
by the predominance of IE 6.

Reduce that tagsoup...

You have set your own pit trap, are you now going to walk into it?

Richard.


Richard

Your points are are 100% valid and i must agree with all of them.

And rereading my statment about case of tag I feel that i did sound a
touch forthright and maybe i should have said "Can i suggest you use
lowercase for tags and attribs, if only for easy of reading". Tell me
what case do you use?

Andy

Jul 23 '05 #8
Down below :0)

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:d8*******************@news.demon.co.uk...
Astra wrote:
<snip>
<SPAN NAME="NewsPrev" ID="NewsPrev">
<A HREF="javascript:void(0)"
Executing a javascript pseudo-protocol HREF that does not replace the
current page is the scripting equivalent of kicking the browser really
hard. What will and will not function after you have done that is
anyone's guess. Web browsers are fragile, they should not be kicked.
OnClick="NewsNextPrev(thepage-=1)">Prev</A></SPAN>
If the onclick handler cancelled the navigation, by returning false, the
HREF would never be activated and so would not be able to have harmful
side effects. That would also make the contents of the HREF irrelevant
to script supporting browser, and available to facilitate fall-back for
script disabled browsers. It might, for example, contain the URL of the
pertinent news article proper so the script incapable/disabled browser
would navigate to that article (which seems quite an acceptable
fall-back in this situation) and it would even allow users to employ
that common context menu option of opening a link in a new browser
window (if they wanted to; giving the user the choice is good).

<snip> <SCRIPT LANGUAGE="javascript">
In valid HTML 4 the TYPE attribute is required in a SCRIPT element, and
proving it renders the deprecated LANGUAGE attribute redundant.
<!--
The 'hide scripts from older browsers' stuff is for the benefit of
browser so old that nobody will still be using them (as they will not
function at all with any of the modern internet). Stop doing it.

<snip> function NewsNextPrev(thepage) {
self.NewsPrev.innerHTML = thePrevDisabled;

<snip> ^^^^^^^^

The premise here is that a reference to an IDed DOM element is available
as a named property of the window object in web browsers. That is a
facility that Microsoft introduced, and others copied, but it is not
part of any formal specification and not implemented in numerous
browsers (including Mozilla/Firefox/Netscape/Gecko).

This is covered in this group's FAQ:-

<URL: http://www.jibbering.com/faq/ >

Richard.
Dear Andrew/Richard

Thanks for the feedback.

I've tried the innerHTML, but it doesn't seem to kick in, eg:

By default my HTML code now looks like:

<SPAN NAME="NewsPrev" ID="NewsPrev"><A HREF="#"
OnClick="NewsNextPrev(thepage-=1);return false">Prev</A></SPAN>

in my JS code I set the following vars:

var thePrevEnabled = '<A HREF="#" OnClick="NewsNextPrev(thepage-=1);return
false"><IMG SRC="skins/<%=cSkinsFolderName%>/btn-prev.jpg" BORDER=0></A>';

var thePrevDisabled = '<A HREF="#"><IMG
SRC="skins/<%=cSkinsFolderName%>/btn-prev-disabled.jpg" BORDER=0></A>';

further down the JS code I've set a literal test of:

document.getElementById("NewsPrev").InnerHTML = "fred";

but nothing happens.

Having changed all the self's to getElementByIDs, my text actually works,
eg:

var eNewsText = document.getElementById("NewsText");
eNewsText.replaceChild(document.createTextNode(the ParaText[thepage]),eNewsText.firstChild);

now cycles through the text although HTML tags also appear as plain text as
well!!

If I used the style.visibility command line to show/hide the
disabled/enabled status then the whole thing works fine, but I want to show
an enabled/disabled button instead of nothing.

Can you help me get this InnerHTML to kick in.

Thanks

Robbie

Jul 23 '05 #9
false alarm!!

wasn't careful enough with my casing > InnerHTML should be innerHTML.

All sorted now.

Thanks

Robbie
"Astra" <No@Spam.com> wrote in message
news:11*************@corp.supernews.com...
Down below :0)

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:d8*******************@news.demon.co.uk...
Astra wrote:
<snip>
<SPAN NAME="NewsPrev" ID="NewsPrev">
<A HREF="javascript:void(0)"
Executing a javascript pseudo-protocol HREF that does not replace the
current page is the scripting equivalent of kicking the browser really
hard. What will and will not function after you have done that is
anyone's guess. Web browsers are fragile, they should not be kicked.
OnClick="NewsNextPrev(thepage-=1)">Prev</A></SPAN>
If the onclick handler cancelled the navigation, by returning false, the
HREF would never be activated and so would not be able to have harmful
side effects. That would also make the contents of the HREF irrelevant
to script supporting browser, and available to facilitate fall-back for
script disabled browsers. It might, for example, contain the URL of the
pertinent news article proper so the script incapable/disabled browser
would navigate to that article (which seems quite an acceptable
fall-back in this situation) and it would even allow users to employ
that common context menu option of opening a link in a new browser
window (if they wanted to; giving the user the choice is good).

<snip> <SCRIPT LANGUAGE="javascript">
In valid HTML 4 the TYPE attribute is required in a SCRIPT element, and
proving it renders the deprecated LANGUAGE attribute redundant.
<!--
The 'hide scripts from older browsers' stuff is for the benefit of
browser so old that nobody will still be using them (as they will not
function at all with any of the modern internet). Stop doing it.

<snip> function NewsNextPrev(thepage) {
self.NewsPrev.innerHTML = thePrevDisabled;

<snip> ^^^^^^^^

The premise here is that a reference to an IDed DOM element is available
as a named property of the window object in web browsers. That is a
facility that Microsoft introduced, and others copied, but it is not
part of any formal specification and not implemented in numerous
browsers (including Mozilla/Firefox/Netscape/Gecko).

This is covered in this group's FAQ:-

<URL: http://www.jibbering.com/faq/ >

Richard.
Dear Andrew/Richard

Thanks for the feedback.

I've tried the innerHTML, but it doesn't seem to kick in, eg:

By default my HTML code now looks like:

<SPAN NAME="NewsPrev" ID="NewsPrev"><A HREF="#"
OnClick="NewsNextPrev(thepage-=1);return false">Prev</A></SPAN>

in my JS code I set the following vars:

var thePrevEnabled = '<A HREF="#" OnClick="NewsNextPrev(thepage-=1);return
false"><IMG SRC="skins/<%=cSkinsFolderName%>/btn-prev.jpg" BORDER=0></A>';

var thePrevDisabled = '<A HREF="#"><IMG
SRC="skins/<%=cSkinsFolderName%>/btn-prev-disabled.jpg" BORDER=0></A>';

further down the JS code I've set a literal test of:

document.getElementById("NewsPrev").InnerHTML = "fred";

but nothing happens.

Having changed all the self's to getElementByIDs, my text actually works,
eg:

var eNewsText = document.getElementById("NewsText");
eNewsText.replaceChild(document.createTextNode(the ParaText[thepage]),eNewsText.firstChild);

now cycles through the text although HTML tags also appear as plain text as
well!!

If I used the style.visibility command line to show/hide the
disabled/enabled status then the whole thing works fine, but I want to show
an enabled/disabled button instead of nothing.

Can you help me get this InnerHTML to kick in.

Thanks

Robbie


Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: christian9997 | last post by:
Hi I would be very helpful if someone could help me with this code. It works fine in IE but when I display it in Netscape or Firefox and I move the mouse from one menu to the other the gap...
4
by: L2XL | last post by:
I have an ASP.NET (VB) app that I created for the Windows and IE6 enviroment. When it runs under Firefox on Windows it looks similar but has some display issues. When I run it under Firefox on...
12
by: PMA | last post by:
Hi all, I am porting a web application from IE 6.0 to FireFox 1.5. I have solved almost all compatibility issues (quite a lot but not too bad) except two of them : 1) Clipboard access thru'...
6
by: laramie.hartmann | last post by:
I have a script (see below) that accesses a XML file and displays the contents through a series of document.write calls. This all works fine in IE, but not at all in Firefox. I get no errors in the...
6
by: smoitra | last post by:
Hi All, I am new here.I have a textbox in my form where user is supposed to enter zip codes and as soon they enter that and press tab or click elsewhere on the form it is supposed to go to...
22
by: giordan | last post by:
Hi all! I've wrote this code: <script type="text/javascript"> var largImg; var altImg; var txtTop = '<b>Ottima scelta!</b> Ora compila il form e premi "Ricevi banner". Il...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
Oralloy
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,...
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
agi2029
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,...

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.