<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>标题页</title>
<SCRIPT LANGUAGE="JavaScript">
URL = window.location.href; //获取网页当前URL地址
ishtm = (URL.indexOf('.htm') > -1); //判断地址中包含的字符串
ishtml = (URL.indexOf('.html') > -1);
isshtml = (URL.indexOf('.shtml') > -1);
isphtml = (URL.indexOf('.phtml') > -1);
isaspx = (URL.indexOf('.aspx') > -1);
</script>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
//一个全局变量,用来判断网页类型
if (isphtml)
document.write("这是一个.phtml 文件!");
else if (isshtml)
document.write("这是一个.shtml 文件!");
else if (ishtml)
document.write("这是一个.html 文件!");
else if (ishtm)
document.write("这是一个.htm 文件!");
else if (aspx)
document.write("这是一个.aspx文件!");
else {
document.write("无法识别该类型文件.");
}
</script>
</body>
</html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?