HTML 将设置为内页标题

时间:2022-12-04 23:44:23

I have a page (page1.html) that request an other page via an <object> tag like this:

我有一个页面(page1.html)通过标签请求其他页面,如下所示:

<!DOCTYPE html>
<html>
  <head>
  <title></title>
  </head>
  <body>
    <object data="www.anotherdomain.com/page2.html"></object>
  </body>
</html>

Now, in the page2.html, there's a dynamic title property, how can I keep this title and display it as if it was page1's title?

现在,在page2.html中,有一个动态标题属性,如何保留此标题并将其显示为是否为page1的标题?

1 个解决方案

#1


0  

Now this is more javascript question in my opinion. When object tag loads the page2.html inside your page1.html then you can target title tag and just get text. It's really easy to do it with jquery.

现在这是我认为的更多javascript问题。当object标签加载page1.html中的page2.html时,您可以定位标题标记并获取文本。用jquery做它真的很容易。

<script>$(document).ready(function(){
//here target the title inside your object, html ..  
</script>

References:

参考文献:

jQuery

jQuery的

Example

#1


0  

Now this is more javascript question in my opinion. When object tag loads the page2.html inside your page1.html then you can target title tag and just get text. It's really easy to do it with jquery.

现在这是我认为的更多javascript问题。当object标签加载page1.html中的page2.html时,您可以定位标题标记并获取文本。用jquery做它真的很容易。

<script>$(document).ready(function(){
//here target the title inside your object, html ..  
</script>

References:

参考文献:

jQuery

jQuery的

Example