复制代码代码如下 :
<! doctype html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<헤드>
<meta http-equiv = "content-type"content = "text /html; charset = gb2312" />
<title> javaScript_ </title>
<script language = "javaScript">
함수 get_pagetitle (split_chr, new_pagetit)
{
var titleitems, return_title;
var the_pagetitle = document.title;
TitleItems = the_pagetitle.split (split_chr);
return_title = the_pagetitle;
if (titleitems [1])
{
return_title = the_pagetitle.replace (TitleItems [1], new_pagetit)
}
또 다른
{
if (new_pagetit)
{
return_title = the_pagetitle & split_chr & new_pagetit;
}
}
경고 (return_title);
}
</스크립트>
</head>
<body>
<입력 값 = "value"유형 = "버튼"onclick = "javaScript : get_pagetitle ( '_', '=');" />
</body>
</html>