Javascript window.open() with php code (true popup) - javascript

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';

Related

How do I open a link to a website on a new window in a browser and block the current website until the user finish or close the new one?

Currently I'm working with Mercado Pago API, but the thing is that I want when the user clicks the pay button, I want to open a new window in the browser (chrome, firefox, etc.) in the middle of the screen where is going to fill his credit card number and all that stuff meanwhile i want that the background site (I mean the main site where the user clicked on pay) to be blocked, like with darker colors, and not be able to do anything in that site until the user close the new window or he finish with the payment. I've been looking on the internet but I haven't found anything related to the blocked site. Maybe you could help me or have any idea to make that. thanks in advance.
I can't make comments, so sorry in advance for this being an "answer". But are you not able to store information about what the user has selected and then use the current page to process the payment, then bring back or send off what they wanted? perhaps using AJAX to run a PHP page that stores something. Just a suggestion but not entirely an answer, because AFAIK you can't "block" tabs as that could be very dangerous and could be used for the wrong reasons.
The task you want to do requires both back-end programming (php/server-side) and a bit of front-end jquery(js) + ajax.
For front-end something like this could be your start.
Bootstrap Static Modal Example.
And you would need to put your form there, submit it via ajax, and on success close the modal.
I hope this could help you a bit, and get you started in the right direction.
Note: This is not particularly safe. (It's not hard to hide the modal and fiddle around the page in the background.

Jquery mobile popup refresh page after the second one

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.

Javascript reload page after popup submit Coldfusion

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.

Pop-up/modal dilemma

I'm stuck in a problem that on first glance seems simple, but actually it's a bit hard to fix. I have a share button on my colorbox and when a user clicks it I want to open a pop-up with the social media link. Now I tried a few simple pop-ups but a lot of the blockers are disabling them and it's not an option to force the users to disable their software.
Can anyone offer suggestions?
You can try to replace your popup with iframe integrated into your page. Place it to the center of the page, hide it initially. And on user click set iframe's src to the url which you open in popup now and show iframe.
Off the top of my head, I'd suggest some sort of modal, jqModal is pretty popular and my preferred way of doing things. Do you have any code that you could share?

how to open a facebook login page in a iframe insted of popup

I am using facebook login button in website. when i clicked on that it opens a popup. insted of popup i want to open that in a iframe. is there any way to do that using javascript.
plz help me.
thanks in advance.
Show some of your code. Is the code that opens the popup yours or included from some other site? If it's not your own code and it uses window.open, there's nothing much you can do.
If it's your code, use something like this onClick: document.getElementByID('iFrameID').src=url;
Keep in mind that if the facebook-login (which will be an external page) expects to be running in a popup window could execute window.close to return to your page, which may cause problems if you're using an iFrame.

Categories

Resources