开发者

i need the document.write code for iframe

开发者 https://www.devze.com 2023-01-05 09:55 出处:网络
I want the document.write code to load a page(as iframe) example - i need document.write function to get http://google.com

I want the document.write code to load a page(as iframe)

example - i need document.write function to get http://google.com

I dont want html function but as document开发者_开发技巧.write


I'm not sure that you know what the document.write method does...

The document.write method is used to write HTML code into the current document. If it's done at load time, the code becomes part of the document currently loading. If it's done after the page has loaded, it will replace the current page.

You can use the method to write code to a window or a frame, but you can't use it to change the location of the window. Even if you get the HTML code from google.com and write it to a window, the location will not be google.com so the code will most likely not work properly.

If you want to change the location of a window, you just use the location.href property:

window.location.href = 'http://google.com';
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号