0

这就是我调用 iframe 并传递数据的方式

<script type="text/javascript">
         function refreshConversatio() {
             document.getElementById('iframeDisplayMessage').src = 'Message.aspx?id=' + document.getElementById('val').value;
             }
</script>

这就是我获得价值的方式,但是我如何通过 Hiddenfield 获得价值?

<script type="text/javascript">
        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
                results = regex.exec(location.search);
            return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
        }
        function myLoad() {
            document.getElementById('divConversation').innerText = getParameterByName("id");
        }
    </script>
</head>
<body style="background-color:#a32c05;" >
       <input type="hidden" runat="server" id="hidden1" name="hidden1" />
    <div id="divConversation"></div>

    <script>
        myLoad();
    </script>
</body>
4

1 回答 1

0
var hiddenId = document.getElementById('<%hidden1.ClientId%>');
hiddenId.value=getParameterByName("id");
于 2013-10-22T09:27:56.913 回答