473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a new Explorer Window by passing HTML

I currently have this code:

<script language="javas cript">
function init()
{
// load XML source document
var source = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
source.async = false;
source.load("re cord49a36bde.xm l");

// load XSLT stylesheet document
var stylesheet = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
stylesheet.asyn c = false;
stylesheet.load ("detail_view.x sl");

// transform the source using the XSLT stylesheet
target.innerHTM L = source.transfor mNode(styleshee t);
}
</script>
I then need to be able send the html stored in 'target' to a new
explorer window.

Is this possible?

Thanks

Apr 25 '06 #1
4 2081

"Casper" <ma************ **@gmail.com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
I currently have this code:

<script language="javas cript">
function init()
{
// load XML source document
var source = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
source.async = false;
source.load("re cord49a36bde.xm l");

// load XSLT stylesheet document
var stylesheet = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
stylesheet.asyn c = false;
stylesheet.load ("detail_view.x sl");

// transform the source using the XSLT stylesheet
target.innerHTM L = source.transfor mNode(styleshee t);
}
</script>
I then need to be able send the html stored in 'target' to a new
explorer window.

Is this possible?


Something like :-

var newWindow = window.open();
newWindow.docum ent.innerHTML = target.innerHTM L;

or some variation may possibly work.

Aaron
Apr 27 '06 #2
>
var newWindow = window.open();
newWindow.docum ent.innerHTML = target.innerHTM L;


"document" doesn't nave "innerHTML" property, use "write()" method
instead of.

newWindow.docum ent.write(targe t.innerHTML);

Apr 28 '06 #3
marss wrote:
var newWindow = window.open();
newWindow.docum ent.innerHTML = target.innerHTM L;

Please provide attribution of quoted material.

<URL:http://jibbering.com/faq/faq_notes/pots1.html>
<URL:http://www.safalra.com/special/googlegroupsrep ly/>
"document" doesn't nave "innerHTML" property, use "write()" method
instead of.

newWindow.docum ent.write(targe t.innerHTML);


It will not work, because the `innerHTML' property of any DOM object will
always only evaluate to the code of the content, not to the code of the
container. Therefore, one has to write at least:

var newWindow = window.open();
if (newWindow && newWindow.docum ent)
{
newWindow.docum ent.open();
newWindow.docum ent.write(
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"'
+ ' "http://www.w3.org/TR/html4/loose.dtd">'
+ '<html>'
+ target.innerHTM L;
+ '<\/html>');
newWindow.docum ent.close();
}

Since the `outerHTML' property has no broad support, there is an inevitable
loss of information to this approach.
PointedEars
--
There are two possibilities: Either we are alone in the
universe or we are not. Both are equally terrifying.
-- Arthur C. Clarke
Apr 28 '06 #4
Thomas 'PointedEars' Lahn said the following on 4/28/2006 5:04 AM:
marss wrote:
var newWindow = window.open();
newWindow.docum ent.innerHTML = target.innerHTM L;
Please provide attribution of quoted material.

<URL:http://jibbering.com/faq/faq_notes/pots1.html>
Solid reference but at a minimum point a person to the relevant spot in
that document:

<URL: http://jibbering.com/faq/faq_notes/pots1.html#ps1P ost>

covers quoting/attributing.
<URL:http://www.safalra.com/special/googlegroupsrep ly/>
Irrelevant to the post you replied to.
"document" doesn't nave "innerHTML" property, use "write()" method
instead of.

newWindow.docum ent.write(targe t.innerHTML);


It will not work, because the `innerHTML' property of any DOM object will
always only evaluate to the code of the content, not to the code of the
container. Therefore, one has to write at least:


That does not, at a minimum, satisfy the needs.
var newWindow = window.open();
if (newWindow && newWindow.docum ent)


No test to see if the window was closed by a popup blocker?

Nor does the code do anything with Symantec popup blocking code.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 30 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1298
by: SROSeaner | last post by:
I am seeking to create a new internet explorer window with certain dimensions and a position on screen. Also, I have a couple of arrays containing data I want to send to that new window. I have been using Javascript's window.open function to create the window exactly the way I want, but don't know how to get my ASP array data to that new...
22
3115
by: Tom Moroow | last post by:
Hi, I'm pretty new to javascript and was wondering how you would piece together a variable name and then assign it a value. I want to create a hidden field and assign it a value based on the value of another variable Right now it looks like: ("document.all.SM_MARK_10" + dateNumber + ".value") where dateNumber is an already defined...
5
5073
by: Nicola Pedrozzi | last post by:
Here I really need a guru... ;^( I found out today with a big disappointment that : window.open("url", ...) and also navigate("url") limit the max length of the url string to something like 2080 characters. That on Explorer only; Netscape and Mozilla work perfectly
4
4653
by: Pasquale | last post by:
Hello, I wondering if there is a way to dynamically update a select list with javascript from a database query without having to reload the page to update the list?
8
1850
by: David W. Simmonds | last post by:
Is there an easy way to create a new browser window from C# and ASP.NET? I would just like to have a popup window without any menus or toolbars that would contain a high-res image. The low-res image would be in the main window and would have a button that when pressed brings up the "popup" window that has the high-res image. I would like the...
6
2884
by: Sandy | last post by:
Hello - I have a little application that I would like to have an exit button on that closes my web application and closes Internet Explorer. What is the code that will do that? Any help will be greatly appreciated! --
6
7243
by: Adam Tilghman | last post by:
Hi all, I have found that IE doesn't seem to respect the <SELECT> "multiple" attribute when set using DOM methods, although the attribute/property seems to exist and is updated properly. Those changes just don't make it onto the screen. Am I doing something wrong here? If not, is there a better feature test I can use than...
4
4714
by: Ryan Knopp | last post by:
This is an update from a previous post, I just simplified the code. It seems that I can't get the image map to work with IE7. The page is located here http://www.theknopps.com/test.html and the source below. I can't seem to figure out why IE7 won't recognize the image map. Thanks for your help Ryan
2
3137
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation...
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.