2014-12-11 2 views
0

어떻게 쿼리 문자열로 proj JSON 콜백을 추가 할 수 있습니까?Jquery JSON 반환 쿼리 문자열에

success: function(response){ 
     window.proj = '?proj='+response.proj; 
     alert(proj); 
} 

그것은 필요 오른쪽

<button type="button" onClick="parent.location='export.php'">Submit</button> 

export.php?proj=project-name이 가능 있을까 후 삽입 할거야?

답변

0

decodeURIComponent 함수는 주어진 문자열에서 이스케이프 시퀀스를 검색하여 실제 문자로 바꿉니다.

success: function(response){ 
     window.proj = '?proj='+response.proj; 
     //If data is your object with key value pair of names and values 
     var data = { first_parameter: 'first', second_parameter: 'second' }; 
     var queryStringparams = decodeURIComponent($.param(data)); 
     //End 
     alert(proj); 
}