이 질문에 대한 답은 간단 할 수도 있지만, 소년은 내가 멍청이 에 수고를했습니다! 어떤 도움을 주시면 감사하겠습니다. 우리는 페이스 북의 애플 모든 좋은 설정하고 우리의 행동과 객체는 작은 자바 스크립트와 함께 잘 작동합니다. 그러나 ... 나는 행동을 유발하는 자바 스크립트의 경고 대화 상자에서 을 제거하여 사이트 전체의 흐름을 간소화하고 싶습니다.Facebook API 스크립트에서 IF/ELSE 단순화하기
이것은 우리가 (어떤 작품) 지금 가지고 무엇을 : 그가 작동하도록되어 방법
<script type="text/javascript">
function postResonate_with_cambodia()
{
FB.api('/me/onemandala:resonate_with' +
'?intention=http://1mandala.org/1action-002','post ',
function(response) {
if (!response || response.error) {
if (confirm('You are not yet signed up for 1Mandala. 1Mandala uses Facebook Connect to showcase the amazing 1Actions folks are taking on our platform. We will redirect you now to the signup page...')) { window.location.href='http://www.1mandala.org/app-signup ' } else { void('') };;
} else {
if (confirm('You are resonating with the intention for 1SewingKit Cambodian Orphanage Empowerment. We will take you now to the project page to take action...')) { window.location.href='http://1mandala.org/1action-002 ' } else { void('') };;
}
});
}
</script>
대화는 꽤 명확하게해야한다. 하지만 그 대화가 아니라면 스크립트는 방문자를 직접 Facebook 가입 대화 상자로 보냈습니다. 아니면 방문 페이지로 보냈습니까? 여기 내 시도가 작동하지 않습니다. 어떤 제안이 주시면 감사하겠습니다 :-(. 간단
<script type="text/javascript">
function postResonate_with_cambodia()
{
FB.api('/me/onemandala:resonate_with' +
'?intention=http://1mandala.org/1action-002','post',
function(response) {
if (!response || response.error)
{window.location.href='http://www.sign-up-page.com' } ;
} else {
{ window.location.href='http://1mandala.org/app-1action-002' } ;
}
});
}
</script>
"작동하지 않음"을 정의하십시오. 그것은 무엇을합니까? 오류가 있습니까? 브라우저의 콘솔을 확인하고 있습니까? – deceze
고마워, 좋은 질문. Firefox 디버거에서 얻은 오류는 "ReferenceError : postResonate_with_cambodia가 @ http://1mandala.org/app:1에 정의되지 않았습니다." – russs