Skip to content

Instantly share code, notes, and snippets.

@tobie
Created July 29, 2009 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobie/158165 to your computer and use it in GitHub Desktop.
Save tobie/158165 to your computer and use it in GitHub Desktop.
document.observe('click', function(event) {
var element = event.findElement('a.quickdetails');
if (!element) { return; }
var href = element.readAttribute('href'),
m = href.split('/');
if (m.length < 3) { return; }
new Ajax.Request('/VacancyInfo', {
method: 'get',
parameters: { id: m.last() },
onSuccess: function(transport) {
$modals.showVacancy({
string: transport.responseText,
node: element
});
},
onError: function() { window.location = href; },
onFailure: function() { window.location = href;}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment