Im tyrying use following code to browse an image and preview it before uploading.Its not working for jpeg image.Can anybody suggest changes or new code for it
maxWidth) { y*=maxWidth/x; x=maxWidth; } if (y>maxHeight) { x*=maxHeight/y; y=maxHeight; } field.style.display=(x<1 || y<1)?"none":""; field.src=globalPic.src; field.width=x; alert("3."+field.width); field.height=y; alert("4."+field.height); } // End -->
Test it by locating a valid file on your hard drive:

Script submitted by: Sydney Wedding Video / DVD
Free JavaScripts provided
by The JavaScript Source
Comments
Comment #1
btopro commented