API:webAlert

From MODx Wiki
Jump to: navigation, search
 API Function Definition: 
webAlert
Versions 
> 0.9.0 ?
Return Values
Success: null
Fail: null
Data Type 
void
Object Hierarchy 
DocumentParser
void webAlert(string $msg[, $url]);


Displays a javascript alert alert message in the web browser

Examples

Related Functions

Function Source

File: manager/includes/document.parser.class.inc.php
Line: 1259
  1. function webAlert($msg, $url= "") {
  2. if (substr(strtolower($url), 0, 11) == "javascript:") {
  3. $act= "__WebAlert();";
  4. $fnc= "function __WebAlert(){" . substr($url, 11) . "};";
  5. } else {
  6. $act= ($url ? "window.location.href='" . addslashes($url) . "';" : "");
  7. }
  8. $html= "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>";
  9. if ($this->isFrontend($html))
  10. $this->regClientScript($html);
  11. else {
  12. echo $html;
  13. }
  14. }

Notes

Personal tools