Changing the stylesheet of a nested page at runtime

First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS and JavaScript.

I gather that in XHTML, the correct way to have a nested page is as follows (instead of an iframe):

<object name="nestedPage" data="" type="text/html" 
width="500" height="400" />

If I have a nested page like that - is it possible to change the stylesheet used by the nested page at runtime using JavaScript in the parent page? Ideally this would happen immediately so that the nested page would never be visible with its original stylesheet.

Please assume that you do not have control of the original source code of the nested page, yet it is on the same domain (don't ask)


d = document.getElementsByTagName('object').namedItem('nestedPage').getContentDocument();
d.styleSheets[d.styleSheets.length].href = 'whereever';

WARNING: hasn't been tested in all browsers.

Need Your Help

Why is using TextView to update int value and display it giving me a crash?

java android android-layout dynamic android-textview

Im trying to develop a text adventure for android. Already found a subtle way to change 'pages' without creating new Activity.

Extract icon from executable that's in memory

.net dll icons executable

Does anyone know an API function to extract an icon resource from an executable file that's in RAM (inside, say, a MemoryStream)?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.