User:Gabriele Nunzio Tornetta/monobook.js: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
//var source = document.editform.wpTextbox1.value |
//var source = document.editform.wpTextbox1.value |
||
var client = new XMLHttpRequest(); |
var client = new XMLHttpRequest(); |
||
⚫ | |||
client.setRequestHeader("User-Agent", navigator.userAgent); |
client.setRequestHeader("User-Agent", navigator.userAgent); |
||
alert(navigator.userAgent); |
alert(navigator.userAgent); |
||
⚫ | |||
client.send(); |
client.send(); |
||
var src = client.responseText |
var src = client.responseText |
Revision as of 12:53, 9 August 2011
// My scripts.
addOnloadHook(
function () {
addPortletLink('p-coll-print_export', "javascript:doTeXify()", "TeXify", "coll-texify", "Produces a LaTeX document out of the current article");
}
);
function doTeXify() {
//var source = document.editform.wpTextbox1.value
var client = new XMLHttpRequest();
client.open('GET', 'http://en.wikipedia.org/enwiki/w/index.php?title=' + document.getElementById("firstHeading").innerHTML + '&action=edit', false);
client.setRequestHeader("User-Agent", navigator.userAgent);
alert(navigator.userAgent);
client.send();
var src = client.responseText
var win = document.open()
win.document.write(client.responseText);
win.document.close();
}