Archive for the ‘Javascript’ Category.
June 28, 2009, 11:56 am
Thomas Fuchs is the pioneer of the first FX JavaScript library script.aculo.us and as he and his work reside in Vienna (which is more or less my hometown) I have to support his new open source product called scripty2 which is a successor of script.aculo.us.
To keep things short: It’s a first release and therefore still in Alpha. It looks promising, especially because it’s only 5KB of size (gzipped & excl. PrototypeJS).
Check out the demos to see if it’s something you gonna need for your future work or not.

April 8, 2008, 6:44 pm
Did you ever wanted to build a context menu like google does it? I have figured out an easy and quick way to achieve this with a small amount of CSS and 3 lines of javascript.

Click here for a demo
Continue reading ‘create a contextmenu with javascript & prototypejs in seconds’ »
March 26, 2008, 10:41 am
wow, google recently released an API for their translation services called Google language API. Thats a good news but it even gets better! The api is really easy to use and applications can be boosted within minutes. The reference can be found here
Here is a quick example of how to translate something...
JAVASCRIPT:
-
google.language.translate('my mum is swimming', 'en', 'de', function(result) {
-
alert(result.translation);
-
});
and it gets better and even easier: its possible to let the API detect the language .. so nothing you have to take care about anymore.
JAVASCRIPT:
-
google.language.detect('Deutsch ist auch eine Sprache',
-
function(result) {
-
alert(result.language);
-
});
Further reading: An introduction to the language API and translation tools.
Now its time to come up with some nice little tools, widgets which use this service. "a user selects a paragraph an your page, clicks a button and suddenly the text is translated into the desired language".
December 21, 2007, 3:47 pm
Today i have found scripteka.com which is an awesome resource for prototype and scriptaculous extensions. It offers one of the best extensions around on a very clear and web2ish site. Currently they offer 88 extensions which include javascript calendars, password strength meters, reflection generators, image croppers, faders, .... Go to scripteka.com and look yourself what they offer. Its good stuff which is based on one of the best libraries out there.
December 17, 2007, 4:47 pm
Today i stumbled across a nice tool called Pastie. Pastie helps you if you want to show some bits of your source code to someone else. e.g. you need some help, advice (or you just want to show off with your code). You paste an excerpt of your code and pastie saves it for under a unique URL. Then you send this URL to the person you want to show the code. The big advantage here is that the syntax is nicely highlighted ... very nice for remote troubleshooting! I have created a code snippet for demonstration.

(i've used code sections to create more sections.)
July 2, 2007, 12:50 am
My last post (about an ASP RSS component) included a demonstration which made use of a cool ajax technique simply called "ajaxed". See the demonstration here again. If you play around you will recognize that there is no conventional postback and AJAX is up in here ;) I have developed a small "library" which easily allows you to call server side ASP VBScrtipt procedures from the client side. No low-level Ajax knowledge is required... Continue reading ‘ajaxed: Calling server side VBScript procedures from client side (equivalent to PHP xajax)’ »
May 29, 2007, 10:20 pm
A very nice balloon tooltip from BeauScott.com is another gift of the web 2.0 era. Look at the stylish appearance and enjoy...
Continue reading ‘Web 2.0 balloon tooltip with prototype and scriptaculous’ »
May 10, 2007, 7:52 pm
Today i stumbled across something really funny which is called "lazy star" and is used as a term within regular expressions. I did work on an expression and could not get it to work till i found the lazy "guy" which was the solution for the problem. Continue reading ‘lazy stars within regular expressions’ »
April 26, 2007, 5:18 pm
When working with JSON it's nice to have a generator for your language which transforms all the datatypes from your chosen programming language into the JSON grammar so that you can use them within javascript. For a lot of popular languages it's done already (i suppose) but I haven't found one for classic ASP .. so here it comes. The following example quickly demonstrates what the goal is:
ASP:
-
set RS = getRecordset("SELECT * FROM table")
-
response.write((new JSON).toJSON("rows", RS))
A simple usage of JSON normally is that you create a page which outputs data as JSON as the only response. This page is called later from another page and the returned data is used within a javascript function (known as callback). So the snippet above gets some data from the database and stores it in an adodb.recordset which is passed then to the JSON generator and the result is printed on the page. The consuming page would like to access the data now as it originally was within the recordset. like this:
JAVASCRIPT:
-
function callback(rows) {
-
for (i = 0; i <rows.length; i++) {
-
alert(rows[i].columName);
-
}
-
}
read on to get the details... Continue reading ‘Generate JSON from VBScript (ASP) datatypes’ »
April 16, 2007, 3:07 pm
In conventional business applications users are used to navigate through form fields just by using the "enter" key rather than using the "tab" key. Especially on forms where they bung in a lot of numeric data (e.g. sales) it's more common to use the numeric block (numlock) and therefore the "enter" key is more convenient to use ... cause there is no tab key. I've just written a short javascript snippet which solves this problem. I call it FormWalking. Continue reading ‘FormWalker – walking through form fields with the enter key’ »