eas*_*der 1 html iframe jquery
我有一个索引页面,里面有2个iframe.当我点击iframe 2中的链接时,将在iframe 1中打开一个页面.现在,当您点击iframe2中的该链接时,我想更改浏览器标签标题.
我知道如何使用以下脚本更改浏览器标题选项卡,但只有当它在索引页面上时才有效.
<script type="text/javascript">
$(document).ready(function(){
$('#link1').click(function(){
$('head title').text('HelloWorld');
});
});
</script>
<a id="link1" href="home.html" target="iframe1">Home</a>
Run Code Online (Sandbox Code Playgroud)
希望你们能帮忙.
这应该工作.
<script type="text/javascript">
$(document).ready(function(){
$('#link1').click(function(){
$('head title', window.parent.document).text('HelloWorld');
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
家