object-tag

Cross-browser Access html content of object tag

这一生的挚爱 提交于 2019-12-02 06:44:05
问题 I have object tag with a data attribute to a html file from same domain. I want to access the content of the html. HTML: <object id="object" width="420" height="360" data="jsp/index.html"></object> JS: var object = document.getElementById("object").contentDocument; var html = object.getElementById("tmpl").innerHTML The above code is working in all browsers except IE7 Please help me in accessing the DOM content of object tag in IE7 回答1: Ok so i tried to play around the code a little as

Calling a javascript function in html page embedded in an object tag

半腔热情 提交于 2019-12-02 01:25:41
问题 I have a page which contains another page embedded inside an object tag. Now I want to call a javascript function from the "parent"-page. To be specific: The parent page wants to call a function, which resides inside the embedded code. Former I used iframes but they caused some nasty bugs with Firefox, so I don't want to use them anymore. Edit: So, my question is: what would be the best way to achieve this, when using an object tag? Here's some example to illustrate what I want to do: I have

How can I dynamically add an <object> tag with JavaScript in IE?

心不动则不痛 提交于 2019-11-29 02:39:54
I have to add either an embed tag for Firefox or an object tag for Internet Explorer with JavaScript to address the appropriate ActiveX / Plugin depending on the browser. The plugin could be missing and needs to get downloaded in this case. The dynamically added embed tag for Firefox works as expected. The dynamically added object tag for Internet Explorer seems to do nothing at all. The object tag needs the following attributes to function properly. id ="SomeId" classid = "CLSID:{GUID}" codebase = "http://www.MyActicexSource.com/MyCuteActivex.CAB#Version=2,0,0,1" Even a general working idea

Is it ok for an HTML element to have the same [name] as its [id]?

不问归期 提交于 2019-11-28 09:36:26
I'm working on embedding a flash app in a webpage using the Satay method: <object type="application/x-shockwave-flash" data="embeddy.swf" id="embeddy" name="embeddy" > <param name="movie" value="embeddy.swf" /> </object> I want flash to provide the correct objectID in ExternalInterface.objectID , which means I need to set both the name and id attributes for the object . Normally I try to avoid naming collisions with elements in HTML, but is there anything wrong with setting both attributes to the same value in this case? What about HTML forms? Does anyone feel that it's worthwhile to set a(n)

Is it ok for an HTML element to have the same [name] as its [id]?

扶醉桌前 提交于 2019-11-27 03:02:39
问题 I'm working on embedding a flash app in a webpage using the Satay method: <object type="application/x-shockwave-flash" data="embeddy.swf" id="embeddy" name="embeddy" > <param name="movie" value="embeddy.swf" /> </object> I want flash to provide the correct objectID in ExternalInterface.objectID , which means I need to set both the name and id attributes for the object . Normally I try to avoid naming collisions with elements in HTML, but is there anything wrong with setting both attributes to

Load event not fired on Safari when reloading page

自闭症网瘾萝莉.ら 提交于 2019-11-26 11:40:28
问题 I have a simple SVG loaded inside a object tag like the code below. On Safari, the load event is fired just once, when I load the first time the page after opening the browser. All the other times it doesn\'t. I\'m using the load event to initialize some animations with GSAP, so I need to know when the SVG is fully loaded before being able to select the DOM nodes. A quick workaround that seems to work is by using setTimeout instead of attaching to the event, but it seems a bit akward as