JavaScript TextBoxÊäÈëÊý×Ö¿ØÖÆ
var OnPasteCheckIntNum = function()
{
if(window.clipboardData)
{
if(isNaN(window.clipboardData.getData('text')))
{
clipboardData.setData('text','');
}
else
{
//clipboardData.setData('text',clipboardData.getData('text'))
clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))
}
}
else if(navigator.userAgent.indexOf("Opera") != -1)
{
if(isNaN(window.location))
{
//window.location = window.location.replace(/[^\d]/g,'');
window.location = '';
}
}
};
var OnPasteCheckDecimal = function(id)
{
return function()
{
if(window.clipboardData)
{
if(isNaN(window.clipboardData.getData('text') + id.value))
{
clipboardData.setData('text','');
}
&n
Ïà¹ØÎĵµ£º
<SCRIPT LANGUAGE="JavaScript">
var s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß ......
±¾ÎIJο¼×Ô£ºhttp://www.cnblogs.com/mophee/archive/2009/03/15/1412590.html
¿´µ½Ò»²©¿ÍÀï̽ÌÖjavascript Àï×÷ÓÃÓòµÄÎÊÌâ
Àý×Ó1£º
var tt = 'aa';
function test(){
alert(tt);
var tt = 'dd';
alert(tt);
}
test();
Àý×Ó2£º
var tt = 'aa';
funct ......
alert(parseInt("101101", 2))
ÔËÐдúÂë
function toBin(intNum) {
var answer = "";
if(/\d+/.test(intNum)) {
while(intNum != 0) {
answer = Math.abs(intNum%2)+answer;
intNum = parseInt(intNum/2);
}
......
JavaScript ECMAScriptÊÇÕâ¸ö½Å±¾ÓïÑԵıê×¼»¯°æ±¾¡£ ScriptÔªËØ£º ÔÚHTML´úÂëÖÐÌí¼ÓJavaScript´úÂë Ò²¿ÉÒ԰ѽű¾´úÂë·ÅÔ ......