Difference between using relative and absolute urls for loading javascript

In my java spring application i am loading javascripts in jsp like :
    <script src="resources/lib/jquery/dist/jquery.js"></script>

Open in new window

This is a relative url to the url i used to open the page .
Other way i can do is :
    <script src="/resources/lib/jquery/dist/jquery.js"></script>

Open in new window

This will be used as an absolute url.
Although my application works fine both ways.
Does it make any difference which of the above i use to load my javascript ?

Rohit BajajAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CPColinSenior Java ArchitectCommented:
It'll only make a difference if you move the page into a different directory. Otherwise, those URL's will act the same.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rohit BajajAuthor Commented:
Does it have any security related thing to do ?
CPColinSenior Java ArchitectCommented:
Posting JavaScript questions in the Java TA is not appropriate, and might make your question less likely to be answered. http://technojeeves.com/joomla/index.php/free/127-javascript-is-not-java
CPColinSenior Java ArchitectCommented:
While typically true, this specific question is about a Java Spring application and already has an answer.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.