/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Firefox Specific Issue – Unrecognized Function

Hey everybody. I am having a very difficult time with a website I’m making for a friend. I uploaded it to [url]http://puppies.evilmouseonline.com[/url] . That way you can see exactly what the problem is. The problem is that when you “pick a puppy” nothing happens in Firefox and Opera. It works perfectly in Google Chrome and Internet Explorer.

Here is one of the not working functions that work on other browsers. Mozilla Firefox keeps claiming that “it’s not a function”, and the error is occurring on line 1.

function mom()
{
document.getElementById(“name3”).childNodes[0].nodeValue = “Name: None”;
document.getElementById(“age3”).childNodes[0].nodeValue = “Age: ???”;
document.getElementById(“gender3”).childNodes[0].nodeValue = “Gender: Female”;
document.getElementById(“color3”).childNodes[0].nodeValue = “Color: Brown and White”;
document.getElementById(“cost3”).childNodes[0].nodeValue = “Cost: $325.00”;
document.getElementById(“comment3”).childNodes[0].nodeValue = “This dog is pure bred and trained!”;
document.getElementById(“dog3”).src = “system/images/mom-big.jpg”;
document.getElementById(“dog3”).style.visibility = “visible”;
}

Also the site passes W3C Validation for XHTML Strict. So I know it’s not a DTD issue.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@opifexOct 26.2009 — The problem is that you have named functions with the same name as element id's (male1, male2, female1, etc.).

The quickest fix is probably to rename the functions, example:
[code=html]function showmale1()[/code]
[B]and[/B]
[code=html]onclick="showmale1();" [/code]

[I]...works fine, lasts a long time and don't rust.[/I]

oh, the semicolon isn't [I]absolutely[/I] required, but [B]is [/B] a good habit.
Copy linkTweet thisAlerts:
@theultimate2009authorOct 27.2009 — It worked like a charm. My webpage is fixed! I'll have to remember to name my ids and onclick events differently next time. Thanks.

Also, that link I posted is going to be pulled down after I find my friend a good webhost. I only posted it there for an example.
×

Success!

Help @theultimate2009 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.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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