开发者

jQuery tabs content via ajax

开发者 https://www.devze.com 2023-03-01 04:01 出处:网络
Can anyone help me figure out why this isn\'t working? http://jsfiddle.net/87pWn/ I basically copied the source from here: http://jqueryui.com/demos/tabs/ajax.htm开发者_如何转开发lYou are trying to l

Can anyone help me figure out why this isn't working? http://jsfiddle.net/87pWn/

I basically copied the source from here: http://jqueryui.com/demos/tabs/ajax.htm开发者_如何转开发l


You are trying to load in content via XMLHttpRequest with a relative base path.

<li><a href="ajax/content1.html">Tab 1</a></li> 

When you click on a link, the code is trying to take the content from "http://jsfiddle.net/87pWn/ajax/content1.html", which is why the error handler is being fired.


$(anchor.hash) should be $('a.hash')


You must select jQuery 1.8.2 or higher. Also you must select jQuery UI, because jQuery UI is main thing you need to see tabs.

0

精彩评论

暂无评论...
验证码 换一张
取 消