Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- beforeSend: function(req) {
- req.setRequestHeader("Accept", "text/xml");
- },
- type: "GET",
- url: "[proper url]",
- contentType: "text/plain; charset=utf-8",
- dataType: ($.browser.msie) ? "text" : "xml",
- username: '---',
- password: '-------',
- success: function(data) {
- var xml;
- if (typeof data == "string") {
- alert("Data is string:" + data);
- xml = new ActiveXObject("Microsoft.XMLDOM");
- xml.async = false;
- xml.loadXML(data);
- } else {
- xml = data;
- alert("Data is not string:" + $(xml).text());
- }
- // Returned data available in object "xml"
- //alert("Status is: " + xml.statusText);
- $("#ingest_history").html($(xml).text());
- }
- });
- setRequestHeader('Accept', '')
- setRequestHeader('Accept', null)
- $.ajax({
- headers: {
- Accept : "text/plain; charset=utf-8",
- "Content-Type": "text/plain; charset=utf-8"
- }
- data: "data",
- success : function(response) {
- ...
- }
- })
- $.ajax({
- dataType: ($.browser.msie) ? "text" : "xml",
- accepts: {
- xml: "text/xml",
- text: "text/xml"
- }
- });
Add Comment
Please, Sign In to add comment