title: ajax code to change image on webpage in template
body: <p>i have one website which is working on templates.</p>
  
  <p>in the template there is one main image &amp; i want to replace that main image on some pages only not on full website. what i am looking for is to change the main image to new image on page where i need with ajax.</p>
  
  <p>when i see the css of that template i found following code to show image</p>
  
  <blockquote>
    <p>.top-bg{</p>
  
  <pre><code>  background:url(../images/top-bg.jpg)
  top center no-repeat;
  position:relative;
     }
  </code></pre>
  </blockquote>
  
  <p>and on php page i found following line which bring image.</p>
  
  <pre><code>       &lt;div class="top-bg"&gt;
  </code></pre>
  
  <p>i need ajax / jquery code to change image.</p>
  
  <p>my basic logic is, i will get that image URL from MYSQL databse and assign to one variable and then i will change the image which come from database, actually its one page displaying products and i want to display main image of product with ref to loaded product, i hope you will understand what i need at the end...</p>
  
  <p>Thanks</p>
  
  <p>Thanks for every one how reply, i found the solution</p>
  
  <p>$(document).ready(
   function(){
   $('#imageContainer').css("background-image", "url(images/cube.jpg)");<br>
   }
  );</p>
  
  <p>this did trick for me what i need, any way thanks and also for -ve voting thanks... :((</p>