Ajax call not working within click handler function?
I have the following code:
- $(document).ready(function(){
- $('#link').click(function() {
- alert('Clicked!');
$('#content').load('dialogs/load/content', function() {});
});
- });
The link is a normal link that is not dynamically created. The alert works. I know the problem is not the Ajax call because this works just fine:
- $(document).ready(function(){
- $('#content').load('dialogs/load/content', function() {});
- $('#link').click(function() {
- alert('Clicked!');
- });
- });
It only breaks when located inside the click handler. It does not return response headers or a response. Is there something about event handlers and ajax that I'm missing?