2012-02-15 15 views
0

私は私のページに「ドリルダウン」機能を持ったチャートコントロールを持っています。可能なドリルポイントを描くためにイメージマップを使用します。このコードはすべて最新のChromeと最新のInternet Explorerで完璧に動作します。FireFoxは私の古いイメージマップを記憶しているようです

enter image description here

ので、上記の画像を見て、左側のコンソールに次の3つのエントリを参照してください。

  • エントリ1:チャートが最初にページにロードされるとき、これは最初のイメージマップです。
  • エントリ2:チャートがドリルされると、これは次のレベルのイメージマップです。このマップは正しくレンダリングされます。
  • エントリ3:ドリルダウンを元に戻します。データは最初のエントリのデータと同じであることに注意してください。

私の右のモニターは、現在、エントリ3のチャートを表示しています。そして、エントリー3のマップがロードされていることがわかるHTMLマークアップを調べています。 (「1489」)DrillChart:あなたは私の右のモニターの左下隅に見れば

はまだ、あなたはjavascriptを参照してください。このメソッドは、エントリ2の一部であり、エントリ1/3ではありません。

function UndoDrillDown() { 
    $('#ChartLoading').show(); 

    $.ajax({ 
     url: '../Chart/UndoDrillDown', 
     data: { ReportID: reportID }, 
     datatype: 'json', 
     success: Reload 
    }); 
} 

function Reload(htmlImageMap) { 
    //Remove the old image map and then add a fresh one. 
    console.log(htmlImageMap); 
    //$('#HistoricalChartDialog').children("map").remove(); 
    $('#HistoricalChartMap').remove(); 
    $(htmlImageMap).appendTo('#HistoricalChartDialog'); 

    //Fetch image associated with new image imap. 
    var reportID = parseInt($('#ReportSelector').val()); 

    $('#HistoricalChart').bind('load', function() { 
     $(this).unbind('load'); 
     //When drilling down it does not make sense to continue showing the old tooltip after clicking. 
     $('#CustomTooltip').hide(); 
     $('#ChartLoading').hide(); 
     $(this).show(); 
    }).bind('error', function() { 
     $(this).unbind('error'); 
     $('#ChartLoading').hide(); 
     $('#ChartLoadingError').show(); 
    }).attr('src', '../Chart/HistoricalChart?ReportID=' + reportID + '&cacheBuster=' + new Date().getTime()); 
} 

イメージマップを複数の方法で削除しようとしました。限り、私はイメージマップは削除されたが、FireFoxはまだ古いデータを覚えていると言うことができます。

編集:私は再びそれを示す前に、HistoricalChartを非表示にした場合、それは、Firefoxで正しく動作します...私は、可能な場合しかし、ちらつきを避けるためにしたいと思います。

答えて

2

これはhttps://bugzilla.mozilla.org/show_bug.cgi?id=694503のように見えるが、それはあなたが実行しているどのようなFirefoxのバージョンのFirefox 10で修正されていますか?

旧バージョンのFirefoxで回避する必要がある場合は、<map>を削除する前に<map>からすべての<area>要素を削除することもできます。私はその後、適切な画像マップがロードされているリロードの開始時にHistoricalChartに非表示を呼び出す場合

+0

よろしくお願いします。 FireFoxの私のバージョンは古くなっていた。私は7歳だった。なぜ自動アップデートが実行されなかったのか分からない。ありがとう。 –

0

キャッシュからリフレッシュしましたか? Ctrlキーを押しながらF5を押すと、最新の変更が反映され、表示されます。

+0

。かなり変わったようだ。おそらくそれはキャッシュの問題ですが、チャートにはキャッシュ・バスターがあります。イメージ・マップにどのように追加できるかわかりません。 –

1

これはFirefoxで奇妙な癖があります。私は解決策を考え出したが、好奇心は、なぜ私はそれを使用する必要があります。

function Reload(htmlImageMap) { 
    if ($.browser.mozilla) { 
     //Image maps are 'held onto' in FireFox even when the HTML is removed. 
     $('#HistoricalChart').attr('usemap', ''); 
    } 

    //Remove the old image map and then add a fresh one. 
    $('#HistoricalChartDialog').children("map").remove(); 
    $(htmlImageMap).appendTo('#HistoricalChartDialog'); 

    $('#HistoricalChart').attr('usemap', '#HistoricalChartMap'); 

    //Fetch image associated with new image imap. 
    var reportID = parseInt($('#ReportSelector').val()); 

    $('#HistoricalChart').bind('load', function() { 
     $(this).unbind('load'); 
     //When drilling down it does not make sense to continue showing the old tooltip after clicking. 
     $('#CustomTooltip').hide(); 
     $('#ChartLoading').hide(); 
     $(this).show(); 
    }).bind('error', function() { 
     $(this).unbind('error'); 
     $('#ChartLoading').hide(); 
     $('#ChartLoadingError').show(); 
    }).attr('src', '../Chart/HistoricalChart?ReportID=' + reportID + '&cacheBuster=' + new Date().getTime()); 
} 
関連する問題