Return confirm - not working in IE

I have the following code that I use on links for delete scripts and it doesn’t seem to be working in IE, when you hit cancel it still follows though with the link. Firefox is fine. Is there something I need to change to allow it to work in all browsers?


onclick="return confirm('Are you sure you want to delete this?')"

I also tried the following using JavaScript, the same thing happens, cancel still follows though with the script.


$('.deleteItemLink').click(function() 
{
	return confirm('Do you really wanna delete this?');
});

This works in IE7.
hth.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript">
            function confirmDelete(){
                return window.confirm('Are you sure you want to delete this?');
            }
        </script>
    </head>
    <body>
        <table>
            <tr>
                <td>Some item with an id</td>
                <td><a href="deleteScript.php?id=xxx" onclick="return confirmDelete();">Delete</a></td>
            </tr>
        </table>

    </body>
</html>

Thankyou, I have discovered that the code I use is working in IE when stripped out however I have something else stopping it from working correctly in my code, any idea how I can find out what might be causing this to continue though anyway?

I did some isolation testing and discovered the issue is http://www.flexigrid.info/ within jQuery… Anyone had this issue before and found a solution?

I have found the issue, within flexgrid.js there is the following code basically changing the table row class on click which seemed to override my JavaScript.

As I didn’t need this part I simply removed it.

Thanks


.click(
	function (e)
		{
			var obj = (e.target || e.srcElement); if (obj.href || obj.type) return true;
			$(this).toggleClass('trSelected');
			if (p.singleSelect) $(this).siblings().removeClass('trSelected');
		}
)