Ticket #89 (closed enhancement: fixed)
Add javascript support for <relocate/> tag
| Reported by: | mike@… | Owned by: | scorfield |
|---|---|---|---|
| Type: | enhancement | Priority: | normal |
| Milestone: | Fusebox 5.1 | Component: | Miscellaneous |
| Version: | 5.0 | Severity: | normal |
| Keywords: | Cc: |
Description
In PHP there's a provision set up in the <relocate/> tag that tests for the existence of any http headers sent to the browser. If there are any it automatically switches from a header-based Location: call to a block of javascript code instead. This makes <relocate/> safe to use in a fuseaction where the current fuseaction is no longer considered a "virtual" page.
Here's a rough draft on what the code generated in the parsed fuseaction might look like for this:
<cfset fb_.httpreq = GetHTTPRequestData()>
<cfif not StructKeyExists(fb_.httpreq,'headers') or not IsArray(fb_.httpreq.headers) or ArrayLen(fb_.httpreq.headers) eq 0>
<cflocation url="#fb_verbInfo.attributes.url#" addtoken="#fb_verbInfo.attributes.addtoken#">
<cfelse>
<cfoutput><script type="text/javascript">( document.location.replace ) ? document.location.replace("#fb_verbInfo.attributes.url#") : document.location.href = "#fb_.verbInfo.attributes.url#";</script></cfoutput>
</cfif>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
