我如何替换[b]#[/b]
为[b]?[/b]
http://site.com/?first是否
有可能?
我有以下脚本:
$(function () {
var tabContainers = $('div.tabs > div');
tabContainers.hide().filter(':first').show();
$(window).bind('hashchange', function () {
var hash = window.location.hash || '[b][b]#[/b][/b]first';
tabContainers.hide();
tabContainers.filter(hash).show();
$('div.tabs ul.tabNavigation a').removeClass('selected');
$('a[hash=' + hash + ']').addClass('selected');
});
$(window).trigger( "hashchange" );
});
<div class="tabs">
<ul class="tabNavigation">
<a href="#first" class="selected">First</a>
<a href="#second" class="">Second</a>
<a href="#third" class="">Third</a>
</ul>
<div id="first" style="display: block;">
<h2>First</h2>
</div>
<div id="second" style="display: none;">
<h2>Second</h2>
</div>
<div id="third" style="display: none;">
<h2>Third</h2>
</div>
</div>