473,734 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is This "AJAX"?

I have some javascript in a standard HTML page that uses the ubiquitous
"XMLHttpRequest " to send data to a remote ASP page.

If that page "answers back" by sending a string using a simple
Response.Write, which I then use in the original HTML page to
dynamically update stuff, is this "AJAX"?

Specifically, is there anything "wrong" with sending back info from
classic ASP pages using simple Response.Writes ? (Is there usually
something more required in the "answer back"? Or something that
Response.Write might not be sending, like an appropriate header "AJAX"
header?)

I mean, what I have done works! -- so I wonder if I am missing
something? It seems so easy to do -- I _MUST_ be missing something?
Right?

Thanks,
Blue Apricot

Apr 14 '06 #1
6 2491


bl************@ gmail.com wrote:
I have some javascript in a standard HTML page that uses the ubiquitous
"XMLHttpRequest " to send data to a remote ASP page.

If that page "answers back" by sending a string using a simple
Response.Write, which I then use in the original HTML page to
dynamically update stuff, is this "AJAX"?


You can call it AJAX as it uses XMLHttpRequest. You could refuse to call
it AJAX if you don't exchange XML as the X in AJAX stands for XML. But
noone cares anymore whether that terms makes much sense or whether any
of the components (Asynchronous Javascript and Xml) are really used.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 14 '06 #2
SOrry, it is not so much the "term" I am wondering about.

What I am wondering is:

1. Can I use "Response.Write " to send info back to the XMLHttpRequest?
2. Is there any shortcomings to doing so?

Thanks,
B.A.

Apr 14 '06 #3


bl************@ gmail.com wrote:
1. Can I use "Response.Write " to send info back to the XMLHttpRequest?
2. Is there any shortcomings to doing so?


Sure you can use Response.Write in an ASP page to write stuff as the
response to an HTTP request. That is what Response.Write is meant for.
And it does not matter if the HTTP request is e.g. made by the browser
because the user asked to load a URI or e.g. by some script executed in
the browser. Processing a HTTP request and writing a response with ASP
does not depend on how the request was made on the client.
As with all responses your ASP makes, you should decide what
Content-Type to send and indicate that with e.g.
Response.Conten tType = "applicatio n/xml"
or
Response.Conten tType = "text/plain"

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 14 '06 #4
Yep!, you are right. You can also send the response data in an XML format and
parse it in the client side to display them.

- Rafiq
http:/www.ajaxtoday.c om

"bl************ @gmail.com" wrote:
I have some javascript in a standard HTML page that uses the ubiquitous
"XMLHttpRequest " to send data to a remote ASP page.

If that page "answers back" by sending a string using a simple
Response.Write, which I then use in the original HTML page to
dynamically update stuff, is this "AJAX"?

Specifically, is there anything "wrong" with sending back info from
classic ASP pages using simple Response.Writes ? (Is there usually
something more required in the "answer back"? Or something that
Response.Write might not be sending, like an appropriate header "AJAX"
header?)

I mean, what I have done works! -- so I wonder if I am missing
something? It seems so easy to do -- I _MUST_ be missing something?
Right?

Thanks,
Blue Apricot

Apr 27 '06 #5
I have question here Martin.

Is there anyway (DHTML) to detect if the content is xml file or text.

right now what I am doing is

'xmlstring = xml file or error code in like "Error:- Error is generated so
and so"

Response.Conten tType = "applicatio n/xml"
Response.write xmlstring
response.end

my client page DHTML looks like

var sTemp = xmlhttp.respons eText
var i = sTemp.indexOf(" Error:-") // instead of doing this I wish to detect
if thats xml or not, if xml means go ahead if not display error
if (i >= 0)
{
//display error
return false
}
var nodes = xmlhttp.respons eXML.documentEl ement.getElemen tsByTagName('ab cd')

Martin Honnen wrote:
bl************@ gmail.com wrote:
1. Can I use "Response.Write " to send info back to the
XMLHttpRequest? 2. Is there any shortcomings to doing so?


Sure you can use Response.Write in an ASP page to write stuff as the
response to an HTTP request. That is what Response.Write is meant for.
And it does not matter if the HTTP request is e.g. made by the browser
because the user asked to load a URI or e.g. by some script executed
in the browser. Processing a HTTP request and writing a response with
ASP does not depend on how the request was made on the client.
As with all responses your ASP makes, you should decide what
Content-Type to send and indicate that with e.g.
Response.Conten tType = "applicatio n/xml"
or
Response.Conten tType = "text/plain"

May 5 '06 #6

