alena1347 Posted March 26, 2013 Share Posted March 26, 2013 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'}); } }); } Quote Link to comment https://forums.phpfreaks.com/topic/276164-jquery-ajax-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.