title: bootstrap/JS/Ajax after button click get form TO CHANGE images
body: <p>I have a submit form with a click button, once the submit form its clicked, I want to change a series of images within my html site.</p>
  
  <p>As of now I am using the following JS code but I am having trouble defining the appropriate success response.</p>
  
  <pre><code>&lt;script type=text/javascript&gt;                                                                     
  $(function() {
  $("#valueme").click(function() {                                                                  
       $.ajax({
          type: "GET",
          url: $SCRIPT_ROOT + "/mypythonscript/",
          contentType: "application/json; charset=utf-8",                                           
          data: { 
                  input1: $('input[name="input1"]').val(),
                  input2: $('input[name="input2"]').val(),
                },
          success: function(data) {
              //$ ('#photo_link1_div').text(data.photo_link1);                        
              //$ ('#photo_link2_div').text(data.photo_link2);                        
          }
      });                                                                                           
   });                                                                                              
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>The data that mypythonscript returns is a dictionary with the links to all the images that I want to change in the html site, i.e., mypythonscript returns <code>{photolink1:'../static/img/myphoto1.jgp',photolink2:'../static/img/myphoto2.jgp'}</code>.</p>
  
  <p>Using such data I'd like to change the background images in my html by changing the DIVs background image urls.  As of now the DIVs in my html look like (ideally I do not have to change this part but rather the JS part):</p>
  
  <pre><code>&lt;div id="photo_link1_div" style="background-image: url(../static/img/anotherphotowanttochange.jpg); background-repeat: no-repeat; width: 200px; height: 310px; background-size: 100% auto;" align="center"&gt;&lt;/div&gt;
  </code></pre>