-
target blank and jscript window.opener
hi
alright i am targeting a blank window with a link in flash. in this blank window it does not detect a window opener. when i target a blank window with this script with html it works fine. of course this problem only exists in ie6 and ie7 all other browsers are fine.
has anyone run into this? window.opener not recognizing a parent window when the child window is launched with a link in flash.
thanks
-
In the future please post some code for us to work with.
You can try:
PHP Code:
getURL("javascript: window.open('somepage.html','myWindow');","_self");
That should assign an opener to your window.
-
hi I will try that thank you, my code is just a target blank window from the flash movie. and in the new window:
Code:
function swapWin(winLink) {
if (window.opener != null && !window.opener.closed) {
window.opener.location = winLink;
window.opener.focus();
}
else {
window.open(winLink, "newWindow");
}
}
and called with
Code:
<a href="javascript:swapWin('http://www.google.com/');">link to brand site</a>
-
Using this javascript works for me:
PHP Code:
var myWindow;
function swapWin(winLink) { if (myWindow != null && !myWindow.closed) { myWindow.location = winLink; myWindow.focus(); }else{ myWindow = window.open(winLink, "newWindow"); } }
-
ya doesnt look like that worked, popped up the new window but then changed the url of the parent too and didnt work in ie, thank you for the reply though.
-
yeah that code works in every browser but ie6/7
-
Works for me in IE7, IE6, Firefox 3 and Chrome.
-
could I get a link?
mine blocks the popup with the window open method but with popups allowed it works but redirects the parent to say [object window] thanks again.
-
-
hmm here is my button code something must be off but its early and im not seeing it
Code:
test.onRelease = function() {
getURL("javascript: window.open('index2.html','newWin');","_self");
}
-
I am using my javascript function from above along with this code in flash:
PHP Code:
<a href="javascript:swapWin('http://www.google.com/');">link to brand site</a>
-
thanks again for the help so far. i dont think i was totally clear with what i was doing but i was able to use what you did to make this work so thanks.
1 more problem: the window.open function is getting trapped by a popup blocker in ie, is there a way to use the window.open function without having it stopped by a standard popup blocker?
thanks
heres the actionscript
Code:
test.onRelease = function() {
getURL("javascript:openContact();");
}
code for index landing page
Code:
<script type="text/javascript">
window.onload = function() {
var myWindow;
var winLink;
}
function openContact() {
winLink = 'index2.html';
myWindow = window.open(winLink, "newWindow");
}
</script>
code for the window.open index2.html page
Code:
<script type="text/javascript">
function swapWin(winLink) {
if (window.opener != null && !window.opener.closed) {
window.opener.location = winLink;
window.opener.focus();
}
else {
window.open(winLink, "newWindow");
}
}
</script>
and the html <a href="javascript:swapWin('http://www.google.com/');">link to brand site</a>
once that link it clicked it changes the url of the parent and refocuses the parent on top.
anyway popup blocker and window.open, any ideas?
-
There is no way around a popup blocker using the window.open method, you can however use a 'lightbox' script which will display a pseudo popup inside the same window your website is in.
Google that, will get you started.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|