/    Sign up×
Community /Pin to ProfileBookmark

Easy question! :)

Why doesn’t this work:

[code=html]
<a href=”#” onclick=”Open(Test)”>Test</a>
<script language=”JavaScript”>
function Open(what) {
window.open(“answer.php?show=”+what,null,
“height=283,width=283,status=yes,toolbar=no,menubar=no,location=no”);
}
</script>
[/code]

Whats wrong? 😮

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@SoreheadMar 13.2007 — You are trying to pass a string as an argument, so you have enclose the string in single quotations like so
[code=html]
<a href="#" onclick="Open('Test')">Test</a>
[/code]
Copy linkTweet thisAlerts:
@LivijnauthorMar 13.2007 — I know, i've figured that out for like 3 hours ago... ?

It works...
Copy linkTweet thisAlerts:
@KorMar 13.2007 — a small detail... use [B]type[/B] instead of [B]language[/B]. [B]language[/B] is deprecated
<i>
</i>&lt;script [COLOR="Blue"]type="text/javascript"[/COLOR]&gt;
×

Success!

Help @Livijn 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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