繁体   English   中英

通过JavaScript设置页面标题

[英]Setting page title through javascript

如何通过javascript设置此页面标题

<head runat="server">
    <link href="../App_Themes/CSS/Catalyst.css" rel="stylesheet" type="text/css" />
    <title><asp:Literal ID="ltlTitle" runat="server"></asp:Literal>
        </title>
</head>

您可以做类似的事情,

<script type="text/javascript">    
  document.title = "This is the new page title.";

  //or 

 $(document).attr('title', 'test');
</script>

您可以通过以下代码进行检查:

document.title="My Title by Vaibhav";
document.write(document.title);

采用

$('title').html("new title");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM