上一篇:全文本检索的应用 >>
使用标签的ASP源程序例子
<%
// ============================================
// note: all source code downloaded from coveryourasp was written by
// james shaw (unless stated otherwise), and is copyright (c) 2000 by
// james shaw. you may use this source code on your web sites, but
// please dont publish or distribute in any way.
//
// i would appreciate an html comment in any code you use, i.e.
// <!-- portions (c) james@coveryourasp.com-->
// (see footer(), documented in ssi.asp for details on how to do this)
//
// <shameless plug>
// please contact me to discuss any asp contract work you may have.
// </shameless plug>
// ============================================
// ============================================
// the standard meta tags to start document
// ============================================
function init ( stitle, skeywords )
{
out ( <!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/tr/rec-
html40/loose.dtd"> );
out ( <html><head> );
out ( <base target="_top"> );
// for any browsers
out ( <link rev=made href="mailto:james@coveryourasp.com"> );
out ( <meta name="resource-type" content="document"> );
out ( <meta http-equiv="content-type" content="text-html; charset=iso8859-1"> );
out ( <meta http-equiv="pics-label" content=\(pics-1.1 "http://www.rsac.org/ratingsv01.html" l gen
true comment "rsaci north america server" for "http://coveryourasp.com/" on "2000.09.08t03:03-0800" r (n 0
s 0 v 0 l 0))\> );
// for spiders only - i hide these lines from browsers
var sbrowser = "" + request.servervariables ( http_user_agent );
if ( ( -1 == sbrowser.indexof ( mozilla ) && -1 == sbrowser.indexof ( opera ) ) || isdebug () )
{
// its an unknown browser - probably a spider
out ( <meta name="author" content="james shaw"> );
out ( <meta name="keywords" content="coveryourasp, cya, james shaw, asp, active server pages,
active, server, pages, scripts, microsoft, iis, email, cdonts, form, access, database, free code, source,
code, programmer, programming, developer, development, javascript, jscript, com, atl, c++ );
// add any passed-in keywords
if ( skeywords != undefined )
out ( , + skeywords );
out ( "><meta name="description" content="live examples and full source code for solving practical
problems using asp (active server pages), c++ atl com components, server and client-side javascript and
dhtml."> );
}
else
{
// its a known browser - show "throwaway" keywords so we dont arouse suspicion!
out ( <meta name="keywords" content="james shaw"> );
out ( <meta name="description" content="james shaw\s site"> );
}
out ( <title> + stitle + </title> );
out ( <style> );
out ( a:link { color:#ff3300; } );
out ( a:vlink { color:#ff3300; } );
out ( a:alink { color:#cc0000; } );
out ( body { font:8pt/11pt verdana;} );
out ( table { font:8pt/11pt verdana;} );
out ( </style></head> );
}
// ============================================
// are we being run from a special debug url?
// ============================================
var bdebug;
function isdebug ( )
{
// for efficiency, only work out if were in debug mode
// the first time were used on a page.
if ( bdebug == undefined )
{
// the test can be if were on localhost (i.e. on development machine)
/*
var sserver = "" + request.servervariables ( "server_name" );
bdebug = ( -1 != sserver.indexof ( "localhost" ) );
*/
//..or for demo purposes, if a certain querystring exists
bdebug = ( 0 != request.querystring ( "debug" ).count );
}
return bdebug;
}
// ============================================
// shorthand to save me typing response.write all the time!
// ============================================
function out ( shtml )
{
response.write ( shtml );
}
// ============================================
// only display when special url
// ============================================
function debugout ( shtml )
{
if ( !isdebug () )
return;
out ( shtml );
}
%>
()
下一篇:在ASP中如何访问Novell下的数据库 >>
相关文章:
- · 另一种显示文章系统的思路-2
- · 另一种显示文章系统的思路-1
- · asp+ VB上传文件代码
- · 使用ADO的批量更新方法UpdateBatch
- · asp性能测试第二部分(转)(十二)
- · asp性能测试第二部分(转)(十一)
- · asp性能测试第二部分(转)(十)
- · asp性能测试第二部分(转)(九)
- · asp性能测试第二部分(转)(八)
- · asp性能测试第二部分(转)(七)
- · asp性能测试第二部分(转)(六)
- · asp性能测试第二部分(转)(五)
- · asp性能测试第二部分(转)(四)
- · asp性能测试第二部分(转)(三)
- · asp性能测试第二部分(转)(二)
- · asp性能测试第二部分(转)(一)
- · 二十八条改善 ASP 性能和外观的技巧(22-28)
- · 二十八条改善 ASP 性能和外观的技巧(15-21)
- · 二十八条改善 ASP 性能和外观的技巧(8-14)
- · 二十八条改善 ASP 性能和外观的技巧(1-7)
- · 在ASP中编写DLL的问题
- · asp性测能试报告(转)(八)
- · asp性能测试报告(转)(七)
- · asp性能测试报告(转)(六)
- · asp性能测试报告(转)(五)
- · asp性能测试报告(转)(四)
- · asp性能测试报告(转)(三)
- · asp性能测试报告(转)(二)
- · asp性能测试报告(转)(一)
- · 最大限度优化你的Asp性能
- · 用GetString来提高ASP的速度
- · 用ASP编写网络传呼机
- · 结合asp和存储过程做的搜索程序
- · ASP调用带参数存储过程的几种方式
- · asp实现在web中显示电子表格数据(四)创建文件选择列
- · asp实现在web中显示电子表格数据(三)创建电子数据表列表和
- · asp实现在web中显示电子表格数据(二)生成HTML表格
- · asp实现在web中显示电子表格数据(一)显示数据表格的应
