0
이것은 내 자바 스크립트 코드입니다.아약스의 javascript 변수
$(\"img.agree\").click(function()
{
var follow_id = $(this).attr(\"id\");
var user_id = $(\"img.user_id\").attr(\"id\");
$.ajax({
type: \"POST\",
url: \"/sys/follow.php\",
data: { 'follow_id': + follow_id, 'user_id': + user_id },
success: function(html){}
});
$(\"img.agree\"+follow_id).hide();
$(\"img.notagree\"+follow_id).css('display','inline-block');
});
$(\"img.notagree\").click(function()
{
var follow_id = $(this).attr(\"id\");
var user_id = $(\"img.user_id\").attr(\"id\");
$.ajax({
type: \"POST\",
url: \"/sys/dontfollow.php\",
data: { 'follow_id': + follow_id, 'user_id': + user_id },
success: function(html){}
});
$(\"img.notagree\"+follow_id).hide();
$(\"img.agree\"+follow_id).css('display','inline-block');
});
나는 모든 IMG 태그의 수와 같은 요청을 보낼 수 없습니다 아약스 요청 하나 특정 일 또는 클래스 = 'notagree의 $ 문자열' '$ 문자열을 동의'= 수업 후 고유 한 문자열을 사용합니다. 그러나 그것은 작동하지 않을 것이다. 내가 생각하는 문제는 + follow_id 또는 이와 비슷한 것이다.
당신이 무엇을하고 있는지 이해하기 위해 여기에 충분한 정보가되지 않습니다 PHP에서이 제거 옹호 :
대응 JS는 것이다. 이 자바 스크립트를 출력하는 PHP 코드를 게시하여 완전한 컨텍스트를 볼 수 있습니다. –
따옴표를 왜 이스케이프하고 있습니까? – Blowsie
무엇이 문제입니까? – pankar