This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Correct way to implement JQuery ajax?
Correct way to implement JQuery ajax? [message #102418] Tue, 13 July 2010 13:17 Go to previous message
rob.davidson84  is currently offline rob.davidson84
Messages: 15
Registered: June 2010
Junior Member

Im no sure if the way im going about it is the right way.

Im planning on modifiying existing actions that already work in php to include ajax rather than writing a new action solely for ajax? Is this bad pratice?

I am using symfony 1.4 with doctrine.

javascript file

strData = $('#customerUpdateBarcode').serialize()+'&ajax=true';  //parses the data fields

strURL = $('#customerUpdateBarcode').attr('action'); //get the url to post data to

type: "POST",
url: strURL,
async: false,
data: strData,
success: function(msg) 
	// output the array of saved barcodes

And in the action function it will look for $_REQUEST['ajax'] and carry out a modified output (namely an array of modified barcodes and/or some with errors for user feedback)

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:session_start() failed to initialize storage module
Next Topic:symfony filters
Goto Forum:


powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software