0

这是共享点母版页中的代码。

<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 回答