本文介绍了使用 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!