"abcd" <ab**@abcd.co m> wrote in message
news:ed******** ******@TK2MSFTN GP04.phx.gbl...
I have question here Martin.

Is there anyway (DHTML) to detect if the content is xml file or text.

right now what I am doing is

'xmlstring = xml file or error code in like "Error:- Error is generated so
and so"

Response.Conten tType = "applicatio n/xml"
Response.write xmlstring
response.end

my client page DHTML looks like

var sTemp = xmlhttp.respons eText
var i = sTemp.indexOf(" Error:-") // instead of doing this I wish to detect
if thats xml or not, if xml means go ahead if not display error
if (i >= 0)
{
//display error
return false
}
var nodes = xmlhttp.respons eXML.documentEl ement.getElemen tsByTagName('ab cd')
A client can reasonably expect to test the content type header to determine
the type of content received. If you are sending plain text then really
ought to be setting the Response.Conten tType to text/plain.

if (xmlResponse.ge tResponseHeader ("Content-Type").indexOf( "applicatio n/xml") -1)

//xml was sent

Personally I prefer to allways send XML even if there is an error. I use
error xml along the lines of:-

<error>
<number>5</number>
<description>In valid Procedure Call</description>
<source>Somewhe re</source>
<error>

Then test if the documentElement has the tag name 'error'.

Anthony.
May 6 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1794
by: John Willems | last post by:
Interesting GUI developments, it seems. Anyone developed a "Ajax" application using Python? Very curious.... thx (Ajax stands for: XHTML and CSS; dynamic display and interaction using the Document Object Model; data interchange and manipulation using XML and XSLT; asynchronous data retrieval using XMLHttpRequest;
7
1412
by: Larry Bud | last post by:
More of a design question than technical.... combining Ajax technology with ASP... Top portion of the page contains several Select boxes which are dependant upon one another. Ajax handles that pretty well, although when reloading the page, I have to "draw" each one, which the user can see.... Once the search criteria is chosen, user clicks a Find button... Currently, the entirep page redraws... Is there any reason NOT to put the...
3
2893
by: Tony | last post by:
I've done a fair bit of searching on this, but I want to be certain about what I've found - so here goes with a long example and three questions: For clarity, let me give an example (a number of the pages I found had some ambiguity). Say I have a page with 2 buttons ( A and B, for simplicity) and each button will make a different "ajax" request, for data to be placed in a corresponding DIV. For sake of example, we won't consider...
1
1410
by: Tony Lawrence | last post by:
Probably a lot of you here are already old hands at Ajax, but I haven't started doing this yet. Part of the reason was that I really didn't understand where Ajax would be useful to my own site, and also that my experiences with early Javascript put me off on that a bit. "Understanding Ajax" by Joshua Eichorn helped me with both of those impediments. Complete review at http://aplawrence.com/Books/understanding_ajax.html --
3
1779
by: caston | last post by:
Well, everybody can now agree with the fact that the Ajax hype is over. Still multiple Ajax Frameworks are flourishing, aren't they? So, last night I questioned myself with the following: "When Ajax Frameworks will be gone? What is required to get rid of them and start using browsers?" (To be more precise, I should probably also mention what kind of frameworks do i mean. These are: Dojo, BackBase, Qooxdoo etc.) I've got an answer that I...
2
1663
by: pe3no | last post by:
Hi, I'm going to create applications PHP + AJAX + Linux + Apache + Postgres. - Other Open Source technologies / Frameworks, etc. also :) Is this book http://www.amazon.com/gp/reader/0471777781 suitable for my "case"? I'm asking persons who read this book :) I wouldn't like to buy something unuseless, which for example is completely concentrated on .NET, C#, ASP.NET, m$something etc...
1
1754
by: mark4asp | last post by:
Which should I use: 1. "ASP.NET AJAX-Enabled Web Site" or 2. "AJAX Control Toolkit Web Site"? In the first, controls from the control toolkit start as: <cc1:SomeControl></cc1> In the 2nd, those controls are: <ajaxToolkit:SomeControl></ ajaxToolkit>
5
13928
by: Sommer.pde | last post by:
It took me some time to find out when and why this happens. When the window of Internet Explorer is closed with an AJAX call still pending, something funny happens. Do it twice, and you will have to restart the browser. Here a little sample: http://truefriendz.de/iedos The script on this site will open 5 test-windows one at a time.
11
1534
by: Jonathan Wood | last post by:
Can anyone point me to any good resources on adding AJAX to a page once the page has already been created? I know VS2008 has options to add AJAX pages, but I didn't select those options when the pages were created. Thanks. Jonathan
0
9319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9191
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6744
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6041
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.