I have the following code that uses jquery to dynamically update a page once its been loaded from a URL
$(document).ready(function() {
var htmlattri="background-color:red;";
$("body").attr("style", htmlattri);
$("#navbar").append('<div id="test" style="position: absolute; left: 0px; top: 0px; z-index: 3000; height: 20px"><input type="button" value="Back" onclick="window.history.go(-1)" /></div>')
});
The problem I have is that the #navbar element is built via ajax (non JQuery) which happens after the $(document).ready
has fired.
Is there a way to get this to fire once the page is fully built ?
I don't have control of the pages source code.