javascript - ajax response does not use currently loaded resources (php + jquery) -


I am using some CSS files and JS libraries (bootstrap, packetry etc.) in my master page. On the page there is a button, when you click on it, it sends an Ajax request and prints the response on a single page in the current page:

  jQuery.post ("index.php "," Some_post_data ", function (data) {jQuery ('# mydiv') .html (data);});  

The page I'm calling on needs the libraries I've already included on my master page, but when I print the feedback inside the div Even JS shows errors and styles-less objects. If I add those resources to the second page, then it will work, but I do not want to do this.

Do I have to refresh the latest printed HTML code, or something like that? Am I doing wrong here?

When you dynamically add HTML content to a page. Any script files loaded in the header section (or elsewhere for that matter) will not be loaded and registered in your domain. I assume that the style sheet you add to the dynamic page will apply to it .

To add any script files or stylesheets that you need to register separately in the body of your document.

Or check this link:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -