I am using JQuery Ajax to post a form to a cfc.
When an error occurs, such as a duplicate post being made, then the cfc checks this and does a simple redirect. Its like this:
<cfif rsDuplicate.RecordCount GT 0>
<cflocation url="/items/new" addtoken="no">
</cfif>
When this error occurs, the redirect is going crazy and appears to send a URL to my browser which contains the HTML for an entire webpage i.e. its like this http://mysite/items/<!doctype html><html lang="en"><meta charset="utf-8">...
I can't understand why its doing this. I'm pretty certain it has something to do with me making the original call to the CFC through Ajax but if I'm asking the server to redirect me to a new page, surely it doesn't involve the client at all?
I have also included data-ajax="false"
in my form tag because I read somewhere that this may help, but it hasn't. Any ideas?