Click to See Complete Forum and Search --> : Targeting a frame


Digital Pimp
01-13-2006, 09:42 AM
Hi

I need to set a PayPal auto return page to a page within a frameset (mainFrame). Can anyone tell me how to include this in a URL. I seem to remember it being something like...

http://www.whatever.com/some.htm?target=_mainFrame

or something. Does this look right?

TIA

Russ

LiLcRaZyFuZzY
01-13-2006, 09:53 AM
<a href="http://whatever.com" target="mainFrame">http://whatever.com</a>


don't forget to set your doctype to frameset
or to add a frameset doctype if your don't have any
http://www.w3.org/QA/2002/04/valid-dtd-list.html

Digital Pimp
01-13-2006, 10:02 AM
Thanks LiLcRaZyFuZzY

I know this method but I did't make myself clear. In Paypal you can set a return URL once a customer has made a purchase. You must enter the URL in a text field which doesn't give me the choice of a destination frame...only a URL (http://www.whatever.co.uk/success.htm). I want it to return the customer to the success page WITHIN the frameset.

thanks anyway

Russ

jalarie
01-13-2006, 10:05 AM
You could even shorten it to:

http://www.whatever.com/some.htm?mainFrame

Within the "some.htm" page, use 'onload="ReFrame();"' on the main frameset tag to set off the "ReFrame" function. Include a default "src" for the target frame just in case the user doesn't have Javascript. The function could look like this:

function ReFrame() {
Par=document.location.search.substring(1); // get the page name
window.frames['target_frame_name'].location=Par;
}

LiLcRaZyFuZzY
01-13-2006, 10:11 AM
ok, you might have to use a server side language for this
even better, you could use server-side include and drop the frames

Digital Pimp
01-13-2006, 10:38 AM
Thanks all

Will try the Javascript solution Jalarie.

Thanks again LiLcRaZyFuZzY but the frame is there because there is a music player in it. Frames is the only way to have the music playing without being interupted other than opening more browser windows or using popups.

cheers

Russ :¬)