如何在属性css中显示结果javascript

时间:2014-03-09 14:28:28

标签: javascript css

我是新手,所以很困惑如何在#ltsposts中放置javascript(最近发布的帖子)的结果。请帮帮我...,(这里是我的剧本......)

<style type='text/css' scoped="scoped">
#news { background: #fff; border-bottom: 1px solid #333; border-top: 1px solid #333;    display: block; float: left; height: 20px; line-height: 20px; overflow: hidden; padding: 5px 0px; width: 1000px; margin-top: -7px; margin-bottom: 10px;}
.titlenews { background:#333; color: #fff; display: block; float: left; font: bold  12px/22px Tahoma; padding: 4px; margin-top: -5px; position: absolute; }
#ltsposts { float: left; margin-left: 140px; }
#ltsposts ul,#ltsposts li{list-tyle:none;margin:0;padding:0;}
#ltsposts li a { background: none !important; color:#333 !important; font: bold  12px/22px Tahoma; text-decoration: none; }
</style>
<div id='ltsposts'>loading...</div>
<script type="text/javascript">
function getYpipeTL(feed) {document.write('<marquee onmouseover="this.stop()"     onmouseout="this.start()" scrollamount="4">');
var i;
for (i = 1; i < feed.count ; i++)
{
var href = "'" + feed.value.items[i].link + "'";
var pTitle = feed.value.items[i].title + "</a> | ";
var pList = "</a>" + "<a href="+ href + '">' + pTitle;
document.write(pList);
document.write('</a></li>');
}
document.write('</marquee>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?
YourBlogUrl=http://wahono8.blogspot.com
&Order=alphabet
&_id=401e43055731c1a29f1e1d3eb5e8e13f
&_callback=getYpipeTL
&_render=json"
type="text/javascript"></script>

2 个答案:

答案 0 :(得分:0)

试试这个:

var myNewText="hello";
document.getElementById ("ltsposts").innerHTML = myNewText;

答案 1 :(得分:0)

$( "div.wrapper" )
  .html("<marquee>"+href+ptitle+plist+"</marquee>"  );

这不是一个确切的工作代码,但是你需要在调用div的jquery上调用html ...在文本中单独使用“”文件,并且在没有它们的情况下加载vars