T
Tim Streater
The following test page is intended to allow the user to choose an image
file, and then display it. It works as expected in Safari 3.1.1, FF
2.0.0.14 (Mac), and IE7 (XP).
But, it fails in FF 2.0.0.14 (Win-XP) - the image doesn't appear. The
error console shows no errors and Page Info, under the media tab, shows
no loaded image (in contrast to FF Mac which shows the image).
The images I select are all jpegs, btw.
Any pointers would be appreciated - thanks.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Image with a Javascript preview.</title>
<script type="text/javascript">
function preview()
{
var filename = document.form1.filesent.value;
var Img = new Image ();
Img.src = filename;
document.images[0].src = Img.src;
alert ("Filename: '" + filename + "' width: " + Img.width + "
height: " + Img.height);
}
</script>
</head>
<body>
<h3>File Upload - v020</h3>
<form name='form1'>
<input type=file name=filesent>
<input type=button value="Preview" name="Preview" onClick="preview()">
</form>
<p>Image follows</p>
<img name="image1">
</body>
</html>
file, and then display it. It works as expected in Safari 3.1.1, FF
2.0.0.14 (Mac), and IE7 (XP).
But, it fails in FF 2.0.0.14 (Win-XP) - the image doesn't appear. The
error console shows no errors and Page Info, under the media tab, shows
no loaded image (in contrast to FF Mac which shows the image).
The images I select are all jpegs, btw.
Any pointers would be appreciated - thanks.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Image with a Javascript preview.</title>
<script type="text/javascript">
function preview()
{
var filename = document.form1.filesent.value;
var Img = new Image ();
Img.src = filename;
document.images[0].src = Img.src;
alert ("Filename: '" + filename + "' width: " + Img.width + "
height: " + Img.height);
}
</script>
</head>
<body>
<h3>File Upload - v020</h3>
<form name='form1'>
<input type=file name=filesent>
<input type=button value="Preview" name="Preview" onClick="preview()">
</form>
<p>Image follows</p>
<img name="image1">
</body>
</html>