I've you tried something similar to this?
in your js file (call using url your controller, don't forget the
format=json param
================
$.ajax({
type: "POST",
url: getRootPath() + "members/invitefriends?format=json&message=" + message,
dataType: "json",
async: false,
success: function(response){
if (response == "success"){
$( "#invite_friends" ).dialog( "close" );
$('#message_container').addClass("guest_message").html("Thanks
for sharing " + name);
$('#container_aboutus_form').hide();
}
}
});
Then in your controller:
====================
<cffunction name="invitefriends" hint="Send email to invited friends">
<cfset provides("json")>
do some stuff here
<cfset renderWith("success")>
</cffunction>
I return "success" in that case and then in my js success function I
verify its success and do some other stuff
Hope this help.
> --
> You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
> To post to this group, send email to cfwh...@googlegroups.com.
> To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.
>
--
Yannick Morin
Founder of bizonbytes.com
function create() {assetCategory = model("assetCategory").new(assetId=params.assetKey, category=params.category);if (assetCategory.save()) {if (isAjax()) {ajaxResponse = {"ajaxResponse"=true,"dataRefreshUrl"=urlFor(route="assetAssetCategories", assetKey=params.assetKey, action="checkBoxes"),"dataRefreshContainerId"="category-check-boxes-list"};renderWith(ajaxResponse);}else {flashInsert(success="The category was created successfully.");redirectTo(route="assets", action="edit", key=params.assetKey);}}else {$setAsset();category = assetCategory.category;flashInsert(error="There was an error saving the category. Review the highlighted fields below and try again.");renderPage(action="new");}}
--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.
> ...
>
> read more »
--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.
> ...
>
> read more »
--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.