Javascript Section Index | Page 14
Where can I see the javadocs for the JSObject class?
API docs for Netscape's JSObject (and other 'standard' netscape.* classes can be viewed in Netscape's LiveConnect/Plug-in Developer's Guidemore
How can I use a servlet to print a file on a printer attached to the client?
The security in a browser is designed to restrict you from automating things like this. However, you can use JavaScript in the HTML your servlet returns to print a frame. The browser will still ...more
How do I access the value of a cookie using JavaScript?
You can manipulate cookies in JavaScript with the document.cookie property. You can set a cookie by assigning this property, and retrieve one by reading its current value.
The following statemen...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
When using the Java Plug-in, how can I communicate with JavaScript from my applet?
According to Sun's documentation (at least for the 1.3 version of the plug-in), you can communicate with JavaScript using the JSObject classes. The difference is in how you tell the JVM that you w...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
Are there any JavaScript engines written in Java that I can incorporate into my applications?
Rhino from Mozilla.org and FESI (pronounced like fuzzy / stands for Free EcmaScript Interpreter) represent two such implementations.more
Can JavaScript be used to access JavaBean properties within a JSP page?
JavaScript is code nested between SCRIPT tags within an html page. This code is interpreted and executed by the browser on the client PC. There is no way to directly access a JavaBean property wit...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
Can we maintain an XML data structure on the client side using JavaScript? Is there any parser to parse the xml data on the client side? The xml data will be passed as an string.
Yes, refer to the XML data islands on the Microsoft web site.
You can have the XML in a web page (which can be generated dynamically) or embedded in the HTML. You can use Microsoft XML data islan...more
It seems to me that a JSP page forward always ends up in the frame where the original JSP page was in. How can I replace the entire frame with a new page?
Unfortunately, your JSP application has no way of knowing that it's being loaded into a frameset - your forward will always be loaded into the browser in the place that the original request would ...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
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
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
For JSP 1.0, is there any way to use both standard Java scriptlets and JavaScript in the same JSP? (Motivation: Reuse of tool-generated JavaScript)
You can only use one server-side scripting language per JSP. You can use client-side JavaScript in a JSP as template text, with Java as the scripting language, but not both as the server-side scr...more