How to open links in ajax pages?
i had use Ajax using jquery.
Now i had one page and in that page their is one div, in which one page will be shown, lets say there is main-page.php and in that i have i had开发者_开发技巧 ajax-page.php [ which will shown in that div ].Now ajax-page.php, is having some links and i want to open in that same div.
Currently the links of ajax-page.php is opening in new window. so how to open ajax page links in ajax part?Exactly what others said - using it with iframe would be the best. If you do want those other links to open with ajax, then you need to use something like
$('#ajaxcontent').children('a').live('click', function(){
load content here again with ajax
});
Basically loading the contents of ajax div over and over again.
Sounds like you're after a good 'ole fashion "iframe". They will behave exactly as you've described. The advantage to iframes is that you don't even need to write any fancy Javascript to use them.
More info here: http://www.w3schools.com/tags/tag_iframe.asp
精彩评论