Back to previous page что это
Going back to previous page using javascript
Is using JavaScript the most efficient way of navigating back to the previous page when a link or button is clicked?
What if JavaScript is disabled on the user’s end (Which most people don’t)?
Are there any known issues with cross-browsers? Like are there any browsers that don’t support history.back() function?
I am using this code to go back to the previous page:
7 Answers 7
According to this all major browsers are supported
Try using this PHP code to generate your back button.
if you dont want to use client side scripting you can use server side like php: try to set cookie in every page like this
now on your other pages :
Yes, I believe that is the only way of going back using javascript, with the exception of writing this
If javascript is disabled and you are not using any server software, then I don’t know of any way outside of the user hitting the back button on the browser.
In the event of Javascript being disabled, you can use Flash, Java, Silvelight, or other control based technology to assist in controlling this behavior as a fallback. Aside from that, you will be unable to control the users browser history navigation if the user said no by disabling support for it.
Is pretty much the defacto standard way of doing this, however, HTML5 has a more complex mechanism of controlling user history (using JavaScript), that doesn’t necessarily involve the entire page switching (aka, on an element by element basis you can control the history)
See this article here for HTML5/Javascript method : HTML5 History Navigation
Переводы пользователей
Добавлены профессиональными переводчиками и компаниями и на основе веб-страниц и открытых баз переводов.
Английский
Русский
Информация
Английский
back to previous page
Русский
back to previous page
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to previous page
Русский
Вернуться к предыдущей странице
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to previous page
Русский
Вернуться на предыдущую страничку
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to previous page
Русский
Обратно на предыдущую страницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to previous page
Русский
вернуться на предыдущую страницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to previous page
Русский
обратно на предыдущую страницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to previous page »
Русский
назад к предыдущей странице »
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Английский
back to the previous page
Русский
перейти в центр сообщений
Последнее обновление: 2016-11-18
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
back to the previeoux page
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
Вернуться к предыдущей странице
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
назад на предыдущую сдтраницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
назад на предыдущую страницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
назад на предыдущую страсницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to the previous page
Русский
обратно на предыдущую страницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
go back to previous page
Русский
go back to previous page
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
go back to previous page
Русский
К предыдущей странице
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
« back to the previous page
Русский
« Вернуться на предыдущую страницу
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
back to previous page contact
Русский
Вернуться к предыдущей странице
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Анонимно
Английский
go back to the previous page
Русский
Перейти к предыдущей странице
Последнее обновление: 2011-10-23
Частота использования: 1
Качество:
Источник: Анонимно
Получите качественный перевод благодаря усилиям
4,401,923,520 пользователей
Сейчас пользователи ищут:
MyMemory — крупнейшая в мире память переводов. Она была создана на основе систем памяти переводов Европейского Союза, Организации Объединенных Наций и ведущих специализированных многоязычных сайтов из разных отраслей.
Мы относимся к Translated, так что, если вам нужны услуги профессионального перевода, посетите наш основной сайт.
Как заставить браузер вернуться на предыдущую страницу с помощью JavaScript?
Существует два популярных способа заставить браузеры вернуться на предыдущую страницу, нажав событие JavaScript, оба метода описаны ниже:
Синтаксис:
Примечание. Если мы хотим вернуться более чем на один шаг, увеличьте значение delta с «-1» до необходимого значения.
Пример:
How to make browser to go back to
h1 style = «color: green» >
Onclick javascript to make browser
go back to previous page?
Click on the link to get
to the second page.
a href = «page2.html» >Go to Page 2 a >
How to make browser to go back to
h1 style = «color: green» >
Onclick javascript to make browser
go back to previous page?
Click on the button to go back
to the previous page.
button onclick = «history.go(-1)» >
Click here to go back
Выход:
Метод 2: Использование метода history.back (): метод back () объекта window.history используется для возврата на предыдущую страницу в текущей истории сеанса. В случае отсутствия предыдущей страницы этот вызов метода ничего не делает.
С помощью этого метода можно указать событие onclick для возврата на одну страницу в истории.
Синтаксис:
Пример:
Onclick javascript to make browser go
back to previous page?
h1 style = «color: green» >
Onclick javascript to make browser
go back to previous page?
Click on the link to get
to the second page.
a href = «page2.html» >Go to Page 2 a >
Onclick javascript to make browser
go back to previous page?
h1 style = «color: green» >
Onclick javascript to make browser
go back to previous page?
Click on the button to go
back to the previous page.
button onclick = «history.back()» >
Click here to go back
Выход:
what is the best way to make ‘back to previous page’ system?
In my web application, where presentation tier is in JSF, i want to have button ‘back to previous page’ on some pages.
I’m making it through URL parameters: http://www.example.com/index.xhtml?backurl=value
for example, in mange bean i set current page A.xhtml url:
and at B.xhtml (with url http://www.example.com/A.xhtml?backurl=A.xhtml ) i have
which redirect me to previous page.
2 Answers 2
Although it’s quite awkward there are two ways I can think of.
The first one stems upon a ‘linear flow’ assumption, under which you have a predefined sequence of views to be presented to the user, as in a flow or conversation, and the current back URL depends on the current view id. So you are supposed to have an application scoped bean with a map of back URLs where the key would be the source view and the destination view (as pointed at by the back button) would be the value. Then, you can define back button outcomes basing on the current view id:
Then you can have a following structure in your flow:
That’s good as soon as you have a linear tree of your flow and a predefined set of pages.
Another viable option is to pass a JSON-serialized list of back URLs instead of a plain back URL. In this approach you’ll add an element to the list when next page is requested and user proceeds further in the flow and you’ll remove an element from the list when user clicks back. Then the last list element is your current back URL. From-to JSON serialization is performed in a postconstruct method by means of, say Gson.
But beware that get query parameters can be limited in size due to server limitations, so this approach is feasible in case you have not-so-deep flows. Also, don’t forget to URL-encode the list as you pass it as a query parameter in your action method.
Advantage of this approach is its generality. Implementation of this approach is left for your practice.
That said, back button must be a back button and it should take user to the previously requested page. Otherwise you may end up with poor user experience.
In my opinion, these forward-back views could be simulated with a wizard-like component containing the navigational buttons. The approach with the back buttons is possible for two-page views like master-detail pages, but not for the flow with a more complex structure.
How to go back to previous page if back button is pressed in WebView?
I have an app in which I have a WebView where I display some websites. It works, clicking a link in the webpage goes to the next page in the website inside my app. But when I click the phone’s back button, it takes me straight into my app. I want to go back to the previous page in the website instead. How can I do this?
Here is the code sample I’m using:
16 Answers 16
I use something like this in my activities with WebViews:
For this code to work, you need to add a field to the Activity containing the WebView:
Initialize it in the onCreate() method and you should be good to go.
If using Android 2.2 and above (which is most devices now), the following code will get you what you want.
This is my solution. It works also in Fragment.
Full reference for next button and progress bar : put back and next button in webview
If you want to go to back page when click on phone’s back button, use this:
You can also create custom back button like this:
Focusing should also be checked in onBackPressed
here is a code with confirm exit:
The first answer by FoamyGuy is correct but I have some additions; low reputations cannot allow me to do comments. If for some reasons your page fails to load, ensure that you set a flag to take note of the failure and then check it on the onBackPressed override. Otherwise your canGoBack() will be forever executed without heading to the actual back activity if it was there:
You can try this for webview in a fragment:
You should the following libraries on your class handle the onBackKeyPressed. canGoBack() checks whether the webview can reference to the previous page. If it is possible then use the goBack() function to reference the previous page (go back).