Skip to content
Advertisement

Javascript doesn’t work if it’s linked from jsp in my project

my js doesn’t work in my dynamic web project if I linked it from a jsp, but if i put it in the jsp it works fine. Same for every js code. I don’t know what to do, jquery is imported… The javascript code is correct because it work fine in the same jsp, but if I put it in a *.js file it doesn’t work. Here’s my code:

JavaScript

Here “CarouselSlider.js”:

JavaScript

and “CarouselSlider.jsp”:

JavaScript

UPDATE: I solved. it was a path problem. I used “../” instead of “./”

Advertisement

Answer

Check your console and verify the file is actually loading. Most likely you have a bad path.

Also your type attribute is bad. In HTML5 it is also redundant just remove it.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement