S
sammy
I have finaly had reason to look at JS, but I can't find any detailed
info on the web about objects.
I trying to create a requiest for GM_xmlhttpRequest()
// obj1 = { method:"POST", url:"192.168.0.6:7777",
// headers:{
// "User-Agent":"monkeyagent",
// "Accept":"text/monkey,text/xml"},
// onload:function(details) {
// alert([
// details.status,
// details.statusText,
// details.readyState,
// details.responseHeaders,
// details.responseText].join("\n")) }
// };
The above is almost verbatim from mozilla docs ( which I can't now find )
obj1 = { method:"POST", url:"http://voidstar:7777",
headers:{
"User-Agent":"monkeyagent",
"Accept":"text/monkey,text/xml",
"Content-type":"application/x-www-form-urlencoded" },
data: "data here?" };
// obj1 = { method:"POST", url:"http://voidstar:7777",
// headers:{
// "User-Agent":"monkeyagent",
// "Accept":"text/monkey,text/xml" }
// };
// obj1.data = response
GM_xmlhttpRequest( obj1 )
I guess I am not sure what is realy happening in the original example.
Is it creating object with method , headers and "?? nameless function"
members?
I have tried:
obj1.data = posted_data_string
to add member var data but no joy, so how can I add my data string to this?
Many thanks
info on the web about objects.
I trying to create a requiest for GM_xmlhttpRequest()
// obj1 = { method:"POST", url:"192.168.0.6:7777",
// headers:{
// "User-Agent":"monkeyagent",
// "Accept":"text/monkey,text/xml"},
// onload:function(details) {
// alert([
// details.status,
// details.statusText,
// details.readyState,
// details.responseHeaders,
// details.responseText].join("\n")) }
// };
The above is almost verbatim from mozilla docs ( which I can't now find )
obj1 = { method:"POST", url:"http://voidstar:7777",
headers:{
"User-Agent":"monkeyagent",
"Accept":"text/monkey,text/xml",
"Content-type":"application/x-www-form-urlencoded" },
data: "data here?" };
// obj1 = { method:"POST", url:"http://voidstar:7777",
// headers:{
// "User-Agent":"monkeyagent",
// "Accept":"text/monkey,text/xml" }
// };
// obj1.data = response
GM_xmlhttpRequest( obj1 )
I guess I am not sure what is realy happening in the original example.
Is it creating object with method , headers and "?? nameless function"
members?
I have tried:
obj1.data = posted_data_string
to add member var data but no joy, so how can I add my data string to this?
Many thanks