Skip to content Skip to sidebar Skip to footer

Replacing Images In Django With Jquery

Hi StackOverflow Community I am using Django to set up a mobile-friendly web-page. The page contains a series of images and a button. When you click the button one of those images

Solution 1:

Django only renders the {% static 'img/Test2.jpg' %} on page-load.

Django does not render template on page-load. Django renders it before page-load.

If you already know what path you want to paste, then no need for Django static tag:

$("#about-btn").click( function(){
    $('.chat_window img').attr("src","img/Test2.jpg");
});

Post a Comment for "Replacing Images In Django With Jquery"