我有两个HTML文件:index.html
和Page2.html
。
我在index.html
页面有一个按钮,名为WWW_onclick()
。
如您所见,此功能打开Page2.html
并写入“hello”。
问题是这个功能抹去了原来的Page2.html
,只写“你好”。
JavaScript删除第二页的内容
有没有办法保留Page2.html
的内容并在其中添加其他文字,图片或...?
function WWW_onclick()
{
document.location.href = "Page2.html";
document.write("hello");
}
重复:http://stackoverflow.com/questions/9280750/how-to-change-content-after-page-is-loaded- js – Quentin