Showing a javascript alert
#1
When you look for a method to show an alert screen from php, the solution that is given everywhere is to trigger a javascript alert by:


echo '<script type="text/javascript">alert("' . $message . '")</script>';


I tested this in a test script and it works perfectly.
When I use it in a MyBB plugin function it works initially too, the popup screen that I get looks like:

[Image: attachment.php?aid=34781]

But when I click OK, the screen goes on blank and execution seems blocked.
When I run the same plugin script but then with the alert line commented, execution goes on without problem.

So it must be something related to javascript executing and the communication to php that javascript has finished. I have looked for applications of this in MyBB, but cannot find these. I think there will be an explanation for this.

I got the idea that it has something to do with page headers, but I can be totally wrong.

Is there I way to let this work?


Attached Files Thumbnail(s)
   
Regards, Ad Bakker (NL)
Reply


Messages In This Thread
Showing a javascript alert - by Ad Bakker - 2015-08-03, 09:35 AM
RE: Showing a javascript alert - by Devilshakerz - 2015-08-03, 10:04 AM
RE: Showing a javascript alert - by Ad Bakker - 2015-08-03, 10:21 AM
RE: Showing a javascript alert - by Devilshakerz - 2015-08-03, 10:38 AM
RE: Showing a javascript alert - by Ad Bakker - 2015-08-03, 11:33 AM
RE: Showing a javascript alert - by Devilshakerz - 2015-08-03, 12:00 PM
RE: Showing a javascript alert - by Ad Bakker - 2015-08-03, 12:09 PM
RE: Showing a javascript alert - by Devilshakerz - 2015-08-03, 12:34 PM
RE: Showing a javascript alert - by Ad Bakker - 2015-08-03, 03:10 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)