into DIV:
<div id="materialcolor"></div>
I must incject this dynamically generated code:
<select class="groupsmaterialcolorsDDs" name="group_6" id="group_6" onchange="putLayer(document.getElementById(this.id).value);">
<option id="futura_perspective_merita_aubergine.jpg" value="76" selected="selected" title="Aubergine">Aubergine</option>
<option id="futura_perspective_merita_bordeaux.jpg" value="100" selected="selected" title="Bordeaux">Bordeaux</option>
</select>
I do this via jQuery’s load() funcion from other location:
/ajaxcreator.php?product_id=14
Before AJAX’s request the function putLayer() in select’s onchane parameter works (It’s changing the other DOM’s elements – put a background from ids of this select). After AJAX Request – not.
I probably must refresh the DOM elements to try again modyfi them. How can I do this?
you can use the jquery ‘.on’ function to make sure the event handler is always attached to all future ‘.groupsmaterialcolorsDDs’ in that div.
example:
$(‘#materialcolor’).on(‘change’, ‘.groupsmaterialcolorsDDs’, function(){
putLayer(this.value);
});