Javascript 按钮,启动url
下面是我想开始工作的案例陈述。我将格式设置在我想要的地方,但是此时按钮(onclick)没有任何操作Javascript 按钮,启动url,javascript,html,websense,Javascript,Html,Websense,下面是我想开始工作的案例陈述。我将格式设置在我想要的地方,但是此时按钮(onclick)没有任何操作 case 'This Websense category is filtered: <b>Uncategorized</b>.': document.write('<p><b style="margin-left: 8px;">Help:</b><INPUT TYPE="button" STYLE="margin-left: 64
case 'This Websense category is filtered: <b>Uncategorized</b>.':
document.write('<p><b style="margin-left: 8px;">Help:</b><INPUT TYPE="button" STYLE="margin-left: 64px;" VALUE="Submit UNCATEGORIZED website to Websense" onClick="window.open=(http://aceinsight.websense.com/?url=' +
'$*WS_URL*$,' + ' "_blank")' + '"></p>\
<hr />\
<p style="margin-left: 108px; color: #FF0000;">Clicking on the above button will open another webpage for Websense to categorize the above site. You will NOT receive a confirmation e-mail or any communication from Websense indicating your request is processing. Please note the response time for your request will vary. Allow three to four (3-4) hours for updates to take effect once approved.</p>');
break;
case“此Websense类别已筛选:未分类”:
文档。编写(“帮助:\
\
单击上述按钮将打开另一个网页,供Websense对上述网站进行分类。您将不会收到确认电子邮件或任何来自Websense的通信,表明您的请求正在处理中。请注意,您的请求的响应时间将有所不同。允许三到四(3-4)个更新在批准后生效的时间。');
打破
我认为您的onClick调用可能是错误的
尝试:
而不是:
window.open=("http://aceinsight.websense.com/?url= (rest of your url)")
您不应该通过html绑定元素内部的事件,这使得调试javascript非常困难。可以使用document.write创建元素,然后使用DOM引用元素并以这种方式添加事件。 下面是一个例子:
document.write('<button id="foo">Hai!</button>');
document.getElementById('foo').onclick = function () {
window.open('http://aceinsight.websense.com/',"_blank");
};
document.write('Hai!');
document.getElementById('foo')。onclick=function(){
打开窗户http://aceinsight.websense.com/","空白";;
};
我不确定我是否理解这个问题。。。不工作?错误?不确定这是否是全部问题,但您正在使用
窗口。open=(…
当它不需要=
时,只需窗口。open(…
您缺少“
在窗口中包装URL。open
onClick=“window.open(\'http://aceinsight.websense.com/?url=“+$*WS\u URL*$,”空白““根据前面的注释进行了更改,没有更改。您缺少了”
…应该是窗口。打开(”http://aceinsight.websense.com/?url=...“
这里有一个更好的链接,特别是在我从文章中删除了=yes:)
document.write('<button id="foo">Hai!</button>');
document.getElementById('foo').onclick = function () {
window.open('http://aceinsight.websense.com/',"_blank");
};