Recent Notes

Displaying keyword search results 1 - 12
Created by James on May 03, 2012 14:54:46    Last update: May 03, 2012 14:54:46
History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. For HTML4 browsers it will revert back to using the old onhashchange functionality. All major browsers are supported. This is a simple test page to get started: <html> <head> <title>Test History</title> ... Note: state url must be provided for IE to generate a unique hash. YOu can prefix the state url with '?' ('#' does not work).
Created by mee2 on October 19, 2011 20:51:04    Last update: October 19, 2011 20:51:53
From Alfresco wiki : Script Files Script files can be stored either on the ClassPath (for example, in alfresco/extension/myscripts ) or in a repository store. Scripts are generally stored in the default repository in the Company Home/Data Dictionary/Scripts location. Scripts in this location can be accessed directly by users via the Execute a script action . Scripts in any repository location can be accessed by any user via REST URL if they have the appropriate read permissions on the script document. Scripts on the ClassPath can be imported into other scripts but not executed directly in the web client.
Created by James on March 03, 2011 20:50:51    Last update: March 03, 2011 20:51:54
This function parses the querystring and returns the query parameters as a map. It calls the string replace function with a function replacement and uses the side effects of the replacement function call to populate the parameter map. function getQueryParameters() { var result ...
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 woolf on February 03, 2010 04:02:07    Last update: February 03, 2010 04:03:18
Redirect without delay: <html> <body> <script type="text/javascript... Redirect with delay: <html> <body> <script type="text/javascript...
Created by Dr. Xi on October 04, 2008 04:13:57    Last update: October 04, 2008 04:15:22
substr returns a substring beginning at a specified location and having a specified length . substring returns a substring by specifying the start and end index. s = 'She-sells-sea-shells-by-the-sea-shore'; s.... But really, providing two options does not make things better. Either one gets the jobs done. Two options just create more confusion.
Created by Dr. Xi on August 14, 2008 22:44:53    Last update: September 29, 2008 21:41:40
Syntax: oNewWindow = window.open( [sURL] [, sName] [, sF... Example: window.open("Sample.htm",null, "height=200,... However, for IE7 (at least) the sName parameter can't have the space character: // this works window.open("sample.html", "wndCh...
Created by Dr. Xi on September 23, 2008 02:50:53    Last update: September 23, 2008 02:59:22
You can set browser options to dictate whether a popup should be opened in a new tab or a new window. For IE, when you select "Let Internet Explorer decide how pop-ups should open" in the Tabbed Browsing Settings dialog, the popup will be shown in a new window when toolbar , menubar , or location is "no": window.open("Sample.htm",null, "height=200,... For Firefox, a popup without toolbar, menubar or location bar will be opened in a new window even when you check "New Pages should be opened in: a new tab " in the Tabs options.
Created by Dr. Xi on September 22, 2008 23:15:03    Last update: September 23, 2008 02:33:14
Simply put, you can't. There are various hacks to get what you want, but none of them is 100% satisfactory: Disable caching: <html> <head> <meta http-equiv="Expires" C... Open the target URL in a new browser without the toolbar and close the parent: <script language="JavaScript"> <!-- popup=wi... Move forward when back button is clicked. Put this in your web page: <script language="JavaScript"> <!-- javasc... Replace the current location: <a href="#" onclick="location.replace('nextpage.ht... Maybe a better question to ask is why you want to disable the back button. A lot of users use the back button because it is convenient and they are used to it. It's probably better to solve the problem at the server side so that using the back button would not interfere with your...
Created by Dr. Xi on March 25, 2008 23:11:26    Last update: March 25, 2008 23:11:26
The current URL is given by window.location . If you set window.location to a new value, the browser loads the new document: window.location = "http://www.google.com"; Previously document.location and document.location.href was used for this purpose, but are now deprecated.
Created by Dr. Xi on August 10, 2007 21:05:26    Last update: August 10, 2007 21:05:26
This style sheet transforms the struts-config.xml into HTML for easy viewing in a browser. It uses the DHTML JavaScript tooltip from http://www.walterzorn.com/tooltip/tooltip_e.htm . <?xml version="1.0" encoding="UTF-8"?> <xsl...