html-object

How can I get the text inside an object element?

半世苍凉 提交于 2020-01-07 05:03:08
问题 In the object element with the ID x a text file is loaded and displayed correctly. How can I get this text with JavaScript? I set y.data = "prova.txt" then tried y.innerHTML; y.text; y.value; None of these work. <!DOCTYPE html> <html> <head> </head> <body> <object id="x" data="foo.txt"></object> <script> var y = document.getElementById("x") </script> </body> </html> 回答1: I'm afraid this isn't going to be easy as you'd like it to be. According to your comments, you tried AJAX first, but came

Embedding with 'object' tag not working on dynamic data

只愿长相守 提交于 2019-12-11 07:10:10
问题 I am trying to embed youtube videoes using the object tag instead of iframes. However, it doesn't work even though element.url points to the correct url. If I replace {{element.url}} (in object tag) with just the url, it works just fine. The iframe works as it is. <div ng-show="element.url" id="resourceFrame"> <iframe class="iframe" width="500" height="325" src="{{element.url}}" frameborder="0" allowfullscreen></iframe> <object width="500" height="325" > <param name="{{element.name}}" value="

how to access the elements of the HTML loaded in object tag?

好久不见. 提交于 2019-12-07 12:00:31
问题 Eg: Fetching text input value using jQuery $('#username').val(); I had tried this from this question Here is my code <div id="siteloader"></div> $(window).load(function(){ $("#siteloader").html('<object data="http://testk.shopnix.org/admin" />'); setTimeout(function() { console.log($("#lemail_id")); $("#lemail_id").val("lemail_id"); console.log($("#lemail_id").val()); }, 10000) }) JS fiddle here 回答1: Use event onload instead of timeout. For access to object internal structure use method