KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

Best books about Javasript

java script,javascript, javascript detect chinese input formDetect image size using Javascript

If you host image gallery business, sometimes you need limit the uploading image size. You may use the following javascript to check the image size.

First you may take a look at the following demo.


javascript java script flash check detectHow to do it.

Copy the following code to your web page <head></head> section.

function imgExceedSize(w,h){
if(img.width>w || img.height>h){
alert("Image size:"+img.width+"X"+img.height+"。Image too big!Please make it less than "+w+"×"+h);
return true;
return false;
return true;

function detect(){
var ok=imgExceedSize(20,20); //20,20 are size limitation

//success uploading image


You set imgExceedSize(width,height); to your desired image size.



Best books about ASP & ASP.Net from Amazon
JavaScript Bible, Fifth Edition (Paperback) JavaScript & DHTML Cookbook (Paperback) JavaScript: The Definitive Guide (Paperback) Beginning JavaScript Second Edition (Paperback) JavaScript: The Complete Reference, Second Edition (Paperback)


Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © All rights reserved(new). Privacy|Copyright
designed by

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer