Javascript函数调用页面刷新

时间:2013-05-02 21:56:06

标签: javascript function twitter-bootstrap

对此我不知所措......

尝试从twitter bootstrap模态窗口调用以下函数

Twitter Bootstrap HTML:     <button id="modal-agree-btn" class="btn btn-primary" onclick="rentalAgreement('true')">I Agree</button>

Javascript函数rentalAgreement():

function rentalAgreement(value){

if(value=='true'){
<?php
    $updateQuery = "UPDATE prospect SET Registration_Flag='Yes' WHERE p_id=$prospectID";
    $dbcon->query($updateQuery);
    error_log("Clicked");
?>
$('#myModal').modal('hide');
var brokerAgreementBox = document.getElementById('brokerAgreementModalButton');
brokerAgreementBox.style.visibility = 'hidden';
var brokerAgreeHeader = document.getElementById('brokerAgreementHeader');
brokerAgreeHeader.style.visibility = 'hidden';

document.getElementById('noRegFlagMove').appendChild(
    document.getElementById('uploadHeader')
    );
document.getElementById('noRegFlagMove').appendChild(
    document.getElementById('uploadBox')
    );

var brokerAgTag = document.getElementById('brokerAgreementTag');
brokerAgTag.style.color = "green";
brokerAgTag.class = "icon-ok-sign";
}

};

如果我通过登录屏幕进入页面,它会很有效,但是当我刷新页面时,该功能会在没有单击按钮的情况下执行。是什么原因导致函数调用或如何调试它来解决它?

0 个答案:

没有答案