473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.cfm"
oXmlHttpadditem=GetHttpObject(addStateChanged);
oXmlHttpadditem.open("GET",url,true);
oXmlHttpadditem.send(null);

then, in add_item.cfm, I am just using:
<script type="text/javascript">window.alert("Hello 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 3118
On Oct 24, 2:04 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
evangst...@gmail.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.cfm"
oXmlHttpadditem=GetHttpObject(addStateChanged);
oXmlHttpadditem.open("GET",url,true);
oXmlHttpadditem.send(null);
then, in add_item.cfm, I am just using:
<script type="text/javascript">window.alert("Hello 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...@web.de>
wrote:
evangst...@gmail.com wrote:
On Oct 24, 2:04 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
evangst...@gmail.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.cfm"
oXmlHttpadditem=GetHttpObject(addStateChanged);
oXmlHttpadditem.open("GET",url,true);
oXmlHttpadditem.send(null);
then, in add_item.cfm, I am just using:
<script type="text/javascript">window.alert("Hello 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$8300d...@news.demon.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
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...
1
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...
3
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...
1
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...
0
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 ...
8
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...
5
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...
2
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
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,...

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.