Reputation: 1892
I am having a problem with IE (who doesn't) in all versions of the browser. It works fine in every other browser.
<a href="<?php echo base_url() ?>pages/delete_page/<?php echo $row->id; ?>" class="delete" data-uid="<?php echo $row->id; ?>">
<i class="icon-cancel"></i><span class="delete_tooltip">delete page</span>
</a>
That is my <a>
tag, and it is pretty simple.
Basically IE is following the href and not executing the JS at all. If I remove the link from the href, it just sends it back to the homepage.
I am using a plugin to load a modal box and like I said, everything works fine in every browser.
$('.delete').click(function(e) {
console.log($('#modal-'+$(this).data('uid'))); // Button which will activate our modal
$('#modal-'+$(this).data('uid')).reveal({ // The item which will be opened with reveal
animation: 'fadeAndPop', // fade, fadeAndPop, none
animationspeed: 400, // how fast animtions are
closeonbackgroundclick: false, // if you click background will modal close?
dismissmodalclass: 'modal_cancel' // the class of a button or element that will close an open modal
});
return false;
});
And that is the JS that calls the plugin to that link.
Any help will be much appreciated.
Upvotes: 0
Views: 95
Reputation: 1685
This might be a funny one...
console.log($('#modal-'+$(this).data('uid')));
will cause an exception in IE so false is never returned causing the href to execute its default action.
Edit:
May have caused some confusion here. In IE it will cause an exception because console
is undefined
.
Upvotes: 1
Reputation: 123377
$('.delete').click(function(e) {
e.preventDefault();
...
Use preventDefault()
inside your handler
http://api.jquery.com/event.preventDefault/ for reference
Upvotes: 0