0
좋은 날!내 blogspot 페이지에이 Javascript를로드하는 방법은 무엇입니까?
여기 초보자는 Google에서이 자바 스크립트를 발견했는데 내 새 블로그 글에 결과를 삽입하는 방법을 모릅니다. 새 블로그 게시물에 임의의 텍스트를 표시하고 싶습니다.
<script type="text/javascript">
<!--
//I. Array of banner that will randomly appear
var randomquote = new Array ();
randomquote[0] = '<em>Allergic reactions</em>';
randomquote[1] = '<em>Dental hygiene </em>';
randomquote[2] = '<em>Diabetes</em>';
randomquote[3] = '<em>Back pain</em>';
randomquote[4] = '<em>Weight loss </em>';
randomquote[5] = '<em>Heat cramps</em>';
randomquote[6] = '<em>Heat stroke</em>';
randomquote[7] = '<em>Pain Medication </em>';
randomquote[8] = '<em>Diet plan</em>';
randomquote[9] = '<em>Dehydration</em>';
//II. function to generate number from 0 to n
function randomzero (n)
{
return (Math.floor (Math.random ()*0.9999999999999999* (n + 1)));
}
//III. assign any random number from 0 to 2 to x.
x = randomzero(2);
//IV. display the text
document.write(randomquote[x]);
//-->
</script>
감사합니다.
위의 코드를 블로그 포스트에 추가 하시겠습니까? 또는 html 결과를 생성하기 위해 코드를 사용하고 싶습니까? –