프로젝트에 YQL을 처음 사용하기 때문에 바보 같은 오류가 발생하는 경우 사과드립니다.Google 드라이브를 쿼리 할 때 YQL이 콜백 함수를 호출하지 않습니다.
저는 공개적으로 볼 수있는 Google 드라이브 폴더의 콘텐츠 목록을 가져 오기 위해 YQL을 사용하려고합니다. Google 드라이브 폴더는 자바 스크립트를 통해 조작 할 수 있습니다. 나는 야후의 example code에 자바 스크립트를 아주 가깝게두고 있지만 내 코드는 작동하지 않는다. (나는 실제 예제를 얻었습니다.) YQL이 콜백 함수를 트리거하지도 않는 것처럼 보입니다.하지만 계속 진행되는 것을 디버깅하는 방법이 확실하지 않습니다.
Here's my query (작동하는 것으로 보이는 YQL 콘솔) 당신은 당신의 코드에서이 작은 오류가
<!DOCTYPE html>
<html>
<head>
<title>
Test
</title>
<script type="text/javascript">
//Parses returned response
function specialhelper (yqlQuery) {
//Attenpt to see if function is even being called
document.getElementById("yes").innerHTML = "Yes!"
var items = yqlQuery.query.results.a;
var output = "";
var no_items=items.length;
for(var i=0;i<no_items;i++){
var iHref = contents[i].href;
var iContent = contents[i].content;
output += "<p><b>" + iContent + "</b> " + iHref + "</p>"
}
// Place output in div tag
document.getElementById('results').innerHTML = output;
}
</script>
</head>
<body>
<p id="yes">No</p>
<!-- Div tag for results -->
<div id='results'></div>
<!-- The YQL statment will be assigned to src. -->
<script src="https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22https%3A%2F%2Fgoogledrive.com%2Fhost%2F0B-3jydFVOQDnLUM5QmM3c0Vfa3M%2F%22%20and%20xpath%3D'%2F%2Fdiv%5B%40class%3D%22folder-cell%22%5D%2Fa'&format=json&callback=specialhelper">
</body>