Current location: Hot Scripts Forums » General Web Coding » JavaScript » Help Needed with Script Plz!


Help Needed with Script Plz!

Reply
  #1 (permalink)  
Old 08-01-07, 06:02 AM
Shenron Shenron is offline
New Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Help Needed with Script Plz!

hey all. I'm new to scripting and need some major help please.
I'm trying to get a page in an inline frame to check its parent and load a stylesheet accordingly. eg:

the parent is a.htm and the page checking is b.htm so
b.htm checks a.htm to make sure its correct and loads b.css if it is.

I used the else if because there are quite a few pages and files to add so I needed it to be extendable.

I have started some code but can't get it to work.

Code:
var filename = parent.document();

if (filename == "main_page_nehf.htm");
{
document.write('<link rel="stylesheet" href="night.css" type="text/css">');
}
else if (filename == "main_page_gwf.htm");
{
document.write('<link rel="stylesheet" href="nome.css" type="text/css">');
}
Reply With Quote
  #2 (permalink)  
Old 08-01-07, 09:09 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
__________________
Jerry Broughton
Reply With Quote
  #3 (permalink)  
Old 08-01-07, 01:35 PM
Shenron Shenron is offline
New Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I should have added that b.htm is the same page in every instance. It's page a.htm that changes while b.htm is displayed in an inline frame.
Reply With Quote
  #4 (permalink)  
Old 08-01-07, 02:16 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
I think I got you mixed up with someone else and sent you to the wrong
information. I reread your request and came up with this link that should
help you to communicate with your iFrames.

I believe that this example only deals with one iFrame. But the principles
should work to communicate with any iFrame.

http://www.quirksmode.org/js/iframe.html
__________________
Jerry Broughton
Reply With Quote
  #5 (permalink)  
Old 08-02-07, 02:35 AM
Shenron Shenron is offline
New Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Spin

Thanks...I appreciate all the help you have given. My problem has been solved.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
3 Column CSS Fluid Layout (IE 6 Problem) Heidenreich12 CSS 9 10-04-06 03:22 PM
Dating script needed: MissRikka Job Offers & Assistance 14 06-21-06 07:52 PM
free calendar script needed plz help phpnut Script Requests 0 12-03-05 07:06 PM
i need php game script plz .... HOSSAM007 Script Requests 2 10-04-05 05:52 PM
will pay. php script needed. upload, resize, & email jamjammo Script Requests 4 02-29-04 08:30 PM


All times are GMT -5. The time now is 11:30 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.