View Full Version : Replace content instead of show/hide

06-12-2011, 08:53 PM
Can anyone tell me how I can change the code below so that instead of all the fade in fade out stuff the function will actually replace whatever is inside a div called Myholder with the response this script pulls in?

Here's the code I need to change.

<script type="text/javascript">
$(document).ready(function() {
$.get("func.php", {
func: "drop_1",
drop_var: $('#drop_1').val()
}, function(response){
setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400);
return false;

function finishAjax(id, response) {

drop_1 is the name of a drop down which when changed runs this script which brings back a second dropdown with data relating to the first one.

If I need to post more info to get some help with this please let me know.

Thanks in advance.

06-12-2011, 10:02 PM
Assuming 'Myholder' is the id for the div

function finishAjax(id, response) {


You could strip out other stuff you don't need (including the id parameter).

06-12-2011, 10:25 PM
Thanks so much for the help with that it works perfectly now. Don't suppose you could help me with a checkbox issue I'm having aswel could you?