Solved

ColdFusion equivalent of window.top.location

Posted on 2000-05-03
10
203 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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
 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

777 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