Hi i am new for jquery mobile . I got 3 pages in my apps. Page1.html,page2.html and popup.html. Page2 allow user navigate to popup.html to select item adding record into page2.html.
So now is my problem when i in page2.html go to popup.html then popup.html back to page2.html . When press back button in page2.html will back to popup.html. Is it possible to skip back to popup.html directly back to page1.html?
Related
The "start_url" works for Android browsers, but for iPhone, Safari always uses current page's URL and ignores the "start_url".
For example, the current page is https://test.com/index.html, on manifest the "start_url" is set to be "start_url": "index.html?flag=1", but when the page is added to home screen on Safari, it still uses https://test.com/index.html, without the parameter.
Is there a way to apply a different URL as the start up URL for Safari?
A hacky solution I've implemented here is to silently change the URL on the page you prompt the user to install the PWA with: history.pushState({}, "", "/"); (see: https://stackoverflow.com/a/56691294/827129)
This will update the URL but won't cause the page to reload or refresh the DOM, so you can see the page you're on as normal, but when the user goes to install the PWA (Add to home screen) it'll save the root URL, so that's what they'll see when they open the PWA.
Downsides here include:
the URL in the address bar will update (not a big deal on mobile)
if the user presses the back button they'll go "back" to the page you triggered the history.pushState() on, so they'll need to press back twice to actually go back
if the user refreshes the page they'll see the homepage
In my use case this is good enough, there might be extra solutions to handle these issues that could be applied on top of this solution to improve UX.
try this url format
"start_url": "./index.html?flag=1"
I have two pages - A and B. When a user clicks on a link in page A, I open page B using
$.mobile.changePage('pageBurl');
When the user clicks on a link in page B, to go back to page A, I have
$.mobile.back();
This works in iPad safari browser, but not inside an app's uiwebview.
How can I make this work?
Thanks.
Have you ever tried to use the attribute data-rel="back" on your link ?
This attribute work for me. Try to test
The situation is like this:
User opens app from a website using a custom urlscheme
User does stuff in the app
User clicks button in the app to return to the website in Safari.
I have tried opening a new tab containing a javascript:window.close() but this does not work on iOS 6.1.
So my question is: Is there a way to open Safari to view the website the user left from? Either with a working new tab that closes itself or a different route?
When you open the app with your custom url scheme, pass the actual page url as an argument.
mycustomUrlScheme://mydomain.com?objectid=1234&callback_url=encoded_url
In your app, handle the url for the content info and keep the page url to open it afterwards. It will make safari open a new tab. But that should be a good start.
As far as i understand you can do it.
user opens mobile safari for example http://www.example.com
user clicks a link that is appscheme://open and the application become active
user taps a button to open safari for example http://www.example.com?q=test
for the third step you can use [[UIApplication sharedApplication]openURL:url]
I am trying to use a web app to access a few key internal sites in the business.
The web app opens full screen and there is no address bar etc. The main page has a header bar with a back and a home button.
To open the internal links within the webapp the following code has been used
<script type="text/javascript">
function OpenLink(theLink){
window.location.href = theLink.href;
}
</script>
along with the below in the 'a href'
onclick="OpenLink(this); return false"
The new page opens within the web app with no address bar etc, but how do I keep the web apps header bar with the back and home buttons in it for basic navigation?
Any help would be appreciated. Thanks
You should use an iFrame for this.
Here is an example: http://jsbin.com/aziqap/1
I have gone through the following link and my situation is same like it.
Disable the hardware back function with jQuery Mobile
Situation: Device under test: Samsung Galaxy S III
Page A: ListView with Names(A1, A2, A3)
Page B: Consist of a Form, Submit and Cancel button.
The user fills in the form and click on the Submit button. And his/her data gets uploaded to the server. The page is updated and a confirmation dialog is displayed that data is uploaded to the server.
Now the issue arrives.
Now when the user clicks on the hardware back button he/she is again redirected to Page B and he/she is again able to submit the form (which we don't require, as the form is meant to be filled only once).
So is there a way through which I can control the hardware back button to show Page A whenever it is on Page B?
The following answer from Nirmal seems to have answer, but I don't know how to implement it -
There is no real way disable the hardware back button on the
BlackBerry or Android.
What you can do is maintain a session variable which gets invalidated
in your back handler and check for that session variable in the
pagebeforeshow event of the Exam page.
How can I fix this?
You should be able to capture the hardware back button click event with JavaScript:
$(document).bind('keydown', function(event) {
if (event.keyCode == 27) {
// Prevent default (disable the back button behavior)
event.preventDefault();
// Your code to show another page or whatever...
}
});
Use cookies. Whenever the form is processed, add a value to the user's cookie and on the form page check if that cookie value exists.
If it does, just show the user a message which indicates that the data have already been submitted or redirect the user to the main page.
I included the Login form and the page the user is directed after login, in the same HTML file as two pages (multi-page containers).
After validating the login, I call the changePage to the id of the new page I want to load with changeHash as false. This way, the user won't be returned to the login even by the hardware back button.