Javascript Section Index | Page 7
How do you add scroll bars to a selection list created using HTML SELECT tag?
How do you add scroll bars to a selection list created using
HTML SELECT tag?
How can I make mousepointer turn into an hourglass and backwards, driven by relevant events in my application?
How can I make mousepointer turn into an
hourglass and backwards, driven by relevant events in my application?
For example, I want an hourglass to appear when a new window is opened by the applica...more
How do you find the ASCII value of a character in JavaScript?
You can use the charCodeAt(int) method of String objects to get the character code of a specific char in a string.
Example:
var anyString = 'hello';
anyString.charCodeAt(1);
more
Dictionary type select How do I setup a dropdown box to have multi-character (dictionary) type select?
Dictionary type select
How do I setup a dropdown box to have multi-character (dictionary) type select?
If I have Jean, John, and Oscar in the list, I want typing "J" then "O" to go to John, not Osc...more
How to give custom colors to scrollbars?
Try using this style:
BODY {
display: block; font-family: verdana, arial, serif;
font-size: xx-small;
scrollbar-face-color: navy;
scrollbar-shadow-color: yellow;
scrollbar-highlight-color: b...more
What are the ASCII values of arrow keys?
37(left arrow)
38(up arrow)
39(right arrow)
40(down arrow)
What do the various location object properties mean?
1. hash
Refers to any internal anchors of the URL, including the '#' sign. Changing this will change the anchor reference portion of the URL.
2. host
The hostname:port of the URL. Changing this...more
How do I print the contents of a different frame from JavaScript?
Use parent.frameName.print();
How can I print only a portion of the page and not the whole window from JSP? Calling a JavaScript function and performing window.print(), prints the whole window.
There may be an easier solution but one idea might be to use JavaScript.
Open a new browser window and write the data you want to print into that. You can also format it any way you want using co...more
How can I manually scroll down to a desired location within the page?
There's method in window, scrollTo(x, y).
To scroll to a certain location automatically, you could use it like this:
...
<BODY ONLOAD="self.scrollTo(x, y)">
...
more
How can I add a hidden form field just before submitting a form using JavaScript?
For Internet Explorer...
To use, cut and paste into a new html doc to test it, if you name your html doc anything other than DynamicHiddenField.html, then update the form's action as need be.
...more
How do we know whether the JavaScript is enabled or disabled in the client's browser?
Just use the <NOSCRIPT> tag:
<script>
alert('Javascript is enabled');
</script>
<noscript>
this browser doesn't support scripting or has Javascript...more
How can we hide the html source code when the user tries to view the source code from the browser's "view source" file menu option?
[Short answer: no, it's not possible, since the source code *is* the response. If the user wants to see your source, he can. However, here's a clever hack... -A]
Yes it's possible, I've done it...more
Browser Page idle for 3 minutes Is it possible to find out if the browser page is idle for some time and prompt to the user?
Hi,
This is a very simple html page that after a 1 minute (set with the IDLE_TIME variable) of total inactivity, it will diplay an alert box.
The "total" inactivity is defined using the <script...more
Is it possible to trigger events as each frame of an animated GIF89A image is displayed?
It seems that you can't. The image trigers a new "onLoad()" event every time the animation restarts from the first frame, but there is no way to trap the event of a frame change.