Friday, 30 August 2013

Alphabetize a List Using orderby=

Alphabetize a List Using orderby=

I have a script that searches post titles and generates a list based on a
specific label (Freebies). However, it does not return an alphabetical
list because of the command "orderby=published" How can I get my list to
be alphabetical? I've tried "&Order=alphabet" Can someone tell me what
keywords "orderby=" uses? This will be used on Blogger and I am a neophyte
:(
Here is the script:
<script type="text/javascript">
var numposts = 100;
var standardstyling = true;
function showrecentposts(json) {
for (var i = 0; i < numposts; i++) {
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}}
posttitle = posttitle.link(posturl);
if (standardstyling) document.write('<li>');
document.write(posttitle);}
if (standardstyling) document.write('</li>');
}
</script>
<ul>
<script src="http://blogname.blogspot.com/feeds/posts/default/-/Freebies?
orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts&amp;max-
results=999
"></script>
</ul>

No comments:

Post a Comment