By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,018 Members | 870 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,018 IT Pros & Developers. It's quick & easy.

FireFox & simple Javascript

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.