The web page does't act to changes in my javascript code (django)
I am working with django now. And I write a javascript for my website, but now it seems that the website doesn't act to changes of my javascript code. Here is part of the code I have in the javascript file on my computer
$(document).ready(function() {
alert("fslfjsdlkf");
// geocode
//if ($("input[name$='l']") && $("input[name$='l']").val() == '' && !$(".email")){
if(1>2){
var geocoder;
var latitude;
var longitude;}
here is the code I get from the Developer tools of Chrome
$(document).ready(function() {
// geocode
if ($("input[name$='l']") && $("input[name$='l']").val() == ''){
var geocoder;
var latitude;
var longitude;
var altitude;
var user_location;
You can see that the codes are different.
Also, the web page will act to my html code. Another thing 开发者_运维问答to add, I use git for this project.
Does anyone have an idea of the reason??? Thanks in advance!
I've run into similar problems with Django. It has to do with caching of static content. Try restarting your webserver and/or clearing your browser cache. Also, some more information about your setup would be helpful.
- How are you running Django? What webserver and delivery method are you using?
- What version of Django are you using? There have been some changes in the latest version (1.3) that affect how I would answer your problem.
- If you are using 1.3, where are you putting the js? In the STATIC_ROOT or one the application static folders?
If the code is in a static javascript file, and you are not serving it out of the runserver, perhaps you need to regenerate static files? manage.py collectstatic will handle that for you.
It's not related to Django, but I have had similar problems with Chrome before. It sometimes just doesn't reload Javascript files, and uses the files from the cache even though the file on the server has changed.
Until this problem is solved, I'd suggest developing with another browser (which is a shame, as Chrome is very nice in other respects).
精彩评论