Skip to content

Instantly share code, notes, and snippets.

@whoeverest
Created November 17, 2012 22:15
Show Gist options
  • Save whoeverest/4100682 to your computer and use it in GitHub Desktop.
Save whoeverest/4100682 to your computer and use it in GitHub Desktop.
$(function(){
$("div#mw-content-text a").mouseover(function(){
var new_link_title = "This needs to be changed.";
$.get(this.href, function(data){
var description_html = $(data).find('div#mw-content-text p')[0];
new_link_title = $(description_html).text(); // this assignment doesn't work
})
this.title = new_link_title; // link title is undefined here
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment