36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
/* wontofor: A JavaScript shortcut system
|
|
* Copyright (C) 2010 Niels G. W. 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.name>
|
|
* See <http://metanohi.name/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')
|