The first block of code below to run a function called 'Hi' and does not work.
The second block of code to run the JS alert function does.
For the first piece of code I can see that when I hover over the image it gives JavaScript:Hi('Server Function');
I cannot understand why one works and the other doesn't. The error I get is object expected. I've put the JS function below also, it's tiny and just for a test.
(1) change the href to onclick and drop the "javascript:" part, or
(2) Make it "javascript:", not "java script:" (remove the space)
Cheers!
Originally posted by Alex Vincent
.....2) Make it "javascript:", not "java script:" (remove the space)
Just a little FYI; the forum automatically inserts the space in java^script: , especiallywhen it's inside the [code][/code] tags, otherwise, sometimes it will add the space and sometimes it won't. The way to avoid it is to use ISO entities to code the colon (&#58).
W/colon coded: