AJAX, JSON And Microsoft.XMLHTTP
Mar 27, 2006
I am trying to use AJAX and JSON to do this. I have copied an example of
using HttpRequest Object as the backbone of this from
http://www.w3schools.com/dom/dom_http.asp. Further, I am enclosing both of
my files here, in full as opposed to mere snippets. This code does what I
wish it to do except:
1. It does not update when getdata.php is rewritten. On non MSIE broswers,
it shows when first invoked, but not subsequently.
2. It fails altogether under MSIE (6.026 SP1 || SP2) -- I never get
xmlhttp.readyState==4 under MSIE.
Code:
View 1 Replies
ADVERTISEMENT
Mar 17, 2006
I'm trying to translate an asp application, i have some difficulties with a
particular line :
---
Set myxml = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
---
Classical ajax exemples rather use :
[...]
req = new ActiveXObject("Microsoft.XMLHTTP");
.... But i'm not sure the ActiveXObject is identical to the original :
Set myxml = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
I'm not an asp expert, can you give me some tips on that question ?
View 4 Replies
View Related
May 1, 2007
Just trying to create a basic xmlhttpobject.
However, the following always returns null
xmlhttpobj = New ActiveXObject("Microsoft.XMLHTTP")
(it is Microsoft. and not Msxml2. I've already narrowed that part
down; just trying to create the object now)
If I check for the value of xmlhttpobj, it is always null or
undefined.
IE settings aren't blocking any ActiveX
View 1 Replies
View Related
Mar 24, 2010
jquery provides ajaxStart() and ajaxStop() events. Those two events do not seem to be triggered if the ajax requests are made by Microsoft Ajax tool Kit (from ASP.Net code). Is there any way to bridge those two event models? If not currently possible, is there any future initiative or plan out there to make this happen?
View 2 Replies
View Related
May 26, 2010
Issues with jquery ajax calls with IE and what the workarounds are?
I'm having users complain about issues of an ajax call not working, however, I've been unable to reproduce this or see the error myself.
Works fine in firefox/safari/chrome. I have windows7 + IE8/IE7 to test and that works.
My call looks like this...
I added the _requestno parameter because i read that IE does some smart caching of ajax calls, but, that didn't solve the problem.
View 2 Replies
View Related
Dec 4, 2011
This is really more a IE issue than jquery but I am using jquery.
Has anyone used this setTimeouts method from the IXMLHttpRequest2 object from IE.
I want to monkey path jquery calls with this call below. I tried this and I still get a property method error even though the method seems to be available. Has anyone experienced this?
With this Javascript code, I get this error "Object does not support this property or method" error. I checked that the methods are available and I do a check that the method is there. Am I sending the wrong number of args? Has anyone used this?
View 1 Replies
View Related
Jan 6, 2010
In firefox, i look through the DOM and its showing me that both xmlHttpRequest and ActiveXObject("Microsoft.XMLHTTP") are undefined.Also if one could check the ready state methods I used, I'm not 100% if they are correct eg. xhttp.onreadystatechange = loadBlurbs() and if null is the value for a failed loading procedure.lasty, can I do this processBlurbs() = getElementByTagName, and then, processBlurbs() { this.length, this.child etc. ? }
Code:
<script type="text/javascript" language="javascript">
var blurbdoc;
var blurbs;[code].......
View 3 Replies
View Related
Mar 6, 2011
i want an argument that will ask if the previous xmlhttp content was = to the current xmlhttp content. Like as so:
Code:
if(oldxmlhttp = xmlhttp) {
alert("yes");
} else {
[Code]....
All in all i want to make it so it doesn't reload if content is not different. To hold control over the server.
View 3 Replies
View Related
Jun 9, 2011
I've been racking my brain for a couple hours now and doing a lot of searching and I cannot seem to find an answer. I want to know if it is possible to return the xmlhttp.responseText value from an AJAX function to the function that originally called the AJAX function.
Code:
//Set handler for server response.
xmlhttp.onreadystatechange = function()
{
[Code]....
I want to return the my_response variable to the original caller. No matter what I try I have been unsuccessful. I even tried assigning it to the global window variable using window.my_response = xmlhttp.responseText but it ends up being undefined.
Every example I've seen of using AJAX pretty much does something inside of the if (xmlhttp.status == 200) part to update the web page. I really do not want to do that.
Can I return the value?
View 4 Replies
View Related
Jun 1, 2010
How can I get the json that this url generates?[URL]... It returns a json object as a file to download, I've tried getting the data as jsonp, but it needs a callback in the feed, but I can't generate it cause the server which generates the code is external.
[Code]...
Couldnt make it work using the get method. And using other data type just would make the incoming data as null (even including ?callback=? in the url).
View 1 Replies
View Related
Apr 3, 2009
I am new to Ajax and have a bit of a gap in my understanding. I have a status monitor that sets a JS function to run every second with setInterval. When the document loads, I will need to get data from the server asynchronously (I wont know the info before hand) and use that data to set id values to find them as nodes and change them later on.
The problem is as I see it, that the callback function I will use to grab the initial data is coming back via a JSON object. The callback function is done with javascript. So, how can I take the JSON data, or converted to javascript data and set my ID values when the document loads? If I change the values dynamically with the DOM, will those values be reliable enough to use as my other recurring functions find them and set their innerHTML properties?
View 3 Replies
View Related
Feb 15, 2012
Im having difficulty getting my form contents to send to my php page using ajax, jquery and json. The results just doesnt want to show.
My javascript, where I create the JSON object and try to send it through to the php page:
var JSONobj;
var JSONstr;
function createJSON(){
[code]....
What should happen is the firstname should be alerted. But the alert box doesnt even show and I find no errors using firebug...
View 2 Replies
View Related
Feb 15, 2011
I am using ajax to process a url. The result echoed back is
ok=true how can I convert that to json format so I can read that back in?
I can't edit how the response comes to me.
View 1 Replies
View Related
Oct 15, 2010
[code]....I have 2 DropDownList, like Master-Slave.This is my Default.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
[code]....
but there is nothing to append. Also I see the response in firebug windows as following(when I Select G2 from Master ddl):
[{"Value":"G2s1","Text":"SV1"},{"Value":"G2s2","Text":"SV2"}]
And for more specific view the following pic is the JSON tab in firebug windows when I select G3 in Master ddl:I change my success method of script with this new one for test:
function SuccessHandler2(data) {
$('select#Slaveddl').empty();
$.each(data, function (i, slaveValue) {
[code]....
So I think there is a problem with manipulate of return value (data).Also I try this one and just the first alert appear, apparently the (data.d) is null or unknown object:
function SuccessHandler4(data) {
var selection = $('select#Slaveddl');
$(selection).children().remove();
[code]....
View 5 Replies
View Related
Aug 14, 2007
whats the best way to pass a json string to the server.
if my jsonstring = {a:Ƈ',b:'sds',c:'sdg'}
could i send that to the server passing it as 1 variable like so:
url = /serverside.php?json=jsonstring
or would i have to break it down into something like this:
url = /serverside.php?a=1&b=sds&c=sdg
View 2 Replies
View Related
Jul 16, 2010
I have a ajax post that is a datatype json.
So my success function looks like this:
But it is not sure name exists. How can i check this out?
View 2 Replies
View Related
Nov 4, 2010
I have troubles with a simple jQuery.ajax-request which looks like this:
jQuery.ajax({
type: "GET",
url: "[URL]",
//url: "[URL]",
data: "",
success: function(data, status) {
$('body').html(data);
},
dataType: "json"
});
I test this with two different url's:
[URL]
[URL]
The first url works and I get json-data in the data-object. The second url gives a "parseerror", and I can't figure out why. As far as I can see (and using a json-validator) the second url returns valid json, so what's wrong?
View 2 Replies
View Related
May 21, 2011
I am doing a project now i going to use ajax to retrieve coordinate from the json in html and pin the coordinate onto a point on the map using javascript but the problem is i am only able to use one point on the map can tell me what to add in ? or how should i change it with? it will be nice if u can change the code from the below and show me how
Quote:
View 2 Replies
View Related
Sep 6, 2009
What is the best way to server AJAX data and why? JSON, HTML, or XML? Which is best?
View 1 Replies
View Related
Jan 31, 2011
I have a multiple select box that is dynamically populated based on a selection from another select box. There are 3 possible results:
1. Every click on the parent select box replaces the html of the child <select> with a "Loading..." message. Then it runs an ajax request to a server side page that returns JSON data back to the post-processing function.
In that post-processing function I check to see if any data was returned for that selection.
2. If data was returned, replace the child multi-select with the data.
3. If no data was returned then replace the child multi-select with a default message.
Now the problem I'm seeing. When I select an item from the parent select that I know returns data, the child multi-select seemingly doesn't update, but when I mouse over the select I see the changes.
BUT! On a whim, I created another <div> just to see if it was in fact a problem with the select, so everytime I updated the <select> I also updated this new <div>. Magically it all worked. So what I ended up doing is keeping the <div> there, just set it to display:none and now it works like it "should".
I'm using jQuery.ajax and jQuery.html to handle the processing.
View 4 Replies
View Related
Mar 28, 2011
I got a problem with a json response from an ajax request.
I have the following code :
Code:
And the called page (ajax_sous_famille.php) is giving me this result :
Code:
The info in the resulting string is correct, but here you can see the [ ] at the start and end of the line. It seems not to be a correct Json string and then it crashes my script !
I have another request like this which gives me the good format of resulting data (without the [ ]) and which works perfectly when i decode the Json string to display it.
The difference between the 2 requests is that the one which works returns only 1 array of values like
Code:
And the second one which doesn't work returns something like
Code:
Actually, all the records are coming from a database and in the case it doesn't work, i wanna get several results from this database.
View 7 Replies
View Related
Jul 3, 2011
So I can't for the life of me understand JSON. I've looked through numerous links but nothing. If I have a Database and all I want to pull is:
How do I print that out to an HTML document using JSON. I don't get it. I think it puts it in an array but how does it get there? Do I just print it out like I would a normal javascript array? If this isn't quite the right place to post this I apologize but there wasn't an AJAX section.
View 4 Replies
View Related
Jan 20, 2010
I am trying to populate page elements from an AJAX call, which returns JSON.
For some reason, JSON that looks like this, fails to evaluate, I'd like to understand what's wrong with it.
JSON:
Code:
View 2 Replies
View Related
Aug 15, 2011
I have a web service that accepts application/json but returns HTML to place in a DIV. I am not having any luck configuring the .ajax call so that it both POSTs in a format accepted by the web service and does not attempt to validate the HTML response as JSON.
[Code]...
It would seem that I cannot have anything other than 'json' in the dataType, even though from the docs it appears that this only affects the interpretation of the response, changing it's value to 'html' causes the web service to reject the call. I've also tried a converter but perhaps I'm not using it properly. Is it possible to use jquery to post JSON and get back HTML? What configurations am I missing?
View 2 Replies
View Related
Aug 18, 2011
I want to know how to delete the returned JSON data.
ex:
$( "#clickme" ).click( function(){
var dataString = "something=" + somethingelse;
$.ajax({
url: "do.php",
[Code].....
View 5 Replies
View Related
May 3, 2011
How might I go about getting the parsed JSON object in the complete function? The json param shown below seems to just receive the http status text message.
My 2nd question would be how should I knwo if the first place what params I can receive to a callback function like this?
$.ajax({
type: 'POST',
url: 'url.json',
dataType: 'json',
[Code].....
View 1 Replies
View Related