frames question
I am working on a site开发者_Go百科 that has a bar on the side, and then using jquery load function I'm loading content in the main div, without navigating out of the page.
Since the stuff loaded on the main div does not require the header, menus, etc, I have files around that I don't know how to hide from the outside world. For example, I am loading to my main div with code like this: $(document).ready(function() {
$('#see_bio').click(function() {
$("#main").load("show.php?=bio");
return false;
});
});
I want to avoid the user from going to mydomain.com/show.php by himself... How can I do so?
You can select which elements of the resulting content are added to the div by using CSS selectors. For example you can replace:
$("#main").load("show.php?=bio");
with:
$("#main").load("show.php?=bio div#content");
this will pick from the returned data only the div with id="content" inside the #main element. So headers and menus are just discarded.
精彩评论