我有一个节点,该节点具有javascript和一个粘贴到页面上的计算器表单,该表单允许用户根据他们选择的表单字段计算分数。
这仅在我使用旁路cookie功能时有效。我曾尝试在URL上添加?advagg = 0,但这似乎根本不起作用,页面只会重新加载。
还有另一种方法可以绕过一个URL,以便计算器正常工作吗?
这是我们粘贴到页面上的内容:
<!-- APS Calculator Script start -->
<script>
function DetectEnterPressed(e) {
var characterCode;
if (e && e.which) {
e = e;
characterCode = e.which;
}
else {
e = event;
characterCode = e.keyCode;
}
if (characterCode == 13) return true;
else return false;
}
function validateform(thisform) {
with (thisform) {
var e = document.getElementById("FirstLanguage");
var strFirstLanguage = e.options[e.selectedIndex].value;
if (document.getElementById("FirstLanguage").options[document.getElementById("FirstLanguage").selectedIndex].value == "" || document.getElementById("FirstLanguageAPS").options[document.getElementById("FirstLanguageAPS").selectedIndex].value == "") {
alert("Please select your First language and mark");
document.getElementById("FirstLanguage").focus();
return false;
}
if (document.getElementById("SecondLanguage").options[document.getElementById("SecondLanguage").selectedIndex].value == "" || document.getElementById("SecondLanguageAPS").options[document.getElementById("SecondLanguageAPS").selectedIndex].value == "") {
alert("Please select your Second language and mark");
document.getElementById("SecondLanguage").focus();
return false;
}
if (document.getElementById("Maths").options[document.getElementById("Maths").selectedIndex].value == "" || document.getElementById("MathsAPS").options[document.getElementById("MathsAPS").selectedIndex].value == "") {
alert("Please select your Math type and mark");
document.getElementById("Maths").focus(); ;
return false;
}
if (document.getElementById("LO").options[document.getElementById("LO").selectedIndex].value == "" || document.getElementById("LOAPS").options[document.getElementById("LOAPS").selectedIndex].value == "") {
alert("Please select your LO mark");
document.getElementById("LOAPS").focus();
return false;
}
if (document.getElementById("Subject5").options[document.getElementById("Subject5").selectedIndex].value == "" || document.getElementById("Subject5APS").options[document.getElementById("Subject5APS").selectedIndex].value == "") {
alert("Please select a fifth subject and mark");
document.getElementById("Subject5").focus();
return false;
}
if (document.getElementById("Subject6").options[document.getElementById("Subject6").selectedIndex].value == "" || document.getElementById("Subject6APS").options[document.getElementById("Subject6APS").selectedIndex].value == "") {
alert("Please select a sixth subject and mark");
document.getElementById("Subject6").focus();
return false;
}
if (document.getElementById("Subject7").options[document.getElementById("Subject7").selectedIndex].value == "" || document.getElementById("Subject7APS").options[document.getElementById("Subject7APS").selectedIndex].value == "") {
alert("Please select a seventh subject and mark");
document.getElementById("Subject7").focus();
return false;
}
var APSscore;
var FirstLang = parseInt(document.getElementById("FirstLanguageAPS").options[document.getElementById("FirstLanguageAPS").selectedIndex].value)
var SecondLang = parseInt(document.getElementById("SecondLanguageAPS").options[document.getElementById("SecondLanguageAPS").selectedIndex].value)
var Maths = parseInt(document.getElementById("MathsAPS").options[document.getElementById("MathsAPS").selectedIndex].value)
var LO = parseInt(document.getElementById("LOAPS").options[document.getElementById("LOAPS").selectedIndex].value)
var Subject5 = parseInt(document.getElementById("Subject5APS").options[document.getElementById("Subject5APS").selectedIndex].value)
var Subject6 = parseInt(document.getElementById("Subject6APS").options[document.getElementById("Subject6APS").selectedIndex].value)
var Subject7 = parseInt(document.getElementById("Subject7APS").options[document.getElementById("Subject7APS").selectedIndex].value)
APSscore = FirstLang + SecondLang + Maths + LO + Subject5 + Subject6 + Subject7;
document.getElementById("showScore").innerHTML = "<p class='APSscore'>Your APS score is <strong>" + APSscore + "</strong></p><br />";
return false;
}
}
</script>
<!-- APS Calculator Script end -->
<form action="#" method="post" name="APSCalculator" onsubmit="return (validateform(this))">
<div class="HideTableBorders">
<table width="100%" class="table table-bordered">
<tbody>
<tr>
<td style="border: 1px solid #999;padding: 3px 5px;background-color: #999;color: #fff;border-right: 1px solid #bbb;">
</td>
<td style="border: 1px solid #999;padding: 3px 5px;background-color: #999;color: #fff;border-right: 1px solid #bbb;">
<strong>Subjects:</strong>
</td>
<td style="border: 1px solid #999;padding: 3px 5px;background-color: #999;color: #fff;border-right: 1px solid #bbb;">
<strong>Marks:</strong>
</td>
</tr>
<tr>
<td style="background-color: #e7ecf9">
<strong>First Language</strong></td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="FirstLanguage" name="FirstLanguage">
<option selected="selected" value="">Select a subject.</option>
<option value="Afrikaans Home Language">Afrikaans Home Language</option>
<option value="English Home Language">English Home Language</option>
<option value="IsiNdebele Home Language">IsiNdebele Home Language</option>
<option value="IsiXhosa Home Language">IsiXhosa Home Language</option>
<option value="IsiZulu Home Language">IsiZulu Home Language</option>
<option value="Sepedi Home Language">Sepedi Home Language</option>
<option value="Sesotho Home Language">Sesotho Home Language</option>
<option value="Setswana Home Language">Setswana Home Language</option>
<option value="SiSwati Home Language">SiSwati Home Language</option>
<option value="Tshivenda Home Language">Tshivenda Home Language</option>
<option value="Xitsonga Home Language">Xitsonga Home Language</option>
</select>
</td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="FirstLanguageAPS" name="FirstLanguageAPS">
<option selected="selected" value="">Select your mark.</option>
<option value="8">90% - 100% (Level 8)</option>
<option value="7">80% - 89% (Level 7)</option>
<option value="6">70% - 79% (Level 6)</option>
<option value="5">60% - 69% (Level 5)</option>
<option value="4">50% - 59% (Level 4)</option>
<option value="3">40% - 49% (Level 3)</option>
<option value="2">30% - 39% (Level 2)</option>
<option value="0">0% - 29% (Level 1)</option>
</select>
</td>
</tr>
<tr>
<td>
<strong>Second Language</strong></td>
<td>
<select class="form-control" id="SecondLanguage" name="SecondLanguage">
<option selected="selected" value="">Select a subject.</option>
<option value="Afrikaans First Additional Language">Afrikaans First Additional Language</option>
<option value="English First Additional Language">English First Additional Language</option>
<option value="IsiNdebele First Additional Language">IsiNdebele First Additional Language</option>
<option value="IsiXhosa First Additional Language">IsiXhosa First Additional Language</option>
<option value="IsiZulu First Additional Language">IsiZulu First Additional Language</option>
<option value="Sepedi First Additional Language">Sepedi First Additional Language</option>
<option value="Sesotho First Additional Language">Sesotho First Additional Language</option>
<option value="Setswana First Additional Language">Setswana First Additional Language</option>
<option value="SiSwati First Additional Language">SiSwati First Additional Language</option>
<option value="Tshivenda First Additional Language">Tshivenda First Additional Language</option>
<option value="Xitsonga First Additional Language">Xitsonga First Additional Language</option>
</select>
</td>
<td>
<select class="form-control" id="SecondLanguageAPS" name="SecondLanguageAPS">
<option selected="selected" value="">Select your mark.</option>
<option value="8">90% - 100% (Level 8)</option>
<option value="7">80% - 89% (Level 7)</option>
<option value="6">70% - 79% (Level 6)</option>
<option value="5">60% - 69% (Level 5)</option>
<option value="4">50% - 59% (Level 4)</option>
<option value="3">40% - 49% (Level 3)</option>
<option value="2">30% - 39% (Level 2)</option>
<option value="0">0% - 29% (Level 1)</option>
</select>
</td>
</tr>
<tr>
<td style="background-color: #e7ecf9">
<strong>Maths</strong></td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="Maths" name="Maths">
<option selected="selected" value="">Select a subject.</option>
<option value="Mathematical Literacy">Mathematical Literacy</option>
<option value="Mathematics">Mathematics</option>
</select>
</td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="MathsAPS" name="MathsAPS">
<option selected="selected" value="">Select your mark.</option><option value="8">90% - 100% (Level 8)</option><option value="7">80% - 89% (Level 7)</option><option value="6">70% - 79% (Level 6)</option><option value="5">60% - 69% (Level 5)</option><option value="4">50% - 59% (Level 4)</option><option value="3">40% - 49% (Level 3)</option><option value="2">30% - 39% (Level 2)</option><option value="0">0% - 29% (Level 1)</option></select></td>
</tr>
<tr>
<td>
<strong>Life Orientation (LO)</strong></td>
<td>
<select class="form-control" id="LO" name="LO"><option selected="selected" value="Life Orientation">Life Orientation</option></select></td>
<td>
<select class="form-control" id="LOAPS" name="LOAPS"><option selected="selected" value="">Select your mark.</option><option value="8">90% - 100% (Level 8)</option><option value="7">80% - 89% (Level 7)</option><option value="6">70% - 79% (Level 6)</option><option value="5">60% - 69% (Level 5)</option><option value="4">50% - 59% (Level 4)</option><option value="3">40% - 49% (Level 3)</option><option value="2">30% - 39% (Level 2)</option><option value="0">0% - 29% (Level 1)</option></select></td>
</tr>
<tr>
<td style="background-color: #e7ecf9">
<strong>Subject 5</strong></td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="Subject5" name="Subject5"><option selected="selected" value="">Select a subject.</option><option value="Accounting">Accounting</option><option value="Afrikaans Second Additional Language">Afrikaans Second Additional Language</option><option value="Agricultural Management Practices">Agricultural Management Practices</option><option value="Agricultural Science">Agricultural Science</option><option value="Agricultural Technology">Agricultural Technology</option><option value="Arabic Second Additional Language">Arabic Second Additional Language</option><option value="Business Studies">Business Studies</option><option value="Civil Technology">Civil Technology</option><option value="Computer Applications Technology">Computer Applications Technology</option><option value="Consumer Studies">Consumer Studies</option><option value="Dance Studies">Dance Studies</option><option value="Design">Design</option><option value="Dramatic Arts">Dramatic Arts</option><option value="Economics">Economics</option><option value="Electrical Technology">Electrical Technology</option><option value="Engineering Graphics and Design">Engineering Graphics and Design</option><option value="English Second Additional Language">English Second Additional Language</option><option value="French Second Additional Language">French Second Additional Language</option><option value="Geography">Geography</option><option value="German Home Language">German Home Language</option><option value="German Second Additional Language">German Second Additional Language</option><option value="Gujarati First Additional Language">Gujarati First Additional Language</option><option value="Gujarati Home Language">Gujarati Home Language</option><option value="Gujarati Second Additional Language">Gujarati Second Additional Language</option><option value="Hebrew Second Additional Language">Hebrew Second Additional Language</option><option value="Hindi First Additional Language">Hindi First Additional Language</option><option value="Hindi Home Language">Hindi Home Language</option><option value="Hindi Second Additional Language">Hindi Second Additional Language</option><option value="History">History</option><option value="Hospitality Studies">Hospitality Studies</option><option value="Information Technology">Information Technology</option><option value="IsiNdebele Second Additional Language">IsiNdebele Second Additional Language</option><option value="IsiXhosa Second Additional Language">IsiXhosa Second Additional Language</option><option value="IsiZulu Second Additional Language">IsiZulu Second Additional Language</option><option value="Italian Second Additional Language">Italian Second Additional Language</option><option value="Latin Second Additional Language">Latin Second Additional Language</option><option value="Life Sciences">Life Sciences</option><option value="Mechanical Technology">Mechanical Technology</option><option value="Music">Music</option><option value="Physical Sciences">Physical Sciences</option><option value="Portuguese First Additional Language">Portuguese First Additional Language</option><option value="Portuguese Home Language">Portuguese Home Language</option><option value="Portuguese Second Additional Language">Portuguese Second Additional Language</option><option value="Religion Studies">Religion Studies</option><option value="Sepedi Second Additional Language">Sepedi Second Additional Language</option><option value="Sesotho Second Additional Language">Sesotho Second Additional Language</option><option value="Setswana Second Additional Language">Setswana Second Additional Language</option><option value="SiSwati Second Additional Language">SiSwati Second Additional Language</option><option value="Spanish Second Additional Language">Spanish Second Additional Language</option><option value="Tamil First Additional Language">Tamil First Additional Language</option><option value="Tamil Home Language">Tamil Home Language</option><option value="Tamil Second Additional Language">Tamil Second Additional Language</option><option value="Telegu First Additional Language">Telegu First Additional Language</option><option value="Telegu Home Language">Telegu Home Language</option><option value="Telegu Second Additional Language">Telegu Second Additional Language</option><option value="Tourism">Tourism</option><option value="Tshivenda Second Additional Language">Tshivenda Second Additional Language</option><option value="Urdu First Additional Language">Urdu First Additional Language</option><option value="Urdu Home Language">Urdu Home Language</option><option value="Urdu Second Additional Language">Urdu Second Additional Language</option><option value="Visual Arts">Visual Arts</option><option value="Xitsonga Second Additional Language">Xitsonga Second Additional Language</option></select></td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="Subject5APS" name="Subject5APS"><option selected="selected" value="">Select your mark.</option><option value="8">90% - 100% (Level 8)</option><option value="7">80% - 89% (Level 7)</option><option value="6">70% - 79% (Level 6)</option><option value="5">60% - 69% (Level 5)</option><option value="4">50% - 59% (Level 4)</option><option value="3">40% - 49% (Level 3)</option><option value="2">30% - 39% (Level 2)</option><option value="0">0% - 29% (Level 1)</option></select></td>
</tr>
<tr>
<td>
<strong>Subject 6</strong></td>
<td>
<select class="form-control" id="Subject6" name="Subject6"><option selected="selected" value="">Select a subject.</option><option value="Accounting">Accounting</option><option value="Afrikaans Second Additional Language">Afrikaans Second Additional Language</option><option value="Agricultural Management Practices">Agricultural Management Practices</option><option value="Agricultural Science">Agricultural Science</option><option value="Agricultural Technology">Agricultural Technology</option><option value="Arabic Second Additional Language">Arabic Second Additional Language</option><option value="Business Studies">Business Studies</option><option value="Civil Technology">Civil Technology</option><option value="Computer Applications Technology">Computer Applications Technology</option><option value="Consumer Studies">Consumer Studies</option><option value="Dance Studies">Dance Studies</option><option value="Design">Design</option><option value="Dramatic Arts">Dramatic Arts</option><option value="Economics">Economics</option><option value="Electrical Technology">Electrical Technology</option><option value="Engineering Graphics and Design">Engineering Graphics and Design</option><option value="English Second Additional Language">English Second Additional Language</option><option value="French Second Additional Language">French Second Additional Language</option><option value="Geography">Geography</option><option value="German Home Language">German Home Language</option><option value="German Second Additional Language">German Second Additional Language</option><option value="Gujarati First Additional Language">Gujarati First Additional Language</option><option value="Gujarati Home Language">Gujarati Home Language</option><option value="Gujarati Second Additional Language">Gujarati Second Additional Language</option><option value="Hebrew Second Additional Language">Hebrew Second Additional Language</option><option value="Hindi First Additional Language">Hindi First Additional Language</option><option value="Hindi Home Language">Hindi Home Language</option><option value="Hindi Second Additional Language">Hindi Second Additional Language</option><option value="History">History</option><option value="Hospitality Studies">Hospitality Studies</option><option value="Information Technology">Information Technology</option><option value="IsiNdebele Second Additional Language">IsiNdebele Second Additional Language</option><option value="IsiXhosa Second Additional Language">IsiXhosa Second Additional Language</option><option value="IsiZulu Second Additional Language">IsiZulu Second Additional Language</option><option value="Italian Second Additional Language">Italian Second Additional Language</option><option value="Latin Second Additional Language">Latin Second Additional Language</option><option value="Life Sciences">Life Sciences</option><option value="Mechanical Technology">Mechanical Technology</option><option value="Music">Music</option><option value="Physical Sciences">Physical Sciences</option><option value="Portuguese First Additional Language">Portuguese First Additional Language</option><option value="Portuguese Home Language">Portuguese Home Language</option><option value="Portuguese Second Additional Language">Portuguese Second Additional Language</option><option value="Religion Studies">Religion Studies</option><option value="Sepedi Second Additional Language">Sepedi Second Additional Language</option><option value="Sesotho Second Additional Language">Sesotho Second Additional Language</option><option value="Setswana Second Additional Language">Setswana Second Additional Language</option><option value="SiSwati Second Additional Language">SiSwati Second Additional Language</option><option value="Spanish Second Additional Language">Spanish Second Additional Language</option><option value="Tamil First Additional Language">Tamil First Additional Language</option><option value="Tamil Home Language">Tamil Home Language</option><option value="Tamil Second Additional Language">Tamil Second Additional Language</option><option value="Telegu First Additional Language">Telegu First Additional Language</option><option value="Telegu Home Language">Telegu Home Language</option><option value="Telegu Second Additional Language">Telegu Second Additional Language</option><option value="Tourism">Tourism</option><option value="Tshivenda Second Additional Language">Tshivenda Second Additional Language</option><option value="Urdu First Additional Language">Urdu First Additional Language</option><option value="Urdu Home Language">Urdu Home Language</option><option value="Urdu Second Additional Language">Urdu Second Additional Language</option><option value="Visual Arts">Visual Arts</option><option value="Xitsonga Second Additional Language">Xitsonga Second Additional Language</option></select></td>
<td>
<select class="form-control" id="Subject6APS" name="Subject6APS"><option selected="selected" value="">Select your mark.</option><option value="8">90% - 100% (Level 8)</option><option value="7">80% - 89% (Level 7)</option><option value="6">70% - 79% (Level 6)</option><option value="5">60% - 69% (Level 5)</option><option value="4">50% - 59% (Level 4)</option><option value="3">40% - 49% (Level 3)</option><option value="2">30% - 39% (Level 2)</option><option value="0">0% - 29% (Level 1)</option></select></td>
</tr>
<tr>
<td style="background-color: #e7ecf9">
<strong>Subject 7</strong></td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="Subject7" name="Subject7"><option selected="selected" value="">Select a subject.</option><option value="Accounting">Accounting</option><option value="Afrikaans Second Additional Language">Afrikaans Second Additional Language</option><option value="Agricultural Management Practices">Agricultural Management Practices</option><option value="Agricultural Science">Agricultural Science</option><option value="Agricultural Technology">Agricultural Technology</option><option value="Arabic Second Additional Language">Arabic Second Additional Language</option><option value="Business Studies">Business Studies</option><option value="Civil Technology">Civil Technology</option><option value="Computer Applications Technology">Computer Applications Technology</option><option value="Consumer Studies">Consumer Studies</option><option value="Dance Studies">Dance Studies</option><option value="Design">Design</option><option value="Dramatic Arts">Dramatic Arts</option><option value="Economics">Economics</option><option value="Electrical Technology">Electrical Technology</option><option value="Engineering Graphics and Design">Engineering Graphics and Design</option><option value="English Second Additional Language">English Second Additional Language</option><option value="French Second Additional Language">French Second Additional Language</option><option value="Geography">Geography</option><option value="German Home Language">German Home Language</option><option value="German Second Additional Language">German Second Additional Language</option><option value="Gujarati First Additional Language">Gujarati First Additional Language</option><option value="Gujarati Home Language">Gujarati Home Language</option><option value="Gujarati Second Additional Language">Gujarati Second Additional Language</option><option value="Hebrew Second Additional Language">Hebrew Second Additional Language</option><option value="Hindi First Additional Language">Hindi First Additional Language</option><option value="Hindi Home Language">Hindi Home Language</option><option value="Hindi Second Additional Language">Hindi Second Additional Language</option><option value="History">History</option><option value="Hospitality Studies">Hospitality Studies</option><option value="Information Technology">Information Technology</option><option value="IsiNdebele Second Additional Language">IsiNdebele Second Additional Language</option><option value="IsiXhosa Second Additional Language">IsiXhosa Second Additional Language</option><option value="IsiZulu Second Additional Language">IsiZulu Second Additional Language</option><option value="Italian Second Additional Language">Italian Second Additional Language</option><option value="Latin Second Additional Language">Latin Second Additional Language</option><option value="Life Sciences">Life Sciences</option><option value="Mechanical Technology">Mechanical Technology</option><option value="Music">Music</option><option value="Physical Sciences">Physical Sciences</option><option value="Portuguese First Additional Language">Portuguese First Additional Language</option><option value="Portuguese Home Language">Portuguese Home Language</option><option value="Portuguese Second Additional Language">Portuguese Second Additional Language</option><option value="Religion Studies">Religion Studies</option><option value="Sepedi Second Additional Language">Sepedi Second Additional Language</option><option value="Sesotho Second Additional Language">Sesotho Second Additional Language</option><option value="Setswana Second Additional Language">Setswana Second Additional Language</option><option value="SiSwati Second Additional Language">SiSwati Second Additional Language</option><option value="Spanish Second Additional Language">Spanish Second Additional Language</option><option value="Tamil First Additional Language">Tamil First Additional Language</option><option value="Tamil Home Language">Tamil Home Language</option><option value="Tamil Second Additional Language">Tamil Second Additional Language</option><option value="Telegu First Additional Language">Telegu First Additional Language</option><option value="Telegu Home Language">Telegu Home Language</option><option value="Telegu Second Additional Language">Telegu Second Additional Language</option><option value="Tourism">Tourism</option><option value="Tshivenda Second Additional Language">Tshivenda Second Additional Language</option><option value="Urdu First Additional Language">Urdu First Additional Language</option><option value="Urdu Home Language">Urdu Home Language</option><option value="Urdu Second Additional Language">Urdu Second Additional Language</option><option value="Visual Arts">Visual Arts</option><option value="Xitsonga Second Additional Language">Xitsonga Second Additional Language</option></select></td>
<td style="background-color: #e7ecf9">
<select class="form-control" id="Subject7APS" name="Subject7APS"><option selected="selected" value="">Select your mark.</option><option value="8">90% - 100% (Level 8)</option><option value="7">80% - 89% (Level 7)</option><option value="6">70% - 79% (Level 6)</option><option value="5">60% - 69% (Level 5)</option><option value="4">50% - 59% (Level 4)</option><option value="3">40% - 49% (Level 3)</option><option value="2">30% - 39% (Level 2)</option><option value="0">0% - 29% (Level 1)</option></select></td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<input class="btn btn-default" onclick="return(validateform(this))" onkeypress="return(DetectEnterPressed(event))" type="submit" value="Calculate APS" /></td>
<td align="center" id="showScore">
</td>
</tr>
</tbody>
</table>
</div>