簡體   English   中英

Ajax IE7不停止重新加載問題

[英]Ajax IE7 non stop reloading issues

我正在使用AJAX並同時執行一些javascript / jquery。 我正在使用.load()。 現在,我在IE7上遇到問題,每個瀏覽器都能正常運行。 IE7不知何故一直不斷地重新加載相同的內容。

我嘗試使用

$.ajaxSetup({
   cache: false
});

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

沒有任何工作。

我真的不知道發生了什么,也找不到任何解決方案。

希望你們能幫助我。 提前致謝。

我的AJAX代碼:

$('#ir_content').load(pageurl + ' #ir_inner_content');

並且由於另一個文件使用的是帶有后端語言的手動編碼的javascript,所以我通過在img標簽的1個上使用onload來運行腳本:

<img src="/images/icon_loadingLarge.gif" width="32" height="32" alt="loading..." id="loading_indicator" style="display: none;" onload="var script_text = $('#webchart_js').html(); eval(script_text);" />

script_text:

<div id="webchart_js">
    (function($){
      var interactive_chart_config = {
        zoom_historical_default: [% chart_config.chart.chart_interactive.zoom_historical_default %],
        zoom_intraday_default: [% chart_config.chart.chart_interactive.zoom_intraday_default %],
        quotes_delay: [% ir.var.Config.format.quotes_delay %],
        news_on_chart: {
          [% news_types = chart_config.chart.chart_interactive.news_on_chart.keys %]
          [% FOREACH news_type = news_types %]
            [% news_type %]: {
              [% news_options = chart_config.chart.chart_interactive.news_on_chart.${news_type}.keys %]
              [% FOREACH news_option = news_options %]
                [% news_option %]: [% chart_config.chart.chart_interactive.news_on_chart.${news_type}.${news_option} ? 'true' : 'false' %][% IF news_option != news_options.last %],[% END %]
              [% END %]
            }[% IF news_type != news_types.last %],[% END %]
          [% END %]
        },
        modify_news: [
          [% FOREACH news = chart_config.chart.chart_interactive.modify_news.news %]
            {
              [% FOREACH key = news.keys %]
                [% key %]: '[% news.${key} %]'[% IF key != news.keys.last %],[% END %]
              [% END %]
            }[% IF news != chart_config.chart.chart_interactive.modify_news.news.last %],[% END %]
          [% END %]
        ]
      };

      $(document).ready(function(){
        $('#content_container').web_chart($.extend({}, {
          theme : Highcharts.theme,
          counter_code : "[%= stock_ids.first %]",
          plot_on_load : true,
          always_reload : true,
              loading_indicator_id  : 'loading_indicator',
              chart_setting_id      : 'chart_setting',
              counter_list_form_id  : 'counter_list_form',
              chart_container_id    : 'chart_container',
              css_class_for_flags    : {'N' : 'news_tooltip', 'I' : 'insider_trades_tooltip', 'C' : 'corporate_actions_tooltip'}
        }, interactive_chart_config));
      });
    })(jQuery);

  </div>

嘗試在ajax URL的末尾添加一個隨機字符串。 這將停止IE緩存內容。 像這樣:

$('#ir_content').load(pageurl + '?r=' + Math.Random() + '#ir_inner_content');

什么是always_reload 通過將其傳遞為true,是否有可能重新加載IE7?

$(document).ready(function(){
        $('#content_container').web_chart($.extend({}, {
          theme : Highcharts.theme,
          counter_code : "[%= stock_ids.first %]",
          plot_on_load : true,
         /*
          * HERE
          */
          always_reload : true,
              loading_indicator_id  : 'loading_indicator',
              chart_setting_id      : 'chart_setting',
              counter_list_form_id  : 'counter_list_form',
              chart_container_id    : 'chart_container',
              css_class_for_flags    : {'N' : 'news_tooltip', 'I' : 'insider_trades_tooltip', 'C' : 'corporate_actions_tooltip'}
        }, interactive_chart_config));
      });
    })(jQuery);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM