Supertod
Supertod

Reputation: 397

jQuery script working in Firefox and Coda (IDE) but not Chrome

It's way too much code to put here so here's the link to where I'm temporarily hosting it. http://theowindebank.co.uk/jailbreak.

To reveal the tabs enter iPhone 2G and 1.1. The problem is that in Chrome, the second layer of tabs (jailbreak software) doesn't seem to work. When loading it shows the icons fine but the idTabs script doesn't seem to be firing. The strange thing is that the Operating system tabset loads and functions fine. I've had it working on Chrome before and I don't know what I've changed since. Also it works fine in Firefox and Coda. The console shows nothing.

Upvotes: 0

Views: 329

Answers (1)

Michael Robinson
Michael Robinson

Reputation: 29498

Instead of having event.preventDefault() within your inline onclick event, try cancelling the default within your click function, like:

function (event) {
    event.preventDefault();
    (...snipped the rest of your function...)
}

More information - jQuery event.preventDefault().

Your inline onclick event.preventDefault(); seems to be causing issues in Chrome, this is the error output from Chrome's console:

/jailbreak/:52Uncaught TypeError: Cannot call method 'preventDefault' of undefined
(anonymous function)/jailbreak/:52
onclick/jailbreak/:53
f.event.triggerjquery.min.js:3
f.fn.extend.triggerjquery.min.js:3
e.extend.eachjquery.min.js:2
e.fn.e.eachjquery.min.js:2
f.fn.extend.triggerjquery.min.js:3
$.idTabsjquery.idTabs.min.js:7
$.fn.idTabsjquery.idTabs.min.js:4
e.extend.eachjquery.min.js:2
e.fn.e.eachjquery.min.js:2
$.fn.idTabsjquery.idTabs.min.js:4
tabloader/jailbreak/:125
(anonymous function)

Upvotes: 2

Related Questions