Ok so the title is a little odd but wasn't sure how to describe problem in 1 line (feel free to update it) so I'll explain the best I can.
I load content from a file foobar.php into a div #foobar
in index.php like so:
$('.foo').click(function(){
var id = $(this).attr('id'),
cls = $(this).attr('class'),
dstr = 'id='+id;
if(cls=='bar'){
$.ajax({
type:'GET',
url:'foobar.php',
data:dstr,
cache:false,
success:function(a){
// this is where it calls for the content of foobar.php
$('#foobar').html(a);
}}
)
}
return false;
});
in foobar.php it queries database and shows the results depending on unique id which works fine, but it also has a form which I'm trying to use with jquery.form.
Now if I add the script links in foobar.php it works great:
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.form.min.js"></script>
but these jquery files are are loaded in index.php so am wanting if possible to get jquery.form to work using the already loaded jquery files from index.php.
I know it doesn't currently work as it has something to do with the fact the content of foobar.php is being loaded into/via a dom and so as the lines above are not present in foobar.php it can't call them?!