View Full Version : alternative style sheet

08-26-2004, 11:49 PM
i am calling a remote page into frames at 6 different locations. i want a different style sheet depending on which location.

<script language="javascript" type="text/javascript">
if (frame.name='AmainFrame') {
document.write '<style type="text/css">
@import url("http://www.meyer.com/A.css");

Willy Duitt
08-27-2004, 01:01 AM
Your document.write statement(s) need to be within params ( ... ) and either on one line or broke across several statements as I have done below.... I would also reference the frame name thru the document.frames collection but I am unsure if your use in the if conditional is correct....

<script type="text/javascript">
if(document.frames['AmainFrame']) {
document.writeln('<style type="text/css">');
document.writeln('@import url("http://www.meyer.com/A.css")');


08-27-2004, 01:38 AM
well that certainly looks much better, but it's still not working.

i'm now wondering if anything along this line will work.
i'm starting to think that since the remote file doesn't "know" where it's going until it goes it's too late to call the css.

should it work, do you think?

what other methods might there be to accomplish this?

Willy Duitt
08-27-2004, 01:46 AM
Don't know...

I already said that this does not look right: if(document.frames['AmainFrame']) {

Either way it is said: if (frame.name='AmainFrame') {

It doesn't make sense to me but I am not privy to the context it is being used in so.....