һ˿javascript·½·¨
///
<summary>
///
һЩ³£ÓõÄJavascript·½·¨
///
</summary>
public
static
class
Jscript
{
///
<summary>
///
µ¯³öÌáʾ¿ò
///
</summary>
public
static
void
Alert(Page page,
string
msg)
{
string
js
=
@"
alert('
"
+
msg
+
"
')
"
;
if
(
!
page.ClientScript.IsStartupScriptRegistered(page.GetType(),
"
Alert
"
))
page.ClientScript.RegisterStartupScript(page.GetType(),
"
Alert
"
, js,
true
);
}
///
<summary>
///
µ¯³öÌáʾ¿ò²¢Ìøתµ½Ö¸¶¨Ò³Ãæ
///
</summary>
public
static
void
AlertAndRedirect(Page page,
string
msg,
string
ToURL)
{
string
js
=
@"
alert('{0}');window.location.replace('{1}');
"
;
js
=
string
.Format(js, msg, ToURL);
if
(
!
page.ClientScript.IsStartupScriptRegistered(page.GetType(),
"
AlertAndRedirect
"
))
page.ClientScript.RegisterStartupScript(page.GetType(),
"
AlertAndRedirect
"
,js,
true
);
}
///
<summary>
///
·µ»ØÀúÊ·
///
</summary>
public
static
void
GoHistory(Page page,
int
value)
{
string
js
=
@"
history.go('{0}')
"
;
if
(
!
page.ClientScript.IsStartupScriptRegistered(page.GetType(),
"
GoHistory
"
))
page.ClientScript.RegisterStartupScript(page.GetType(),
"
GoHistory
"
,
string
.Format(js, value),
true
);
}
///
<summary>
///
¹Ø±Õ²¢Ê¹¸¸´°¿Ú¸ù¾ÝURLË¢ÐÂ
///
</summary>
public
static
void
Ref
Ïà¹ØÎĵµ£º
ÔÌûµØÖ·£ºhttp://www.followman.com/bbs/Topic-B11-T262.aspx
JavaScript¶¯Ì¬ÏìÓ¦ATLʼþ
Ïà¹ØÌÖÂÛ:http://topic.csdn.net/t/20061012/21/5078729.html
ÖØ
µã£º½Å±¾´«¹ýÀ´µÄ¶ÔÏóÊÇIDispatch½Ó¿Ú£¬Ó¦¸ÃÓÃIDispatch::InvokeÀ´µ÷Óá£Èç¹û´«¹ýÀ´µÄÊǸöfunction£¬ÄÇôDISPID
Ϊ0£¬Èç¹ûÊǸö¶ÔÏó£¬ÄÇôҪÏÈÓÃGetIDsOfNamesµÃ ......
ÖÆ×÷Javascriptµ¯³ö´°¿Ú¼¼ÇɾÅÔò
1¡¢×î»ù±¾µÄµ¯³ö´°¿Ú´úÂë
¡¡¡¡Æäʵ´úÂë·Ç³£¼òµ¥£º
¡¡¡¡< SCRIPT LANGUAGE="javascript">
¡¡¡¡< !--
¡¡¡¡window.open ("page.html")
¡¡¡¡--
>
¡¡¡¡< /SCRIPT>
¡¡¡¡ÒòΪÕâÊÇÒ»¶ÎJavascript´úÂ룬ËùÒÔËüÃÇÓ¦¸Ã·ÅÔÚ< SCRIPT LANGUAGE="javascript">Ö®¼ä¡£ ......
JavaScript ʱ¼ä¼Ó¼õ:
<HTML>
<BODY>
<script type="text/javascript">
var time = new Date("04/30/2010");
document.write(time);
......
Ò»¸öÍêÕûµÄʼþϵͳ£¬Í¨³£´æÔÚÒÔÏÂÈý¸ö½ÇÉ«£º
ʼþ¶ÔÏó£¬ÓÃÓÚ´¢´æʼþµÄ״̬¡£
ʼþÔ´¶ÔÏ󣬵±Ç°Ê¼þÔÚ²Ù×÷µÄ¶ÔÏó£¬ÈçÔªËؽڵ㣬Îĵµ¶ÔÏó£¬window¶ÔÏó£¬XMLHttpRequest¶ÔÏóµÈ¡£
ʼþ¼àÌýÆ÷£¬µ±Ò»¸öʼþÔ´Éú³ÉÒ»¸öʼþ¶ÔÏóʱ£¬Ëü»áµ÷ÓÃÏàÓ¦µÄ»Øµ÷º¯Êý½øÐвÙ×÷¡£ÔÚIEÖУ¬Ê¼þ¶ÔÏóºãΪȫ¾ÖÊôÐÔwindow.eventµÄ·ÖÉí¡£
ÔÚw3cà ......
/**
* ±í¸ñÅÅÐò(µ¥¸ö±í¸ñ£¬½µÐò)
* @example
* <code>
* <table is_sort="1">
* <tr>
* <th><a href="javascript:void(0)" mce_href="javascript:void(0)" onclick="table_sort(0, 0)">field1</a></th>
* <th><a href="javascript:void(0)" mce_href ......