|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to reference a different "document" CSS .... ?
Hi All,
Does anybody know how to reference a 'document' attribute in a different window, if there are several CSS windows on the screen? For example: javascript:document.styleSheets[0].disabled=true; Will do the current window (on a web page already created, which has multiple windows each with their own CSS file). I want to reference [other window on screen].javascript:document.styleSheets[0].disabled=true; ? ? ? ? ? ? |
|
#2
|
|||
|
|||
|
you mean like
document.frames[x].document.styleSheets[y].disabled=true; |
|
#3
|
|||
|
|||
|
For
document.frames[1].document.styleSheets[3].disabled=true; I'm getting the error: Error: 'document.frames.1.document' is null or not an object I mean I understand that you would use 0-3 say for 4 styleSheets, but what in the world goes in argument "x"? I've tried every number from 0 to 10 and nothing works. And is it assigned somewhere? I can't find any web literature on it.
Last edited by jeffpas; 11-06-2009 at 11:15 PM. |
|
#4
|
|||
|
|||
|
this is so ridiculous.
Why should this be so difficult? All I want to do is reference an object in another window. I've searched web pages for almost two days straight now and can't find a reference that works anywhere. Surely JavaScript can do it........... does anybody know the safe lock combination........... Last edited by jeffpas; 11-06-2009 at 11:45 PM. |
|
#5
|
|||
|
|||
|
In another window.
So, you can only reference other windows if those windows are opened by the parent. in the parent you can open a window and write the document- function popawindow(){ var aWin =window.open('','aWin','top=150px, left=200px, width=400, height=375, location, menubar, scrollbars, toolbar, resizable, status'); aWin.document.write('allo?'); aWin.document.close(); } aWin is the name and how you reference it. Same here now but the window must be in your domain var aWin =window.open('http://yourDomain.com/another.html','aWin','top=150px, left=200px, width=400, height=375, location, menubar, scrollbars, toolbar, resizable, status'); |
|
#6
|
|||
|
|||
|
so how about
'http://yourDomain.com/theothercss.css'.document.styleSheets[3].disabled=true; ??? http://www.greatlakesoffshore.com/gr...es/blowup2.gif |
|
#7
|
|||
|
|||
|
There are several 'windows' on the page, or CSS defined areas. Each has its own CSS file. At least, thats the way these people did it, and they can't be reached.
When I execute: document.styleSheets[0].disabled=true; The stylesheet in the same window as the drop-down box disappears, leaving a blank drop down box with no background. Apparently 'document' handle only refers to the current window. There seems to be no ability in Java to do (pick a window).document.xxxxx. I need to make a background in the other window disappear, not the same one I am in. |
|
#8
|
|||
|
|||
|
Are you still working on this
http://www.sitepal.com/ttswidgetdemo?mId=31950713.3 |
|
#9
|
|||
|
|||
|
I'm believing it!
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|