Jquery template plugin refuse to replace my marker?

I want to replace some marker in my jquery template with values from my database and I pick up a json encoded array but my templates remains empty? Here is my jquery code:

    $j.get(url, function(json) {
       var singleview = $j('#tx-charbeitsbeispiele-pi1 #singleview');

       singleview.append($j("#singleviewTemplate").tmpl(json).css({
         "display": "block"
        }));
     }

My json_encoded data:

   "{"header":"Lorem Ipsum Header","bodytext":"Lorem ipsum dolor sit amet, 
    consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et  
    dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo 
    dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est 
    Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing 
    elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam 
    erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea   
    rebum.Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor 
    sit amet."}"

My jquery template:

   <script id="singleviewTemplate" type="text/html">
     <div class="singleview">
         <h3>${header}</h3>
         <p>${bodytext}</p>
     </div>
   </script>

My stylesheet:

#singleview 
{
    position: relative;      
    float: left;          
    width: 1200px;        
    height: 800px;                
    background-color: #ffffff;    
    margin-left: 15px;        
    margin-top: 0px;         
    margin-bottom: 0px;       
    margin-right: 0px;        
    padding: 0px;        
    display:none;
}

Answers


I changed the Jquery function to getJSON because the data type of the ajax request wasn't json but only text:

 $j.getJSON(url, function(json) {
   var singleview = $j('#tx-charbeitsbeispiele-pi1 #singleview');

   singleview.append($j("#singleviewTemplate").tmpl(json).css({
     "display": "block"
    }));
 }

Need Your Help

how to create an index to parse big text file

python sqlite file indexing fastq

I have two files A and B in FASTQ format, which are basically several hundred million lines of text organized in groups of 4 lines starting with an @ as follows:

download image blobs from mysql to local machine using bash?

mysql bash jpeg

I have a bunch of jpeg images stored as blobs on a mysql database which I need to download to my local machine, the following does not work, can someone please advise?