Created
November 1, 2008 02:12
-
-
Save anonymous/21463 to your computer and use it in GitHub Desktop.
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
CmdUtils.CreateCommand({ | |
name: "get-page-title", | |
preview: function(previewBlock) { | |
Utils.parseRemoteDocument( | |
"http://www.google.com/", // URL | |
null, // post data | |
function(doc) { // success callback | |
var title = jQuery("head > title", doc).text(); | |
previewBlock.innerHTML = "Google's page title is: <b>" + title + "</b>"; | |
}, | |
function() { // error callback | |
previewBlock.innerHTML = "Error!"; | |
} | |
); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment