然后大家都按照这来做.调用的人想办法猜测里面的内容.再拿来为我所用.
对于自己的BC支持RSS已经确定.可是...能不能用的更加灵活一些?
我本来想做一个用html实现结果SKIN更换的.用RSS提供数据,这样我就可以简单的支持任意多的模版了.用css+脚本+rss提供数据
以下是雏形.对于IE的安全机制还有一些有待于解决的难题.
1<html>
2<script language=vbscript>
3sub loadrss2()
4loadrss sss.value
5end sub
6function LoadRSS(theurl)
7dim xml
8dim item
9dim ret
10Set http=CreateObject("Microsoft.XMLHTTP")
11http.Open "GET",theurl,False
12http.send
13'msgbox "step1"
14
15Set xml=CreateObject("Microsoft.XMLDOM")
16xml.Async=False
17xml.ValidateOnParse=False
18xml.Load(http.ResponseXML)
19'msgbox "step2"
20Set item=xml.getElementsByTagName("item")
21
22
23For i=0 To (item.Length-1)
24 Set title=item.Item(i).getElementsByTagName("title")
25 Set link=item.Item(i).getElementsByTagName("link")
26 Set des=item.Item(i).getElementsByTagName("description")
27
28 ret=ret+ "<a href='" & link.Item(0).Text &" ' target='_blank'>" & title.Item(0).Text &"</a><hr/> "& des.item(0).text &"<hr />"
29Next
30'msgbox ret
31'document.write ret
32bord.innerhtml=ret
33end function
34
35</script>
36<body>
37
38<input type="text" id=sss />
39<a onclick="loadrss2" href="#">get rss</a>
40<div id="bord"></div>
41<script language=vbscript>loadrss "http://bbs.lloup.com/rss.php"</script>
42</body>
43</html>
2<script language=vbscript>
3sub loadrss2()
4loadrss sss.value
5end sub
6function LoadRSS(theurl)
7dim xml
8dim item
9dim ret
10Set http=CreateObject("Microsoft.XMLHTTP")
11http.Open "GET",theurl,False
12http.send
13'msgbox "step1"
14
15Set xml=CreateObject("Microsoft.XMLDOM")
16xml.Async=False
17xml.ValidateOnParse=False
18xml.Load(http.ResponseXML)
19'msgbox "step2"
20Set item=xml.getElementsByTagName("item")
21
22
23For i=0 To (item.Length-1)
24 Set title=item.Item(i).getElementsByTagName("title")
25 Set link=item.Item(i).getElementsByTagName("link")
26 Set des=item.Item(i).getElementsByTagName("description")
27
28 ret=ret+ "<a href='" & link.Item(0).Text &" ' target='_blank'>" & title.Item(0).Text &"</a><hr/> "& des.item(0).text &"<hr />"
29Next
30'msgbox ret
31'document.write ret
32bord.innerhtml=ret
33end function
34
35</script>
36<body>
37
38<input type="text" id=sss />
39<a onclick="loadrss2" href="#">get rss</a>
40<div id="bord"></div>
41<script language=vbscript>loadrss "http://bbs.lloup.com/rss.php"</script>
42</body>
43</html>
用脚本就没有任何问题.
1
2msgbox "run"
3Set http=CreateObject("Microsoft.XMLHTTP")
4http.Open "GET","http://bbs.lloup.com/rss.php",False
5http.send
6msgbox "step1"
7'if xml is nothing then mesgbox "no xml"
8Set xml=CreateObject("Microsoft.XMLDOM")
9'if xml is nothing then mesgbox "no xml"
10xml.Async=False
11xml.ValidateOnParse=False
12xml.Load(http.ResponseXML)
13msgbox "step2"
14Set item=xml.getElementsByTagName("item")
15'msgbox item.Length
16if xml is nothing then mesgbox "no xml"
17For i=0 To (item.Length-1)
18 Set title=item.Item(i).getElementsByTagName("title")
19 Set link=item.Item(i).getElementsByTagName("link")
20 msgbox title.Item(0).Text &" "& link.Item(0).Text &"<hr />"
21Next
22
23msgbox "end"
2msgbox "run"
3Set http=CreateObject("Microsoft.XMLHTTP")
4http.Open "GET","http://bbs.lloup.com/rss.php",False
5http.send
6msgbox "step1"
7'if xml is nothing then mesgbox "no xml"
8Set xml=CreateObject("Microsoft.XMLDOM")
9'if xml is nothing then mesgbox "no xml"
10xml.Async=False
11xml.ValidateOnParse=False
12xml.Load(http.ResponseXML)
13msgbox "step2"
14Set item=xml.getElementsByTagName("item")
15'msgbox item.Length
16if xml is nothing then mesgbox "no xml"
17For i=0 To (item.Length-1)
18 Set title=item.Item(i).getElementsByTagName("title")
19 Set link=item.Item(i).getElementsByTagName("link")
20 msgbox title.Item(0).Text &" "& link.Item(0).Text &"<hr />"
21Next
22
23msgbox "end"