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:







Only local images are allowed.


Script submitted by: Sydney Wedding Video / DVD


Free JavaScripts provided

by The JavaScript Source

Comments

btopro’s picture

Status: Active » Closed (fixed)