I have some code that runs and does an XML request to a web service. This web service then returns a url. I need to take the user to that url.
At the moment the url is opening in an iframe, which was fine. However changes are being made to the site and it now needs to open in a new tab. I have seen a few javascript examples of how to open a url in a new tab, but all of them require an onclick
event. Also, my javascript skills are very limited. Is there any code I could use to open the url , returned by the webservice. in a new tab without having to use a click event?
At the moment this is my code inside of the iframe. I know that the iframe would have to be removed and other changes will be made. I just want to give you an idea of how the webservice is called etc.
<cftry>
<cfinclude template="webservices/travelit_request.cfm">
<cfset mynewURL = "#XML_URL#">
<cfset mynewURL &= "&adref=0">
<cflocation url="#mynewURL#" addtoken="false">
<cfcatch type="any"><h1>Your request was cancelled. Please retry.</h1></cfcatch>
</Cftry>