JQM Popup doesn't popup when url has GET details in it - jquery-mobile

I have a page which displays a calendar/diary and lets you navigate back and forth using a form so the URL often looks like:
calendar.php?&month=6&year=2014
The popup works fine initially before there is any string after the .php. However, once the "&month=" etc is there the popup doesn't work. I note as soon as the popup loads it shows up #&ui-state=dialog in the url.
Is there a simple solution for this? (Other than changing the form to method=post, which I haven't yet tried).
Many thanks.

The simplest solution is to add:
data-history="false"
to your popup <div>. That will avoid URL modification when the popup is open.

Related

Modal window don't work times to times in any browser

I create application on ruby on rails and add modal window for login. I put modal code in partial layouts/header. I expect it must work on every page of my app but not. Modal don't open in home/index. It's start work on home/about. I don't understand why. I'll update my ask If needs code. Can anyone help me understand?
I try to move modal code on another pages but get same effect.
home/index and home/about is URI?
Make sure you use the same layout (header file) and the modal element exist in HTML of home/index (you can use dev tool - f12 for checking)
Please, Does the modal need to be triggered by a button or something?

Popop Box With URL Like Dribbble.com

Explanation:
I have a portfolio page with all of my graphic design I've made. I always liked the Dribbble way of showing "Shots".
Problem:
The problem is that I don't know how I can make the popup have an URL like on Dribbble. Dribbble opens the "Shots" in a popup box with an URL callback.
Question:
Can you guys point me in the right direction? What is this type of action called? I will appreciate all type of help!
Thanks in advance.
It's a combination of opening a popup with onclick and changing the url and opening the popup when the url has /shots in it onload. The popup content itself is loaded trough ajax.
If you want I can make an example. Do you want to load content that is already on the page in the popup or load external content?

How to navigate to different page while coming back from activity in WL.NativePage.show()?

My scenario is this: I am using WL.NativePage.show(nativePageClassName, backFromNativePage, params) to navigate to an activity. Once returning back to the WebView, I need to navigate directly to other page(Div) in html, rather from the page I originally navigated from to the activity, which is developed using jQuery-Mobile.
See the below example code.
WL.NativePage.show("com.example.SignatureActivity", function(data) {
if(data.goToPage == "example2"){
$.mobile.changePage('#example2-page',{transition: 'none'});
}else{
$.mobile.changePage('#example1-page',{transition: 'none'});
}
});
Here I am using WL.NativePage.show() In example1-page, I have two buttons in activity, one is save and one is back, while saving I need to navigate to example2 and while back, its example1.
I am able to navigate to example2, but example1-page is executing and displaying first and then displaying example2-page.
Please give me suggestions on how to navigate directly to example2-page without displaying example1-page.
You can't navigate directly from the activity to a different place in the DOM which is in the WebView from which you navigated to the activity.
What you could do, is open displaying the activity, also hide the current content in the WebView. I assume it is a DIV essentially - so you could do something with display:none or any other standard method.
That way when the user returns back to the WebView from the activity and the code to change page is executed, you could then play again with the visibility of the DIV to display it when needed.
This way what you don't want to be seen will not be shown.

Programatically open a dialog as popup with jQuery Mobile

So I have a page and a dialog. When the user click the page button, one AJAX request will open the dialog with the results. Something like that simple example without AJAX: http://jsfiddle.net/rBBpx/
It works. The dialog opens programatically. But it hides the page content, showing the dialog as if it's another page. I know that popup's can open dialogs in-page with links, but I didn't get the point in how I can do that programatically.
I tried to change $.mobile.changePage() call to that, but it didn't worked as I expected:
$('#dialog').popup();
$('#dialog').popup('open');
How can I show that dialog in-page, as a popup? Is it ever possible? Thank you in advance!
In case you use phonegap, there is an alert plugin: http://docs.phonegap.com/en/edge/cordova_notification_notification.md.html
navigator.notification.alert("your AJAX result here");

jqm 1.1.0 closing dialogs when hashListeningEnabled=false

i've got a page that displays a dialog on an href. am setting hashListeningEnabled=false because if someone refreshes the page, they need to be greeted with the first 'page' again. when the dialog is clicked it comes up fine, clicking the close button however does nothing - it changes the href (via history.back()), but as listening is disabled, it doesn't actually close the dialog.
anyone think of a workaround?
that'd be right - as soon as i post the question on SO, i work it out myself. you simply turn hashListeningEnabled on when the dialog is shown, then you can turn it back off.

Resources