javascript »ñÈ¡file±íµ¥È«Â·¾¶
ÔÚie6ÖжÔÓÚ<input type="file"
/>ͨ¹ýobj.valueÊÇ¿ÉÒÔ»ñÈ¡¿Í»§¶ËÑ¡ÔñÎļþµÄȫ·¾¶µÄ£¬µ«Êǵ½ie7¾ÍÖ»ÄÜ»ñÈ¡ÎļþÃû£¬Õâ¶ÔÓÚonchangeʼþÁ¢¼´ÏÔʾͼƬ»áÓÐÎÊÌ⣬¿ÉÒÔÓÃjs·½·¨½â¾ö
¾ßÌå´úÂëÈçÏ£º
<html>
<head>
<title>get file input full path</title>
<script
language='javascript'>
function getFullPath(obj)
{
if(obj)
{
//ie
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
obj.select();
return document.selection.createRange().text;
}
//firefox
else
if(window.navigator.userAgent.indexOf("Firefox")>=1)
{
if(obj.files)
Ïà¹ØÎĵµ£º
ÓÃcall·½·¨ÊµÏּ̳Ð
function classA(sColor){
this.color=sColor;
this.sayColor=function(){
alert(this.color);
......
<script language="javascript" type="text/javascript">
var TempTime=new Date().getTime();
function StayTime(){
var NowTime=new Date().getTime();
var Time=NowTime-TempTime;
var&nb ......
eval()º¯Êý
JavaScriptÓÐÐí¶àСÇÏÃÅÀ´Ê¹±à³Ì¸ü¼ÓÈÝÒס£
ÆäÖÐÖ®Ò»¾ÍÊÇeval()º¯Êý£¬Õâ¸öº¯Êý¿ÉÒÔ°ÑÒ»¸ö×Ö·û´®µ±×÷Ò»¸öJavaScript±í´ïʽһÑùÈ¥Ö´ÐÐËü¡£
¾Ù¸öСÀý×Ó£º
var the_unevaled_answer = "2 + 3";
......
»ù±¾ÉÏÿ¸ö¿â¶¼ÓÐÕⶫÎ÷£¬ÒòΪÈç¹ûÒª¶ÔÒ³ÃæÉϵÄÔªËؽøÐвÙ×÷£¬ÎÒÃDZØÐëµÈµ½Ò³Ãæ¼ÓÔØÁËÕâ¸öÔªËزÅÐУ¬·ñÔò»á±¨´í£¬µ«ÊÇÎÒÃǺÜÄÜÅж¨Ä³¸öÔªËØÊÇ·ñÒѼÓÔØ£¬µ«ÎÒÃÇ¿ÉÒÔÅж¨Ò³ÃæÊÇ·ñ¼ÓÔØ£¬Õâ¾ÍÊÇÎÒÃǾ³£°Ñ´úÂë·Åµ½window.onload = function(){}Ö®ÖеÄÔµÓÉ¡£µ«window.onloadʼþÊÇ´ýµ½Ò³ÃæÉϵÄËùÓÐ×ÊÔ´±»¼ÓÔزż¤»î£¬Èç¹ûÒ³ÃæÉÏÓ ......
1.document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃ() ......