/    Sign up×
Community /Pin to ProfileBookmark

return string on internet explorer

I am trying to return a string from a function. It works perfectly on firefox but just stop once it gets to the point of reading the string on internet explorer.
I am not using any kind of fancy code just this where dates() returns the string

if(dates(i,j))
{
txt=dates(i,j)
}

any help would be great
thanks

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERFeb 10.2008 — We'll need to see more of the script that you are trying to write.

What you have provided is not correct JS syntax and will therefore do just

what you tell it to do, which currently is nothing!
Copy linkTweet thisAlerts:
@canadiaauthorFeb 10.2008 — im trying to make a calender for a little league which will check if something is happening on a certain day which is calender[][]. dates is a function from an external .js file which i have already called in the head.

calender[][] contains the dates every date for the year. the script runs correctly on firefox just not on internet explorer

if(dates(i,j)!=0)

{

txt=dates(i,j)

}

else

{

txt=""

}

document.write("<td valign="top" height=100 width=100">"+calender[i][j]+txt+"</td>")

thanks again
Copy linkTweet thisAlerts:
@KorFeb 10.2008 — I guess we need to see [I]what[/I] exactly returns the function dates(). I mean, in the case it does not return a string, what else does the function return?

Because, by default, if no [B]return[/B] is specified inside that function, it will simply return the function itself, which in the Boolean if conditioner will be always a [B]true[/B] primitive value.

And... is it the [B]dates()[/B] function a constructor?
Copy linkTweet thisAlerts:
@canadiaauthorFeb 10.2008 — when i typed th if statement i forgot the "not zero"

if(dates(i,j)!=0)

{

txt=dates(i,j)

}

document.write("<td valign="top" height=100 width=100 bgcolor="#FFFFFF">"+test[i][j]+txt+"</td>")



...week is the week in the year(ie 1 through 53) and day is which day in the week(1 through 7)



function dates(week, day)

{

if(week==5 && day==6)

{

return ("<br> it works!!!");

}

else if(week==6 && day==3)

{

return ("<br> it works again!!!");

}

else

{

return(0)

}

}



thanks again for the help
Copy linkTweet thisAlerts:
@canadiaauthorFeb 11.2008 — well it looks like iv fixed it thanks for your help
×

Success!

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