Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

1man's Recent Snippets



Way to update the footer of a website automatically on 1st Jan.
3 845 posted 17 years ago by 1man
Very simple navigation. Style the id using CSS. Allows you to highlight the current page with CSS.
1 1007 posted 17 years ago by 1man
Removes the default styling different browsers use, so you minimise cross browser problems.
1 754 posted 17 years ago by 1man
addEvent function. Can't remember the exact site i got it from. Works well for me.
1 696 posted 17 years ago by 1man
Example off ALA, pleasing typography layout for the web. Based on the grid system.
4 1017 posted 17 years ago by 1man
Shows you how to link 2 objects together via the object function. If a value isn't found in the object, it will look for it in the linked object.
0 677 posted 17 years ago by 1man
Extend a custom object, and a pre-defined object(e.g. string) using .prototype available in JS.
1 798 posted 17 years ago by 1man
Simply replaces the div's innerHTML with the response text received from the file.
3 1533 posted 17 years ago by 1man
The simple form that calls the searchYahoo function.
1 1028 posted 17 years ago by 1man
Basic layout for the data contained in a JSON file.(JavaScript Obsect Notation).
1 746 posted 17 years ago by 1man
This function allows you to parse a simple XML document(passed to it using this.href on a onclick event). Virtually the same as JSON, the things that have been changed ate labeled !Important.
3 1071 posted 17 years ago by 1man
This function is near enough the same as parsing XML. The only things that have changed are the sections marked !important.
3 1092 posted 17 years ago by 1man
This while loop will remove all childNodes from a selected element.
1 653 posted 17 years ago by 1man
Very basic grab a line of text from a file then display it in an alert box. Uses other functions for loading prepareLinks() and creating the request.
2 998 posted 17 years ago by 1man
Simple Ajax POST request using the getHTTPObject function.
2 898 posted 17 years ago by 1man
2 938 posted 17 years ago by 1man
This functions allows you to create a new XMLHTTPRequest, it checks to see if the browser supports each method, if not it returns false.
4 1132 posted 17 years ago by 1man
This function allows you to open a new window, without using any inline Javascript. Simply add rel="external" to the link you wish to open in a new window.
3 1172 posted 17 years ago by 1man
This function extracts a value from a url. Very useful for tracking codes. For example, you have a url http://your.url/?source=666999, and you need the source number to be placed into a variable. Use the code below.
2 931 posted 17 years ago by 1man
Function to look if an element has a class, if it doesn't simply add it to the element. If it does have a class add it to the class that is already there. Function expects 2 values, the element to add the class to, and the new class name (value).
3 1136 posted 17 years ago by 1man
This function looks for tables in a web page, then loops through the rows and sets the backgroundColor for ever other row.This creates a striped table which is easier to read.
2 1012 posted 17 years ago by 1man
Use this function to queue functions you wish to load on window onload. Very useful when code becomes complex.
3 1142 posted 17 years ago by 1man
Usage of the getNextElement function. Very basic usage to pick out the h1 tags, then change the properties of the next element(not node).
1 868 posted 17 years ago by 1man
Useful function for CSS DOM, returns the next element after the selected node. So you could style the element directly after a h1 element for example.
2 762 posted 17 years ago by 1man
The very basic markup for the enhancement DOM script from a tutorial.
0 627 posted 17 years ago by 1man
This is another script from the DOM scripting book. Not really relevant to anybody else. Useful for reminding myself about the DOM.
1 806 posted 17 years ago by 1man
Not really relevant to anybody else. Full unobtrusive js file for a simple gallery. From DOM Scripting by Jeremy Keith (superb book, highly recommend it for anyone looking to move into DOM scripting)
2 727 posted 17 years ago by 1man
Vert useful function since there isn't an insertAfter function in the DOM. Call it inside scripts, it expects insertAfter(*the new element to be inserted*, *the element you want it to be inserted after*);
3 2058 posted 17 years ago by 1man
Simple extension of the string method using string.prototype.
1 716 posted 17 years ago by 1man
Stop the background image flickering on IE by including this code in the header of your page. See link for more information.
2 1012 posted 18 years ago by 1man