簡體   English   中英

在IE中,Javascript Window.open錯誤的URL

[英]Javascript Window.open wrong URL in IE

使用javascript打開一個新窗口有一個問題。 在Chrome和Firefox中這很好用,但是IE提供了錯誤的網址。

該鏈接位於以下頁面: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

我不知道從哪里開始......

當我談到我的評論時。 我相信這里的問題是你的網址沒有以正斜杠/開頭。 onclick事件中嘗試以下操作:

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

問題是,如果沒有開頭的斜杠,某些瀏覽器不會將其識別為根路徑URL,因此會嘗試將其附加到當前請求路徑,而不是僅將其附加到域名。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM