因此,我有一个从父窗口打开的子窗口的javascript代码。
try{
window.opener.item(23,Add,document.AddEdit.name.value,document.AddEdit.type.value);
} catch(err){
alert('The form you are editing is not available.');
}
父窗口中的item函数-
function item(id,action,name,type){
saveScroll();
document.ab
我正在尝试使用用户按下的javascript按钮来弹出一个新窗口的按钮。该按钮出现在网站上,但当我按下它时什么也不会发生。我已经在Chrome和Firefox上试过了。我不知道是浏览器设置还是代码错误。
<button onclick="window()">Reminisce</button>
<script type="text/javascript">
function window() {
var w = window.innerWidth;
var h = window.innerHeight;
我是一个新的JavaScript学习者,我想改变我的页面的背景色,所以我在下面写了一页:
function change_color() {
console.log('6666');
document.body.style.backgroundColor = "green";
alert("the color has changed to green!");
console.log('6666');
document.body.style.backgroundColor = "blue";
我有一些浏览器问题打开一个外部网站的新窗口标签。
它应该做什么:当前窗口被重定向到一个页面,同时它打开一个新窗口选项卡,并被重定向到一个外部页面。
它在Firefox上运行良好,但不支持IE或Chrome,因为它不会打开新的窗口标签和重定向。不过,它确实可以在当前窗口中将页面重定向到我想要的页面。有人知道为什么吗?
<script type="text/javascript">window.open('Site A');</script> (This doesn't open in IE, and Chrome open in a
我一直在为Chrome (作为一个扩展)写一个Greasemonkey脚本,以便在Facebook上使用。我知道Greasemonkey是沙箱的,至少就Firefox而言,除非你在浏览器中改变设置,否则你不能用脚本关闭窗口。然而,我知道大多数浏览器允许父窗口关闭子窗口,而不需要用户的确认。无论如何,我正在尝试让我的脚本打开一个窗口,从HTML对象中抓取一段文本,然后在按下页面上的一个按钮后关闭窗口。
我打开窗口的代码如下所示:
function birthday(linkAddress) {
var winNew=window.open(linkAddress, "_blank"
我有一个申请表,当我提交的表格,它是重定向到窗口,其中有选项“打印”和关闭。
Please click <a onclick="self.close();" href="#">here</a> to close this window.
如果我点击关闭,标签本身关闭在chrome和IE,但它不能在Mozilla中工作。
当我使用这段代码时,
Please click <a onclick="CloseWindow();" href="#">here</a> to close th