dialogArguments property

http://msdn.microsoft.com/en-us/library/ms533723(v=vs.85).aspx


dialogArguments property

42 out of 56 rated this helpful - Rate this topic

Gets the variable or array of variables passed into the modal dialog window.

Syntax

JavaScript

p = object.dialogArguments

Property values

Type: Variant

the arguments that were passed when the dialog was created.

Remarks

The dialogArguments property>showModalDialog method >showModelessDialogmethod.

Examples

The following example shows how to get information passed into a modal dialog window by using the dialogArguments property. The code corresponds to two different files. One file launches the modal window and the other file stores the code for the modal window.

This file launches the modal window and then sends an object to that modal window.

HTML
<!DOCTYPE html>
<html>

<head>
  <script>
    function fnLaunch() {
      var aForm;
      aForm = document.getElementById('oForm').elements;
      var myObject = new Object();
     >// The object "myObject" is sent to the modal window.
      window.showModalDialog("modalDialogSource.htm", myObject, "dialogHeight:300px; dialogLeft:200px;");
    }
  </script>
</head>

<body>
  <button onclick="fnLaunch();">Launch The Dialog</button>
  <form id="oForm">
    First Name:
    <input type="text" name="oFirstName" value="Jane">
    <br>
    Last Name:
    <input type="text" name="oLastName" value="Smith">
  </form>
</body>

</html>

This file (modalDialogSource.htm), stores the code for the modal window. Get the object sent to this modal window by using thedialogArguments property.

Code>http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/dialogArgumentsCallerEX1.htm

HTML
<!DOCTYPE html>
<html>

<head>
  <script>
    var oMyObject = window.dialogArguments;
    var sFirstName = oMyObject.firstName;
    var sLastName = oMyObject.lastName;
  </script>
  <title>dialogArguments</title>
</head>

<body style="font-family: arial; font-size: 14pt; color: Snow; background-color: RosyBrown;">
  First Name:
  <span style="color: 00ff7f">
    <script>
      document.write(sFirstName);
    </script>
  </span>
  <br>
  Last Name:
  <span style="color: 00ff7f">
    <script>
      document.write(sLastName);
    </script>
  </span>
</body>

</html>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值