2011-04-04 38 views
0

有没有办法从另一页触发<a href="javascript:switch_tabs('tab3');">与这样的锚链接像这样的<a href="www.sample.com/page.html#reference" class="links">从另一页触发JavaScript功能与锚点

不喜欢的东西

如果(window.location.hash == '#abstract'){ $(文件)。就绪(函数(){ switch_tabs( 'TAB1'); }); (window.location.hash =='#full'){ $(document).ready(function(){ switch_tabs('tab2'); });如果(window.location.hash =='#full'){ } (window.location.hash =='#reference'){ $(document).ready(function(){ switch_tabs('tab3'); }); }

如果有人想使它更漂亮,成为我的客人。

谢谢

+0

只有在page.html中有一个脚本来捕获location.hash并为您触发 – mplungjan 2011-04-04 13:40:20

+0

感谢设法做了一些与location.hash,apreciate的帮助。 – bart 2011-04-04 16:06:26

回答

0

不需要。您需要获取脚本。