<!--JavaScript»ñÈ¡¿Í»§¶ËIP-->
<script type="text/javascript" language="javascript">
<!--
function GetLocalIPAddress()
{
var obj = null;
var rslt = "";
try
{
obj = new ActiveXObject("rcbdyctl.Setting");
rslt = obj.GetIPAddress;
obj = null;
}
catch(e)
{
//Òì³£·¢Éú
}
return rslt;
}
document.write("ÄãµÄIPÊÇ£º" + GetLocalIPAddress());
//-->
</script>
......
<div id="imgbox" style="height:110px;width:600px;overflow:hidden;">
<div id="imgbox1" style="float:left;width:1000%">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src=" ......
<div id="imgbox" style="height:110px;width:600px;overflow:hidden;">
<div id="imgbox1" style="float:left;width:1000%">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif" mce_src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.gif">
<img src=" ......
/*
* JavaScriptÖ®ÐÅÏ¢µÄ·â×°
* ÔÚ±àÂëǰ£¬ÎÒÃÇÐèÒªÁ˽âÈçϼ¸¸öÊõÓ
* ·â×°£º¶ÔÄÚ²¿Êý¾ÝµÄ±íÏÖÐÎʽºÍʵʩϸ½Ú½øÐÐÒþ²Ø£»
* ˽ÓÐÊôÐԺͷ½·¨£ºÍâ½çÖ»ÄÜͨ¹ýÆä¹«¿ªµÄ½Ó¿ÚÓëÆä½øÐдæÈ¡ºÍ½»»¥
* ×÷ÓÃÓò£ºJavaScriptÖУ¬Ö»Óк¯Êý¾ßÓÐ×÷ÓÃÓò£¬º¯ÊýÄÚ²¿¶¨ÒåµÄÊôÐԺͷ½·¨ÔÚÍⲿÎÞ·¨·ÃÎÊ
* ÌØÈ¨·½·¨£ºÉùÃ÷ÔÚº¯ÊýÄÚ²¿£¬ÄÜ·ÃÎʺ¯ÊýÄÚ²¿±äÁ¿£¨ÊôÐÔ£©µÄ·½·¨£¬±È½ÏºÄ·ÑÄڴ棻
*/
function Person()
{
/*
* ÉùÃ÷˽ÓеÄÊý¾Ý
* êdzƣ¬ÄêÁ䣬ÓÊÏä
*/
var nickName, age, email;
/*
* ÐèÒª·ÃÎÊ˽ÓÐÊý¾ÝµÄ·½·¨(ÌØÈ¨·½·¨)
* ÿÉú³ÉÒ»¸öʵÀý½«ÎªÌØÈ¨·½·¨Éú³ÉÒ»¸öеĸ±±¾
*/
this.setData = function(pNickName, pAge, pEmail)
{
nickName = pNickName;
age = pAge;
email = pEmail
};
this.getData = function()
{
return [nickName, age, email];
}
}
/*
* ²»ÐèÒªÖ±½Ó·ÃÎÊ˽ÓÐÊý¾ÝµÄ·½·¨£¨¹«Óз½·¨£©
* ²»¹ÜÉú³É¶àÉÙʵÀý£¬¹«Óз½·¨ÔÚÄÚ´æÖÐÖ»´æÔÚÒ»·Ý
*/
Person.prototype = {
showData: function()
{
alert("¸öÈËÐÅÏ¢£º" ......
/*
* ÔÚÍŶÓjs¿ò¼Ü½¨Éè¹ý³ÌÖÐдµÄÒ»¶Îä¯ÀÀÆ÷ÅжϴúÂë
* return £¨Array£©borwser
* ±ÈÈ統ǰä¯ÀÀÆ÷ÀàÐÍÊÇie6.0£¬ÄÇôborwserµÄÖµÓ¦¸ÃÊÇ[“ie”,"6","6.0"]
* Êý×éµÄµÚÒ»¸öÖµ±íʾä¯ÀÀÆ÷µÄÀàÐÍ£¬µÚ¶þ¸öÖµ±íʾä¯ÀÀÆ÷µÄ´ó°æ±¾£¬µÚÈý¸öÖµ±íʾä¯ÀÀÆ÷µÄÏêϸ°æ±¾ºÅ¡£
* @author sky
*/
var browser = function()
{
//ĬÈÏΪie6
var _a = ["ie", "6", "6.0"];
var _s = false;
var _ua = navigator.userAgent.toLowerCase();
//¼ì²âÕýÔò
var _pat = {
opera: /opera.([\d.]+)/,
ie: /msie ([\d.]+)/,
ff: /firefox\/([\d.]+)/,
chrome: /chrome\/([\d.]+)/,
safari: /safari\/([\d.]+)/,
mozilla: /rv:([\d.]+).+gecko/
};
for (var _t in _pat)
{
var _s = _ua.match(_pat[_t]);
if (_s)
{
_a = [_t, parseInt(_s[1]), _s[1]];
br ......
javascript¶ÔÏóÖ®——ÄÚÖöÔÏó“Math”
Math¶ÔÏóµÄһЩ·½·¨ÄÜʵÏÖÎÒÃǿα¾ÉϵÄijЩÊýѧ¼ÆË㣬±È½Ï³£Óõķ½·¨ÓÐÈçϼ¸¸ö£º
Ò»¡¢Math.min()ºÍMath.max()£¬·Ö±ð·µ»Ø²ÎÊýÖеÄ×îСºÍ×î´óÖµ
¡¡¡¡Àý£º
¡¡¡¡alert(Math.min(1,2,3))¡¡¡¡//Êä³ö “1”
¡¡¡¡alert(Math.max(1,2,3))¡¡¡¡//Êä³ö “3”
¶þ¡¢Math.abs()£¬·µ»Ø²ÎÊýµÄ¾ø¶ÔÖµ
¡¡¡¡Àý£º
¡¡¡¡alert(Math.abs(-1))¡¡¡¡//Êä³ö “1”
Èý¡¢Math.random()£¬²úÉúÒ»¸ö0µ½1µÄËæ»úÊý
¡¡¡¡Àý£º
¡¡¡¡window.open("http://www.***.com/index.shtml?t="+Math.random)¡¡¡¡//ÔÚurlµØÖ·ºóÃæ¼ÓÉÏÒ»¸öÖµÎªËæ¼´ÊýµÄ²ÎÊý£¬Äܱ£Ö¤Ò³ÃæÃ¿´Î¶¼´Ó·þÎñÆ÷ÉÏÖØÐÂÀÈ¡£¬¶ø²»ÊǶÁÈ¡»º´æ¡£
ËÄ¡¢Math.floor()£¬Math.round()£¬Math.ceil()
¡¡¡¡Math.floor()£º°ÑСÊýÏòÏÂÉáÈë³ÉÕûÊý¡¡¡¡¡¡¡¡Àý£ºalert(Math.floor(1.5))¡¡¡¡//Êä³ö“1”
¡¡¡¡Math.round()£º°ÑСÊý±ê×¼ËÄÉáÎåÈë³ÉÕûÊý¡¡¡¡Àý£ºalert(Math.round(1.5))¡¡¡¡//Êä³ö“2”
¡¡¡¡Math.ceil()£º°ÑСÊýÏòÉÏÉáÈë³ÉÕûÊý¡¡¡¡Àý£ºalert(Math.round(1.5))¡¡¡¡//Êä³ö“2”
¡¡¡¡ÀûÓÃÕâÈý¸öº¯Êý£¬ÔÚÉæ¼°Ð¡Êý¼ÆËãµÄʱºò¾ ......
1. BooleanÖµ¡¢Êý×Ö¡¢×Ö·û´®µÄÔʼֵÊÇα¶ÔÏó£¬ÕâÒâζ×ÅËûÃǾßÓÐÊôÐԺͷ½·¨¡£
var test = "hello";
alert(test.length); //outputs "5"
2. javascript Ëù¶¨ÒåµÄËùÓжÔÏó¶¼ÓÐ toString() ·½·¨£¬²»¹ÜÊÇα¶ÔÏó»¹ÊÇÕæµÄ¶ÔÏó£¬Boolean µÄ toString() ·½·¨Ö»·µ»Ø “true” »òÕß“false”¡£
var test = false;
alert(test.toString()); //outputs "false"
3. parseInt() ºÍ parseFloat()
alert(parseInt("1234test")); //outputs "1234"
alert(parseInt("0xA")); //outputs "10"
alert(parseInt("22.1")); //outputs "22"
alert(parseInt("test")); //outputs "NaN"
4. String() ºÍ toString() ΨһµÄÇø±ðÔÚÓÚ¶Ô null »òÕß undefined ÖµµÄÇ¿ÖÆ×ª»»ÉÏ¡£
var test = String(null) //"null"
var test1 = null;
var test2 = test1.toString(); //»á²úÉú´íÎó
5. Object “Àà”¡£
¾ßÓÐÒÔÏÂÊôÐÔ
Constructor---¶Ô´´½¨¶ÔÏóµÄº¯ÊýµÄÒýÓã¨Ö¸Õ룩¡£¶ÔÓÚ Object Àà¸ÃÖ¸ÕëÖ¸ÏòÔʼµÄ Object() º¯Êý¡£
Prototype---¶Ô¸Ã¶ÔÏóµÄ¶ÔÏóÔÐ͵ÄÒýÓá£
¾ßÓÐÒÔÏ·½·¨
HasOwnProperty(property)---Åж϶ÔÏóÊÇ·ñÓÐÌØ¶¨ ......