Javascript window.open服务器上的断开链接

时间:2015-12-01 17:22:06

标签: javascript html hyperlink window.open

以下功能在本地工作,但在我将包含它们的文件发布到服务器上时却没有:

function optionOtbutton(){
    if (g_oQuizResults.strScore<100) alert("You did not pass this quiz with 100% accuracy; therefore you will not get a certificate. Click OK, close the browser window and click on the Retry Quiz button.") + end;
    if (g_oQuizResults.strScore=100)
    window.open("Certificate_1.html", target="_self");
}
function optionOtherbutton(){
    if (g_oQuizResults.strScore<100) alert("You did not pass this quiz with 100% accuracy; therefore you will not get a certificate. Click OK, close the browser window and click on the Retry Quiz button.") + end;
    if (g_oQuizResults.strScore=100)
    window.open("Certificate_2.html", target="_self");

以下是调用函数的按钮:

<a href="" onclick="optionOtbutton()"><h4>Occupational Therapy</a>

<a href="" onclick="optionOtherbutton()">Other</a>

基本上,在本地保存时,它可以正常工作。但是当我将它上传到服务器时,该功能的第一个条件运行良好(意思是,提示用户提示)但另一半显示链接断开(当我将鼠标放在链接上时,任务栏显示我Certificate_1.htmlCertificate_2.html所在的目录,但不会打开HTML文件本身)。

0 个答案:

没有答案