Jquery Not Working when debugger is disabled

Jquery Not Working when debugger is disabled

Hi There,

i am using vs2010,jquery1.8.2 Version, i tried to pull the contents from the iframe by forcing the button click using jquery , in button click event handler ,iam assigning the hidden field some value, When eanble a debugger in script, value is fetched properly{alert gives value} , but when debugger is disabled hidden field is empty .

can any provide a soln/reason why script is not working when debugger is disabled.

here is My Parent aspx page . having the frame ,

<div>

<iframe id="framePatInfo" src="ModifyRegistration.aspx" height="400px" width="780px" frameborder="0"></iframe>

<asp:HiddenField ID="PatId" runat="server" />

</div>

<asp:Button ID="Button1" class="btn btn-primary" runat="server" Text="Save changes" OnClientClick="_childClick()" OnClick="btnPostBack_Click"></asp:Button>

<asp:Button ID="btnPostBack" runat="server" Visible="false"/>

Script on parent page:

function childClick() {
            debugger;
            var m = $("#framePatInfo").contents().find('#txtFName').val();
            $("#framePatInfo").contents().find("#btnSaveDown").click();
            var x = $("#framePatInfo").contents().find("#hdnPatId").val();
            alert(x.toString());
            document.getElementById('<%=PatId.ClientID %>').value = x.toString();
            alert(document.getElementById('<%=PatId.ClientID %>').value);
        }







This the Child page , which have the button which iplements my logic & some value is set after implementing it.

Aspx page:-

<asp:Button ID="btnSaveDown" runat="server" Text="Save" class="btn btn-primary pull-right"
                    Style="margin-right: 20px;"
                    onclick="btnSave1_Click" />

<asp:TextBox ID="hdnLable" runat="server"></asp:TextBox>

CodeBehind :-

public void btnSave1_Click(object sender, EventArgs e)
    {
        hdnPatId.Value = "1";
     }