jquery load issue
<p>I'm loading pages asynchronously with the jQuery load function, like this:</p>

<pre><code>tree.click(function() {
                if ($(this).hasClass("file")) {
                    tree.removeClass("selected");
                    $(this).addClass("selected");
                    content.load("content/"+this.id+".html");
                    contentContainer.effect("highlight");
                    SyntaxHighlighter.all();
                }                         
            });
</code></pre>

<p>One of the external pages looks like this:</p>

<pre><code>&lt;pre class="brush: java;"&gt;
   /**
     * The HelloWorldApp class implements an application that
     * simply prints "Hello World!" to standard output.
     */
   class HelloWorldApp {
      public static void main(String[] args) {
         System.out.println("Hello World!"); // Display the string.
      }
   }
&lt;/pre&gt;
</code></pre>

<p>now the SyntaxHighlighter.all(); call in the tree.click() function from above should render the pre block with pretty syntax highlighting, but when loading the file with the pre block via the jQuery load() function this doesn't work.</p>

<p>When I hardcode the pre block into the content div of the main file, it does work, however.</p>

<p>Any ideas??</p>

<p>Thanks for the answers so far .
I understand the callback part and I implemented the SyntaxHighlighter.all() call in the callback of the load function now, but still no luck...</p>

<p>I'll append the 2 complete files, as they are rather small in size atm.</p>

<p>index.php:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
    &lt;title&gt;braindump&lt;/title&gt;
    &lt;link type="text/css" href="css/style.css" rel="stylesheet" /&gt;
    &lt;link type="text/css" href="css/jquery.treeview.css" rel="stylesheet" /&gt;
    &lt;script type="text/javascript" src="jquery/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="jquery/jquery-ui-1.7.2.custom.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="jquery/jquery.treeview.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="syntaxhighlighter_2.0.320/scripts/shCore.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="syntaxhighlighter_2.0.320/scripts/shBrushJava.js"&gt;&lt;/script&gt;
    &lt;link type="text/css" rel="stylesheet" href="syntaxhighlighter_2.0.320/styles/shCore.css"/&gt;
    &lt;link type="text/css" rel="stylesheet" href="syntaxhighlighter_2.0.320/styles/shThemeDefault.css"/&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function() {
            var tree = $("#tree li");
            var contentContainer = $("#contentContainer");
            var content = $("#content");

            SyntaxHighlighter.config.clipboardSwf = 'syntaxhighlighter_2.0.320/scripts/clipboard.swf';
            SyntaxHighlighter.all();

            // Treeview
            $("#tree").treeview({
                persist: "location",
                collapsed: true
            });

            tree.click(function() {
                if ($(this).hasClass("file")) {
                    tree.removeClass("selected");
                    $(this).addClass("selected");
                    content.load("content/"+this.id+".html", function() {
                        contentContainer.effect("highlight");
                        SyntaxHighlighter.all();
                    });
                }                         
            });

        });
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div id="container"&gt;
        &lt;div id="header"&gt;

        &lt;/div&gt;

        &lt;div id="leftMenu" class="thinDottedBorder"&gt;
            &lt;div class="min500px"&gt;&lt;/div&gt;
            &lt;ul id="tree" class="filetree"&gt;
                &lt;li&gt;
                    &lt;span class="folder selectable"&gt;Design Patterns&lt;/span&gt;
                    &lt;ul&gt;
                        &lt;li id="softwareengineering/designpatterns/decorator" class="file"&gt;&lt;span class="file selectable"&gt;Decorator Pattern&lt;/span&gt;&lt;/li&gt;
                        &lt;li id="softwareengineering/designpatterns/visitor" class="file"&gt;&lt;span class="file selectable"&gt;Visitor Pattern&lt;/span&gt;&lt;/li&gt;
                        &lt;li id="softwareengineering/designpatterns/chainofresponsibility" class="file"&gt;&lt;span class="file selectable"&gt;Chain of Responsibility&lt;/span&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                &lt;/li&gt;
                &lt;li&gt;
                    &lt;span class="folder selectable"&gt;Design Principles&lt;/span&gt;
                    &lt;ul&gt;
                        &lt;li&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                &lt;/li&gt;
            &lt;/ul&gt;
            &lt;div class="clear"&gt;&lt;/div&gt;
        &lt;/div&gt;

        &lt;div id="contentContainer" class="thinDottedBorder"&gt;
            &lt;div class="min500px"&gt;&lt;/div&gt;
            &lt;div id="content"&gt;
                &lt;pre class="brush: java;"&gt;
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
   public static void main(String[] args) {
      System.out.println("Hello World!"); // Display the string.
   }
}
&lt;/pre&gt;
            &lt;/div&gt;
            &lt;div class="clear"&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>and the other file:</p>

<pre><code>&lt;pre class="brush: java;"&gt;
 /**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
 class HelloWorldApp {
    public static void main(String[] args) {
       System.out.println("Hello World!"); // Display the string.
    }
  }
&lt;/pre&gt;
</code></pre>

<p>please note that initially the hardcoded pre block is rendered correctly by SyntaxHighlighter.all(), but the one in the callback of the load function doesn't work.</p>
