I have this jq function to open a link inside a div:
$(document).ready(function() {
$('#all').delegate('a', 'click' (function() {
$('#content').empty();
var page = $(this).attr("id");
$('#content').load("scripts/loop_a.php?page=" + page);
});
});
I call this inside the head tag of my index.php and is working for all links that are in my header_template.php
If I load a new.php page inside my main_body div and it has a link inside, that link does not work with my script, (basically my new.php page doesn’t see my .js file).
Is there a way to make it work for any new .php file that I open by calling the .js file only in my index.php?
Thank you
Edit… Solution Found… I edided the script above.
In my index.php I am using which includes everything that happens.
So I just chose that div and I delegate all the functions that I needed to work when loading/opening new.php files.
Thank you all for your help.
1 Answer