/    Sign up×
Community /Pin to ProfileBookmark

‘onclick’ not firing in Firefox

Hi,

I can’t for the life of me figure out why my ‘Empty Basket’ button doesn’t work in Firefox!

Any help would be much appreciated!

[URL=”http://www.outlook-group.com/outlook_images/v4/cart.php?action=add&itemID=1192891806&itemTitle=97:%20Times%20Square%20at%20Night%20Canvas&itemDescription=approx%2059.4%20x%2084.1%20centimeters&itemPrice=10ecf&itemQuantity=1″]http://www.outlook-group.com/outlook_images/v4/cart.php?action=add&itemID=1192891806&itemTitle=97:%20Times%20Square%20at%20Night%20Canvas&itemDescription=approx%2059.4%20x%2084.1%20centimeters&itemPrice=10ecf&itemQuantity=1[/URL]

The code for the button looks like this:

[CODE]<button name=”buttonEmptyCart” id=”buttonEmptyCart” class=”command_button” onclick=”window.location.href = ‘http://www.outlook-group.com/outlook_images/v4/cart.php?action=empty’;”>Empty Cart</button>[/CODE]

Many Thanks,

dai.hop

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@scragarOct 20.2007 — why not make it javascript free and just have it a submit button for a forms who's action atribute is http://www.outlook-group.com/outlook_images/v4/cart.php?action=empty since that's all the button does there.
Copy linkTweet thisAlerts:
@Angry_Black_ManOct 20.2007 — open your page, clear the firefox error/javascript console under the tools menu, and then click your button. what error is noted? when code doesnt work in FF, there is a very high likelyhood you will get a very informative error message. FF owns like that.
Copy linkTweet thisAlerts:
@dai_hopauthorOct 20.2007 — I should have been more specific.

The onclick doesn't work correctly. Instead of navigating to the URL

...cart.php?action=empty

it just reloads the page and all the variables after the question mark stay the same.
Copy linkTweet thisAlerts:
@Declan1991Oct 20.2007 — Try location.replace(). But there is no reason to use Javascript here, it really is bad practice.
×

Success!

Help @dai_hop 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.15,
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,
)...