Client-Side Development Section Index | Page 2
How do I execute a string whose value is a line of JavaScript code?
Just use eval("your string here");
How can I disable the forward and back buttons in a browser from JavaScript?
You can't. About the best you can do is hide the buttons and disable caching of the pages. Unfortunately, their keyboard equivalents (ALT+Right/Left Arrow) will still work. At least with caching d...more
What causes an "javax.activation.UnsupportedDataTypeException: no object DCH for MIME type xxx/xxxx javax.mail.MessagingException: IOException while sending message;" to be sent and how do I fix this? [This happens for known MIME types like text/html.]
The Java Activation Framework used by JavaMail is not configured correctly.
It doesn't know how to handle the text/html content type.
An html handler is provided in JavaMail 1.1.3 but the mailc...more
What is the difference between a Frame and a JFrame?
Frame is part of java.awt package and exists since JDK1.0. JFrame is part of javax.swing package and exists since JDK1.1.3 or something.
Frame extends Window.
JFrame extends Frame.
You can di...more
What causes the error "Can't connect to X11 window server"?
The Sun AWT classes on Unix and Linux have a dependence on the X Window System: when you use the classes, they expect to load X client libraries and be able to talk to an X display server. This ma...more
How do I disable JavaScript in Internet Explorer?
With IE5/5.5, to disable JavaScript you have to change the security settings. You'll find the setting under Tools->Internet Options->Security Tab bar->Custom Level->Disable Active scri...more
Is there any way to generate offscreen images without relying on the native graphics support? I'd like to create an image without an X server running, or create an image with more colors than the current video mode.
You must have a graphical environment installed on your server to work with Java image routines in AWT, even though the image will only be displayed on the client's machine.
The AWT image manipul...more
What's the difference between JavaScript and Java?
JavaScript is an object-oriented scripting language that allows you to create dynamic HTML pages, allowing you to process/validate input data and maintain data, usually within the browser. Origina...more
How can I display content in the form of a Tree using JSP?
There are a few ways that you could try, although it all depends on any restrictions you have on deployment.
First off, you could use Swing's JTree in a small applet. This would require the use o...more
How can you logout a user (invalidate his Session) when a user directly closes his browser window?
Short answer: you can't. Fortunately, sessions expire automatically after a period of time; check your servlet engine documentation to see how to set this timeout period.
I felt that there should...more
How can I display raw HTML, generated by an applet, without saving it on the server?
You can display HTML dynamically generated by your applet by passing it first to a JavaScript method,
(see also this
FAQ)
that in turn puts the code into the page.
You can overwrite a document fra...more
Is there any way in JSP to set focus on an input field in a HTML form using JSP code, and not JavaScript?
No, there isn't. Remember, JSP is strictly a server-side technology, which is responsible
for generating dynamic content in HTML, DHTML or XML format. Setting focus on
specific input elements wi...more
How and why would you use the java.awt.EventQueue?
Well there are many reasons.
Say, you wanted to catch all the mouse events across all the GUI of your application.
Without tapping the EventQueue you will have to add a mouse listener
and mouse...more
When I display HTML in a JEditorPane, does it support JavaScript?
No.
How can you copy a JavaScript variable to a JSP session variable without using cookies?
How can you copy a JavaScript variable to a JSP session variable without using cookies?
I am trying to store the value of a SELECT object in a session variable so it can be accessed in other JSP's...more