May 24, 2010
use jquery to refresh div tab onclick?
Question by Q7898339
I’m using tabs, but wondering if it’s possible to “refresh” tab content onclick?
Answer by Starx
Yes it is possible, but you dont need onClick event for this I think
use this
<div id="example">
<ul>
<li><a href="ajaxpage1.php"><span>Content 1</span></a></li>
<li><a href="ajaxpage2.php"><span>Content 2</span></a></li>
<li><a href="ajaxpage3.php"><span>Content 3</span></a></li>
</ul>
</div>
Notice that: instead of giving the id of the tab’s division, a page link given
so every time you click on the tabs, it updates it
this degrades gracefully – the links, e.g. the content, will still be accessible with JavaScript disabled.
ps: I am assuming that you having a
working tabs