New Window in GWT, DOM, Internet explorer - javascript

I'm trying to create new Window with GWT as it shown here: https://stackoverflow.com/a/4205058/898588
This works in FF, Chrome, but doesn't work in IE (IE9 in my case). I see exception in dev. mode:
(null): DOM Exception: HIERARCHY_REQUEST_ERR (3)
So, this string:
bdElement.getOwnerDocument().getElementById("mainbody").appendChild(config.getElement());
throws this exception.
I've tried:
bdElement.appendChild(config.getElement());
but it was unsuccessfully.
How to make it work in IE?

Solution was found:
bdElement.getFirstChildElement().setInnerHTML(config.getElement().getString());
This works in IE, Opera, Chrome, FF

To be more specific, you only need to use setInnerHTML() instead of appendChild(), so the following piece of code will work as well in IE9 and Chrome as far as I can tell:
bdElement.getOwnerDocument().getElementById("mainbody").setInnerHTML(config.getElement().getString());

Related

jsPDF to show iframe in ANY IE versions

https://parall.ax/products/jspdf#
http://mrrio.github.io/jsPDF/
Both resources ^ work fine in chrome and firefox, but the iframe generating the preview won't work in any version of IE for me. Anyone have any work-arounds?
The correct way I've found after dealing with both iframe and object/embed attempts, is through http://pdfobject.com/ .
Works in all IE v9+, Chrome, FireFox browsers.

document.open does not work in Safari

I have the following javascript code, I tried to test it in Chrome, Firefox and Opera, they all working fine, but on Safari, it generates error "undefined is not an object (evaluating 'x.document')", any idea on how to resolve it? Thanks.
var x = window.open();
x.document.open();
x.document.write('hello world');
x.document.close();
You need to enable popup windows in Safari. Go to Preferences > Security > Block pop-up windows for this to work in Safari. Otherwise, Safari does not allow you to reference a document within a blocked window.

How to get Raphael XML string in Explorer 8?

I have a function that turns the Raphael svg into a PNG. It works for everything IE9+, Firefox and Chrome. The problem is that a lot of our clients still use IE8 and cannot upgrade b/c they still use Windows XP. What I need is to emulate this functionality for IE8:
var svgElement = document.body.getElementsByTagName("svg")[0];
var svgXml= (new XMLSerializer()).serializeToString(svgElement);
var finalSvg = svgXml.FixForRaphael();
The problem is that in IE8 document.body.getElementsByTagName("svg")[0] is "undefined" and that XMLSerializer is not in IE8 either. The latter I believe I have solved for, but I still cannot figure out how to solve the first. When I alert(svgElement) in Firefox it says it is a "Object SVGSVGElement". How do I get this object in IE8?

Cross browser issue with window.opener.insertHTML

This code works fine in Firefox window.opener.insertHTML but it doesnot work for IE. I just noticed that this code works even for IE9 but its not working for IE8
How can i get it to work for both the browsers?
The insertHTML command is for documents in design mode. It is a Mozilla invention and apparently isn't supported by IE.
Please try with pasteHTML insted of InsertHtml.

SlideShare Does not Load on Internet Explorer 8

I have made a simple embed of slideshare on my site. However, on Internet Explorer, it keeps saying "Loading" and nothing appears. However, in Firefox its almost instant. Please try here using internet explorer.
Or is it just me? It makes use of Flash and Javascript.
What can the problem be?
Thanks all for any hellp
This page works fine in IE9 at least, and the content you say is broken was written in Flash. You might want to watch your HTTP traffic using Fiddler (www.fiddler2.com) and check for script errors using IE's developer tools (hit F12).
I've check it in Chrome, Firefox, IE6/7/8 and they all seem fine. I haven't checked it in Opera or Safari though.

Categories