Jquery does not load effect obtained through a service

Asked

Viewed 140 times

-2

I will try to present my problem as best I can.

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

In this my html page I use an ajax function to load the data of this service until then everything works well, but 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 it’s not carrying something?

Here the page with the service running: LINK

Here the static page without the service LINK 2

Click on the + to do the tests.

1 answer

2


The archive "http://williamvillar.com.br/assets/js/materialize.min.js" must be loaded after the end of the ajax request, otherwise the elements will not have their listeners loaded, IE, does 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." );
});
  • @ Jhonnyjks, thank you! How can I upload the file after the call?

  • I edited the answer to inform you that!

  • I’m new here, so if I helped you, mark my answer as useful! ;-)

  • of course But yes! It worked out here thank you very much!!!! If I could send you 1000 rsrs points... Hug

  • Right! Always take a little time to the OS too! Let’s share knowledge and let this PT version well enough!

  • I was testing on the browsers here and it didn’t work on the Edge and the cell phone, you can tell me where the problem might be?

  • Which link with this correction I indicated to you?

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.