Using jQuery within http.open
<p>I have a jquery function whichh looks like this:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function() {
    $('a#id').click(function(e){
        e.preventDefault();
        var id = $(this).attr('pid');
        var title = $(this).attr('ptitle');
    $('#product_list').prepend('&lt;input type="hidden" value="'+ id +'"/&gt;&lt;div&gt;'+ title +'&lt;/div&gt;')
    });
});
&lt;/script&gt;
</code></pre>

<p>I have a javascript file which has this code here:</p>

<pre><code>&gt; http.open('get', 'livesearch.php?name='+searchq+'&amp;nocache =
&gt; '+nocache+'&amp;type=bookings/products');
</code></pre>

<p>The livesearch.php file has the a element (which the jQuery is requesting) like this:</p>

<pre><code>&lt;a href="#" id="id" ptitle="&lt;?php echo $product['title']; ?&gt;" pid="&lt;?php echo $product['product_id']; ?&gt;"&gt;Add&lt;/a&gt;
</code></pre>

<p>However when I click on the a element the jQuery doesn't respond. Could any please help?</p>

<p>Thanks
Peter</p>
