내가 JSON과 PHP 파일에서 URL을 검색하고있어, 다음 성공 부분에 내가JSON
window.location=msg.message
할 수 있지만, proble 우리가 생각하면 내 도메인이 있다는 것입니다으로 다른 도메인으로 자바 스크립트로 리디렉션 HTTP example.com과 msg.message
값이 리디렉션 HTTP로 이루어집니다
https://otherdomain.com
입니다 : /example.com/https는 : /otherdomain.com 코드 : /otherdomain.com 는 어떻게 HTTPS로 바로 이동할 수 있습니다
$.ajax({
type: "POST",
url: "ajax.php",
data: dataString,
dataType: "json",
success: function (msg){
$.fn.colorbox.close();//close the box
alert(decodeURI(msg.message));//
window.location.href(msg.message); // goes to domain.com/msg.message
},
});
그게 옳은 것처럼 보이지 않는데, 여기는 바이올린입니다. http://jsfiddle.net/f5mWV/1/ (jsfiddle에서 iframe을 사용하기 때문에'window.top' 사용) 더 많은 코드를 게시 할 수 있습니까? –
'https :/otherdomain.com'은'https : // otherdomain.com'이어야합니다. – Musa
나는 해결책을 찾지 못했습니다. 문제는 json_encode이며 // 및 :를 % 2F % 2F 및 % 3A로 인코딩합니다. 올바른 URL을 검색하려면 어떻게합니까? –