请参阅下面的代码......并且有一个fiddle here.
我想用 jQuery UI 来设置它的样式。但是,我仍然可以调用此脚本,还是必须将其直接嵌入 HTML 页面?
这是表格...
<div class="search-pell">
<form onsubmit="showpell_13_14(document.getElementById('pellscore').value); return false;">
<input type="text" value="Enter 13-14 PELL Score" onfocus="if(this.value == 'Enter 13-14 PELL Score') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Enter 13-14 PELL Score'; }" class="search-input-bg-pell" id="pellscore" />
</form>
目前,当您搜索 PELL Grant 分数时,会从另一个脚本调用 alert()。
脚本是这样构建的...
// Begin EFC Calculator for 2013-2014
function showpell_13_14(efc) {
var pell;
var ssg;
var estpay;
var monthpay;
if (efc == 0) {
pell = 5645;
ssg = 0;
estpay = -573;
monthpay = 0;
}
else if (efc <= 100) {
pell = 5595;
ssg = 0;
estpay = -523;
monthpay = 0;
}
else if (efc <= 200) {
pell = 5495;
ssg = 0;
estpay = -423;
monthpay = 0;
}
...基于此显示结果...
alert('Based on the 2013-2014 EFC you entered ('+efc+'), you may receive...'
+' \n_________________________________________________________'
+' \n-Tuition of 36 credits: $14,472'
+' \n_________________________________________________________'
+' \n-Direct Loan maximum for a Freshman* student: $9,405**'
+' \n_________________________________________________________'
+' \n-Potential PELL Grant Award: $'+pell+'.'
+' \n_________________________________________________________'
+' \n-Your estimated total out of pocket payment: $'+estpay+'.'
+' \n_________________________________________________________'
+' \n-Potential Student Success Grant: $'+ssg+'.'
+' \n_________________________________________________________'
+' \n-Your estimated monthly out of pocket payment: $'+monthpay+'.'
+' \n...'
// +' \nIf your student has $0 out of pocket, disregard the next few lines...'
// +' \n_________________________________________________________'
// +' \n-Your estimated monthly payment is calculated by...'
// +' \n'
// +' \nTaking your total out of pocket for the year ($'+estpay+')'
// +' \nand subtracting your Student Success Grant ($'+ssg+') to get'
// +' \n your overall payment which is then broken up over 9 months'
// +' \nand comes to $'+monthpay+' per month.'
+' \n_________________________________________________________'
+' \n *Note: This is only configured for 1st year undergraduate students.'
+' \n **Loan fees of 1% are included in the loan rates listed on this sheet.');
再次 -我想用 jQuery UI 来设置它的样式。但是,我仍然可以调用此脚本,还是必须将其直接嵌入 HTML 页面?