Frame open new frame depending of directory 
Author Message
 Frame open new frame depending of directory

Hi,
I have a frameset and I want to open a different page in the topframe depending
of what directory the page that opens in the mainframe is in!

I have tried to mix some aspcode but it does not work:
-----------------------------------------------
</head>
<%If ((location.pathname.substring(0,location.pathname.lastIndexOf("/")))
= "/webnavn/et_mappenavn") Then%>
<body onload="parent.frames[0].location = '../topbanner2.htm'">
<%Else%>
  <body onload="parent.frames[0].location = '../topbanner1.htm'">
<%End If%>
-----------------------------------------------
Any suggestions?

Ulrik Jeppesen



Thu, 11 Sep 2003 16:47:43 GMT  
 Frame open new frame depending of directory
I am not sure why you mix asp with JavaScript here but with client side
code you could do
 <body onload="if (location.pathname.indexOf('dir1Name') != -1)
                 parent.frames[0].location.href = '../topbanner2.htm';
               else
                 parent.frames[0].location.href = '../topbanner1.htm';"
 >

Quote:

> Hi,
> I have a frameset and I want to open a different page in the topframe depending
> of what directory the page that opens in the mainframe is in!

> I have tried to mix some aspcode but it does not work:
> -----------------------------------------------
> </head>
> <%If ((location.pathname.substring(0,location.pathname.lastIndexOf("/")))
> = "/webnavn/et_mappenavn") Then%>
> <body onload="parent.frames[0].location = '../topbanner2.htm'">
> <%Else%>
>   <body onload="parent.frames[0].location = '../topbanner1.htm'">
> <%End If%>
> -----------------------------------------------
> Any suggestions?

> Ulrik Jeppesen

--

        Martin Honnen
        http://javascript.faqts.com/
        http://home.t-online.de/home/martin.honnen/jsgoddies.html



Thu, 11 Sep 2003 21:49:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. saving htm in frame with code from another frame to directory on server

2. Frames - within the frame and new window.

3. opening a frame with values from another frame

4. Can't open URLs in frames in new window

5. Want to open frameset in new window with different page in main frame

6. Opening a new page in a frame

7. Opening a page in a new frame using vbscript

8. Response.redirect to target a frame not open new window

9. getting query string from frame in jscript and getting frame name from another frame

10. Chosing Frame content in a 2 framed page from a 1 framed page

11. Newbie script question : reload a frame from another frame

12. Calling a Frame a Frame

 

 
Powered by phpBB® Forum Software