jquery code snippet on load
<p>I'm working with this code snippet plugin : <a href="http://www.steamdev.com/snippet/" rel="nofollow">http://www.steamdev.com/snippet/</a> for my blog
but the plugin doesn't work on page load. 
It only works at first page refresh.</p>

<p>I load my content in a specific div with jquery.ajax request and i'm trying this :</p>

<pre><code>$(window).on("load", function(){ 
  $("pre.cplus").snippet("cpp",{style:"acid"});
  $("pre.php").snippet("php",{style:"acid"});
  });
</code></pre>

<p>I also tried to trigger the load event but i don't know if it is correct..</p>

<p>Another question : i build my html with php string like this example:</p>

<pre><code>$string = '&lt;pre class="cplus"&gt;  
           #include &lt;iostream&gt;   
           int main()
           {
            //c++ code             
           }           
           &lt;/pre&gt;

           &lt;pre class="php"&gt;
           &lt;?php
           function foo()
           {
            // PHP code
           }
           ?&gt;
           &lt;/pre&gt;';

echo $string;   // ajax -&gt; success
</code></pre>

<p>but the PHP snippet shows empty (the c++ is ok). Any other way (or plugin) to show php code snippet on my page?
Thank you.</p>

<p>SOLVED:
The problem isn't the plugin or Iserni suggestions.. i had a problem in page load (ajax).. 
This is how i load the pages:</p>

<pre><code>function pageload(hash) {
    if(hash == '' || hash == '#php')
    {
      getHomePage();
    }

    if(hash)
    {
     getPage();
    }

} 


function getHomePage() {
    var hdata = 'page=' + encodeURIComponent("#php");
    //alert(hdata);
    $.ajax({
        url: "homeloader.php",  
        type: "GET",        
        data: hdata,        
        cache: false,
        success: function (hhtml) { 
            $('.loading').hide();               
            $('#content').html(hhtml);
            $('#body').fadeIn('slow');      

        }       
    });
}

function getPage() {
    var data = 'page=' + encodeURIComponent(document.location.hash);
    //alert(data);
    $.ajax({
        url: "loader.php",  
        type: "GET",        
        data: data,     
        cache: false,
        success: function (html) {  
            $('.loading').hide();               
            $('#content').html(html);
            $('#body').fadeIn('slow');      

        }       
    });
} 

 $(document).ready(function() {

 // content
   $.history.init(pageload);    

    $('a[href=' + window.location.hash + ']').addClass('selected');

    $('a[rel=ajax]').click(function () {

        var hash = this.href;
        hash = hash.replace(/^.*#/, '');
        $.history.load(hash);   

        $('a[rel=ajax]').removeClass('selected');
        $(this).addClass('selected');
        $('#body').hide();
        $('.loading').show();

        getPage();

        return false;
    }); 
    // ..... other code for menus, tooltips,etc.
</code></pre>

<p>I know this is experimental , i have made a mix of various tutorials but now it works..
comments are much appreciated..
Thanks to all.</p>
