Closed Bug 193480 Opened 22 years ago Closed 22 years ago

webcam javascript not working

Categories

(SeaMonkey :: General, defect)

PowerPC
Mac System 9.x
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gsa, Assigned: asa)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.0.2) Gecko/20021216 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:1.0.2) Gecko/20021216 the following javascript code does not work in mozilla it works in netscape 4.8 however [Crows Free Javascript Examples] Forcing an image to reload from the server instead of the browser's cache. <HTML><HEAD><TITLE>Webcam</TITLE> <SCRIPT LANGUAGE="Javascript"><!-- function refreshCam(){ rfsh = new Date() ; rfsh = "?"+rfsh.getTime() document.images["webcam"].src = "webcam.jpg"+rfsh setTimeout("refreshCam()", 30000) // 30secs } //--></SCRIPT> </HEAD><BODY BGCOLOR="#FFFFFF"> <IMG NAME="webcam" SRC="webcam.jpg" WIDTH=200 HEIGHT=200 BORDER=0> <SCRIPT LANGUAGE="Javascript"><!-- if( document.images ) // If browser support it... refreshCam(); // ...start refresher //--></SCRIPT> Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: javascript code doesnt work Expected Results: javascript code should have worked
The only object in there that has anything to do with the JS engine is the Date object.... Is there a live testcase somewhere?
Reassigning to Browser-General for now. I notice the use of the getTime() method above. We've been having crashes on that on the Windows OS, but not on Mac, AFAIK. See bug 160602 for details on that: "Large integers, e.g. getTime(), causing crash at 0x39393929" gsa@myrealbox.com: 1. What do you mean by the "javascript code does not work". Are you crashing? Does the image fail to refresh? What? 2. Are you getting any errors in Tools > Web Development > JavaScript Console? (be sure to clear it of any previous errors first) 3. Be sure to check your settings in Edit > Preferences > Privacy > Images, and Edit > Preferences > Advanced > Scripts & Plugins. Do you have any setting that would affect this code. In Scripts & Plugins, do you have the box "Allow scripts ... to change images" checked ?
Assignee: rogerl → asa
Component: JavaScript Engine → Browser-General
QA Contact: pschwartau → asa
image fails to refresh allow javascript to change images is deactivated
Attached file testcase
I believe this bug is INVALID. getTime() returns a long integer. Reporter, are you sure your images are named correctly?
> allow javascript to change images is deactivated As in the checkbox is not checked? Then how do you expect this to work?
I'm reading the reply in Comment 3 just as bz is. Reporter, is the box next to "allow javascript to change images" checked or not checked? (and please use the term checked)
tested on webcam site it works with scripts & plugins turned on <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN"> <title></title> [Crows Free Javascript Examples] Forcing an image to reload from the server instead of the browser's cache. <br> <HTML><HEAD><TITLE>Webcam</TITLE> <SCRIPT LANGUAGE="Javascript"><!-- function refreshCam(){ rfsh = new Date() ; rfsh = "?"+rfsh.getTime() document.images["0"].src = "http://wxnation.com/livecam/ccam.jpg"+rfsh setTimeout("refreshCam()", 60000) // 30secs } //--></SCRIPT> <IMG NAME="0" SRC="http://wxnation.com/livecam/ccam.jpg"> <SCRIPT LANGUAGE="Javascript"><!-- if( document.images ) // If browser support it... refreshCam(); // ...start refresher //--></SCRIPT>
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: