/    Sign up×
Community /Pin to ProfileBookmark

Newbie question, please help

I seems like a problem with a simple solution but after searching through google for almost 3 hours I still haven’t found the info I need. I’ve been working with javascript for less than a week.

So here’s what I’m trying to do. I’ve been given the task of creating a simple cinema listing page thats going to extract the titles and times from an XML document. (This is probably more info than you need, but I’m setting the scene ? )

I’ve been altering an example I found on the web. At the moment its in frames (which is not good). I want to change it so instead of opening in a target frame it opens a pop-up. I’m guessing I need the change the line I’ve underlined below, but I don’t know the right methods etc to use. Thank you for your time.

(just to note, this isn’t how we plan to finally implement this cinema search. my boss needs it asap (as he has people updating them manualling at the moment, which takes a whole day for his team), he wants a version in asp eventually (which our programmers will do when they have time in their schedule)).

(I edited the code down to what I think is relevant)

The script in the head:

var xml = new ActiveXObject(“Msxml2.DOMDocument.3.0”);
xml.async = false;
xml.load(“Cinema.xml”);

function showCinema2()
{
var xsl = new ActiveXObject(“Msxml2.DOMDocument.3.0”);
xsl.async = false;
xsl.load(“Cinema2.xsl”);

[U]parent.bodyFrame.document.body.innerHTML = xml.transformNode(xsl);[/U]

}

The html in the body:

<FORM name=”controlForm”>
<p align=”center”>
<INPUT type=”image” src=”arrow.gif” value=”Show cinema 2″ onclick=”showCinema2();” align=”middle” /></p>
</FORM>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorOct 03.2005 — try:

var mypop=window.open('popup.html','newwin');

mypop.document.getElementsByTagName('body')[0].innerHTML=xml.transformNode(xsl);
Copy linkTweet thisAlerts:
@DelamekoauthorOct 03.2005 — Thank you! You're a star ?

Tho, I gave the body an ID then used getElementById instead, I couldn't get it to work the other way for some reason.
×

Success!

Help @Delameko spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...