i was trying to write a simple script to do an image button, im not sure why the code doesnt work. I have a working script already but was trying to make a generic function. function ImageOver(a,b) { document.images[a].src=b; return true; } when i try to pass the parameters it doesnt work, for example... <a href="1.2.3.4" onmouseover="return ImageOver("jsbutton1","picture.gif")" > </a> im not sure why it wont work, it seems so simple. Im thinking maybe the quotations are being stripped when passing the params, but not sure. Any suggestion would be helpful.
Don't think it's that.. I never got that far with java.. prefer C++ and ruby.. For some reason your syntax looks wrong, but I can't put my finger on it.. more a "doesn't look right" feeling.. http://ajaxian.com/archives/can-your-programming-language-do-this-javascript-can
if i try this it works but its not what i want, im not sure why it doesnt seems to work. function ImageOver(a,b) { a = "jsbutton1"; b = "picture.gif"; document.images[a].src=b; return true; } but it doesnt work when passing parameters. when i try to pass the parameters it doesnt work, for example... <a href="1.2.3.4" onmouseover="return ImageOver("jsbutton1","picture.gif")" > </a> any more suggestions why this wont work?