Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to pass an variable to xmlhttp.open("GET/POST","xmlfile",true) method

876192May 10 2012 — edited May 10 2012
Hi ,


Is it possible to pass a variable instead of providing xml file.

For example

let d='<xml>'+
'<book>'+
'<name>Basker Ville</name>'+
'</book>'+
'</xaml>';

now is it possible xmlhttp.open("GET",d,true); ?

Thanks in advance

Comments

Nitin Khare
>
Is it possible to pass a variable instead of providing xml file.
I'm not sure what do you mean by providing xml file. The xmlhttp.open() function usage has to be like:
xmlhttp.open("GET","url",true);
where the url is for the server resource that you are trying to access (usually a file like php/asp/jsp etc.) and true/false flag denotes whether call has to be asynchronous (true) or synchronous (false) which usually passed as true for making typical AJAX calls. Now in case you want to send some additional data to the server then you may pass it through parameters something like
xmlhttp.open("GET","url?param1=value1&param2=value2",true);
Or in case to do a POST like an HTML form post:
xmlhttp.open("POST","url",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("param1=Value1&param2=Value2");
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 7 2012
Added on May 10 2012
1 comment
233 views