Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

Saturday, November 15, 2008

Quick Reference Cards

Here’s a short list of some quick reference cards that I keep in my bookmarks. It’s good if you’re someone like me always shifting between languages like javascript, c#, xml, xslt, vb6, vb.net, pl/sql, t-sql, etc., etc#, etc++, and keep forgetting some syntax details:

And here’s a nice link with a few Quick Ref Cards:

Friday, February 8, 2008

Online Javascript Formatter

Every now and then I need to format some javascript code that I find online.

I have been using this online javascript formatter. It's simple and it usually fills my needs.

Wednesday, February 6, 2008

How to make sexy buttons with CSS

I just found this article on how to make sexy buttons with round corners with CSS. It's a little hard to customize your own buttons but if you comprehend how they work, you can do it.

Thursday, November 8, 2007

input image objects not found in form.elements

Imagine you write the following javascript sentence in an html page:

self.document.forms[0].elements

That will give you all the elements inside the first form (forms[0]) in the current page, right? Well, no. For some reason, if you have an input of type image (<input type="image">) in the form, that element will not be in the forms[0].elements object.

Every other input (button, text, select, submit, ...) will be in the elements object, but do not expect to find image type inputs. I've tried that in IE and Firefox unsuccessfully.

(If you don't know what an input of type image is, well it's behaviour is the same as the submit inputs but instead of a button, the user is presented with an image.)

So, how do we solve this? Well, instead of using:

self.document.forms[0].elements

we have to use the following:

self.document.all

Of course, that way, you will get a list of all the elements in the current page instead of all the elements in a form but you will find the inputs of type image in there, for certain.

Friday, October 12, 2007

How to "clear screen" in javascript

I wanted to clear an HTML page after clicking a button. So how do I do it in javascript? I wanted something simple like the "cls" command that exists in several programming languages (including the "cls" command in the windows command prompt).

After a simple google search I found two options that I liked in the thescripts.com forum:

location.replace("about:blank")

or

document.body.innerHTML=""

I prefer the second option because I can insert what I want in the innerHTML property.