Namespace: Update

jMod. Update

Since:
  • 0.0.14

Example

var opts = {
    callback: updateCallback,
    onerror: updateErrorCallback,
    getType: 'data',
    XMLHTTPRequest: true,
    args: {
        scriptLoadTime: 1234
    }
};

jMod.Update.getUpdateData(opts);

Methods

staticjMod.Update.getURL(data)

F:/Projects/jMod/main/bin/jMod.full.js, line 9068
Generate the update URL
Name Type Description
data UpdateData Information used to generate the URL

staticjMod.Update.sendRequest(data)

F:/Projects/jMod/main/bin/jMod.full.js, line 9214
Send information to the server with the given data.
If a callback is provided, and data.getType != 'none', it will be called with the server's response. See UpdateCallback
Name Type Description
data UpdateData Information and arguments used to send request to the server

Type Definitions

jMod.Update.UpdateCallback(response)

F:/Projects/jMod/main/bin/jMod.full.js, line 9022
Name Type Description
response object | string The string or JSON object returned from the server

jMod.Update.UpdateDataObject

Data used to send requests to the server.
Overrides settings stored in jMod.Config.
Properties:
Name Type Argument Default Description
script_name string <optional>
Name of script on myUserJS (Not needed if meta block contains a valid updateURL or jModupdateURL)
username string <optional>
Script owner's username on myUserJS
callback UpdateCallback <optional>
Function to be called with the server's response
onerror UpdateCallback <optional>
Function to be called when an error occurs
getType string <optional>
"data" Type of information you want returned from the server, and which partition to store the download/arguments under.
args object <optional>
Arguments to be sent to myUserJS's statistical engine
DOMTiming boolean <optional>
false Generate and send page/script timing information to the server
noDownload boolean <optional>
false Do not record download when processing response (only used when reporting errors)
XMLHttpRequest boolean <optional>
false (Experimental) Use XMLHttpRequest when sending request (only available to userscripts that load jMod via require)
jQuery boolean <optional>
false (broken)
See:
Example
var opts = {
    callback: myCBFunction,
    getType: 'data',
    args: {
        scriptLoadTime: 1234
    }
}
console.log(jMod.Update.getURL(opts));