using onbeforeunload event, url change on 'Leave Page' - browser-cache

I am having a requirement that when a user makes his payment and reached on success page and go back it should be redirected to a custom page. So if i will click on browser back button it will show me two options - Leave Page and Stay on this page. When i will click on Leave page it should redirect to my custom page. I found following link useful but not working for 'Leave Page' button....kindly suggest or help.
using onbeforeunload event, url change on selecting stay on this page

Related

how to secure html page with simple javascript code?

I need a simple javascript code that I'll put inside the html page and do the following:
When a user enters the page, a popup appears that asks to enter a password.
If the correct password is entered, the user will see the window content.
If the wrong password is inserted, the popup will say: "wrong password, try again"
And if a user hit the "cancel" button,
it will do nothing, and the page will stay blank without content until the user hits the refresh button or the back button to the previous page and will try to enter the "secure" page again,
It doesn't need to be complicated or too secured.
The content of the page that I want to secure is not sensitive.
thanks.

Dynamic action to update database record AND redirect to a different page

I'm building a system of modal dialogs to allow users to edit database records.
The user clicks the "Edit" button on a specific row in a report somewhere
A modal dialog pops up, with fields that the user can edit and manipulate
The dialog has four standard buttons the user can select: Cancel, Delete, Save, and Create
Let's start with the Save button.
By default for modal dialogs, the Save button has the following behavior:
I presume this 1) submits the information from the items in the modal dialog (which refreshes the browser, closing the modal dialog), and then 2) performs the SQL UPDATE action with the submitted information, in time for the refreshed page to include the updated information?
This is fine, but I need to:
Avoid refreshing the browser (e.g. submit individual items, rather than the whole page), and
Manually redirect to another modal dialog (a different page) AFTER the SQL UPDATE action is completed
I presume this can be accomplished with dynamic actions, but I don't know how.
How can I ensure the database action is completed, before the dynamic action which navigates to a new page?
Manually redirect to another modal dialog (a different page) AFTER the SQL UPDATE action is completed
I'm thinking of creating a branch with Server-side condition set to "When button pressed" (for every button), or perhaps "Request is contained in value" where request name (by default) equals button name.
So: button would first do its processing part, and then branch to another page, without involving dynamic actions.

How do i reset Safari 12 beforeunload events after pressing "Leave Page" without refreshing?

I have a webpage with a form on it, and a beforeunload event.
When the page first loads, if the form is changed, a confirmation message appears on both Safari and Chrome.
In Chrome - if i press "leave page" and then return to the page, future changes keep invoking the conformation upon attempt to leave the page.
In Safari - if i press "leave page" and then return to the page, future changes to the form don't invoke the message when leaving the page, and the target page is loaded without problems.
If i refresh the page, the confirmation "resets".
I develop using Oracle Apex 5.1, but according to different forums this happens regardless of the platform:
https://github.com/codedance/jquery.AreYouSure/issues/112
Can you help me find a workaround?
Can i "Reset" safari without refreshing the page?

SharePoint homepage template type

I have a fresh installation of SharePoint 2010. Playing around with it I accidentally set the home page to a Document Store (I was logged in as admin). How can I reset the homepage to display the original options before I converted it to a Document Store?
I tried Site Actions -> Reset site definition, but that didn't help.
Solution
SharePoint does not allow site definitions to be changed. The page that allows site definitions to be selected ([YOUR-SITE]/_layouts/templatepick.aspx) says:
Template Selection A site template determines what lists and features
will be available on your new site. Select a site template based on
the descriptions of each template and how you intend to use the new
site. Many aspects of a site can be customized after creation.
However, the site template cannot be changed once the site is created.
To select a page to be the home page, navigate to that page and click on the Page ribbon. You will see 'Make Homepage' button in the 'Page Actions' section of the ribbon then, confirm the action in the pop-up prompt that shows up.

Can't retrieve the session on clicking of browser's back button

I have rails application that calculates prices of goods and I set prices in session. I have 'back' button in my application. When I clicks on 'back' link, I will get my previous session values like 'prices','goods' I purchased.
But when I clicks on 'browsers' back button,I won't get my session values, I have to refresh the page for that.
I'd say you have caching issues... The browser remembers what it saw before, and thinks it's the same (without even going to the trouble to ask the server any more). Try if this article helps
You probably want to prevent the browser from caching your pages so that they get refreshed when the user clicks the Back button. This article should help.