아무튼
아까는 직접 <바디> 안에 <스크립트>를 넣었었는데요..
<헤드>에
var list= new Array()
list[list.length]='http://www.blankcoffee.com/images/0.png';
list[list.length]='http://www.blankcoffee.com/images/1.png';
list[list.length]='http://www.blankcoffee.com/images/2.png';
list[list.length]='http://www.blankcoffee.com/images/3.png';
list[list.length]='http://www.blankcoffee.com/images/4.png';
list[list.length]='http://www.blankcoffee.com/images/5.png';
list[list.length]='http://www.blankcoffee.com/images/6.png';
list[list.length]='http://www.blankcoffee.com/images/7.png';
list[list.length]='http://www.blankcoffee.com/images/8.png';
list[list.length]='http://www.blankcoffee.com/images/9.png';
var likeCount = null;
var count = null;
var spr = null;
var number = null;
$.getJSON("http://graph.facebook.com/blankCoffee", function(json){
likeCount = parseInt(json.likes, 10);
});
count = 5000 - (likeCount * 10);
number = count + "";
spr = number.split("");
function showimgA(){
doc-ument.write("");
}
function showimgB(){
doc-ument.write("");
}
function showimgC(){
doc-ument.write("");
}
function showimgD(){
doc-ument.write("");
}
를 넣어놓고
<바디> 에서
필요한 부분에 showimgA(); showimgB();.... 를 호출하는 식으로 변경해봤습니다.
alert("")을 써서 확인해보니
getJSON 안에서는 likeCount 값이 정상적으로 들어있는데
존슨 밖에서는 likeCount가 그대로 null인 상태입니다.
으어
<xhea>
<s-cript src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></s!crip>
<s-cript language="java-s!crip">
var list= new Array();
list[list.length]='http://www.blankcoffee.com/images/0.png';
list[list.length]='http://www.blankcoffee.com/images/1.png';
list[list.length]='http://www.blankcoffee.com/images/2.png';
list[list.length]='http://www.blankcoffee.com/images/3.png';
list[list.length]='http://www.blankcoffee.com/images/4.png';
list[list.length]='http://www.blankcoffee.com/images/5.png';
list[list.length]='http://www.blankcoffee.com/images/6.png';
list[list.length]='http://www.blankcoffee.com/images/7.png';
list[list.length]='http://www.blankcoffee.com/images/8.png';
list[list.length]='http://www.blankcoffee.com/images/9.png';
$(function(){
$.getJSON("http://graph.facebook.com/blankCoffee", function(json){
var likeCount = null;
var count = null;
var spr = null;
var number = null;
likeCount = parseInt(json.likes, 10);
alert("hahah " + likeCount);
count = 5000 - (likeCount * 10);
number = count + "";
spr = number.split("");
for ( var i=0; i<spr.length; i++ ) {
$("#like_count").append("<img src='"+list[spr[i]]+"' alt='number' border='0' class='iePngFix' styte-='margin:58px 5px 0px 5px' />");
}
});
});
</s!crip>
</head>
<!bod>
<div id="like_count"></div>
</body>
</html>
이런형태는 어떤가요?