1

使用 javascript 打开新窗口时遇到问题。在 Chrome 和 Firefox 中这很好用,但 IE 给出了错误的 url。

该链接位于这样的页面上:www.CORRECTURL.com/SEOKEYWORD/SONGID/SONGNAME.html

链接:

<a href="javascript:void(0)" onclick="window.open('extraListen.php?visa=<?php echo($songID); ?>','welcome','toolbars=1, scrollbars=1, location=1, statusbars=1, menubars=1, resizable=1, width=748, height=660, left = 300, top = 100')">Listen</a>

在 chrome/firefox 中打开:http ://www.CORRECTURL.com/extraListen.php?visa=19 在 IE 中打开:http ://www.CORRECTURL.com/SEOKEYWORD/SONGID/extraListen.php?visa=19

当“seokeyword”和“songid”添加到链接中时,找不到新页面,但我不明白IE如何在url和chrome中添加这个,firefox没有!??

顺便说一句,我有以下 htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteRule midsommarvisor/(.*)/(.*)\.html$ index.php?visa=$1&midsommarvisa=$2 [L]
RewriteRule sitemap\.xml sitemap.php [L]
RewriteRule rss\.xml rss.php [L]
RewriteRule (.*)/(.*)\.html$ index.php?fel=$1&page=$2 [L]
RewriteRule (.*)\.html$ index.php?page=$1

我不知道从哪里开始...

4

1 回答 1

3

当我谈到我的评论时。我相信这里的问题在于您的网址不是以正斜杠开头/onclick在您的活动中尝试以下操作:

onclick="window.open('/extraListen.php?visa=<?php echo($songID); ?>'

问题是,如果开头没有斜线,一些浏览器不会将其识别为根路径 URL,因此会尝试将其附加到当前请求路径,而不是仅将其附加到域名。

于 2012-04-24T15:39:23.677 回答