Pb under JQuery and PHP : passing arg with GET to show content detail
<p>I want to see a list of content in a sidebar.
When i click on a particular content in this sidebar that should refresh the content detail  with its info.</p>

<p>2 pages : test_content.php and test_content_detail.php.</p>

<pre><code>&lt;?php
/*
  $Id:  test_content.php $
  Show all content
*/
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;    
    &lt;script type="text/javascript" charset="UTF-8" src="./js/jquery.min.js" &gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        function loadContent(id) {
            var $element = $('#content');
            var $response = $element.load("test_content_detail.php?id="+id+" #content_detail");
        };
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="main"&gt;
    &lt;div id="sidebar"&gt;
        &lt;div id="items"&gt;
            &lt;div id="1" class="item"&gt;  
                    &lt;input type="button" value="Should show 1" onClick="loadContent(1);"&gt;
            &lt;/div&gt;
            &lt;div id="2" class="item"&gt;  
                    &lt;input type="button" value="Should show 2" onClick="loadContent(2);"&gt;
            &lt;/div&gt;
            &lt;div id="3" class="item"&gt;  
                    &lt;input type="button" value="Should show 3" onClick="loadContent(3);"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="content"&gt;
        &lt;div id="content_detail"&gt;
            empty
        &lt;/div&gt;
    &lt;/div&gt; 
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Call by jquery :</p>

<pre><code>&lt;?php
/*
  $Id:  Test_content_detail.php $
  Show one content
*/
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;    
    &lt;script type="text/javascript" charset="UTF-8" src="./js/jquery.min.js" &gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        function fillDetail(){
             var html = '&lt;br&gt;My detail : ';
             var id = "&lt;?php print $_GET['id']?&gt;"; // Where the PHP do the job
             if (id){
                     html += "my id = "+id;
              }
              var $detail = $('#content_detail');
              $detail.append(html);
        };

        $(document).ready(fillDetail);
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="main"&gt;
    &lt;div id="sidebar"&gt;
        none
    &lt;/div&gt;
    &lt;div id="content"&gt;
        &lt;div id="content_detail"&gt;
            supposed to be filled with &lt;?php print $_GET['id']?&gt;
        &lt;/div&gt;
    &lt;/div&gt; 
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>*<strong>Test_content_detail.php?id=3*</strong> is correct.
But what i see when i click on 3 is "<strong>supposed to be filled with 3</strong>" without the detail.</p>

<p>A sequence pb ?
Thx in advance !</p>
