Jump to content

jquery ajax problem


alena1347

Recommended Posts

I have a function called after some data and the function is given below:-

now the problem here is that at the #vote replace the color of the text is not assigned as it should be from where it is loaded I.e it is not red and not as the font size it should be. sorry this could be simple but not getting it.

 

I have also tried to give .css to vote but it is still not applying that

 

 

 

function attach()

{

var id="<?php echo $_REQUEST['id'];?>";

 

var state="<?php echo $_REQUEST['state'];?>";

 

$.ajax({

url: "petition_details.php",

data: {id:id,state:state}

}).done(function(result){

$("#spprt").replaceWith($(result).find("#spprt").html());

$("#vote").replaceWith($(result).find("#vote").html());               //The problem is here

$("input[type=text]").val("");

$("textarea").val("");

if($("#ttt").text()=="You supported it before")

{

$('#ttt').css({'background-color':'#FFCC00','font-size':'16px','border-style':'none'});

}

else if($("#ttt").text()=="Thank you for your VOTE")

{

$('#ttt').css({'background-color':'#00FF00','font-size':'16px','border-style':'none'});

}

});

}
Link to comment
https://forums.phpfreaks.com/topic/276164-jquery-ajax-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.