Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFLOCATION Target?

Status
Not open for further replies.

metaphiz

Programmer
Jun 30, 2004
91
0
0
US
I need to redirect within the same frame of a frames page. It's a
dropdown menu that uses <CFLOCATION> to send the user to their page
of preference. However, now that I've added frames, it loads the entire
frame into the sub-frame when they redirect.

With HTML, I would just use target="_self" in the href tag. What can I do
to get a similar effect in CF?
 
Try something like this. It allows you to run a bunch of CF, then relocate if necessary, remaining in the same or parent frame. You can also append URL variables if necessary. Make sure not to create an actual function in JS, it will run when the page loads, or if you want you can put onLoad=relocateFunction() in the body tag.

<cfif whatever>
ColdFusion and HTML here


<script language="javascript">
self.location.href = 'page.htm';

or maybe:

parent.location.href = 'page.htm';

</script>

</cfif>
 
metaphiz - do you have to use frames? No designer I know has used them for the last 5-6 years.

Cheers,

Bluetone
 
To take a step back, I'm using frames as a quick way to integrate blogger.com blog functionality into my page. I used to have a custom blog that I coded, but it got spammed and I got impatient. I didn't see an easy way to integrate blogger.com right off the bat, so I came up with the frames solution. I'm open to other methods, or if you know an easy way to use blogger.com blogs on remote sites, let me know.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top