The javascript just worked fine if I opened it with http, but if I opened it with https, it got problem.
Now the problem was solved and I share it online now.
I removed the javacript function: match(). It just works fine now.
The javascript just worked fine if I opened it with http, but if I opened it with https, it got problem.
Now the problem was solved and I share it online now.
I removed the javacript function: match(). It just works fine now.
When the “search” button is pressed, it shows the “Search processing. Please wait…”
until the browser shows “bestsellers.jsp”.
<div id=”search_simple”>
<form id=”form1″ name=”form1″ method=”post” action=”bestsellers.jsp”
onsubmit=”showProcessingBar()”>
……
<button name=”submit” type=”submit”>Search</button>
</form>
</div>
<div id=”processingbar” style=”display:none”>
<h3><font color=”red”>Search processing. Please wait…</font></h3>
</div>
javascript code:
function showProcessingBar()
{
document.getElementById(“search_simple”).style.display = “none”;
document.getElementById(“processingbar”).style.display = “block”;
return true; // you must return true otherwise the form will not be submitted
}
document.URL has been deprecated
My old code “document.URL = location.href + ‘&sortby=2’;” stops working.
It’s said that document.URL has been deprecated.
I change it to “document.location.href = “bestsellers.jsp?sortby=2″;”. It works just fine.
HTML:
<input type=”text” size=”1″ onKeyPress=”onlynumbers(this.value);” onMouseOut=”onlynumbers(this.value);”></input>
javascript:
//if the string includes non-number character, isNaN() will return true. Just note that the code “parseInt() == NaN” isn’t right here.
var str_value = 0;
function onlynumbers(str_value) {
if (isNaN(parseInt(str_value,10))) {
alert(‘Warning: it’s not a positive integer。’);
}
}