/    Sign up×
Community /Pin to ProfileBookmark

Javascript/URL Issue

Help, 😮

I’ve sourced some code for a menu in javascript, but when trying to alter the URL to open it inside an IFRAME, it doesn’t work. Is there anyway of altering the URL/script so it would?

The full code I’m using is [URL=http://www.hullbikers.com/code.htm]here[/URL], areas in bold are what I’m refering to.

I.e. the script only works with URLs such as “[I][url]http://www.website.com[/url][/I]” not [I][url]http://www.website.com[/url] target=”(iframe)”[/I]

Thanks. ?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 04.2005 — The way to use JavaScript to load a document into an IFRAME in the current document is as follows:

self.frames["iframeName"].location.href = "some_url";
Copy linkTweet thisAlerts:
@one1895authorJun 05.2005 — Thanks. ?

Now to find a way to implement it in the script...
Copy linkTweet thisAlerts:
@acorbelliJun 05.2005 — Just use an onclick handler or whatever. If you were using a link before, make it like this...
<i>
</i>&lt;a href="#" onclick="self.frames['iframename'].location.href = 'someurl';"&gt;
Copy linkTweet thisAlerts:
@phpnoviceJun 05.2005 — Of course, JavaScript isn't required at all -- if you're going to use a hyperlink anyway. Thus, this JavaScript I posted:

self.frames["iframeName"].location.href = "some_url";

is equivalent to this straight HTML:

<a href="some_url" target="iframeName">link text</a>
Copy linkTweet thisAlerts:
@one1895authorJun 05.2005 — Meh, I ain't got a clue of how to implement that into the current code, had a look through and it all seemed gobbledegook, I'll try something else.

Thanks again. ?
×

Success!

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

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

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