Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScriptÑéÖ¤ÉÏ´«Îļþ¸ñʽ¼°´óС

ÔÚÉÏ´«²Ù×÷ÖУ¬¾­³£»áÓöµ½ÒªÇóÖ¸¶¨ÉÏ´«ÎļþµÄ¸ñʽ£¬ÏÂÃæµÄʵÀýÊÇÔÚ¿Í»§¶Ëͨ¹ýJavaScriptÑéÖ¤ÉÏ´«Í¼Æ¬¸ñʽΪjpg/gif/png
<html>
<head>
<mce:script language="JavaScript" type="text/JavaScript"><!--

var img=null;
function checkPic(picForm){
var location=picForm.pic.value;
if(location==""){
alert("ÇëÏÈÑ¡ÔñͼƬÎļþ");
return false;
}
var point = location.lastIndexOf(".");
var type = location.substr(point);
if(type==".jpg"||type==".gif"||type==".JPG"||type==".GIF"||type==".PNG"||type==".png"){
img=document.createElement("img");
img.src=location;
if(img.fileSize>102400){
alert("ͼƬ³ß´çÇë²»Òª´óÓÚ100KB");
return false;
}else
return true;
}
else{
alert("Ö»ÄÜÊäÈëjpg»òÕßgif¸ñʽµÄͼƬ");
return false;
}
return true;
}

function changesrc(){
yourpic.src=picForm.pic.value;
}
// --></mce:script>
</head>
<body>
<table width="100%" border="0">
<tr>
<td>
<div align="center"><img border="1" id="yourpic"
onload="javascript:if(this.width>175)this.width=175;if(this.height>150)this.height=150;">
</div>
</td>
</tr>
<form name="picForm" action="#" method="post"
enctype="multipart/form-data" onsubmit="return checkPic(picForm);">
<tr>
<td>
<div align="center"><input type="file" name="file" size="10"
id="pic" onchange="changesrc()"/></div>
</td>
</tr>
<tr>
<td>
<div align="center"><input type="submit" value="ÉÏ´«ÕÕÆ¬" /></div>
</td>
</tr>
</table>
</body>
</html>
ÕâÖÖÅжÏÖ»ÊÇÒ»¸ö³õ²½µÄÅжϣ¬µ±ÉÏ´«ÎļþΪÐ޸ĸñʽµÄÇ


Ïà¹ØÎĵµ£º

JavaScript ÅжÏÎļþÊÇ·ñ´æÔÚ

1. ¿Í»§¶Ë //Ö÷ÒªÕë¶Ô±¾µØIEä¯ÀÀÆ÷·ÃÎÊ
<script
language="javascript">
function FileExist()
{
     var sfso=new
ActiveXObject("Scripting.FileSystemObject");
     var fPath="[The path of the
file]";
     if(sfso.FileExists(fP ......

JavaScriptÎļþ²Ù×÷

Ò»¡¢¹¦ÄÜʵÏÖºËÐÄ£ºFileSystemObject ¶ÔÏó
    ÒªÔÚjavascriptÖÐʵÏÖÎļþ²Ù×÷¹¦ÄÜ£¬Ö÷Òª¾ÍÊÇÒÀ¿¿FileSystemobject¶ÔÏó¡£
¶þ¡¢FileSystemObject±à³Ì
ʹÓÃFileSystemObject ¶ÔÏó½øÐбà³ÌºÜ¼òµ¥£¬Ò»°ãÒª¾­¹ýÈçϵIJ½Ö裺 ´´½¨FileSystemObject¶ÔÏó¡¢Ó¦ÓÃÏà¹Ø·½·¨¡¢·ÃÎʶÔÏóÏà¹ØÊôÐÔ ¡£
£¨Ò»£©´´½¨FileSy ......

10¸öÓÅÐãµÄAjaxºÍJavascript¹úÍâ×ÊÔ´ÍøÕ¾

10¸öÓÅÐãµÄAjaxºÍJavascript¹úÍâ×ÊÔ´ÍøÕ¾
×ªÔØµØÖ·£ºhttp://www.zzsky.cn/build/content/1246.htm
        1¡¢Ajax Rain: http://www.ajaxrain.com
¡¡¡¡AjaxRainÓкܶàÍêÃÀÕûºÏAjax¡¢CSS¡¢DHTML»òJavascriptµÄʵÀý£¬ÓÐһЩDemoµÄÈ·ÖµµÃÄãÈ¥¿´Ò»¿´£¬¼´Ê¹Äã²»ÊÇÍøÒ³Éè¼Æ£¨¿ª·¢£©Ê¦¡ ......

javascript ½ûÖ¹Êó±êÓÒ¼ü...

<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" onmouseup=document.selection.empty() oncopy=document.selection.empty() onselect=document.selection.empty()></body>
½²ÉÏÃæºìÉ«ÏÔʾµÄ²åÈëµ½ÍøÒ³ÖоͿÉÒÔʵÏÖÊó±êÓÒ»÷ÎÞЧ
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