使用CFLocation - CF9重定向到新选项卡 [英] Redirect to a new tab using CFLocation - CF9
本文介绍了使用CFLocation - CF9重定向到新选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法通过使用CFLocation将用户重定向到一个新窗口?据我所知,你不能在CFLocation中使用 target = _blank
。还有另一种方法吗?
Is there a way to redirect a user to a new window by using CFLocation? As far as I know you cannot use target=_blank
in CFLocation. Is there another way to do it?
这是我的代码:
<cfif cgi.PATH_INFO eq "/procedure-page.cfm">
<cflocation url="http://www.example.com/example/example.cfm?id=XXXXXX&contactid=#returnStruct.contactID#&doctorid=#officeLocation#" addtoken="no" >
<cfelse>
<cflocation url="http://www.example.com/example/example.cfm?id=#example#&contactid=#returnStruct.contactID#&doctorid=#officeLocation#" addtoken="no" >
</cfif>
推荐答案
这可能不是最干净的方法,工作。
This is probably not the cleanest way, but it should work.
<cfoutput>
<cfif cgi.PATH_INFO eq "/procedure-page.cfm">
<script type="text/javascript">
window.open("http://www.example.com/example/example.cfm?id=XXXXXX&contactid=#returnStruct.contactID#&doctorid=#officeLocation#", '_blank');
</script>
<cfelse>
<script type="text/javascript">
window.open("http://www.example.com/example/example.cfm?id=#example#&contactid=#returnStruct.contactID#&doctorid=#officeLocation#", '_blank');
</script>
</cfif>
</cfoutput>
这篇关于使用CFLocation - CF9重定向到新选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文