JavaScript³£ÓöÔÏóÏê½â
SCRIPT 񈬀
ÓÃÓÚ°üº¬JavaScript´úÂë.
ÊôÐÔ
LANGUAGE ¶¨Òå½Å±¾ÓïÑÔ
SRC ¶¨ÒåÒ»¸öURLÓÃÒÔÖ¸¶¨ÒÔ.JS½áβµÄÎļþ
window¶ÔÏó
ÿ¸öHTMLÎĵµµÄ¶¥²ã¶ÔÏó.
ÊôÐÔ
frames[] ×ÓèåÊý×é.ÿ¸ö×ÓèåÊý×é°´Ô´ÎĵµÖж¨ÒåµÄ˳Ðò´æ·Å.
feames.length ×Óèå¸öÊý.
self µ±Ç°´°¿Ú.
parent ¸¸´°¿Ú(µ±Ç°´°¿ÚÊÇÖÐÒ»¸ö×Ó´°¿Ú).
top ¶¥²ã´°¿Ú(ÊÇËùÓпɼû´°¿ÚµÄ¸¸´°¿Ú).
status ä¯ÀÀÆ÷״̬´°¿ÚÉϵÄÏûÏ¢.
defaultStatus µ±statusÎÞЧʱ,³öÏÖÔÚä¯ÀÀÆ÷״̬´°¿ÚÉϵÄȱʡÏûÏ¢.
name ÄÚ²¿Ãû,ΪÓÉwindow.open()·½·¨´ò¿ªµÄ´°¿Ú¶¨ÒåµÄÃû×Ö.
·½·¨
alert("message") ÏÔʾº¬Óиø¶¨ÏûÏ¢µÄ"JavaScript Alert"¶Ô»°¿ò.
confirm("message") ÏÔʾº¬Óиø¶¨ÏûÏ¢µÄ"Confirm"¶Ô»°¿ò(ÓÐÒ»¸öOK°´Å¥ºÍÒ»¸öCancel°´Å¥).Èç¹ûÓû§µ¥»÷OK·µ»Øtrue,·ñÔò·µ»Øfalse.
prompt("message") ÏÔʾһ¸ö"prompt"¶Ô»°¿ò,ÒªÇóÓû§¸ù¾ÝÏÔʾÏûÏ¢¸øÓèÏàÓ¦ÊäÈë.
open("URL","name") ´ò¿ªÒ»¸öд°¿Ú,¸øÓèÒ»¸öÖ¸¶¨µÄÃû×Ö.
close() ¹Ø±Õµ±Ç°´°¿Ú.
frame¶ÔÏó
ËüÊÇÕû¸öä¯ÀÀÆ÷´°¿ÚµÄ×Ó´°¿Ú,³ýÁËstatus,defaultStatus,nameÊôÐÔÍâ,ËüÓµÓÐwindow¶ÔÏóµÄÈ«²¿ÊôÐÔ.
location¶ÔÏó
º¬Óе±Ç°URLµÄÐÅÏ¢.
ÊôÐÔ
href Õû¸öURL×Ö·û´®.
protocol º¬ÓÐURLµÚÒ»²¿·ÖµÄ×Ö·û´®,Èçhttp:
host °üº¬ÓÐURLÖÐÖ÷»úÃû:¶Ë¿ÚºÅ²¿·ÖµÄ×Ö·û´®.Èç//www.cenpok.net/server/
hostname °üº¬URLÖÐÖ÷»úÃûµÄ×Ö·û´®.Èçhttp://www.cenpok.net
port °üº¬URLÖпÉÄÜ´æÔڵĶ˿ںÅ×Ö·û´®.
pathname URLÖÐ"/"ÒÔºóµÄ²¿·Ö.Èç~list/index.htm
hash "#"ºÅ(CGI²ÎÊý)Ö®ºóµÄ×Ö·û´®.
search "?"ºÅ(CGI²ÎÊý)Ö®ºóµÄ×Ö·û´®.
document¶ÔÏó
º¬Óе±Ç°ÎĵµÐÅÏ¢µÄ¶ÔÏó.
ÊôÐÔ
title µ±Ç°Îĵµ±êÌâ,Èç¹û䶨Òå,Ôò°üº¬"Untitled".
location ÎĵµµÄÈ«URL.
lastModified º¬ÓÐÎĵµ×îºóÐÞ¸ÄÈÕÆÚ.
r
Ïà¹ØÎĵµ£º
/**
* JavaScript ÊÇÃæÏò¶ÔÏóµÄÓïÑÔ£¬µ«ÊÇËûµÄÃæÏò¶ÔÏó²»ÊÇ»ùÓÚÀàµÄ£¬ÊÇ»ùÓÚÔÐ͵Ä;
* µ«ÊÇËûµÄһЩÌØÐÔ(º¯ÊýÊÇÊý¾Ý)£¬Ê¹µÃËü¿ÉÒÔÄ£Äâ»ùÓÚÀàµÄÃæÏò¶ÔÏ󣬵«ÊÇ JavaScript ²¢²»Ö§³ÖºÍ Java Ò»ÑùµÄÀ࣬
* Òò´Ë JavaScript ÖеÄ"Àà"¿ÉÒÔ³Æ×÷"αÀà"
*/
//
/**
* ¹¹Ô캯Êý: js ÖÐÓÃÀ´ºÍ new ÔËËã·ûÒ»ÆðʹÓõĺ¯Êý³Æ× ......
calcu() ----º¯ÊýʵÏÖÁ½¸öÊýÏà³Ë
document.write(); ---´òÓ¡
document.calc.ÔªËØÃû.value; --»ñµÃ±íµ¥µÄÖµ
document.±íµ¥Ãû¡£±íµ¥ÔªËØÃû¡£value Ϊ±íµ¥¸³Öµ
¶¨Ò庯Êý£º
function Ãû×Ö()
{
//javaScriptÔ¤Óï¾ä
}
onClick="º¯ÊýÃû";  ......
C#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃ
ÎÊ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
ÎÊÌâ1´ð°¸ÈçÏ£º
javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ ......
<SCRIPT>
//ÅжÏyÄêµÄÅ©ÀúÖÐÄǸöÔÂÊÇÈòÔÂ,²»ÊÇÈòÔ·µ»Ø0
function leapMonth(y){
return(lunarInfo[y-1900]&0xf);
}
var lunarInfo=new Array(
0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0 ......
XMLHttpRequest Script Injection XHR½Å±¾×¢Èë
Another approach to nonblocking scripts is to retrieve the JavaScript code using an XMLHttpRequest (XHR) object and then inject the script into the page. This technique involves creating an XHR object, downloading the JavaScript f ......