HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... IFrame with variable URL
IFrame with variable URL
  View type:
Hi All,

I'tried to put a variable as URL of IFrame.

Method (Iframe object) = ReplaceSource
New URL = #variable

It seems that ReplaceSource only accepts absolute typed URL (http://www.courselab.com), and not a #variable with this value.

Am'I wrong, or is a current limitation of IFrame ReplaceSource Method ?

Many thanks
Have a nice day
Andrea
 
Hi, Andrea!

Yes, URL cannot be variable in 2.3 version. In new 2.4 version it can be expression. Version 2.4 should be released by the end of this week.
 
 
Hi Slav,

I tried to insert #variable as "New Url" in ReplaceSource Method for Iframe, but nothing happened.
Variable name is: like http://www.mysite/img.png

I'm using 2.4 version: am I wrong somehow, or variable is yet not supported ?

Many thanks
Have a nice day
Andrea
 
 
 
Hi, Andrea,

Unfortunately, method parameters are not the expressions yet. Perhaps it can be implemented in next build. I will send you the message with some suggestions shortly.
 
 
Hi Slav,

thank you for your kind answer !
(and thank you also for "today" function of past thread).

Good job for incoming 2.4 release.

Have a nice day
Andrea
 
This is a good reference relating to Iframes.
http://www.unix.org.ua/orelly/webprog/dhtml/ch05_09.htm
 
It might be that the iframe is not specifically identified so you have no target for your request to act on.
The browser DOM tends to be explicit rather than implicit regarding page elements.
Off the top of my head (I might try this later [:confused:])
Name the iframe, between the iframe tags needs to be id="framename" and there will be an initial target src="target".
So first a fairly typical script to identify a specific frame
Ifrm= document.getElementById ? document.getElementById=('framename')

Having the script now identify the specific iframe as Ifrm you can do something about the content
(Ifrm) Ifrm.src= ('http://' + "your value" + '.htm'

The only problem is that as external links it is possible they will change if not the home or root of a web site, and you are reliant on the user having access to the resource.
Subject:
Message options
No additional options