/    Sign up×
Community /Pin to ProfileBookmark

Referencing a frame

Hi, folks….I’m building a simple homepage for myself, and placed an <iframe> on the src file used within an <iframe>….and can’t seem to find a way to update the embedded frame with a new source file…wondered if anyone could make a suggestion. I used an onClick handler, and tried to load a new src file into the frame using “document.frames.frameName.location.href=’fileName.html’;” but it acts as if it can’t find the file I’m referencing (the frame is updated with the “can’t find page” IE default…I’ve checked my path several times, so I know I’ve used the correct path to the file).

Anyone have a suggestion as to which expression I could use to get the job done?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Arty_EffemAug 28.2006 — Hi, folks....I'm building a simple homepage for myself, and placed an <iframe> on the src file used within an <iframe>....and can't seem to find a way to update the embedded frame with a new source file...wondered if anyone could make a suggestion. I used an onClick handler, and tried to load a new src file into the frame using "document.frames.frameName.location.href='fileName.html';" but it acts as if it can't find the file I'm referencing (the frame is updated with the "can't find page" IE default...I've checked my path several times, so I know I've used the correct path to the file).

Anyone have a suggestion as to which expression I could use to get the job done?[/QUOTE]
Not unless you supply some usable information like:

1) The absolute path of the parent document.

2) The absolute path of the replacement iframe document.

3) The exact syntax you're currently using to specify the filename.

Also please confirm that there are no errors reported in the console.
Copy linkTweet thisAlerts:
@Mr_JAug 28.2006 — I don't think gecko browsers recognise document.frames but you should be able to use any one of the following

window.frames['iframe_name'].location

or

document.getElementById('iframe_id').src


Note the reference to NAME or ID
×

Success!

Help @okham 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...