Close popup and avoiding navigate to another page in jQuery Mobile - jquery-mobile

I use jQuery Mobile . I created one html file containing two pages (single file multiple page) . In page 2 I used a popup . When it closes , screen redirects to another page . How can I solve this issue ? I want when popup closed it remains in this page not redirecting to another page .

Finally I found.
Add data-history="false" to popup div. thus when popup closes it doesn't redirect to another page .

Related

Jquery mobile popup content appearing during page load

I'm using Jquery Mobile in my website, and I have a page with popups. I don't directly navigate to this page, but I inject the content with Ajax :
$("#myDiv").html(data).enhanceWithin();
The problem is that occasionally, when the page is loading, the popups content appear for half a second on the screen and then disappear...
Is there a way to avoid that ?

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

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.

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");

Primefaces LightBox slows down loading of the page opened inside LightBox

I am using Primefaces LightBox popup window in my application. The problem I am facing is when I click the link to open the corresponding page, it's too slow to display the page through LightBox. It's take more time to loading. How can I solve it?
Link for LightBox :
<p:lightBox style="display:inline">
Login
</p:lightBox>
When I click the link, the corresponding page login.xhtml is to be opened through LightBox. I am using PrimeFaces 3.0 and JSF 2.0.
Check out the Dialog component as a replacement for LightBox for your scenario. Dialog can replicate Lightbox's popup capabilities with the additional ability to make the login page modal (e.g. you can force the user to either complete the login process or close the login popup). Furthermore, unlike LightBox, Dialog is capable of pre-rendering its content so when the Dialog is popped-up, the user wont experience any UI delay due to the popup going to fetch its content. Note, if you want to keep the login page in a separate xhtml file, you can include it inside the Dialog component using a Facelets include.

How to open a html page as a popup with in the page (no new window opens) using Jquery

I am having the link button and when i clicked on the link button the popup will be open (with in the page itself like a modalpopup. now i have to get the popup feel using jquery and inside the div text should come from database.
How is it possible for getting the message from the backend.
means open a div in a modal popup feel using jquery
or opens the html page in a popup in the same window using jquery
Thanks and Regards
Vara Prasad.M
Take a look at the Facebox jQuery plugin. It does pretty much exactly what you're asking for. For example you can have a link like this to some remote page like so
text
then just call the facebox plugin when your content is loaded like so
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
});
and your content will render in a modal window. You can also take a look at Fancybox or ThickBox which provide very similar functionality.
There are two steps to your problem:
Open a modal popup using jQuery
Fetch server side content and display it in the modal dialog
Use jQuery Dialog (http://docs.jquery.com/UI/Dialog) for popping open a modal dialog, and then use jQuery load (http://api.jquery.com/load/) for loading the content from the server.
The server page you call will make the database query and output the contents to the response buffer.

Resources