I have a page doing some functionality and at the end it produces a report displayed in a popup and I want to print this report only not the whole page.
How can I print the the content of the popup?
Popup embeded into the page and there is no way to print only part of the page.
So you have to create separate page (which you can generate from the popup content) or use an iframe.
Related
I created a simple Firefox extension to show an external page in a popup. I was now wondering if it's possible to use the content from the external page to fill a field in the current tab or if this is only possible when loading the content natively.
Basically what I'm trying to do is:
Open a webpage
The webpage contains an input field
Open the extension > popup appears
Click an item inside the popup
Use the content of the item clicked as value for a (or all) input fields in the current tab
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.
Can someone help me out with this one.
I have an MVC page where I have a print button. When clicking on print I need to open a print popup dialog (the same one that we get when we hit Ctrl+P). But when clicking on print, I have a logic to get some content as string from code behind and pass it to the print window.
I tried to open a popup when clicking on print button and doing Print functionality by using window.print but this works only if we have the content to print along with the button.
Edit:
If you see the above picture, I have a button with some label "Hi click below button to print content". When I click on print button, I need to have some other content not in this page to be sent to the printer.
You have to have it in the browser for it to print. Your best shot is to AJAX the content into a content div. Then, set the rest of the DOM to visibility: hidden. In CSS, you can do media queries like #media print { } to apply certain styles only when you print.
If you can imagine, the printer doesn't know HTML / CSS. Only the browser does and you can tell it the media you wish to target.
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");
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.