htmlpage-titleobject-tag

HTML <object> set <title> to inner page title


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

<!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?


Solution

  • 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.

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

    References:

    jQuery

    Example