Can I get the history.back() function to work in Chrome when using the file:// protocol?

StackOverflow https://stackoverflow.com/questions/9423439

Вопрос

I'm building an application in an environment where I'm restricted to using the local file system and a browser (i.e. running a server isn't an option). I have a generic 'go back' link on numerous pages that mainly just calls history.back(). It looks something like the following:

function goBack(evt) {
    // Check to see if override is needed here

    // If no override needed, call history.back()
    history.back();
}

$('#my-back-button').click(goBack);

This code works fine in Firefox and IE6 (don't ask), but fails in Chrome. Any suggestions as to why and/or possible workarounds?

I've also tried history.go(-1); which does not work either.

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top