Jon Diemunsch

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromJon Diemunsch
ToMe
SubjectHello can you help
Date19 August 2003 21:09
AttachmentMost of the code from: http://www.js-examples.com/example/?ex=839&mode=2
This is a lot of code I know and I just can't figure how the graph is
confined to a box. If you could look at it for me that would be great. I
don't know much about Jscript or javascript and I am trying to learn, so any
other help would be very useful.

Sincerely,
Jon Diemunsch
FromMe
ToJon Diemunsch
SubjectRe: Hello can you help
Date07 August 2003 15:03
Jon,

You are right, it was a lot of code, but you were still missing a couple of
js files! It is unnecessary to have language=jscript, it should be
javascript.

The box has nothing to do with JScript or JavaScript. It is an iframe, an
HTML4 tag that allows you to embed one page inside another. JavaScript
treats it like a frame in a frameset (but some browsers like the extra
'window').
var x = window.frames['iframeName'].window.document;
x.open();
x.write('new page content, including HTML tags etc.');
x.close();
It is supported by all modern browsers (NOT Netscape 4, Escape 4 or OmniWeb
4.2-). Because the graph uses absolute CSS positioning, the box could also
have been done using a relatively positioned DIV element. This would also
work in Netscape 4 and Escape (but not Opera 6-).

If you want to rewrite the contents of an iframe yourself, you may find
that many browsers will not rewite the contents, because they need the
iframe's initial page to be in the same domain as the parent page, or their
security model is even tighter than that. What does help is this (although
it adds one history entry every time):
var locToOpen = ( window.opera || ( document.layers &&
  !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' ||
  ( document.childNodes && !document.all && !navigator.taintEnabled ) ) ?
    '' : 'about:blank';
var x = ( window.open(locToOpen,'iframeName') ).document;
x.open();
x.write('new page content, including HTML tags etc.');
x.close();

Is this what you wanted?


Tarquin - author of http://www.howtocreate.co.uk
FromJon Diemunsch
ToMe
SubjectRe: Hello can you help
Date20 August 17:03
Thank You this is quite useful. Though my inexperience leaves me sort of
confused by the code, I have realized what I must do for my project(use
another method, at least for parts of it). Sincerely, Jon Diemunsch
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.