簡體   English   中英

在Chrome中正常運行時,代碼無法在Firefox中運行

[英]Code not working in firefox while runs fine in chrome

下面的代碼如何以及為什么在chrome中給出1,而在Firefox中給出2。

    var a = "2014/04/27"
    var b =  "2014/04/09"
    var n = a.localeCompare(b);
    console.log(n);

我在我的項目中使用上述代碼,它在chrome中運行良好,但在Firefox中卻存在錯誤。 歡迎對上述工作提出任何建議或等效功能。 謝謝.......

一個瀏覽器與另一個瀏覽器的功能實現有所不同。

這是Firefox的文檔頁面: https : //developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare ...

...並查看此線程以獲取更多信息: http : //code.google.com/p/v8/issues/detail? id= 459

暫無
暫無

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

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