【日常】纪录一个愚蠢的问题

最近在做JSP的课设,摸鱼划水了好多天,今天开始改项目。
然而当我去实现一个JS实现跳转问题的时候,我的Chrome开始猛给我报错

mymenu.js:160 Unsafe JavaScript attempt to initiate navigation for frame with origin 'http://unspoken:8080' from frame with URL 'http://localhost:8080/ShoppingDay01/LeftController/queryOne'. The frame attempting navigation is neither same-origin with the target, nor is it the target's parent or opener.

Uncaught DOMException: Failed to set the 'href' property on 'Location': The current window does not have permission to navigate the target frame to 'http://localhost:8080/ShoppingDay01/jsps/book/list.jsp?cid=A9CFBED0F77746C5BD751F2502FAB2CD'.
    at skip (http://localhost:8080/ShoppingDay01/menu/mymenu.js:162:34)
    at HTMLDivElement.onclick (http://localhost:8080/ShoppingDay01/LeftController/queryOne:1:1)
skip @ mymenu.js:162
onclick @ queryOne:1

我花了长达一个半小时的时间来调试这个Bug,中途由于过于烦躁还出去买了一趟零食(借口),果然在外面透了透气,回来大脑清醒多了,开始重新调试Bug。
果不其然,这个bug的原因是我在MyEclipse内置Browser的地址栏复制url时,我复制出来的url是:

http://unspoken:8080

如图
在这里插入图片描述
所以复制到浏览器时,当我去跳转到一个 http://localhost:8080 的url时肯定会出现跨域问题,所以只要把外置Browser的url也改成 http://localhost:8080 就好啦
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值