JQuery does not carry effect obtained through a service

-2

I'll try to expose my problem as best I can.

I have a page made in HTML and I have a service done in Java that returns me an html.

In my html page I use an ajax function to load data from this service until it works fine, however I have some effects that when the user clicks open a div using JQuery does not work.

Is it because I'm bringing the html from somewhere else, is not it loading anything?

Here is the page with the service running: LINK

Here is the static page without the LINK 2

Click the + to do the tests.

    
asked by anonymous 31.03.2016 / 00:31

1 answer

2

The file " link " should be loaded after the ajax request ends, otherwise the elements will not have their listeners loaded, ie it will not detect clicks.

After this line:

if(responseText) {

You can use the block below to fix your problem:

$.getScript( "/assets/js/materialize.min.js", function( data, textStatus, jqxhr ) {
  console.log( data ); // Data returned
  console.log( textStatus ); // Success
  console.log( jqxhr.status ); // 200
  console.log( "Load was performed." );
});
    
31.03.2016 / 01:28