/    Sign up×
Community /Pin to ProfileBookmark

Hi, I have a iframe that displays a page dynamicaly depending on what a user selects in a drop down box. I am using this command:
document.getElementById(‘Inspiration1’).src=”inspirations/” + filename
to display the web page that is stored in the Inspiration folder, named with the name that the variable [I]filename [/I]has stored in it. What I want to have is a default page that gets displayed when there is not a filename by the name that the variable [I]filename[/I] holds.
Any one get the name of run on sentence? whew thats a load of my chest. Can anyone help with this? Did anyone understand what I was trying to say? Thank you.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ray326Feb 08.2004 — Why not just establish an initial src for the iframe and then change it based on the selection in the list box?
Copy linkTweet thisAlerts:
@ChangedSoulauthorFeb 08.2004 — Well what I need to do is check to see if a certain file even exists in a given directory. Is there a command to check for that.

So basicaly what I do is generate a filename based on what the user selects in the drop down box. If that file name does indeed exist, it will be displayed in the iframe. if it does not, I want to be able to check for that so I can display a general page in the iframe.
×

Success!

Help @ChangedSoul 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,
)...