0

HTML/Javascript は初めてです

javascript でウィンドウを開き、外部ソースから HTML コンテンツをロードしたいと考えています。document.write() を使用しましたが、特に HTML をパラメータとして記述しない限り機能しません

document.write を外部ソースから読み取らせる方法はありますか?

これが私が試したものです。

win.document.write('<script src="window.html"></script>');

window.html

  <html>
    <head>
        <title>test</title>
    </head>
    <body>
        test
    </body>
</html>
4

2 に答える 2

3

If you want to get another page into a new window, then just pass the URL when you create the window...

window.open('win.html', 'popup1', 'width=400,height=200,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0');

You may also want to consider using a jQuery UI dialog, purely for presentation purposes :)

于 2013-10-17T11:33:17.903 に答える