上一篇:Microsoft Script Debugger说明书 >>
使用<meta>标签的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 don@#t 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 () )
{
// it@#s 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
{
// it@#s a known browser - show "throwaway" keywords so we don@#t 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 we@#re in debug mode
// the first time we@#re used on a page.
if ( bDebug == undefined )
{
// the test can be if we@#re 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 );
}
%>
下一篇:彻底终结浏览器Cahce页面的解决方案 >>
相关文章:
- · 自己动手,结合javascript和dhtml做一个ubb编辑器(附例子代码)
- · Asp与导航文件
- · 在FLASH中调用ASP
- · 列出 IE5 所支持的所有server端变量
- · 深入研究“用ASP上载文件”(二)
- · 深入研究“用ASP上载文件”(一)
- · 复杂表单的动态生成与动态验证
- · ADO 事件模型
- · ACCESS97关于数据库安全的几个问题
- · 在程序中直接设定待连接的数据库
- · 使用@IDENTITY
- · 在linux上用ASP
- · 数据库记录的表格显示,编辑与更新
- · asp实现数据记录的备份及恢复-----抛砖引玉
- · 选择最快的镜像站点
- · 用ASP列出服务器上的所有硬盘及类型
- · 在ADO使用SELECT语法六
- · 在asp聊天室里实现房间功能和用户显示
- · ASP编写的一个简单的颜色吸取器
- · 让IIS 5.0的错误信息提示更详细的方法
- · Iasp+Apache+W98简单试用
- · 利用正则表达式把用URLEncode的字符串转换成正常的字符串函数
- · 用ASP判断Email地址是否有效
- · 如何利用ASP实现邮箱访问
- · 在ASP处理程序时,进度显示
- · 一个显示原代码的asp程序
- · 调试 ASP 脚本
- · 在ADO使用SELECT语法五
- · 在ADO使用SELECT语法四
- · Asp降龙十九掌
- · 在ADO使用SELECT语法三
- · ADO使用SELECT语法二
- · 在ADO使用SELECT语法一
- · 如何解决图形和文字的显示问题
- · 数组数据排序的程序例子
- · ADO存取数据库如何与HTML结合
- · 用纯ASP代码实现图片上传并存入数据库中
- · 讨论 SELECT TOP N 问题
