0

これは、SharePointマスターページのコードです。

<script language="JavaScript">
<!--
function top()
{
var begin = 1;
var end = 63;
var range = end-begin+1;
image_num = Math.floor(Math.random()*range)+begin;
//alert(image_num);
document.write("<img src=\"http://exttemplate.wsu.edu/extsharepoint/images/next/ext" + image_num + ".jpg\" width=\"775\" height=\"85\" border=\"0\">");
}
//-->
</script>

サイトWSU拡張

4

1 に答える 1

0

次のようなものを試してください。

function top()
{
    var begin = 1;
    var end = 63;
    var range = end-begin+1;
    image_num = Math.floor(Math.random()*range)+begin;

    var img = document.createElement('img');
    img.src = 'http://exttemplate.wsu.edu/extsharepoint/images/next/ext' + image_num + '.jpg'
    img.style.width = '775';
    img.style.height = '85';
    img.style.border = '0';
    document.getElementById('siteID').appendChild(img);
}

window.onload = function() {
  top();
};

そして、それをページの下部に含めます。

于 2012-10-11T14:58:18.503 に答える