Author |
Topic |
|
sjuufke
Practical
Netherlands
20 Posts |
Posted - 31 Oct 2006 : 14:49:59
|
Can the content of an Iframe be made variable?
<IFRAME SRC="http://www.whatever.com" NAME="Generic1" width="450" height="350"> Jammer genoeg ondersteunt je browser geen frames. </IFRAME>
I want to make just 1 iframe wich can load different url's depending on different menu items.
Greetz
Sjuufke |
|
s.dav
Site Admin
Italy
3364 Posts |
Posted - 31 Oct 2006 : 17:52:58
|
Yes by using Javascript:
- Put a generic iframe object into the page - Put into a javascript block this code:
document.frames['Generic1'].location='http://www.google.com'
- Lauch the code using events ;-)
Tested and it works ok ;-) |
Regards, Davide |
|
|
Waldorf
Super User
Belgium
284 Posts |
Posted - 31 Oct 2006 : 19:09:51
|
yes, that is the easy way! and idd. it woks well |
* "Happiness" is making -> The <- Choice! *
|
|
|
Waldorf
Super User
Belgium
284 Posts |
Posted - 31 Oct 2006 : 22:14:39
|
@Dav. strange, I tried to do the same with a "generic" but "Flash" and nothing happens? |
* "Happiness" is making -> The <- Choice! *
|
|
|
petran
Super User
Netherlands
345 Posts |
Posted - 01 Nov 2006 : 00:41:45
|
When you want to change its content by using a menu you can choose the iframe as target in the link wizard....or do I miss something?
Seems to me even more simple |
--------
regards
Petran |
|
|
Waldorf
Super User
Belgium
284 Posts |
Posted - 01 Nov 2006 : 01:35:58
|
no,no, you are not missing something, heu...(for once)
there are 3 ways to do it! [3 yes] A minus with the target method = that we have no preview!
*added*
Flash problem also solved! [3 yes]
* |
* "Happiness" is making -> The <- Choice! *
|
Edited by - Waldorf on 01 Nov 2006 05:27:42 |
|
|
petran
Super User
Netherlands
345 Posts |
Posted - 01 Nov 2006 : 13:12:07
|
HaHa[3 w], Beware Waldorf...Belgium is only 20 minutes away |
--------
regards
Petran |
|
|
s.dav
Site Admin
Italy
3364 Posts |
Posted - 02 Nov 2006 : 11:12:17
|
>strange, I tried to do the same with a "generic" but "Flash" and > nothing happens?
This doesn't work because it's not an IFRAME ;-)
I think you should change the code to a thing like this (not tested):
document.getElementById('Generic1').src='http://pippo.swf'
but I'm not sure, I should make some tests...
|
Regards, Davide |
|
|
Waldorf
Super User
Belgium
284 Posts |
Posted - 02 Nov 2006 : 18:46:50
|
Thanks Dav. but see my post (this topic) Posted - 01 Nov 2006 01:35:58 it works in an Iframe
blue txt ;-) * |
* "Happiness" is making -> The <- Choice! *
|
|
|
|
Topic |
|