www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-06-2009, 03:19 PM
    jeffpas jeffpas is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 13
    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;


    ? ? ? ? ? ?
    Reply With Quote
      #2  
    Old 11-06-2009, 10:56 PM
    justinbarneskin justinbarneskin is offline
    Registered User
     
    Join Date: Oct 2006
    Posts: 529
    you mean like
    document.frames[x].document.styleSheets[y].disabled=true;
    Reply With Quote
      #3  
    Old 11-06-2009, 11:10 PM
    jeffpas jeffpas is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 13
    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.
    Reply With Quote
      #4  
    Old 11-06-2009, 11:41 PM
    jeffpas jeffpas is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 13
    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.
    Reply With Quote
      #5  
    Old 11-07-2009, 08:07 AM
    justinbarneskin justinbarneskin is offline
    Registered User
     
    Join Date: Oct 2006
    Posts: 529
    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');
    Reply With Quote
      #6  
    Old 11-07-2009, 11:07 PM
    jeffpas jeffpas is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 13
    so how about

    'http://yourDomain.com/theothercss.css'.document.styleSheets[3].disabled=true;

    ???


    http://www.greatlakesoffshore.com/gr...es/blowup2.gif
    Reply With Quote
      #7  
    Old 11-07-2009, 11:14 PM
    jeffpas jeffpas is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 13
    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.
    Reply With Quote
      #8  
    Old 11-08-2009, 12:11 AM
    justinbarneskin justinbarneskin is offline
    Registered User
     
    Join Date: Oct 2006
    Posts: 529
    Are you still working on this
    http://www.sitepal.com/ttswidgetdemo?mId=31950713.3
    Reply With Quote
      #9  
    Old 11-08-2009, 02:31 AM
    jeffpas jeffpas is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 13
    Wink

    I'm believing it!
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 10:23 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.