solution for popup page as modal - javascript

I was using window.showModalDialog() but doesn't work on all browsers.
People recommends me jquery, thickbox and also this contact Example
but the problem is when i submit the page, server will send me another page, and that page will replace my original page!
so actually it doesn't fulfill my requirement.
My requirement is on button click modal page should open and it can redirect to other page on same window without disturbing my original page and when I close My original page get reflections.
So is it possible?

Sounds like you need a simple html target="_blank" in the link to the other page.
http://www.htmlcodetutorial.com/linking/_A_TARGET_95y98y108y97y110y107y.html

Related

Click a link and stay on the same page

I am trying to navigate to another HTML file without changing pages. Basically I got an emergency button, and once clicked, it should open an HTML file which pops up a box displaying 3 other buttons. This box also has an "X" to close the window, to close this HTML file and go back to the other.
Basically I want 2 html files to display at the same time. I am currently using adobe edge animate to do the process, however I am capable to use Javascript and HTML.
To give you an idea: It is similar to when visiting a website and a box pops up asking you if you want to subscribe to the news letter, or just keep searching.
Thanks
Well. what i understand of your question. You want an html page on an html page. I suggest you could use JQuery popup screen. Visit this link. https://jqueryui.com/dialog/
If you want to call another html page without refreshing your page use Jquery .load(). http://api.jquery.com/load/
$( "#div_to_load_file_in" ).load( "path/to/your/file.html" );

Making a div appear on button click (PHP)

I am a first poster here so please excuse my noob-like behavior.
I have a button on my website that when pressed should disappear, and a form should be echoed out in its place without a page refresh.
I have easily achieved this with JavaScript / AJAX, but if JavaScript is disabled, I still want the button to do it's task.
My question is: Can I do this only using PHP, WITHOUT a page refresh?
Cannot comment or I would have but the answer would be no. PHP is server side so the only way for it to update a view is to reload to a new page. Also, I would think it is very unlikely to run into a situation where JS is disabled these days.
Not in a way I think you'd want to do it, but you could use an iframe that contains the button. The button would be a link or form submit and the navigation would happen inside the iframe to your form. This way, only the iframe is refreshed, but the full page remains unchanged.
You can only aciehcve this using ajax. You can force your users to enable
javascript noscript tags
<noscript>
<p>This page requires a JavaScript-enabled browser.</p>
</noscript>

How to use an external jsp file as a overlay

I have to popup an external jsp page as a popup when i click on hyperlink. And also I have to submit this page after performing some field validation. It is possible while using iframe. But it takes time to load the page.
For example I have one link registerNow, after click on this link I have to show registration page as a overlay. And then after performing some field validations I have to submit the page. At that time the url of the application should not changed.
Use any modal popup scripts.
You may consider any of this
1) jQuery UI dialog ( http://jqueryui.com/demos/dialog/ )
2) jqModal ( http://dev.iceburg.net/jquery/jqModal/)
2) Fancybox
and a lot more...
I follow the below link to achieve my requirement http://jquerytools.org/demos/overlay/external.html

Facebook - Reload iframe without show confirm diaglog

I want to reload my webpage in an iframe (location.reload();) but Facebook always show a confirm dialog. I want to prevent this dialog from showing. Thank you.
You need to first redirect the user to any page via GET. That is a safety mechanism implemented into the browser and can not be disabled via JS.
I now use parent.location.href instead of location.reload();

The Facebook footer bar is an iframe, so why it doesn't it reload with the rest of the page?

I want to know how Facebook is doing their iframe footer bar. I mean, i know they have an iframe on footer, but i want to know how they are reloading pages without reloading the iframe also, 'cause the iframe always stick there even though the page does reload again. Any ideas/knowledge?
EDITED:
Try clicking on a link which is different section and it changes the url and so far i know, if you try to change the URL, then the page will reload again. Also, try using Facebook on Chrome: you will see it reloads on every new page. It's not AJAX, because the URL wouldn't change if it was AJAX (do little research on URL changing, you will know).
Well, powtac pretty much gave you the answer: Facebook doesn't reload the whole page when you click a link, it requests the new content via XMLHttpRequest and refreshes only those portions of the page that change.
It's pretty slick about this: a naive implementation might not use real links at all, thus preventing you from opening, say, a different Facebook tab in a separate browser tab.
This technique - intercepting link navigation - also allows Facebook to use custom prompts when you try to navigate away without saving, and re-write paths as fragments, allowing it to track the current location in the URL without reloading the page.
FWIW, this question has already been asked and answered - see: How are the facebook chat windows implemented?

Categories