/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] code has error-invalid left-hand char & iframe size prob.

[COLOR=”Red”][/COLOR]code with error

[CODE]function submitAddress()
{
url=document.getElementById(‘url’).value;
if ([COLOR=”Red”]url.match(‘://’)=null[/COLOR])
{
url=’http://’+url;
}
document.getElementById(‘1_win’).src=url;
}[/CODE]

and the iframe
i want it to be like so

[CODE]height=screen.availHeight-60+’px’;
document.getElementsByTagName(‘iframe’).height=height;[/CODE]

when i set an alert saying what height is i get the correct number+’px’, but the iframe wont resize
im confused?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@MrNobodyJan 14.2009 — This:
[CODE]if (url.match('://')=null)[/CODE]
is more syntactically correct as follows:
[CODE]if (url.match('://')==null)[/CODE]
Copy linkTweet thisAlerts:
@MrNobodyJan 14.2009 — See post above, plus... Instead of this:
[CODE]document.getElementsByTagName('iframe').height=height;[/CODE]
try this:
[CODE]document.getElementsByTagName('iframe')[0].height=height;[/CODE]
or this:
[CODE]document.getElementsByTagName('iframe')[0].style.height=height;[/CODE]
Copy linkTweet thisAlerts:
@Hud4007authorJan 14.2009 — MrNobody-Thanks your first answer solved that prob.This:
[CODE]if (url.match('://')=null)[/CODE]
is more syntactically correct as follows:
[CODE]if (url.match('://')==null)[/CODE][/QUOTE]
But strange enough, My browser doesnt support the tagname object for the iframe, but at least it still supports ids

this page is specifically for this browser so thats not a prob. i was making this page because of lack of tabs(Wii internet channel, Opera Powered)
×

Success!

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