Recent Notes

Displaying keyword search results 51 - 60
Created by Dr. Xi on April 26, 2007 23:00:25    Last update: January 10, 2011 22:15:32
If you ever wonder how those "cool" dialog boxes are made, copy and paste the following code to a file and test it with your browser. This is probably the simplest code for such effects. If you don't know what I mean, try it anyway. <html> <head> <title>Test Overlay</ti...
Created by James on January 10, 2011 16:37:20    Last update: January 10, 2011 16:37:20
The following page injects CSS rules with JavaScript. It works fine in Firefox and Chrome. <html> <head> <script type="text/javascrip... But in IE, it breaks with "Unknown runtime error" (seemed like it's trying to interpret the curly brackets in the CSS as JavaScript blocks!): In order to make it work in IE, the code need to be changed to: <html> <head> <script type="text/javascrip... The tricks to identify IE and insert new CSS rules came from Paul Irish .
Created by James on October 29, 2010 20:12:28    Last update: October 29, 2010 20:14:17
Some links for layout managers (the widgets that divide your screen into sections with movable separators, like those normally found in IDEs): YUI 2: Layout Manager jQuery UI.Layout Plug-in Also: http://plugins.jquery.com/project/Layout jLayout — jQuery plugin Layout manager - Scripteka :: Prototype extensions library . Demos: http://javascripts.sourceforge.net/html/layoutmanager/layoutmanager-index.html
Created by James on October 15, 2010 20:10:26    Last update: October 15, 2010 20:10:26
Download the Cufon Javascript and save it as cufon-yui.js . Generate the font JavaScript and save it as myfont.js (upload the font file through http://cufon.shoqolate.com/generate/ ). Add these lines to the header element: <script type="text/javascript" src="cufon-yui.js">... Replace selected elements with JavaScript like this: <script type="text/javascript"> Cufon.rep... Full HTML page: <!DOCTYPE html> <html> <head> <title>C... Reference: Cufonize Your Pages – How to add Cufon to your Web Design
Created by James on September 10, 2010 23:01:14    Last update: September 10, 2010 23:01:14
By default, heights for jQuery UI tab panels expand or contract depending on the height of each tab. The code snippet here sets the height of all tabs to be equal to that of the container. <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on September 07, 2010 22:12:01    Last update: September 07, 2010 22:13:45
I had a need to use Ajax to get a response from the server and conditionally render the results based on a status code. Additionally, I need to update multiple areas on the page from the results of one request. The code presented here uses jQuery and an XML response with CDATA sections to achieve that goal. Server side code (perl cgi): #!C:/perl/bin/perl.exe ## ## redirect ##... The HTML page: <html> <head> <script type="text/javascript...
Created by Fang on March 23, 2010 03:50:11    Last update: August 18, 2010 21:59:52
This is a simple web application with a single servlet and a single JSP page. It is intended to be a test bed for JSTL tags. You may want to store all syntax, rules, and exceptions in your head, but in my opinion nothing beats a simple test program that allows you play with it all you want. So here it is (build with Maven ). Prerequisites: Maven: http://maven.apache.org/ . You don't need any prior knowledge of Maven, but you need to install the binary. JBoss: http://jboss.org/jbossas/downloads/ , or Tomcat: http://tomcat.apache.org/ if you don't run the SQL tests. You need to know how to deploy a web application (shh! Don't tell your boss it's just copying a file to the deployment folder). Steps: The directory...
Created by James on June 30, 2010 19:04:45    Last update: July 03, 2010 21:24:33
Technically, file upload cannot be handled by Ajax, because XMLHttpRequest (XHR) does not handle file inputs. All techniques not using Flash rely on an invisible iframe as the upload form submit target. JavaScript then grabs the response content from the iframe and present it, giving the same illusion as Ajax. webtoolkit AIM The technique by webtoolkit is very simple. It involves 3 simple steps: include the AIM script, implement the start/finish JavaScript functions, and add an onsubmit handler to the normal file upload form. The hooked up form looks like: <head> <script type="text/javascript" src="webt... The AIM script is also quite simple: /** * * AJAX IFRAME METHOD (AIM) * http... The above code only supports HTML responses. In order to support JSON responses, the above...
Created by James on June 30, 2010 20:14:28    Last update: July 03, 2010 18:41:12
The HTML page <!DOCTYPE html> <html> <head> <title>jQu... Client Side Code // called before upload submit function sta... Server Side Code Using Apache Commons FileUpload as example. Upload code (responds to fileUpload.do ): final HttpSession session = httpServletRequest... Progress code (responds to uploadProgress.do ): HttpSession session = httpServletRequest.getSe...
Created by James on June 24, 2010 22:04:19    Last update: June 24, 2010 22:04:19
Start with this page: <!DOCTYPE html> <html> <head> <title>jQu... When you click "Submit", the form submits fine. Now turn the form to a jQuery dialog: <head> <title>jQuery UI Dialog</title> ... When you click "Submit", the form no longer submits! Why? When you convert the contents of the form into a dialog, the form becomes empty! The "Submit" button is no longer associated with the form. Conclusion: you should always put the form tag inside the element you are converting to a dialog.
Previous  1 2 3 4 5 6 7 8 9 Next