惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 琼

服务器 'server_1' 上的 MSDTC 不可用 - 琼 用javascript操作word文档 - 琼 - 博客园 Asp.Net中用javascript实现弹出窗口永远居中 - 琼 - 博客园 在sql server 2005数据库中更改数据架构 实现跟踪javascript代码进行调试 转摘--MS SQL Server 2000 数据库使用备份还原造成的孤立用户和对象名‘xxx’无效的错误的解决办法 转摘--具体影响Oracle系统性能的初始化参数 转摘--深入解读ADO.NET2.0的十大最新特性 实现关闭弹出页面后刷新父页 转摘——仿网易126网络硬盘上传 - 琼 - 博客园 转摘_修改表结构,让表中的字段按英文字母的顺序重新排列 javascript中获取文件后缀名 UltraWebGrid模板列及行的相关操作(转) JavaScript实现DataGrid中的CheckBox全选与否 实现弹出窗口的大小 解决"当前命令发生了严重错误。应放弃任何可能产生的结果。"的问题 设置页面文字大小及颜色 图片幻灯片显示 Windows 2000 CMD命令大全
用Javascript隐藏超级链接的真实地址
· 2007-11-16 · via 博客园 - 琼

用Javascript可以隐藏超级链接的真实地址:
在显示下载链接的页sample.aspx的前台合适地方加入以下代码如下:

<href="#" onclick="javascript:window.open('DownLoad.aspx?ID=11','newwin','width=350,height=510,scrollbars=0,toolbar=0,resizable=0')">打开窗口</a> 

通过DownLoad.aspx文件读取需下载的文件信息,在后台加入代码:

try
            
{
                
string str = "select FileContent,FileType, FileName from fileinfo where id = " + base.Request.QueryString["id"];
                SqlDataReader Dr 
= pubValue.DataRead(str);

                
string strfilePath = "file/" + base.User.Identity.Name;
                
string path = "";

                
if (Dr.Read())
                
{
                    
string s = Dr["FileName"].ToString();
                    path 
= base.Server.MapPath(strfilePath + "/" + s);

                    
if (File.Exists(path))
                    
{
                        File.Delete(path);
                    }


                    FileStream stream 
= new FileStream(path, FileMode.Create);
                    stream.Write((
byte[])Dr["FileContent"], 0, ((byte[])Dr["FileContent"]).Length);
                    StreamWriter writer 
= new StreamWriter(stream);
                    writer.WriteLine(
"");
                    writer.Flush();
                    writer.Close();
                    stream.Close();
                    
base.Response.Write("<script>location.href='" + strfilePath + "/" + base.Server.UrlEncode(s).Replace("+""%20"+ "';</script>");
                }

            }

            
catch (Exception exception)
            
{
                
base.Response.Write(exception.Message);
            }

当鼠标打向打开窗口时,出现的链接信息是#,而不是下载文件的链接地址,从而达到隐藏真实的超级链接地址的效果!