Google 사이트에서 맞춤 Google 가젯을 사용하여 자바 스크립트를 사용할 수있게하려고합니다. 아래 코드를 넣었습니다. 기본적으로 게시 된 스프레드 시트에 연결되며 Google 시각화 API를 사용하여 정렬 가능하고 검색 가능한 인터페이스를 만듭니다."hl"은 Google 가젯 코드에서 delimeter 오류로 끝나야합니다.
XML 파일을 호스팅 할 자유 사이트를 모른다. 그래서 나는 같은 구글 사이트 페이지에 파일을 업로드하고 그 파일의 다운로드 링크를 가젯 추가 대화 상자의 URL로 사용했다. 다음과 같은 오류가 발생했습니다.
는 추가 한 가젯이 유효하지 않습니다
지원되지 않는 기능 : org.apache.shindig.common.xml.XmlException :로 끝나야 실체 "HL"에 참고 문헌 ';' 구분 기호. At : (34,97)
여기에서 문제를 이해할 수 없습니다. 스프레드 시트에 대한 링크를 제외하고는 코드에 엔티티 "hl"이 없습니다. 내가 아는 한 제대로 연결했습니다. . 해결 방법?
저는 HTML/Javascript가 새로 도입되었습니다. 문제에 대한 Google 검색을 수행했지만 동일한 문제를 찾을 수 없습니다. 오류가있는 다른 많은 경우에는 서버 오류가있었습니다.
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Database Search" />
<Content type="html">
<html>
<head>
<title>Example of Google Spreadsheet Data Visualisation</title>
</head>
<body>
<form id="form1" method="post" > <label>
<input id="search" name="search" type="text" />
</label>
<label>
<input type="submit" />
</label>
</form>
<p>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['table']});
</script>
<script type="text/javascript">
var visualization;
function drawVisualization() {
var query = new google.visualization.Query(
'http://spreadsheets.google.com/tq?key=0Au0WkOi_oKm0dDNwYkUxRkRqUzVKa1ZEWnFyYXpnaWc&hl=en_GB');
query.setQuery('SELECT A, B, C where upper(A) like upper("%<?php echo $search; ?>%") or upper(B) like upper("%<?php echo $search; ?>%") order by A asc label A "Type", B "Title", C "Date added"');
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
}
var data = response.getDataTable();
visualization = new google.visualization.Table(document.getElementById('table'));
visualization.draw(data, {legend: 'bottom'});
}
google.setOnLoadCallback(drawVisualization);
</script>
<div id="table"></div>
</div>
</body>
</html>
</Content>
</Module>