SoFunction
Updated on 2025-02-28

Solution to JS's showModalDialog function return value undefined in Chrome browser

This article describes the solution to JS's return value of undefined in Chrome browser. Share it for your reference, as follows:

Main page:

<script type="text/javascript">
function SelectGroupCust() {
  var temp = ("?xx=" + Date(), "", "dialogWidth=800px;dialogHeight=600px;help=no;center=yes;");
  //for chrome
  if (temp == undefined) {
    temp = ;
  }
  alert(temp);
  return true;
}
</script>

Detailed page:

<script language="javascript" type="text/javascript">
function ReturnAddressee() {
  if ( != undefined) {
     = "1";
  }
  else {
     = "2";
  }
  ();
}
</script>

For more information about JavaScript, readers who are interested in reading this site's special topic:Summary of JavaScript Errors and Debugging Skills》、《Summary of JavaScript mathematical operations usage》、《Summary of json operation skills in JavaScript》、《Summary of JavaScript switching effects and techniques》、《Summary of JavaScript search algorithm skills》、《Summary of JavaScript animation special effects and techniques》、《Summary of JavaScript data structure and algorithm techniques"and"JavaScript traversal algorithm and skills summary

I hope this article will be helpful to everyone's JavaScript programming.