javascript ѧϰ±Ê¼Ç£¨6£©
1. window ¶ÔÏóÊÇÕû¸ö BOM µÄºËÐÄ,ËùÓжÔÏóºÍ¼¯ºÏ¶¼ÒÔijÖÖ·½Ê½»Ø½Óµ½ window ¶ÔÏó.
window ¶ÔÏó±íʾÕû¸öä¯ÀÀÆ÷´°¿Ú,µ«²»±íʾÆäÖаüº¬µÄÄÚÈÝ.
2. ¿ª·¢Õß¿ÉÒÔʹÓà window ¶ÔÏóÒƶ¯ºÍµ÷Õûä¯ÀÀÆ÷´°¿ÚµÄ±íÏÖÐÎʽ.
window.moveBy(dx,dy); //Ïà¶Ôµ±Ç°Î»ÖÃ,ˮƽÒƶ¯dx¸öÏñËØ,´¹Ö±Òƶ¯dy¸öÏñËØ
window.moveTo(x,y); //Òƶ¯µ½(x,y)λÖÃ
window.resizeBy(dw,dh); //Ïà¶Ôµ±Ç°´óС¸Ä±ä(dx,dy)
window.resizeTo(w,h); //´°¿Ú´óСµ÷ÕûΪ(x,y)
3. ¿ÉÒÔÓà window.open() ·½·¨´ò¿ªÐ´°¿Ú.ʹÓà window.close() ¹Ø±Õд°¿Ú.
window.open("http://www.xxx.com","anyFrame","height=550,width=12,top=23,left=222,resizable")
4. д°¿Ú»¹ÓжԴò¿ªËüµÄ´°¿ÚµÄÒýÓÃ,´æ·ÅÔÚopenerÊôÐÔÖÐ,Ö»ÔÚд°¿ÚµÄ×î¸ß²ã window ¶ÔÏó²ÅÓÐ opener ÊôÐÔ.
var test = window.open("http://www.xxx.com","anyFrame","height=550,width=12,top=23,left=222,resizable");
alert(test.opener == window); //outputs "true"
5. ¿ÉÒÔʹÓà window ¶ÔÏóµÄ3Öз½·¨µ¯³öÐÅÏ¢.alert(),confirm(),prompt().
alert():Ö»ÏÔʾOK°´Å¥
confirm():ÏÔʾOK°´Å¥ºÍcancel°´Å¥
prompt():ÏÔʾOK°´Å¥ºÍcancel°´Å¥,»¹ÓÐÎı¾¿ò.
6. ¿ÉÒÔͨ¹ý window.status ºÍ window.defaultStatus ÕâÁ½¸öÊôÐÔÖµÉèÖô°¿Ú״̬À¸ÐÅÏ¢.
status ÊôÐÔ¿ÉÒÔÁÙʱ¸Ä±ä״̬À¸ÐÅÏ¢
defaultStatus ÊôÐÔ¿ÉÒÔÔÚÓû§À뿪´°¿Úǰʹ״̬À¸Ò»Ö±ÏÔʾ¸ÃÎı¾
window.defaultStatus = "hello world!";
or
<a href="#" mce_href="#" onmouseover="window.status='hello world'">hello world</a>
7. ¿ÉÒÔʹÓà window ¶ÔÏóµÄ history ÊôÐÔ¼°Æä·½·¨·ÃÎÊä¯ÀÀÆ÷´°¿ÚµÄÀúÊ·.
//ºóÍËÒ»Ò³
window.history.go(-1);
//or
window.history.back();
//Ç°½øÒ»Ò³
window.history.go(1);
//or
window.history.forward();
//²é¿´ÀúÊ·Ò³ÃæÊý,ÕâÑù¿ÉÒÔÖªµÀ¿ÉÒÔÇ°½ø»òÕߺóÍ˶àÉÙÒ³
window.history.length
Ïà¹ØÎĵµ£º
50¸öʵÓõÄJavaScript¹¤¾ß- - JavaEye¼¼ÊõÍøÕ¾
JavaScriptÊÇÒ»¸ö¹¦ÄÜÇ¿´óµÄ¿Í»§¶Ë½Å±¾ÓïÑÔ£¬Ðí¶àÏÖ´ú»¯µÄÍøÕ¾ºÍWebÓ¦ÓóÌÐò¶¼»áʹÓõ½Ëü¡£JavaScript¿ÉÒÔÔöÇ¿Óû§µÄÌåÑ飬²¢Ìṩ·á¸»µÄ»¥¶¯Ê½×é¼þºÍ¹¦ÄÜ¡£ËäÈ»ËüµÄÓï·¨Ï൱¼òµ¥£¬µ«ÊǶԿª·¢ÕßÀ´Ëµ»¹ÊǺÜÓÐÄѶȵģ¬ÒòΪËüÒªÔËÐÐÔÚWebä¯ÀÀÆ÷ÖС£
¡¡¡¡ÒÔÏÂÊÇÎÒÃÇΪÄãÍƼöµÄ50¸ ......
ÌØÊâJavaScript½Å±¾£º
1.½ûÓÃ(»Ö¸´)href³¬¼¶Á´½Ó£®
2.javascriptÖе÷ÓÃvbs¶Ô»°¿òʵÏÖConfirm,¿ÉÒÔÏÔʾYes,No,»¹Óи÷ÖÖͼ±ê£¬½öIEÏÂÓÐЧ£®
3.ÏÞÖÆÉÏ´«ÎļþÀàÐÍΪjpg.
4.ÏÞÖÆÀ뿪µ±Ç°Ò³Ã棬ÔÚÀ뿪ʱÌáʾ£®½öÏÞÖÆ´°¿Ú¹Ø±Õ»òͨ¹ýij¸öhref³¬¼¶Á´½ÓÀ뿪£®(Ò³Ãæˢк͵ØÖ·À¸¸Ä±äʱ²»Ìáʾ£©
demo.htmlÈçÏ£º
<html>
&n ......
css,javascriptµÄÔ¤¼ÓÔØ
ΪÁËÌá¸ßÍøÕ¾µÄ¼ÓÔØËٶȣ¬ÓÐÒ»¸öºÜÖØÒªµÄÊֶξÍÊÇÔÚÓû§ä¯ÀÀ¹ý³ÌÖеÄÉÏÓÎÍøÕ¾×öÒ»¸öÎļþµÄÔ¤¼ÓÔØ¡£Ô¤¼ÓÔØÎļþÒ»°ãÓÐÁ½ÖÖ³£Óõķ½Ê½£ºxhrºÍ¶¯Ì¬²åÈë½ÚµãµÄ·½Ê½¡£¶¯Ì¬²åÈë½ÚµãÊÇ×îΪ¼òµ¥Ò²×îΪ¹ã·ºµÄÒ»ÖÖÒì²½¼ÓÔØ·½Ê½(ÀýÈçyuiµÄGetÄ£¿é)£¬È»ºóʹÓö¯Ì¬²åÈë½Úµã·½·¨¼ÓÔصÄÎļþ¶¼»áÔÚ¼ÓÔغóÁ¢¼´Ö´ÐУ¬ ......
ǰ̨£º
<%@ Page AutoEventWireup="true" CodeBehind="CustomerBizList.aspx.cs" Inherits="SSMIS.UI.MISUI.CustomerBizList"
Language="C#" MasterPageFile="/Master/WebAdmin.master" %>
<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="bcr">
......
´ò¿ªÇëÇó
¡¡¡¡ÓÐÁËÒªÁ¬½ÓµÄ URL ºó¾Í¿ÉÒÔÅäÖÃÇëÇóÁË¡£¿ÉÒÔÓà XMLHttpRequest ¶ÔÏóµÄ open() ·½·¨À´Íê³É¡£¸Ã·½·¨ÓÐÎå¸ö²ÎÊý:
request-type:·¢ËÍÇëÇóµÄÀàÐÍ¡£µäÐ͵ÄÖµÊÇ GET »ò POST£¬µ«Ò²¿ÉÒÔ·¢ËÍ HEAD ÇëÇó¡£
url:ÒªÁ¬½ÓµÄ URL¡£
asynch:Èç¹ûÏ£ÍûʹÓÃÒì²½Á¬½ÓÔòΪ true£¬·ñÔòΪ false¡£¸Ã²ÎÊýÊÇ¿ÉÑ¡µÄ£¬Ä¬ÈÏΪ true¡£
......