views:

91

answers:

4

Hey,

The question is pretty simple, but i'm not the big AJAX/JS coder, so I have no clue if it's possible.

Is there any way that I can check whether or not an alert() was executed on a remote site? Like if I inputted an alert("Welcome to this site"); through a get variable, is there any way to check if it that alert() was actually executed in the browser?

And not necessarily through AJAX/JS.

+2  A: 

The short answer is "no", and you really shouldn't use alerts. Use custom popups instead, if you must, or better yet, don't pop anything up at all.

Jakob Kruse
A: 

Simply put some code below your alert to send XmlHttpRequest back to your server.

alert('Welcome to this site');
sendXmlHttpRequest();

The function sendXmlHttpRequest does whatever job to notify server. Since these codes are always executed in sequence, it ensures sendXmlHttpRequest executed if alert is executed.

Morgan Cheng
A: 

Unfortunately when making a POST/GET request on a remote server it won't execute any javascript. The AJAX request only reads what the server response it but doesn't execute it like you own browser would.

If you can elaborate little bit more of what you want to accomplish with AJAX, maybe I can give you a better answer.

fredrik
A: 

well. just make a box with 'div' tag.. and catch the click.

sunglim