I am having problems with the code below:
$('#thing1').on('click',function() {
writeNewHtml(parm1, 550, 925);
});
This works everytime unless I am trying to use an object tag like below:
function writeNewHtml(parm1, height, width) {
$('#div').html("object/embed tag");
}
So my question is, is there any reason as to when using the object tag it writes the inner html only once, but if I use any other tag it works as expected?
In your jsfiddle link, you can see that you have used “selectable” plugin before binding the onClick event. This makes any other onclick bindings to that object obsolete. Removing the following code will get it to work but you will not be able to use the selectable plugin anymore on the ‘Thing 1’ and ‘Thing 2’ elements :