| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 417 人关注过本帖
标题:请教关于ASP的一个问题!
只看楼主 加入收藏
思轩
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-12-27
收藏
 问题点数:0 回复次数:3 
请教关于ASP的一个问题!

在一个文章管理系统中,我看到一个命名为“code.asp”的文件,请问它主要是用来实现什么功能的?好像在其他很多页面中都调用到它!!!
它里面的代码是:
<SCRIPT LANGUAGE="JavaScript">

helpstat = false;
stprompt = true;
basic = false;
function thelp(swtch){
if (swtch == 1){
basic = false;
stprompt = false;
helpstat = true;
} else if (swtch == 0) {
helpstat = false;
stprompt = false;
basic = true;
} else if (swtch == 2) {
helpstat = false;
basic = false;
stprompt = true;
}
}

function AddText(NewCode) {
document.myform.txtcontent.value+=NewCode
}

function email() {
if (helpstat) {
alert("Email 标记\n插入 Email 超级链接\n用法1: [email]webmaster@aspsky.net[/email]\n用法2: [email=webmaster@aspsky.net]沙滩小子[/email]");
} else if (basic) {
AddTxt="[email][/email]";
AddText(AddTxt);
} else {
txt2=prompt("链接显示的文字.\n如果为空,那么将只显示你的 Email 地址","");
if (txt2!=null) {
txt=prompt("Email 地址.","name@domain.com");
if (txt!=null) {
if (txt2=="") {
AddTxt="[email]"+txt+"[/email]";
} else {
AddTxt="[email="+txt+"]"+txt2;
AddText(AddTxt);
AddTxt="[/email]";
}
AddText(AddTxt);
}
}
}
}

function showsize(size) {
if (helpstat) {
alert("文字大小标记\n设置文字大小.\n可变范围 1 - 6.\n 1 为最小 6 为最大.\n用法: [size="+size+"]这是 "+size+" 文字[/size]");
} else if (basic) {
AddTxt="[size="+size+"][/size]";
AddText(AddTxt);
} else {
txt=prompt("大小 "+size,"文字");
if (txt!=null) {
AddTxt="[size="+size+"]"+txt;
AddText(AddTxt);
AddTxt="[/size]";
AddText(AddTxt);
}
}
}

function bold() {
if (helpstat) {
alert("加粗标记\n使文本加粗.\n用法: 这是加粗的文字");
} else if (basic) {
AddTxt="";
AddText(AddTxt);
} else {
txt=prompt("文字将被变粗.","文字");
if (txt!=null) {
AddTxt=""+txt;
AddText(AddTxt);
AddTxt="
";
AddText(AddTxt);
}
}
}

function italicize() {
if (helpstat) {
alert("斜体标记\n使文本字体变为斜体.\n用法: 这是斜体字");
} else if (basic) {
AddTxt="";
AddText(AddTxt);
} else {
txt=prompt("文字将变斜体","文字");
if (txt!=null) {
AddTxt=""+txt;
AddText(AddTxt);
AddTxt="
";
AddText(AddTxt);
}
}
}

