原帖:http://topic.csdn.net/u/20100421/16/817ef7c6-6675-49e1-bf39-b4a96c08b41e.html1、字串轉換為數值常規方法Code:var a = parseFloat("12"); var b = parseInt("34"); 可以用Code:var a = +("12"); var b = +("34"); 差別:Code:parseInt("12px"); // 12 +("12px"); // NaN 2、**
FunctionBase 函數基類檔案:FunctionBase.jsvar $FunctionMapper = [];// Global function mapperfunction $RegisterFunction(funcObj) { if ($FunctionMapper[funcObj.get_FunctionName().toLowerCase()] != null) throw new Exception(this, "$RegisterFunction:"
function CheckUser(){ var obj=document.getElementById("checkUser"); var str=document.getElementById("TxtUserName").value; obj.className="Right"; obj.innerHTML='正在檢查,請稍候...'; if(str.length==0) {
write a javascript timerrequirement: write a javascript timer: it should alert a dialog after certain timer, the dialog has two buttons. click one of them, the page will refresh automatically; click the other, nothing will happen. deploy it on
歡迎大家提出寶貴的意見和建議,歡迎批評指正!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type"
function CheckPsw()...{ var p=document.getElementById("TxtPsw").value; if(p.length==0) ...{ checkPsw="false"; SetCheckPsw(checkPsw); return; } var Expression=/^[A-Za-z0-9]+$/; var regExp=new RegExp(Expression)