I am using following code to load a html page inside a div,
$("#htmlViewer").load("conversion_test/to_convert_3264/"+getPageName(pageCount)+".htm", function(response, status, xhr) { if (status == "error") { /* var msg = "Sorry but there was an error: "; $("#error").html(msg + xhr.status + " " + xhr.statusText); */ jAlert('Unexpected Error : Please try again later', 'Alert'); pageCount--; } }); In the above code I am getting only the HTML text but I am not getting CSS and the images in that page. To get the CSS I added another Ajax request. Without this the page loaded in ajax call will not have the css styles applied.
$.ajax({ url:"conversion_test/to_convert_3264/style.css", success:function(data){ $("<style></style>").appendTo("head").html(data); } }) I am not sure this is the right way to go about it. The problem is I am not getting the images during the ajax call. The images come from conversion_test/to_convert_3264/images folder. Any help is greatly appreciated. Please let me know If I need to give more details.
Thanks in advance.