function quote() {
if (helpstat){
alert("引用标记\n引用一些文字.\n用法:

引用内容
");
} else if (basic) {
AddTxt="";
AddText(AddTxt);
} else {
txt=prompt("被引用的文字","文字");
if(txt!=null) {
AddTxt="
"+txt;
AddText(AddTxt);
AddTxt="
";
AddText(AddTxt);
}
}
}

function showcolor(color) {
if (helpstat) {
alert("颜色标记\n设置文本颜色. 任何颜色名都可以被使用.\n用法: [color="+color+"]颜色要改变为"+color+"的文字[/color]");
} else if (basic) {
AddTxt="[color="+color+"][/color]";
AddText(AddTxt);
} else {
txt=prompt("选择的颜色是: "+color,"文字");
if(txt!=null) {
AddTxt="[color="+color+"]"+txt;
AddText(AddTxt);
AddTxt="[/color]";
AddText(AddTxt);
}
}
}

function center() {
if (helpstat) {
alert("对齐标记\n使用这个标记, 可以使文本左对齐、居中、右对齐.\n用法: [align=center|left|right]要对齐的文本[/align]");
} else if (basic) {
AddTxt="[align=center|left|right][/align]";
AddText(AddTxt);
} else {
txt2=prompt("对齐样式\n输入 'center' 表示居中, 'left' 表示左对齐, 'right' 表示右对齐.","center");
while ((txt2!="") && (txt2!="center") && (txt2!="left") && (txt2!="right") && (txt2!=null)) {
txt2=prompt("错误!\n类型只能输入 'center' 、 'left' 或者 'right'.","");
}
txt=prompt("要对齐的文本","文本");
if (txt!=null) {
AddTxt="\r[align="+txt2+"]"+txt;
AddText(AddTxt);
AddTxt="[/align]";
AddText(AddTxt);
}
}
}

function hyperlink() {
if (helpstat) {
alert("超级链接标记\n插入一个超级链接标记\n使用方法: [url]http://www.aspsky.net[/url]\nUSE: [url=http://www.aspsky.net]链接文字[/url]");
} else if (basic) {
AddTxt="[url][/url]";
AddText(AddTxt);
} else {
txt2=prompt("链接文本显示.\n如果不想使用, 可以为空, 将只显示超级链接地址. ","");
if (txt2!=null) {
txt=prompt("超级链接.","http://");
if (txt!=null) {
if (txt2=="") {
AddTxt="[url]"+txt;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
} else {
AddTxt="[url="+txt+"]"+txt2;
AddText(AddTxt);
AddTxt="[/url]";
AddText(AddTxt);
}
}
}
}
}

function image() {
if (helpstat){
alert("图片标记\n插入图片\n用法: ");
} else if (basic) {
AddTxt="[img][/img]";
AddText(AddTxt);
} else {
txt=prompt("图片的 URL","http://");
if(txt!=null) {
AddTxt="\r[img]"+txt;
AddText(AddTxt);
AddTxt="[/img]";
AddText(AddTxt);
}
}
}

function showcode() {
if (helpstat) {
alert("代码标记\n使用代码标记,可以使你的程序代码里面的 html 等标志不会被破坏.\n使用方法:\n

这里是代码文字
");
} else if (basic) {
AddTxt="\r
\r
";
AddText(AddTxt);
} else {
txt=prompt("输入代码","");
if (txt!=null) {
AddTxt="\r
\"+txt;
AddText(AddTxt);
AddTxt=\"
";
AddText(AddTxt);
}
}
}

function list() {
if (helpstat) {
alert("列表标记\n建造一个文字或则数字列表.\n\nUSE:

    [*]项目一[/*] [*]项目二[/*] [*]项目三[/*]
");
} else if (basic) {
AddTxt="
    [*] [/*][*] [/*][*] [/*]
";
AddText(AddTxt);
} else {
txt=prompt("列表类型\n输入 'A' 表示有序列表, '1' 表示无序列表, 留空表示无序列表.","");
while ((txt!="") && (txt!="A") && (txt!="a") && (txt!="1") && (txt!=null)) {
txt=prompt("错误!\n类型只能输入 'A' 、 '1' 或者留空.","");
}
if (txt!=null) {
if (txt=="") {
AddTxt="
    ";
    } else {
    AddTxt="[list="+txt+"]";
    }
    txt="1";
    while ((txt!="") && (txt!=null)) {
    txt=prompt("列表项\n空白表示结束列表","");
    if (txt!="") {
    AddTxt+="[*]"+txt+"[/*]";
    }
    }
    AddTxt+="
";
AddText(AddTxt);
}
}
}

function showfont(font) {
if (helpstat){
alert("字体标记\n给文字设置字体.\n用法: 改变文字字体为"+font+"");
} else if (basic) {
AddTxt="";
AddText(AddTxt);
} else {
txt=prompt("要设置字体的文字"+font,"文字");
if (txt!=null) {
AddTxt=""+txt;
AddText(AddTxt);
AddTxt="
";
AddText(AddTxt);
}
}
}

function underline() {
if (helpstat) {
alert("下划线标记\n给文字加下划线.\n用法: 要加下划线的文字");
} else if (basic) {
AddTxt="";
AddText(AddTxt);
} else {
txt=prompt("下划线文字.","文字");
if (txt!=null) {
AddTxt=""+txt;
AddText(AddTxt);
AddTxt="
";
AddText(AddTxt);
}
}
}

function openscriphtml()
{
if (navigator.appName!="Microsoft Internet Explorer")
alert("此功能 Netscape 用户不能使用!")
else
{newwin=window.open('htmledit/editor.html','','width=544,height=294');
newwin.focus();
}
}
function runEx(){
//alert('请注意,按下确定将生成页面,按下后请稍后....');
var winEx = window.open("", "winEx", "width=600,height=400,status=yes,menubar=yes,scrollbars=yes,resizable=yes"); winEx.document.open("text/html", "replace");
winEx.document.write(unescape(event.srcElement.parentElement.children[2].value));
winEx.document.close();
}
function openScript(url, width, height) {
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
}
</SCRIPT>
<script language="Javascript">
<!-- hide

function insertsmilie(smilieface){

document.frmAnnounce.body.value+=smilieface;
}
// -->
</script>

搜索更多相关主题的帖子: ASP 
2007-01-12 13:34
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
收藏
得分:0 
这是什么啊,那么多,看起来头疼,没心情看.
2007-01-12 15:15
思轩
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2006-12-27
收藏
得分:0 
不好意思!我只是想问一下,一般的“code.asp”的文件是什么用处!

2007-01-17 00:54
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
编辑器js代码
2007-01-17 09:12
快速回复:请教关于ASP的一个问题!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016493 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved