I'm working with jquery UI tabs. (jquery 1.11.1,jQuery ui 1.11.1)
I've the following <base>
tag in head>
:
<base href="http://mytestdomain.com/" />
Now when the page loads jquery UI makes two tabs out of my two <li>
's and then tries to load the content from base url via ajax. jQuery ui doesn't know that the href
of anchors are not "external", but "local" hence fails to load the content.
My html:
<div id="container-1">
<ul>
<li><a href="#fragment-1">some text1</a></li>
<li><a href="#fragment-2">some text2</a></li>
</ul>
<div id="fragment-1">
LOREM IPSUM1
</div>
<div id="fragment-2">
LOREM IPSUM2
</div>
</div>
My javascript:
<script type="text/javascript">
$(document).ready(function() {
$('#container-1').tabs();
});
</script>
Can someone help me please?
Because of your base tag:
<base href="http://mytestdomain.com/" />
The links having segments will be interpreted like the following:
That certainly won't work since it's pointing to a directory.
Modifying the
href
of the hyperlinks to include the remaining path till the file containing the segment will fix the issue.For example:
will be interpreted as
and jQuery-UI will find the element having
id
fragment-2 fromindex.html