dolythgoe
asked on
jquery click event not working in IE 7 or 8
I've spent ages reading and trying different things to work but I can't get the onclick event to work in IE like it does in every other browser!
The link code:
js is called before in the <head> (tried putting it at bottom too but didn't work
jquery code in jquerywindow.js :
Also tried:
To no avail :(
Would love some help through this IE deugging nightmare!
The link code:
<a href="#" id="signupopen">QUICK SIGNUP</a>
js is called before in the <head> (tried putting it at bottom too but didn't work
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquerywindow.js"></script>
jquery code in jquerywindow.js :
$('#signupopen').click(function() {
$signup.load('signup.php').ready(
$signup.dialog('open'));
// prevent the default action, e.g., following a link
return false;
});
Also tried:
$('#signupopen').live("click", function() {
$signup.load('signup.php').ready(
$signup.dialog('open'));
// prevent the default action, e.g., following a link
return false;
});
To no avail :(
Would love some help through this IE deugging nightmare!
put these js files at the top of document.ready.use $(document).ready(function () {
});
});
$(document).ready(function() {
$('#signupopen').click(function() {
alert("aa")
$signup.load('signup.php').ready(
$signup.dialog('open'));
// prevent the default action, e.g., following a link
return false;
});
});
ASKER
Sorry forgot to say they already are in this function and still no luck :(
atleast are you getting alert?
$(document).ready(function() {
$('#signupopen').click(function() {
alert("aa")
$signup.load('signup.php').ready(
$signup.dialog('open'));
// prevent the default action, e.g., following a link
return false;
});
});
</script>
</HEAD>
<BODY>
<a href="#" id="signupopen">QUICK SIGNUP</a>
instead of hyperlink if u use button then whats hapening.
<input type='button' value='click' id="signupopen">QUICK SIGNUP</a>
<input type='button' value='click' id="signupopen">QUICK SIGNUP</a>
ASKER
Yes it's ok when I paste it into the top like you show..
But not as a seperate script which is full of other similar functions etc..
Cheers
But not as a seperate script which is full of other similar functions etc..
Cheers
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Cool...
Well, it was a rogue comma that IE didn't like.
I had this before the function:
I did read about this and thought I'd removed all trailing commas but one remained after position: ['center',100]. I removed this and all works fine :D
Thanks for your help sorting this out!
Well, it was a rogue comma that IE didn't like.
I had this before the function:
var $resend = $('#resend')
.dialog({
autoOpen: false,
title: 'Activation Required',
draggable: false,
modal: true,
resizable: false,
width: 420,
height: 360,
position: ['center',100],
});
I did read about this and thought I'd removed all trailing commas but one remained after position: ['center',100]. I removed this and all works fine :D
Thanks for your help sorting this out!
Open in new window