the usual culprit with page reloading on ajax request is forgetting to
prevent the default action (click/submit) of the element that triggers
ajax call. if your ajax call is part of a function bound to an
anchor's click event, or a submit type input/button element - check
that you do have e.preventDefault() in your function to cancel the
default click/submit action.

another thing i would check is to make sure your codebase is exactly
the same, including your Application.cfc/cfm contents. if you are
using Application.cfc, check if you have onRequest() method defined on
your prod server - it may interfere with remote calls to cfc's.

as Claude said, seeing the actual live page may help shed more light
on the issue...

Azadi

On Wed, Feb 22, 2012 at 06:02, Brent Shaub <[email protected]> wrote:
>
> Hello, thank you for any assistance with this puzzler.
>
> On my local Windows Vista development machine, I'm using CF 9.  Here I have a 
> JavaScript call JQuery's $.ajax() method to write some text to a database 
> using a web service in a CFC.  On my machine, it works as expected: writes 
> the values, screen stays put.
>
> On production, a leased webserver with Hostek.com, something different 
> happens.  The .ajax() call accesses the CFC which writes to the database, 
> then after about five seconds, refreshes the screen with the data passed into 
> the CFC as querystring parameters.  This page refresh is mucking up the 
> purpose of using ajax.
>
> I haven't a clue why this behavior is server-specific nor if the area of 
> research is Cold Fusion or the CF Admin settings or something else related to 
> JQuery.  I have debugging IPs turned off on both environments.  Why does an 
> ajax post turn into a get and refresh the URL after it's successful on 
> production and not development?
>
> Thanks and hope it's an easy one
> Brent
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350025
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to