I'm using a colorbox to create a popup window that displays some dynamic content (using Coldfusion).
I would like to refresh this data, based on some selections by the user within the window.
Within my colorbox window I'm trying this:
<a id="selectLink" class='ajax' href="index.cfm?event=abc&sort=123" onclick="$.colorbox.close();">
This unfortunately only closes the current colorbox window, then directs the browser to a regular window.
Any ideas?
Related
I would like to know how can i refresh/reload parent window from an iframe on submit without closing the frame using javascript / jquery.
Parent window contains Display table and Button that opens an Iframe.
Iframe contains a form which on submit saves data in the table which is displayed on parent window.
At present data is not displayed until i refresh the page manually.
please Suggest me a method to do so.
This is the scenario
main window has a buttton called form ,
on clicking it an Iframe Opens ,
Iframe has a Form which on submit saves data,
this data is displayed in a table on the main window.
But when I do submit data is saved but not displayed.
I want a method so that My Main window is refreshed / reloaded without having to close the Iframe and refreshing it manually
Please suggest a solution to this problem ...don't offer any other method..
This thing is Not Possible Parent window cannot be refreshed keeping open the I-frame
I want to use jQuery Dialog to display popup through an iframe. However when using it, the overlay and dialog is only displayed inside the iframe not on the parent.
I have checked out this question but that solution will work if I have access to the code of parent page that contains my iframe but in my scenario I don't have access to the pages that will use my page as iframe. How can I display Dialog in parent page?
I have a modal window which is loading an external HTML page. I am trying to figure out how to close this modal window after the content has been loaded. Since this is an external page I will not be able to change this content so I'm guessing that I need to put an event listener on the parent page that can detect when the modal window content has been loaded?
Any help would be greatly appreciated.
Are you using .load() to load the external HTML page? If so, you can put a callback function in the load() function. Like this:
$('#someDiv').load(function(){
//Put code to close the modal
});
JS:
To call a method in the parent window from the modal:
window.opener.document.globalMethodInOpeningFile(param1, param2);
To close the modal window, call this once content is loaded (you can use .load(callbackFn) to check for load`):
window.close();
If you're opening this modal page with window.showModalDialog() then you can't. As its own name indicates, it opens a modal window. Execution of javascript in your main (opener) page will be suspended until the modal closes (because modal dialogs can return values, so the caller must wait for the dialog to close before continuing). As the page you're opening is an external page (I assume in another domain), the only way for it to close, is that the user closes it.
If this is not acceptable, then you need to use window.open or an HTML modal window like the ones jQuery UI offers.
I'm assuming you are using Joomla's core modal feature. Another assumption is the controlling logic is located inside the modal window. Which is why the answer isn't as straight forward as it could be because I'm unsure of the workflow which opens the external HTML page you wish to fire the event after. However, after the logic which opens the external HTML page has fired, you can use the following JavaScript embedded inside your modal window's rendered HTML to close the modal window:
window.parent.SqueezeBox.close();
I have a problem with js popup window.
I open a popup and try to access its elements in another page page, no success, and I don't want to reload the popup source, I simply want access a element of the opened popup
Ex -
1st page - opened popup with html5 music player
2nd page - need to pause the music when user click on button on main page
1st page
var popup = window.open("test.html","mypopup","width=500,height=300");
2nd page I want to access mypopup windows elements without reloading the popup
I only need the way how to access opened popup elements without interrupting its sources using JS or JQuery
Same origin (domain, port and protocol)?
Plain JS:
from page1
var popup = window.open("test.html","mypopup","width=500,height=300");
popup.document.getElementById("player").someFunction();
from page 2
var popup = window.open('','mypopup');
// now popup is known again
popup.document.getElementById("player").someFunction();
This is a tricky one. I have a link on my page that opens a Colorbox iframe to an external website. The external website contains links to another page. When the user clicks those links, I need them to load up in the same iframe.
The problem is, the link on that external site is set to open a new window with target="_blank". Therefore, instead of this page loading within the same colorbox iframe like I need it to, it opens a totally new window.
Is there any way to bypass it so that these links within the iframe do not open a new window, and instead load that window within the same colorbox iframe?
Thanks in advance!
_blank will always open a new window, you could try _TOP instead, it should work something like this;
<a onclick="parent.$.fn.colorbox.close();" href="NEW SITE" target="_top">
open in parent window with animation
</a>
Do you control the document that is being displayed in the iframe? If so you could handle things a little differently so that you only opened new windows if the document isn't being displayed in an iframe. But if the document you are iframing isn't under your control then I don't think there is anything you can do about it.