自动日志记录 JavaScript

Auto Logging JavaScript

本文关键字:JavaScript 记录 日志      更新时间:2023-09-26
<script type="text/javascript">
    function GetImagePaths() {
        GetImagePathsMethod();
    }
    function autoLogin()
    {
        document.loginForm.action = "xxxxx";
        document.loginForm.submit();
    }
</script>
body onload="autoLogin()">
    <div class="minHeightBody">
        <div style="overflow:hidden;">
            <div style="width:2000px !important;overflow:hidden;">
                <div class="overridepanelClass addBorderAndWidth" style="float:left;">
                    <div id="slider" class="pics">
                        <!--Initial Image that needs to be loaded-->
                        <img id="image" style="width: 100%; height: 900px;" src="@Url.Content("~/Content/images/quote3.jpg")">
                    </div>
                </div>
                <div class="overridepanelClass addBorderAndWidth" style="float:left;padding-left:5px;">
                    <div id="displaySite" class="panel2Properities">
                        <!--Initial Site that needs to be loaded-->
                        <iframe src="XXXXX" height=900 width=2900></iframe>
                    </div>
                </div>
                <form name="loginForm" id="login" target="frame" method="post">
                    <input name="username" type="hidden" value="xxxx">
                    <input name="password" type="hidden" value="xxx">
                </form>
            </div>
        </div>
    </div>
</body>

我正在尝试使用上述脚本自动登录,但没有任何反应。如果我使用 iframe 或者我完全做错了什么,是否有不同的方法

document.loginForm.action = "xxxxx";应该引用表单的 id