-1

I have div which contains an HTML object

<div id="webPage">
  <object type="text/html" id="webUrl" data="http://www.pageweb.com" style="overflow:auto"></object>
</div>

In this div the user has the ability to navigate to the http://www.pageweb.com site. I would like to retrieve the exact URL where the user is, for example: http://www.pageweb.com/fr/index.php?page=cadre&option=5. I am unable to find the properties of this object, or its child, in order to retrieve this URL.

When I right click the object in Chrome and click "Display the source code of the frame", it displays the content the URL that I need.

1 Answers1

0

Might be missing something - but surly you just want the data property of the object.

var element = document.getElementById('webUrl');

console.log(element.data);
<div id="webPage">
    <object type="text/html" id="webUrl" data="http://www.pageweb.com" style="overflow:auto">
    </object>
</div>
Fraser
  • 15,275
  • 8
  • 53
  • 104