When for example extending the url
field, the javascript is aware of that element. When adding new html with javascript is not aware of the new html because it did not exist when the javascript file was loaded.
The html generating function
This function is similar to the one I have for generating the html, in another field.
field.find('.a-button').click(function() {
// Adding the element with javascript
// Possible to trigger the js again?
});
Is it possible to somehow trigger to load of the url field javascript again? I’ve tried trigger
and some other fancy ideas but I did not succeed. Is the only way to replicate the javascript file in an extended field?
I don’t think I need a copy/paste solution. Hints in a direction would be great as well.
Here is the url.js
. I took the url field as an example because it’s very small but there are many other fields that rely on javascript as well. Trigger the $.fn.urlfield
at a later point of time is what I want to do, after the html is changed.