JavaScript "complete" property always returns "true"

RESOLVED INVALID

Status

()

Firefox
General
RESOLVED INVALID
13 years ago
13 years ago

People

(Reporter: claudio, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

173 bytes, text/html
Details
(Reporter)

Description

13 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)
Build Identifier: Firefox 1.0.4

The JavaScript "complete" property is a boolean value that indicates whether 
the web browser has completed its attempt to load an image. It is a property of
"Image". I am using it to check whether preloaded images are ready for use.

It should return "false" (as it does in IE) if you try to load a non-existing 
file, but it always returns "true" in FireFox. Please try the following code: 

<HTML>
<HEAD>
</HEAD>

<BODY>

<SCRIPT type="text/javascript">
image1=new Image()
image1.src='fakeurl.jpg'
alert(image1.complete)
</SCRIPT>

</BODY>

</HTML>

Reproducible: Always

Steps to Reproduce:
1. just try the html code I wrote in "details" above. Thanks!
Actual Results:  
returns "true"

Expected Results:  
should return "false"
(Reporter)

Comment 1

13 years ago
Created attachment 185452 [details]
test case
Returns "false" using Firefox 1.1a1.

Comment 3

13 years ago
Bug 190561 says this is deliberate to avoid a potential security issue.

Comment 4

13 years ago
i get false as well

Comment 5

13 years ago
I get "true" now. See comment 3 for explanation.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.