sometimes the javascript code doesn't work in IE8 when ajax callbacks are setted with jquery.html()
===

I make an Ajax.BeginForm dynamically:

    <ul>
    @foreach (var menuItem in menuList)
            {
                <li class="@util.getClassForMenuInitial(index)" id="d-@menuItem.MenuId">
                    @using (Ajax.BeginForm("Dummy",
                                            "Structure",
                                            new { partial = true, menuOption = menuItem.MenuId, menuLevel = menuItem.Level },
                                            new AjaxOptions()
                                            {
                                                HttpMethod = "POST",
                                                UpdateTargetId = "detalle",
                                                OnSuccess = "function(arg){RenderContent(arg,'submenu','d-" + menuItem.MenuId + "','link_d-" + menuItem.MenuId + "','active')}"
                                            },
                                            new { ID = "formSubMenu-" + menuItem.MenuId }
                                            )
                            )
                    {
                        <a href="#" onclick="javascript:submitForm('formSubMenu-@menuItem.MenuId');" id="link_d-@menuItem.MenuId" class="@util.getClassForMenu(menuItem.Title, index)">@menuItem.Title</a>
                                   
                    }
                    </li>
                    index++;
            }
    </ul>

So, my submitForm() function is:


    function submitForm(formName) {
        $("#" + formName).submit();
        return false;
    }

this function submit each form

And i did catching the callback ajax, here:

    function RenderContent(context, menu, option, linkID, linkActive) {
        ChangeMenu(menu, option, linkID, linkActive);
    
        var html = context.get_data();
        if (html == sessionFinish) {
            location.reload();
        }
        else {
            var placeholder = context.get_updateTarget();
            $(placeholder).empty().html(html);
        }
        return false;
    }

My problem is that in IE (8,9) sometime the click event doesn't fire; in fact in FF and Chrome always works.

Any idea?

