posted 13 years ago
Hey there. So I have an html page that has this image (sorry I hadto cut off the < in the beginning and not put it between code tags, it was messing the image text up when I did that...):
img id="avatar_image" src="./images/SampleImage_Icon.png" width="128" height="128"/>
At the top of this html page in the header I have
So I can use various javascript files.
The view-core.js file does various things, one of which is to change the image from the code above when a function is called. Here is the relevant bit of code:
As you can see, right now, all i want to happen is for anytime one of these is called, it changes the image to lepr.gif
In the other js file - survey-logic.js, I have a way of dynamically generating text areas, radio buttons, etc, but for this example we will just use the text area. I want to change the image from above using onFocus() event.
So, in the survey-logic.js file I have this:
Which in my head, should call the Update_Avatar() function from view-core.js, and change the image from my html page to ./images/lepr.gif whenever I focus on the text area. But this is not happening. So I think i either have a syntax issue with how I am using
or
I am doing something wrong with this
Someone mind giving me an idea where I might be screwing up here please?
True wisdom is in knowing you know nothing - Socrates