Solved

ColdFusion equivalent of window.top.location

Posted on 2000-05-03
10
201 Views
Last Modified: 2013-12-24
Hi,

I'm trying to get the URL of a framed page from within one of the pages inside my page, thetop navigator. However, when trying to use CGI variables such as #CGI.Path_Info#, the value returned is the path of the top navigator, not the framed page. The Javascript property window.top.location returns the correct value. However, is there any way to get the equivalent value using ColdFusion so I can get the value at the server-level?

Thanks for your help with this pressing need.

Dave
0
Comment
Question by:SenorDhuff
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 5

Expert Comment

by:nathans
ID: 2775182
I will continue looking but there is no way to get the frame location....

Nathan Stanford
Mr. ColdFusion
www.nsnd.com
ColdFusion Tips Plus
0
 
LVL 9

Expert Comment

by:Dain_Anderson
ID: 2830989
To get the top location (the page that created the frameset), you use CGI.PATH_INFO. To get the the current frame location, you use CGI.HTTP_REFERER, which will return the sub page. At all times, the CGI.PATH_INFO will return the top-most template.

Hope that helps
0
 
LVL 5

Expert Comment

by:nathans
ID: 2831485
This again is not a ColdFusion Solution!!
0
 
LVL 9

Expert Comment

by:Dain_Anderson
ID: 2831497
You're right, it's not -- there isn't a ColdFusion solution to access JavaScript's CLIENT-side document object model.
0
 
LVL 5

Expert Comment

by:nathans
ID: 2831510
Sorry, I hope I did not offend you I just thought SenorDhuff wanted a ColdFusion Solution...

Well the correct answer is

Nope, you can't do that.


I like your suggestion on getting the information tho.

Nathan
ColdFusion Tips Plus free weekly e-ZINE
www.nsnd.com
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Expert Comment

by:nrclar
ID: 2850302
Hmm, I believe there is a way to get the frames location....no matter where you are.


0
 
LVL 5

Expert Comment

by:nathans
ID: 2851302
But not a COLDFUSION way ....

There is a JavaScript way YES but not a ColdFusion way SenorDhuff was hoping ColdFusion had created a CF way to get it.

 Sorry, nope CF did not need to do that since you can get it another way.
0
 

Expert Comment

by:nrclar
ID: 2852074
Nathans, Ok..as a teaser .... explain, your reasoning behind the fact CF cannot resolve a frame location by CF alone? [using a **certain** methodology.........]

?

N

0
 

Expert Comment

by:duderstadt
ID: 2893267
While there is no direct way to access the equivalent value of window.top.location in CFML (there isn't one), a quick and easy work-around is available...

In your frameset code, you can add the following hack:

<cfoutput>
<!-- framset... -->
<frame name="myFrame" src="myPage.cfm?topLocation=#CGI.SCRIPT_NAME#">
<!-- more header code -->
</cfoutput>

Or anything similar (forms, etc.)

This might be an ugly hack... but the user will never see it unless they open one of your frames in a new window. (And there are several ways to stop that evil act).

Jim
0
 
LVL 5

Accepted Solution

by:
nathans earned 150 total points
ID: 3527273
Your Question:

I'm trying to get the URL of a framed page from within one of the pages inside my page, thetop navigator. However, when trying to use CGI variables such as #CGI.Path_Info#, the value returned is the path of the top navigator, not the framed page.

The Javascript property window.top.location returns the correct value.

> Yes, JavaScript can do this.


However, is there any way to get the equivalent value using ColdFusion so I can get the value at the server-level?

> The Answer is NO.  There is no way to get any equivalent value useing ColdFusion.

=======================================
Teaser there is NO CF Variable, or even for that matter no CGI Variable that will tell us where the Page Location inside a Frame is.
=======================================

If someone can prove me wrong using HTML, and ColdFusion ONLY.  Then I will give them 100 Points of my own with a grade of an 'A'

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now