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

推荐订阅源

罗磊的独立博客
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
博客园 - 【当耐特】
H
Heimdal Security Blog
腾讯CDC
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
S
Schneier on Security
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
月光博客
月光博客
A
Arctic Wolf
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
T
Troy Hunt's Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
D
DataBreaches.Net
O
OpenAI News
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
小众软件
小众软件
V
Vulnerabilities – Threatpost
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
美团技术团队
P
Privacy International News Feed

博客园 - BetaGeek™

Geek from SHUFE. 民工之路开篇索引。从游戏到技术 游走在上财主流的边缘 大学四年的总结 Passion & Potential (下部) 博文阅读密码验证 - 博客园 ShufeTaoTao.cn MileStone:RTW, 技术支持及Bug汇报专贴 短篇连载(0),41的大学生涯总结 Passion & Potential , ESports & Technical 索引 短片连载(6),记录这段 电脑爱好者 生涯,从四年级开始接触计算机,直到大二寒假决定步入IT行业。 短篇连载(5),我的民工我的团。感谢民工团,我的好兄弟们。(11P) 短篇连载(4),这些传奇,曾经冠以SHUFE之名 短篇连载(3),在校园里做比赛的那些日子,以及彻底告别钟爱的电子竞技事业 短篇连载(2),和技术无关的经历,关于校园和社会实践。进大学,打比赛,以及组战队 短篇连载(1),41的大学生涯总结 哪里有激情,哪里就有潜力 首章 Microsoft APGC CSS 微软亚太区全球技术支持中心招聘(Expired) 上海财经大学千村调查系统使用说明&Bug&建议管理 【梦想成真】应聘微软大中华区全球技术支持中心实习的经历 力荐iReaper/as a Weekend Systems Admin...为何我从来没用过GHOST? 盖茨和鲍尔默联手接受采访:28年老搭档回忆往昔 微软APGC CSS面试归来,这次貌似没灰头土脸 ASP.NET AJAX ToolKit 中Accordion的关于OnItemCommand的bug, 通过修改重编译源文件完成修补 Never hava I wrote so many english words...just for the company in my dream... 练习选择排序算法碰到鬼 一种用List出错 一种int[]没问题 求助了 大家帮我看看端倪 我菜在哪里还是真碰到灵异事件
用window.open在同一个新窗口中访问指定url【IE页面缓存问题】
BetaGeek™ · 2008-10-02 · via 博客园 - BetaGeek™

无数次尝试,拼命搜索查资料,就这么个问题花去整整5小时,残念。。。

好歹现在解决了。

情况如下:

想实现类似于newegg,icson等网上商城的购物车模式,即在选购商品的页面A中,点击某些链接,把商品ID传入购物车页面B中,B页面根据此querystring中包含的ID向购物车容器添加此商品,然后购物车页面刷新到无querystring参数的页面状态下。此后每次在页面A中点击添加购物车链接,B页面始终在同一个标签页/窗口中刷新。

观察newegg的页面源代码,在页面A中的链接,是以js形式的window.open(url,windowName)进行窗口的触发。

可是问题出现:

在IE中,点击A页面中的链接,B页面的标签会闪一下,但是也没不做任何改动。后来在B页面的body中onload事件添加客户端方法后观察,发现每次A页面执行window.open时候B其实会重新load的,只不过不做任何回发postback。

而如果用手头的FF3,Chrome浏览器,则会达到期望效果。

研究了很久,很遗憾根本搜不出任何关于这个症状有用的信息,直到发现浏览器页面缓存的字眼,问题解决。

代码如下:

页面A:

 <script type="text/javascript" >
        function AddToCart(t, Width, Height) {       
            var newwindow = window.open('test.aspx?id=' + t, 'basketlist');
        }    
 </script>

几种调用方法均可,残念啊,在没找到原因之前,啥都尝试过了...

<asp:HyperLink runat="server" NavigateUrl="javascript:AddToCart('a')" Text ="hyperlink" />
<a href ="javascript:AddToCart('a')" >test</a>
<a href ="#" onclick ="AddToCart('a')" >test</a>
<asp:Button id="btnTest" runat ="server" OnClientClick ="AddToCart('a')" />

页面B:test.aspx.cs

protected void Page_Load(object sender, EventArgs e)
        {            
            if (!IsPostBack)
            {
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.Cache.SetNoStore();
                if (Request.QueryString["id"] != null)
                {
                    HttpCookie cookie = Request.Cookies["Cookie"] ?? new HttpCookie("Cookie");
                    cookie.Value = cookie.Value + Request.QueryString["id"];
                    Response.Cookies.Add(cookie);                      
                    Response.Redirect("test.aspx");

                }
            }
            if (Request.Cookies["Cookie"] != null)
                ltTest.Text = Request.Cookies["Cookie"].Value;

        }

---

补充材料:

window.open方法的使用和重载

http://www.w3schools.com/HTMLDOM/met_win_open.asp