> Is there any way to get cflocation to open a new window?

> Trying to do something like the below, but open a new
> window...

>   <cfcase VALUE="1">
>     <cflocation url=""> >   </cfcase>

No, because cflocation works by setting an http header on the page,
there's no interraction with surrounding windows in the browser or
DOM. So as far as the command is concerned, there are no other windows
to locate. There is a _javascript_ command which is functionally the
same as cflocation (meaning that it replaces the current page in the
browser's history, thus preserving the functionality of the back
button). It's called location.replace() and you can cal this on any
window, i.e.

<cfoutput>
  <script language="_javascript_">
    top.location.replace("myurl.cfm?id=#newsletterID#");
  </script>
</cfoutput>

When using the onTap framework I have a function which creates this
string js output I use this for all my redirection for a number of
reasons -- there is no potential conflict with cfflush (cflocation can
cause an error if performed after a cfflush tag), it can relocate
other frames, and it's a string value, so it can be embedded in the
content and then subsequently manipulated like any other string value,
as opposed to cflocation where only the address can be manipulated and
only before the tag. Of course, since it's _javascript_ it simply won't
do anything if the visitor has turned of the scripting feature in
their browser, but all the browsers that I've found that support
scripting do support the function.

s. isaac dealey     954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to