简体   繁体   中英

Loaded AJAX content breaking out of DIV tag

Hi. I'm new to Java/AJAX etc. I have a page with links down the left and a DIV on the right. I want content (other pages) to load in the DIV when users click on the links on the left... beginner AJAX stuff I guess.

I played around with a few JQery plugins and found one that allows pages to load with a fade effect, which is perfect. I have a problem though:

The plugin works fine when I click links on the parent page, but when I click links in one of the loaded pages, after one link deep, it breaks out of the div and replaces my parent page. (This issue was described on the plugin page, supposedly solved, but is still cropping up on my page). I suspect it has something to do with the "bind" variable.

I've uploaded a stripped down example of my site here : This is the plugin website: www.thecreativeoutfit.com/index.php?view=Simple-AJAX-Content-Changer-with-EZJax (Because I'm a new user I can't add any more links, sorry for the long-hand).

For those who are willing to look at my site or the plugin, I'd appreciate your insight. If that's a hassle maybe you could recommend a similar simple ajax plugin that allows the loading of content with a fade-in effect, but also allows links within the loaded content to stay contained within the original div.

Many thanks!

Max

I was going to post a comment but it got too long so, what the heck..

Your website worked just fine for me (except for the pages that were not available) in Firefox running on Windows XP.

However, I would strongly recommend against that type of design - it will be a pain for you to maintain in the long run and it is generally considered bad design because it is against the functioning principles of the web: different pages of your website should be represented by distinct URLs which users of your site could use to link to. It also breaks browser back button functionality which is a big usability issue (at least for me).

Plus, it will not be SEO friendly - which means that search engines like Google won't think highly of your website - which means that you won't show up in searches.

您嵌套的页面中断了,因为在第一页导致正常的href属性被使用之后,JavaScript click事件没有重新附加到分页控件上。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM