I have jquery tabs like
<ul id="tabsList">
<li><a href="#tab-1">Name 1</a></li>
<li><a href="#tab-2">Name 2</a></li>
<li><a href="http://www.google.com/">Name 3</a></li>
</ul>
<div id="tab-1">content 1</div>
<div id="tab-2">content 2</div>
the first two tabs load the respective divs. But the third one should go to google.com, instead it does nothing. It just adds http://example.com/index.html#ui-tabs-[object Object] to the url.
I am developing a wordpress plugin and the admin page needs a tab interface. I tested this in a local server and not working
update:
i don't want to load google.com inside the page. It should open the webpage in new tab/window like ordinary links do.
I'm not sure what you want it to do, but if it should open the link as a new page/replacement for the current page, the documentation explains:
See http://jqueryui.com/demos/tabs/#...follow_a_tab.27s_URL_instead_of_loading_its_content_via_ajax
Note: In JQuery > 1.9.0 use activate instead of select
You cannot since requesting content from google.com will be a cross domain call and the xhr call will fail.
Why not put an iframe inside the third content div with the src attribute pointing to google?
Demo here
I just had the same problem. I solved it by giving the tab anchor that should be loaded externally a class named "followtablink". Then I modified my tabs() call to this:
Every time a tab gets selected, it follows the link when it encounters the given class.
Note: In JQuery > 1.9.0 use activate instead of select
When i saw the generated source code, the
was changed to
But other lists were same. I still don't know whether it is due to the problem of testing in local server.
So i tried this option. I removed the "href" attribute and added a class named "theLink" like
and then i added the following jquery
after this it worked as i excepted. The third tab when clicked loaded google.com in a new tab