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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.