SL8R.co.uk - Code Zone

Code, Code and Code

SL8R.co.uk - Code Zone header image 4

Entries from May 2008

Javascript: CSS rollover List routine

June 18th, 2008 · No Comments

To quickly loop through a list node and set a rollover CSS value, use the following

// Set all LI of a node to rollover CSS
// Use two CSS class, e.g. item and itemover

function updateList(String nodename)
{
if (document.all&&document.getElementById)
{
navRoot = document.getElementById(nodename);
[...]

[Read more →]

Tags: Code

PHP: Add Slashes to text

June 3rd, 2008 · No Comments

It is sometimes necessary to maintain the special characters in text, such as the apostrophe, speech marks, null character and backslash as these can be mis-interpreted by systems such as SQL if not modified appropriately. The generally accepted method of achieving this is to use the addslashes command which prefixes the special characters with the [...]

[Read more →]

Tags: Code