My requirements are the following:
- I've got a rich webpage that at a certain moment loads a bunch of HTML in a
div
, via AJAX. - The HTML I retrieve does have javascript (
<script>...</script>
) - The retrieved javascript contains
$('document').ready( ... )
parts - I can not modify the retrieved javascript; it comes from an external lib
I've got a javascript function that is called when the AJAX is loaded. I'm trying to "trick it" into executing by doing:
function AjaxLoaded() { $('document').trigger('ready'); }
That doesn't cut it, I'm afraid.
I've seen several responses on Stack Overflow that "evade" this question by changing the code that is returned on the AJAX (make it a function and call it after loading, or just remove the $(document).ready()
). I need to stress out that I can't change the retrieved code on this case.