Support request for http://getsatisfaction.com/balupton/topics/back_button_triggers_an_ajax_request_thet_should_not_happen?utm_content=topic_link&utm_medium=email&utm_source=reply_notification
Last active
September 24, 2015 19:28
-
-
Save balupton/797897 to your computer and use it in GitHub Desktop.
jQuery Ajaxy Support Request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>untitled</title> | |
<meta name="generator" content="TextMate http://macromates.com/"> | |
<meta name="author" content="rafaelvega"> | |
<link rel="stylesheet" href="fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" title="no title" charset="utf-8"> | |
<script src="jquery-1.4.4.min.js" type="text/javascript" charset="utf-8"></script> | |
<script src="ajaxy/scripts/jquery.ajaxy.min.js" type="text/javascript" charset="utf-8"></script> | |
<script src="fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$.Ajaxy.configure({ | |
// base_url: '/', // commented out to work in balupton's env | |
'Controllers':{ | |
'_generic': { | |
classname: 'ajax', | |
matches: /.*/, // match everything | |
request: function(){ | |
$.fancybox.showActivity(); | |
return true; | |
}, | |
response: function(){ | |
var data = this.State.Response.data.responseText; | |
var fb_params = {content: data} | |
$.extend(true,fb_params,ajax_deeplinks.fancybox_options); | |
$.fancybox(fb_params); | |
$('#fancybox-content a.ajax').ajaxify(); | |
return true; | |
}, | |
error: function(){ | |
$.fancybox.close(); | |
$.fancybox.hideActivity(); | |
return true; | |
} | |
} | |
} | |
}); | |
var ajax_deeplinks = { | |
fancybox_options: { | |
modal:true, | |
overlayOpacity:0.85, | |
overlayColor:'#fff', | |
centerOnScroll:true | |
} | |
}; | |
</script> | |
<!-- Date: 2011-01-26 --> | |
</head> | |
<body> | |
<p>Hello, this is a <a href="./ajax_load.html" class="ajax">link</a></p> <!-- needs ./ prefix - this is a bug in jQuery Ajaxy turns out --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment