I have a question, i generate a page with a javascript code and i use popup. This page works great but :
- When i open a popup for the first time, i can close it and it's works normally
- When u open a popup for the second time, i can close it but the page is refresh after this one was closed.
I don't understand why it's happen only after the second closed. I really want to be unable to close how often i want my popup. If someone have an idea to solve this problem please tell me.
Thanks you for all your contribution to my probleme.
nb : i have already try to set the history option to false of jquery mobile popup.
Related
I am trying to have a window popup from a hyperlink.
I have my window with a hyperlink on which I want to open a popup with the OnClick event.
I am using PHP with javascipt.
OK first code with first symptoms.
echo 'Edit'
It doesn't open a popup, it just refreshes the hosting page, so not what I want.
Now other code, other symptoms:
echo 'Edit'
It changes my hosting page for google, so it is not a popup either.... So not what I am looking for.
What I am looking for: having a popup, but I tried many many things before asking here, without success. So I am hoping somebody could help me on this.
Actually google is here just for the example, in my real application it will be a PHP page with a formular on it....
[Edit : ] What I want is a small popup in the same window, like when you do a rightclick on desktop you have a small popup with menus, see? I don't want a popup that does open in a new tab, this is not what I want. I am looking for a small popup in the page I am in.
Many thanks for your replies !
so far so good, here is the solution to have a real popup, not a new page and not a refresh of the hosting page. Here we go !
echo 'Edit';
I'm trying to create a Chrome extension that features a browser action and a popup. I need to refresh the content I serve in the popup every time the user opens it, but since the on clicked event will not fire if a popup is assigned to the browser action, I don't know how to trigger the logic to refresh the content.
I'm trying to do this in the background page, but I understand that that might not be the best way. Does anybody have an idea of how to approach this?
Thanks for any help.
The popup is created from scratch every time the user opens it, so any javascript file you include using a <script> tag will be executed. You can include any logic you need there.
I have a popup window where my user can edit information displayed on the parent page. When someone press submit changes on the popup window i need the popup to close and also the parent page to reload to display the new information.
I know there are a lot of examples out there but the questions displayed here did not provide me with enough information to complete my task.
I am currently using onClick="history.go(0)" which take me back to the parent page but does not reload the page
The question was a bit vague (not really a question at all, even), but you can try window.location.href="/parentpage";
To close the pop up window from within the pop up window use this:
self.close();
To RELOAD the window that opened the pop up use this in the pop up window:
window.opener.href = 'URL';
This should be pretty close to what you need.
Issue: Should restrict the webpage from submission and moving to the next, till the child window gets closed.
Technology: jsp
Browser: firefox.
Code used for Opening:
retValue = window.open(child_url,',',"Height=400px,Width=670px,status:no,top=190px,left=200px");
Desc:
Clicked on one link in the page and opened up the child window from the firefox browser using the window.open command. But just after the click of the link, along with the opening up of the child window, the main page is also getting submitted and moved to the next page.
The same logic in ie works fine. In ie am using showModalDialog() which works without any issue.
NB: Hoping for an alternative way, which is something other than giving if conditions to the page submission line.
Could someone pls help... thanks in advance
I would recommend that you move up to the jQuery modal dialog. It's browser-independent, and your user will understand that he is interacting with a modal dialog that must be closed before proceeding. With a separate window or tab (your current solution), it's too easy for the user to get lost and click away from the browser altogether.
I have written code like this to throw a pop up when my website is closed. But this throws the pop up even if i refresh my page. Please help me to throw popup only when i close the browser of that website. (disable popup on refreshing page)
<body onunload="javascript: exitpop()">
<script type="text/javascript">
function exitpop()
{
my_window= window.open ("","mywindow1","status=1,width=600,height=400");
my_window.document.write('<h1>My Team</h1><p>Thank you</p><p>If you accidentally closed website click here to go back to our website</p>');
}.
onUnLoad is called on a refresh because the browser is requesting a new page (well, the same page in the case of a refresh, but it is still a new call).
I am not sure if there is a way to check where the user is going next, but if there is you could compare it to their current url, if they are the same then the user is just refreshing and the script doesn't need to be run.
Good luck
Sadly, this is not possible. To the browser, it is essentially the same action.
However, if you just use a confirm() box, you can catch a user that is trying to leave without linking them back. If they are refreshing or if they really want to leave, hitting "OK" will allow that action to occur.
Let me know if you need this explained further.