/    Sign up×
Community /Pin to ProfileBookmark

Iframe SRC = Javascript function ??

Hi ..

I have an Iframe inside my html document like this –

<iframe id=”ifrm” name=”ifrm” src=””
scrolling=”Yes” align=”middle” frameborder=”1″
width=”80%” height=”100%” >
[Content for browsers that don’t support iframes goes here]
</iframe>

I have a function defined in javascript IsWithinGeofence()

which returns “1” or “2” ..or “6” which result when one of the “if” conditions inside the function are satisfied.

Now what I want to do is – I want to be able to use the function – IsWithinGeofence() return value in my iframe src.

e.g.
<iframe id=”ifrm” name=”ifrm” src=IsWithinGeofence + .html
scrolling=”Yes” align=”middle” frameborder=”1″
width=”80%” height=”100%” >
[Content for browsers that don’t support iframes goes here]
</iframe>

so that the iframe source becomes 1.html, 2.html ..and 6.html according to the function – IsWithinGeofence()’s return value.

How do I achieve this ??

Regards

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Jul 22.2007 — so how many places did you post this?

http://codingforums.com/showthread.php?t=119421

You wither have to set it onload or with document.write as I already answwered on the other forum.

Eric
Copy linkTweet thisAlerts:
@amol0010authorJul 23.2007 — ^ sorry it didn't work..I am not sure what wrong I am doing..I posted the errors on the forums - coding forums, but didn't get a reply back..

cheers
×

Success!

Help @amol0010 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...