Jump to content


Photo

self.close firefox


  • Please log in to reply
24 replies to this topic

#1 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 01:05 AM

Right, Take a look at this link

<A href=http://www.google.com target=iframe "OnClick=javascript: self.close()"><b><u>Close this window</u></b></a>

That link is in a popup, when someone clicks the link it will load google in the iframe window and close the window

This works fine in IE, however, in firefox, after clicking the link the window closes but google.com does not load in iframe

Obviously a cross browser issue

But, is their a way around this or an alternitive to achieve the same aspect

Thanks
I would love to change the world, but they won't give me the source code

SEO Agency

#2 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 10:39 AM

Link ammended: oops
I would love to change the world, but they won't give me the source code

SEO Agency

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 October 2006 - 03:54 PM

And does it work without the target?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 03:59 PM

It needs the target though, as its loading the website inside an iframe
I would love to change the world, but they won't give me the source code

SEO Agency

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 October 2006 - 05:01 PM

I understand, I'm just trying to narrow down the problem.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#6 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 06:49 PM

Just imagine a webpage with an iframe on it

You click a link from within that webpage and that brings up a popup

In that popup you have a link with a target to the iframe name, and on clicking that link it also uses an OnClick handler to initiate self.close

It works 100% in IE. In firefox the popup closes but the request is not sent to the target
I would love to change the world, but they won't give me the source code

SEO Agency

#7 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 October 2006 - 07:30 PM

Is it sent anywhere? Does it load in the parent window?  Sounds like FF doesn't know where to find the target frame.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#8 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 10:01 PM

Its not sent anywhere, it just doesnt load
I would love to change the world, but they won't give me the source code

SEO Agency

#9 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 10 October 2006 - 10:14 PM

So the HREF doesn't work at all... I'm confused.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#10 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 10:23 PM

<a href='searchresults.php' target='artistnalbums' OnClick="javascript: self.close()"><b><u>Load results in main site</u></b></a>

That works in IE, loads the searchresults.php in artistnalbums iframe and closes the window popup

In firefox it just closes the window popup
I would love to change the world, but they won't give me the source code

SEO Agency

#11 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 10 October 2006 - 10:27 PM

I think firefox cant pickup the iframe name because its in a popup

I was thinking about using window.location

window.artistnalbums.location

But it cant find that either, so how could i add in the _parent so it knows to look for the main page with the iframe on. Maybe like

window.parent.artistnalbums.location (not sure of syntax)
I would love to change the world, but they won't give me the source code

SEO Agency

#12 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 11 October 2006 - 11:32 AM

Any ideas?
I would love to change the world, but they won't give me the source code

SEO Agency

#13 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 11 October 2006 - 10:57 PM

window.parent sounds reasonable... you'll have to see how FF responds.  Try making sure these objects exist as you move down the chain.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#14 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 12 October 2006 - 02:06 AM

Ive tried that, it doesnt work. I do recall it saying something about object non existant

I had

window.parent.songs.location
I would love to change the world, but they won't give me the source code

SEO Agency

#15 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 12 October 2006 - 03:34 PM

Well, post the code or a link to it, and I'll see what I can reproduce on my end.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#16 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 12 October 2006 - 09:56 PM

Here is the link code

<a href='searchresults.php?viewresults=yes&criteria=g&searchby=SONGNAME' target='songs' OnClick="javascript: self.close()"><b><u>Load results in main site</u></b></a>

That code is inside of popup that was loaded from the parent site. The target 'songs' it is referring to is an iframe that is nested in the parent site
I would love to change the world, but they won't give me the source code

SEO Agency

#17 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 12 October 2006 - 11:00 PM

I understand that... but I can't do anything with just one line of HTML.  I'll need you to make a mock-up of the parent & child windows/frames.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#18 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 14 October 2006 - 12:17 AM

paste this into a file called 'mainsite.htm'

<html>
<head>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function audiosearch(url)
{
	newwindow=window.open(url,'name','height=106,width=378');
	if (window.focus) {newwindow.focus()}
	return false;
}

// -->
</SCRIPT>
</head>
<body>

<a href=# Onclick="javascript:audiosearch('search.htm')"><u>Search</u></a>
<BR><BR>

<iframe src=http://google.co.uk height=400 width=600 name='framer'></iframe>

</body>
</html>

And this into a file called 'search.htm'

<a href='http://yahoo.com' target='framer' OnClick="javascript: self.close()"><b><u>Load and close</u></b></a>

I would love to change the world, but they won't give me the source code

SEO Agency

#19 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 15 October 2006 - 11:44 PM

Any ideas
I would love to change the world, but they won't give me the source code

SEO Agency

#20 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 16 October 2006 - 12:29 AM

Interesting... it looks like the onclick happens before the href, so self.close() closes the pop-up window without executing the href.  If you were to remove the onclick handerl, you'd see that everyone was OK.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users