36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
|
/* wontofor: A JavaScript shortcut system
|
||
|
* Copyright (C) 2010 Niels Serup
|
||
|
*
|
||
|
* This file is part of wontofor.
|
||
|
*
|
||
|
* wontofor is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* wontofor is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with wontofor. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
* Maintained by Niels Serup <ns@metanohi.org>
|
||
|
* See <http://metanohi.org/projects/wontofor/>
|
||
|
*/
|
||
|
|
||
|
wontofor.ajax.getWeb = function(url, func, args, method) {
|
||
|
var req = new XMLHttpRequest()
|
||
|
req.open(method, url, true)
|
||
|
req.onreadystatechange = function() {
|
||
|
if (req.readyState == 4) {
|
||
|
if (req.status == 200)
|
||
|
func(req.responseText, true)
|
||
|
else
|
||
|
func(req.status, false)
|
||
|
}
|
||
|
}
|
||
|
req.send(null)
|
||
|
}.base('.', alert, [], 'GET')
|