Reply to Thread List displays all replies show star Replies Show scores Reply Urgent! ! ! Online! ! Why give img src tag assignment, IE can display images, but Firefox does not show

Category: Web Develop
 
xu1009800190
2013-08-20 04:31:00

Sponsored Links
Code is as follows, I want to get the address on file tab under img src on, IE can display images, but Firefox does not how this is going? Urgent! ! !
Online
</script>

<script type="text/javascript">

; $ ("# supPhoto"). change (function () {
/ / alert ($ ("# supPhoto"). val ());
document.getElementById ("bigImage"). src = $ ("# supPhoto"). val ();

});

</script>

</head>
<body>
<div id = imgContainer ; class = imgContainer> <img id=bigImage src="${photoPath}" /> </div>
<tr>
<td height="40">
<s: file name = "supPhoto" id = "supPhoto" class = " ; gensched-37 "> </ s: file>

<input type =" hidden "name =" proId "value = "$ {proId}">
<input type="hidden" name="proPath" value="${proPath}">

</td>
<td>

</td>
</tr>

</body>

</html>

Sponsored Links

q260829437
2013-08-20 04:36:48
This is the compatibility problems. . .
skyey111
2013-08-20 04:51:42
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN">
<HTML>
<HEAD>
<TITLE> image is loaded automatically after rotation </TITLE>
<META NAME = "Generator" ; CONTENT = "EditPlus">
<META NAME="Author" CONTENT="YangHui">
<META ; NAME = "Keywords" CONTENT = "YangHui">
<META NAME="Description" CONTENT="YangHui">
; </HEAD>

<BODY>
<IMG name = "animation" SRC = "images/0.gif" WIDTH = "180" HEIGHT = "200" BORDER = "0" ALT = "crystal clear">
<SCRIPT LANGUAGE = " ; JavaScript ">
<! -
var frame = 0;
var timeout_id = null;

function animate () {
document.animation.src = aniframes [frame]. src;
if (frame == 3)
{
frame = 0;
} else {
frame = (frame + 1)% 10;
}
; timeout_id = setTimeout ("animate ()", 500);
}

var aniframes = new Array (4);
var num_loaded_images = 0;

function countImages () {
if (+ + num_loaded_images == aniframes.length)
{
animate ();
}
}

for (var i = 0; i <4; i + +)
{
aniframes [i] = new Image ();
aniframes [i]. onload = countImages;
aniframes [i]. src = "images /" + i + ". gif";
}
/ / ->
</SCRIPT>
</BODY>
</HTML>
liuzhen123
2013-08-20 05:07:56
/ / image preview code, for reference
var imgPath; / / Image path
var Browser_Agent = navigator.userAgent;
var Preview = document.getElementById (divImage) ;
Preview.innerHTML = "";

if (Browser_Agent.indexOf ("Firefox")! = -1) / / Determine the Browser The type
{
/ / Firefox browser
imgPath = upload.files [0]. getAsDataURL ();
Preview.innerHTML = " <img id = 'imgPreview' src = '"+ imgPath
+"' width = '"+ width +" ; 'height =' "+ height +" '/> ";
}
nickzhu_7
2013-08-20 05:13:56
I tried it, it seems no matter ah
zhougch
2013-08-20 05:20:00
My FF6.0.2 no problem
kangxiao2005
2013-08-20 05:35:52
My version is low, put you on my page on this, but to do so, let me see you complete The code for this is very grateful
benxiong111
2013-08-20 05:38:28
/ / =================================== ================================================== ===============
/ / [Name] Image preview
/ / ----- -------------------------------------------------- ---------------------------------------------
/ / [description] upload chart preview, display the preview image Div and the image size can be set up their own
/ / ------------ -------------------------------------------------- --------------------------------------
/ / [Parameter]
/ / divImage Show preview pictures Div
/ / upload upload control
/ / ; width Image width
/ / height ; Image Height
/ / ------------------------------------- -------------------------------------------------- -------------
/ / [Example of use]
/ / <div id = "Preview" ; style = "filter: progid: DXImageTransform.Microsoft.AlphaImageLoader (sizingMethod = scale);"> </div>
/ / <input ; name = "uploadIamge" type = "file" onchange = "PreviewImage ('Preview', this, 20,20);" />
/ / === ================================================== ===============================================

function PreviewImage (divImage, upload, width, height) {
if (upload.value == "") {
return false ;
}

var isImage = / \. jpg | \. jpeg | \. gif | \. png | \. bmp $ / i;
if ; (! isImage.test (upload.value)) {
alert ("Image format errors, please re-select!");
return false;
}

var imgPath; / / Image path
var Browser_Agent = navigator.userAgent;
var Preview = document.getElementById (divImage);
Preview.innerHTML = "";

if (Browser_Agent.indexOf ("Firefox")! = ; -1) / / Determine the type of browser
{
/ / Firefox browser
imgPath = upload.files [0]. getAsDataURL ();
Preview . innerHTML = "<img id = 'imgPreview' src = '" + imgPath
+ "' width = '" + width + "'height ='" + height + "'/>";
} else {
if (navigator.userAgent.indexOf ("MSIE 6.0") == -1
&& navigator.userAgent.indexOf ("MSIE")> -1) {
upload.select ();
var imgSrc = document.selection.createRange (). text;
/ / IE7, 8 preview

Preview.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader"). src = imgSrc;
Preview.style.width = width;
Preview.style.height = height;
} else {
/ / IE6 preview
Preview.innerHTML = "<img id = 'image_view_ "+"' src = '"
+ upload.value +"' style = 'width: "+ width + "px; height:"
+ height + "px; '/>";
}
}
}
ggdxz
2013-08-20 05:44:34
<div id="Preview" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);"> </div>
<input name = "imageFile" id = "imageFile" type = "file" onchange = "PreviewImage ('Preview ', this, 400,240); "/>
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.