Welcome Guest, Not a member yet? Register   Sign In
Trying to get jQuery/Ajax to work with CI
#7

[eluser]slowgary[/eluser]
Hmmm... so the above doesn't work? It looks okay. The bind command is just a more generalized way to attach event handlers. These are functionally equivalent:
Code:
.bind('click', function(){
});
.click(function(){
});
And so are these:
Code:
.bind('submit', function(){
});
.submit(function(){
});
But in either case, as long as you pass that anonymous function an identifier for the event, you should be able to call the preventDefault() method on that event like so:
Code:
.submit(function(e){
     e.preventDefault();
});
And preventDefault() is not even a jQuery method, it's native JavaScript so it should work in any modern browser. Do you have this code live anywhere for examination?


Messages In This Thread
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 01:45 AM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 12:05 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 09:06 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 10:24 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 10:30 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-28-2009, 02:29 AM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-28-2009, 10:24 AM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-28-2009, 09:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB