469,648 Members | 1,523 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

Javascript "Pause" button working in IE, but not in Firefox

Greetings everyone.

See
http://www.spiceisle.com/cgi-bin/sli...mages&type=jpg

The "Pause" button works in IE, but not in Firefox. Any ideas why?

If you have any other ideas on how the javascript can be improved, please
let me know.
Thanks and regards,
Brian Steele
Jul 31 '05 #1
5 3900
Brian.Steele wrote:
Greetings everyone.

See
http://www.spiceisle.com/cgi-bin/sli...mages&type=jpg

The "Pause" button works in IE, but not in Firefox. Any ideas why?

If you have any other ideas on how the javascript can be improved, please
let me know.
Thanks and regards,
Brian Steele

var e = document.getElementById('PauseButton');
e.value = "Play";

shorten to:
document.getElementById('PauseButton').value = "Play";;
this may not be the root of the problem however
Jul 31 '05 #2
Brian.Steele wrote:
http://www.spiceisle.com/cgi-bin/sli...mages&type=jpg

The "Pause" button works in IE, but not in Firefox. Any ideas why?
The answer is the Firefox Javascript Console (Tools > Javascript
Console) which when you click the pause buttons says

Error: e has no properties
Source File:
http://www.spiceisle.com/cgi-bin/sli...mages&type=jpg
Line: 325

Look at line 325 which says

e.value = "Play";

e is defined at 324

var e = document.getElementById('PauseButton');

and you have no element in the page with an id of 'PauseButton'. At
line 453 use id instead of name.
If you have any other ideas on how the javascript can be improved, please
let me know.


A slightly flippant suggestion perhaps - don't use Microsoft Frontpage.

hth

mike

Jul 31 '05 #3
Thanks Mike:

I combined your response with the assistance from another response, and came
up with the following:

1. "PauseShow" subroutine changed to the following:

function PauseShow() {

if (play == true) {

document.getElementById('PauseButton').value = "Play";
play = false;
}
else {

document.getElementById('PauseButton').value = "Pause";
play = true;
pictimer = timer + delta;
SlideShow('slidepic');
}
}

2. Modified the HTML definition for the "Pause" button as follows:

<input type="button" value="Pause" name="PauseButton" id="PauseButton"
onclick="PauseShow()" style="font-family: sans-serif; font-size: 8pt">

That seems to have fixed the problem. Thanks!
Brian

<in********************@hotmail.com> wrote in message nd
news:11*********************@g14g2000cwa.googlegro ups.com...
Brian.Steele wrote:
http://www.spiceisle.com/cgi-bin/sli...mages&type=jpg

The "Pause" button works in IE, but not in Firefox. Any ideas why?


The answer is the Firefox Javascript Console (Tools > Javascript
Console) which when you click the pause buttons says

Error: e has no properties
Source File:
http://www.spiceisle.com/cgi-bin/sli...mages&type=jpg
Line: 325

Look at line 325 which says

e.value = "Play";

e is defined at 324

var e = document.getElementById('PauseButton');

and you have no element in the page with an id of 'PauseButton'. At
line 453 use id instead of name.
If you have any other ideas on how the javascript can be improved, please
let me know.


A slightly flippant suggestion perhaps - don't use Microsoft Frontpage.

hth

mike

Jul 31 '05 #4
Jedi Fans escribió:
Thanks and regards,
Brian Steele

var e = document.getElementById('PauseButton');
e.value = "Play";

shorten to:
document.getElementById('PauseButton').value = "Play";;
this may not be the root of the problem however


Why do you use ";;" instead of ";"?

Thanks in advance,

knocte

--
Aug 2 '05 #5
knocte wrote:
Jedi Fans escribió:
Thanks and regards,
Brian Steele

var e = document.getElementById('PauseButton');
e.value = "Play";

shorten to:
document.getElementById('PauseButton').value = "Play";;
this may not be the root of the problem however


Why do you use ";;" instead of ";"?

Thanks in advance,

knocte

typo
Aug 2 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Paminu | last post: by
4 posts views Thread by Kerwin Cabrera | last post: by
3 posts views Thread by RR | last post: by
3 posts views Thread by nma | last post: by
4 posts views Thread by Curious | last post: by
2 posts views Thread by Charles Zhang | last post: by
1 post views Thread by =?ISO-8859-1?Q?Andr=E9?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.