代码之家  ›  专栏  ›  技术社区  ›  Geeth

$.ajax和ashx页

  •  2
  • Geeth  · 技术社区  · 14 年前

    我使用以下代码在aspx会话中存储值。

    代码:

     $("div.menu_body a").click(function() {               
         var linkHeaderID = $(this).parent().attr("id");
    
            $.ajax({
               type: "GET",
                url: "SessionHandler.ashx",
                 data: "headerLink=" + linkHeaderID + "&link=" + this.id
                });                              
            });
    

    问题:

    对于前3到5个链接选择工作正常。在此之后,控件将不会命中sessionhandler.ashx页。

    当做, 小精灵。

    1 回复  |  直到 14 年前
        1
  •  1
  •   rahul    14 年前

    这可能是缓存问题。尝试同时设置缓存属性。见 jQuery.ajax( settings )

    尝试

    $.ajax({
               type: "GET",
               cache: false,
                url: "SessionHandler.ashx",
                 data: "headerLink=" + linkHeaderID + "&link=" + this.id
                });                              
            });