Cannot pass an id from html into client.init{url, success:function() ... }


(Kanoute13) #1

Hi,

i would like to to pass the element id from html into this client.init.
So, i have this to html:
div class=“image-container”>
< img src=“imgtest.jpg” id=“image-1” class=“image” onclick=“applyMaterial(id);” alt="/">
< img src=“imgtest1.jpg” id=“image-2” class=“image” onclick=“applyMaterial(id);” alt="/">
< img src=“imgtest2.jpg” id=“image-3” class=“image” onclick=“applyMaterial(id);” alt="/">

and i would like to pass it to the external javascript. When i call the function out of the client it worked.

When i tried to pass it into the client the program didnt recognize it.
The reason is that i want to take the id of every different image when clicked in order to give different textures on the object depending the image.

Does anyone know how can i do it, because after 2 days searching i am thinking to change completely the way that i call the api on the javascript file.

Thank you in advance!

Dimitris