画面の中心にある特定の次元のポップアップウィンドウにhrefをロードしようとしています。ここJavaScriptを使用したポップアップウィンドウのリンクを開く
<li>
<a class="sprite_stumbleupon" href="http://www.stumbleupon.com/submit?url=http://www.your_web_page_url" target="_blank" onclick="return windowpop(545, 433)"></a>
</li>
そして、私のjavascriptです:
function windowpop(url, width, height) {
var leftPosition, topPosition;
//Allow for borders.
leftPosition = (window.screen.width/2) - ((width/2) + 10);
//Allow for title and status bars.
topPosition = (window.screen.height/2) - ((height/2) + 50);
//Open the window.
window.open(url, "Window2", "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
}
これは、試験したときに404エラーを返すようですが
は、ここに私のソースです。何が間違っているのですか?
ありがとうございました。
あなたは 'windowpop'関数に' url'パラメータを送信していません。 –
'function windowpop(url、width、height)'関数はURLを返すことを期待していますが、幅と高さだけを返しています。 – Mal
これは正当な理由で閉鎖されているかもしれませんが、私はそれが役に立たないことがわかりました。私はwindow.openへの余分なパラメータについて知らなかった。 – jstaab