/    Sign up×
Community /Pin to ProfileBookmark

a tiny problem inside a function

this script is called by ‘value’ of a button… i still keep getting a blank image and don´t understand why ?? Anyone ??

<script>
function atool(){
var a=document.txtbox.inp.value;
if (a=””){document.location.reload}
else {window.open(a)}}
</script>
</head>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@CharlesOct 26.2006 — Perhaps:[code=html]<script type="text/javascript">
function atool () {
var a = document.txtbox.inp.value
if (a) {
window.open (a)
} else {
document.location.reload ()

}
}
</script>[/code]
Copy linkTweet thisAlerts:
@morpheussauthorOct 26.2006 — it is still a problem .. it looks alright but now it asks for an object ...

i uploaded a test_file... maybe you see the issue of the problem : [COLOR=Red]http://users.telenet.be/protheuss/testzoekpag_desktop.htm[/COLOR]

Greetz Axl
Copy linkTweet thisAlerts:
@KorOct 26.2006 — you should have written correctly the condition:

if(a=="")

and [B]location[/B] is a window's property, not document's

<i>
</i>function atool () {
var a = document.txtbox.inp.value
if (a=='') {
window.open(a,'')
} else {
location.reload(true) <br/>
}
}
Copy linkTweet thisAlerts:
@morpheussauthorOct 26.2006 — Hello guys,

first thnx for the help you´ve been given, but i found the solution after good sleep and the answer stands below :

<script>

function atool(){

var a=window.document.txtbox.inp.value;

if (a!="http://"){window.open(a)}


else {window.document.location.reload}}

</script>
×

Success!

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