By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,649 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

asynchronous alert?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.