Just Add
<script src="/Style Library/JS/jquery-1.5.1.js" type="text/javascript" ></script>
<script src="/Style Library/JS/jquery-1.6.2.min.js" type="text/javascript" ></script>
<script type="text/javascript">
$(function () {
var lists = new SPAPI_Lists('http://yoursite/msasiaservices/');
var items = lists.getListItems('Announcements');
if (items.status == 200) {
var rows = items.responseXML.getElementsByTagName('z:row'); // Get only list rows
for (var i = 1; i < rows.Count; i++) {
var title = rows[i].getAttribute('ows_Title');
var body = rows[i].getAttribute('ows_Body');
document.getElementById('heading1').innerHTML = title
document.getElementById('lbl1').innerHTML = body
var _id = rows[i].getAttribute('ows_ID');
var attachid = lists.getAttachmentCollection("Announcements", _id);
if (attachid.status == 200) {
var attachid = attachid.responseXML.getElementsByTagName('Attachment');
if (attachid.length > 0) {
for (var i = 0; i < attachid.length; i++) {
alert($(attachid[i]).text())
document.getElementById("img1").src = $(attachid[i]).text()
}}} }
});
</script>
<script src="/Style Library/JS/jquery-1.5.1.js" type="text/javascript" ></script>
<script src="/Style Library/JS/jquery-1.6.2.min.js" type="text/javascript" ></script>
<script type="text/javascript">
$(function () {
var lists = new SPAPI_Lists('http://yoursite/msasiaservices/');
var items = lists.getListItems('Announcements');
if (items.status == 200) {
var rows = items.responseXML.getElementsByTagName('z:row'); // Get only list rows
for (var i = 1; i < rows.Count; i++) {
var title = rows[i].getAttribute('ows_Title');
var body = rows[i].getAttribute('ows_Body');
document.getElementById('heading1').innerHTML = title
document.getElementById('lbl1').innerHTML = body
var _id = rows[i].getAttribute('ows_ID');
var attachid = lists.getAttachmentCollection("Announcements", _id);
if (attachid.status == 200) {
var attachid = attachid.responseXML.getElementsByTagName('Attachment');
if (attachid.length > 0) {
for (var i = 0; i < attachid.length; i++) {
alert($(attachid[i]).text())
document.getElementById("img1").src = $(attachid[i]).text()
}}} }
});
</script>
No comments:
Post a Comment