1

I have added following line to update jQuery in header file

<script src='https://code.jquery.com/jquery-3.1.1.min.js'></script>
<script> $(document).ready(function() { alert('Yup I am working'); }); </script>

It gives alert 'Yup I am working'. But when I check jQuery version on console using jQuery().jquery it shows 2.1.3. Can you please tell me why jQuery is not updating?

2
  • You don't need to update JS files; they are retrieved from the server and stored in the browser cache, which you can usually force refresh by pressing CTRL+F5. Might you have another version of jQuery loaded by your HTML file? Commented Jun 15, 2017 at 4:56
  • Try clearing the cache of your browser and trying again. Commented Jun 15, 2017 at 4:56

2 Answers 2

2

Make sure that you don't include jQuery 2.1.3 later on the page until the closing </body> tag!

Open your page as source code only and CTRL+F or CMD+F for all .js go trough it, you will find another included jQuery somewhere. Remove it, you only want to include jQuery once!

Sign up to request clarification or add additional context in comments.

Comments

1

When you add remote file in your localhost or production server, at that time I suggest you to use CDN library.

Please go through below and find appropriate JS.

https://cdnjs.com/libraries/jquery/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.