Refreshing a page opened with window.location.replace or window.open(url,'_self') takes me to previous window - html

I have a published google web app that I am using as a splash screen. When I click a button on this screen it correctly takes me to the page (using either of the methods below). When I refresh that page, however, it returns me to the splash screen instead of keeping me on the newly opened screen, as I'd like it to do. I thought window.location.replace would correct this, but it is still doing it.
I have tried window.open(myurl,'_self') and window.location.replace(myurl) and it keeps happening. If I create a new tab with just window.open(myurl) and I refresh that, it keeps me on the correct page. I would prefer to not have the user open a bunch of tabs for this to work correctly. Is there something I am missing to make this refresh to the page that was opened with the window command?

Since your app is loaded in a sandboxed iframe, you should use
window.open(myurl,'_top')
to load in the top frame

Related

Is there a way to (i) automatically refresh a url and (2) scroll-down to the end?

My ideal goal is a modified version of this chrome extension
I want to keep a window always open on a website, and that window is supposed to refresh and bring me at the bottom of the page, continuously (until I stop/close). How do you suggest to proceed?
I found extensions for auto-refresh and extensions for auto-scrolldown, but nothing that puts them together

When designing website is opening new tab as bad as a popup window

My web application is mimicing the UI of my desktop application, flow is as follows
Select Task in browser window
Change any Options and then start
Show Progress in same browser window, the progress bar goess back to server every 5 seconds checking progress.
When task has completed we show report in new tab
and go back to Select task Window,
this is done by running following Javascript in progress page
window.open('/start','_self'); window.open('/reporturl','_blank');
This works fine on my PC but when trying on Safari on OSX and on Android phone and iPad one of two things happen
The progress page becomes the start page but the report page is not opened in tab
The Progress page becomes the report page
My question is does opening window in new tab with _blank have all the problems of using popup windows. If so should I modify my prcoess so that at stage 3 it just displays report page, and then add a back button or navigable footer to the report to allow user to get back to start page ?
I can think of some options you could use instead of new tab.
Modal with Ajax
-- With jQuery it is posible to open modal
dialogs they can be populated with html (or other data) fetched with ajax (async). I am a big fan of these and use them all over my projects. Users will not be annoyed with pop-up warning messages, etc. Once the content is read (or whatever) the user can simply close the dialog. (If I had to make your app I would certainly implement this).
Besides the jQuery dialogs, other modal/dialog scripts are out there. Check out Bootstrap Modal if you like it modern.
Serve report as download
-- Depending on what the user can/will do with the report, it might be interesting to write the report page in a way that it sends back a .pdf file, or another type of file, as download. Loading the URL in a new tab will now always start a download. Triggering this from JS without user interaction might be a problem though (same as with pop-up / new tab). Adding a button to trigger the download on complete will solve this.
I know the question was about the use of tabs.. But try to avoid it. Browsers handle it all in their own way. And many users get confused when suddenly stuff is opening in tabs when they did not ask for it. In case of pop-ups, it is possible for users to turn them of or convert into opening a new tab from within the browser settings. If they have been fiddling with browser defaults, you'll have troubles of keeping the 'flow' of the app the same for all users (and cross browser).

UWP suspend operation on just one page

As we all know that when we minimize the UWP app it goes to suspension. and then again when maximized it is exactly at the same place, for all pages. I want to do the same for specific pages, on my own. meaning that I want to do the same operation for one or more pages, when I switch between pages in my app, without minimizing? when app is minimized, even the videos playing on it pause automatically, and when maximized they play themselves, I want to achieve that functionality when I switch to next page and when I come back to previous page, it should start playing again, like it was suspended. thankyou in advance.
The app I am making plays a video on a url in a webview on a page, I want that when I come back to that page after navigating somewhere else on my app, that webview start playing exactly at the same place. Thats exactly wht happenes when I minimize my app. but i wanna do that without minimizing it.
Also I have tried cahcesize of my frame and set navigationmode of my page to enabled, that just saves the current state, and the media on my page keeps on playing when I navigate to another page, it should pause, but it keeps onplaying

Refresh page directing it to a particular div using HTML5/CSS3?

I am making a simple website and I am encountering a problem whenever I reload it.
I placed my menu at the middle of the screen and when you clicked it, it needs to go down to the content. My problem is, whenever I reload it, it would still go up and show the upper picture. What I want is that after one of the menu is pressed, the menu should now stay on the upper corner of the screen without showing the upper picture (Sample website -> http://ec2-54-84-168-45.compute-1.amazonaws.com/Teapop/)
It seems like my url code that directs it on a particular div (e.g menu#teapop_nav)` doesn't work as I expected after I deployed it on the hosting site even though it works well on my local build.
Without using any javascript code, is there a fix for this using html5/css3?
Thank you.
i just tested it on my computer (chrome & firefox) and it seems to work. And also on page refresh. The picture is always on the top.

window.location.reload refreshing the main window

the following is on a page, when i click it - I DO NOT want the page to refresh, but only the new window which this link opens - i want to refresh that newly opened page, not the main window.
clicking the link opens the new window correctly, but refreshes the main window also (where the link lies). that is undesirable and i want to know how to stop it from doing so.
clik to open new window
clik to open new window
pl advice.
as advised below, but not working: infact it is breaking the new window, new window appears as blank window!
clik to open new window
Here's the proper way to open a link in a new window. If javascript isn't available, the link will still work.
Click Me
mywin is a window name, not a variable.
You need to store the returned wobject from window.open() in a global variable:
onclick="window.mywin = window.open('URL','mywin');">
The problem with the main window reloading is likely the href="" line. This could be causing the browser to navigate to the same page where it is presently (and therefore refreshing). You should add return false; to the js, and likely also adopt a more standard link target like href="#" which will navigate to the top of the same page without a refresh (though this will still get cancelled by the false return).
friends, it is resolved by doing this:
clik to open new window