473,946 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asynchronous alert?

Hi,

I am using AJAX and coldfusion, and am having trouble getting some
alerts to work. I am using the http object in javascript:
var url="add_item.c fm"
oXmlHttpadditem =GetHttpObject( addStateChanged );
oXmlHttpadditem .open("GET",url ,true);
oXmlHttpadditem .send(null);

then, in add_item.cfm, I am just using:
<script type="text/javascript">win dow.alert("Hell o World\n");</script>

but the alert isn't being displayed. I assume this has to do with
client-side/server-side issues, but can someone please clarify why
this doesn't work, and perhaps offer a fix or alternative solution?

thanks in advance.

Oct 24 '07 #1
2 3152
On Oct 24, 2:04 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
evangst...@gmai l.com wrote:
I am using AJAX and coldfusion, and am having trouble getting some
alerts to work. I am using the http object in javascript:
var url="add_item.c fm"
oXmlHttpadditem =GetHttpObject( addStateChanged );
oXmlHttpadditem .open("GET",url ,true);
oXmlHttpadditem .send(null);
then, in add_item.cfm, I am just using:
<script type="text/javascript">win dow.alert("Hell o World\n");</script>
but the alert isn't being displayed. I assume this has to do with
client-side/server-side issues, but can someone please clarify why
this doesn't work,

Because it is not code that is parsed by the user agent.
and perhaps offer a fix or alternative solution?

That depends on what exactly you are trying to accomplish here.

PointedEars

not parsed by the user agent? Sorry, I don't know what you mean by
that.

the idea is, additem.cfm alters a database, and I would like to alert
the user when/if there are errors.

thanks.

Oct 24 '07 #2
On Oct 24, 2:21 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
evangst...@gmai l.com wrote:
On Oct 24, 2:04 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
wrote:
evangst...@gmai l.com wrote:
I am using AJAX and coldfusion, and am having trouble getting some
alerts to work. I am using the http object in javascript:
var url="add_item.c fm"
oXmlHttpaddite m=GetHttpObject (addStateChange d);
oXmlHttpaddite m.open("GET",ur l,true);
oXmlHttpaddite m.send(null);
then, in add_item.cfm, I am just using:
<script type="text/javascript">win dow.alert("Hell o World\n");</script>
but the alert isn't being displayed. I assume this has to do with
client-side/server-side issues, but can someone please clarify why
this doesn't work,
Because it is not code that is parsed by the user agent.
>and perhaps offer a fix or alternative solution?
That depends on what exactly you are trying to accomplish here.
[...]
not parsed by the user agent? Sorry, I don't know what you mean by
that.

(Oh my, yet another scriptkiddie ...)

http://www.w3.org/TR/html4/conform.html#h-4.1
the idea is, additem.cfm alters a database, and I would like to alert
the user when/if there are errors.

So your server-side application should return an error status code (see
RFC1945 and RFC2616) when that happens, the client-side application should
evaluate the status code, and display the alert window if the status code
is an error code.

The alternative is that the server-side application serves content that is
clearly marked as being an error message, and the client-side application
should handle that accordingly.

http://developer.mozilla.org/en/docs...etting_Started

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8 300d...@news.de mon.co.uk>
well, you could have just said browser :)

just kidding, thanks for the help.

Oct 24 '07 #3

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

Similar topics

8
15108
by: VA | last post by:
Suppose I have setTimeout(foo(),n); long_running_function(); Would foo() be executed even when long_running_function() is still executing? In other words, does the setTimeout() pre-empt anything else?
1
1562
by: Julian Hershel | last post by:
Reading about asynchronous programming (ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconasynchronousdesignpatterno verview.htm) I could not clarify some doubts. Hope you can help me. 1) Are asynchronous programming and multithreaded programming two different pictures? As I read the help topic above it is not clear to me if the design pattern opens a new thread or not to run the methods asynchronously. 2) One unique thread can run...
3
4005
by: usenetaccount | last post by:
In a newly created test app, to maximize client performance I tried to make two SOAP method calls in tandem (the soap methods execute some specified query), as each call includes a large amount of idle time by the client as it waits for a query to execute and return a dataset. As a test, I initially wrote two versions: ' // Sequential & Synchronous Dim webobj As com.mycompany.webobject Dim ds1 As System.Data.DataSet Dim ds2 As...
1
2884
by: dba123 | last post by:
I need to perform Asynchronous Inserts using DAAB. So far I have a method which does an insert but how can I do this Asyncronously so that it does not affect the load on our public production website? This question is wide open but make sure you give me some ideas in context with DAAB syntax. Some thoughts are threading, ATLAS, etc. but I have no clue how to even approach an Asynchronous Insert or any techniques at this point. Also, I...
0
1767
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ------------------------------------------------------------------------------------------------------------------------- My web.config file: ---------------------
8
2061
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for button A's mouseup has completed? I beleive event processing to be single-threaded for good reason but I need a "stop" button and it's no good if it doesn't do anything until the other processing has finished :-)
5
15522
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous mode, it sounds as if a thread retrieves the data from the supplied URL and the JS function that called the open() and send() methods continues on. Where as using Synchronous mode the method that called open() and send() waits until the data from...
2
1955
by: JagPeram | last post by:
Hi, I have a problem in running ajax in firefox. when i give asynchronous as false, the ajax code is not working. but the same code works fine in internet explorer here is my code: var url = "<%=request.getContextPath%>/AjaxTest.do"; var req = initRequest(); req.onreadystatechange = function()
2
3446
by: Nicolas Le Gland | last post by:
Hello everyone here. This is my first post in this newsgroup, I hope I won't be to much off-topic. Feel free to redirect me to any better group. I am getting strange timing issues when failing to asynchronously connect sockets on closed or filtered ports, but I'm quite unsure if this is a PHP issue or my misunderstanding, as it seems that socket streams only wrap around <sys/socket.h>.
0
9979
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11556
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11150
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...
0
9883
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
8245
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
7412
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
6111
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...
0
6327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4933
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.