Forum Moderators: open

Message Too Old, No Replies

Calling a JS from inside an iframe

         

maitre

7:07 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



Hi,

I am struggling with a problem on a webpage and I can't find a solution. Maybe someone can help.

Here's the issue:

On top of the page there is a scroller, called with this line:
<script language="JavaScript">Tscroll_init (0)</script>. Works fine.

Further down the page there is a link: <a href="store.htm" target="iframe1">Content</a>, which loads the store.htm into an iframe. Works fine too.

When I click on this link I also want to replace the scroller with another one, which would be called like this:
<script language="JavaScript">Tscroll_init (1)</script>.

Is there any way to accomplish this, either by modifying the link itself or by including an onLoad function in store.htm that changes the (0) to (1)?

Thanks a lot,

Ed

Lance

7:38 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



How about:

<a href="store.htm" target="iframe1" onclick="Tscroll_init (1);">Content</a>

maitre

7:59 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



That works, except that it opens the new scroller in its own page, not in the location where the original scroller is located.

maitre

6:55 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Can someone please help me here?

orion_rus

12:21 pm on Nov 29, 2004 (gmt 0)

10+ Year Member



May be u should use a frameborder='0' in iframe?

orion_rus

2:40 pm on Nov 29, 2004 (gmt 0)

10+ Year Member



upss i mean make addition to iframe like scrolling='no'

maitre

9:19 pm on Nov 29, 2004 (gmt 0)

10+ Year Member



Hi Y'all,

Thanks so far.

I am trying something else that might work (with your help):

I have replaced this line:<script language="JavaScript">Tscroll_init (0)</script> with this one:

<iframe name="iframe1" src="store/scroll_store.htm" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" align="left" hspace="0" vspace="0" width="552" height="83"></iframe>

When the parent page loads, the scroller src="store/scroll_store.htm" runs in the iframe1 space. So far so good.

Further down I call another page into an iframe2, works great. When I click on a link to load another page into iframe2, the newly loaded page has this onload function:

<body "onload=load();" src="store/scroll_antiques.htm" target="_parent.iframe1">, which is supposed to replace the src from store/scroll_store to store/scroll_antiques.

Does that make sense?

I don't get any js error messages but it does not work either. Can someone please help here?