JavaScript - Line Breaks In Custom Rss Feed
I pulled together a custom RSS twitter feed that uses javascript; however, when I tell the code to "callback" 3 posts, they all run together without line breaks. What is the best way to have breaks between the posts?
This page shows the html code (in the right sidebar): http://www.westbrockdesign.com/twitter.html The javascript looks like this: Code: function twitterCallback2(C){var A=[];for(var D=0;D<C.length;D++){var E=C[D].user.screen_name;var B=C[D].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(F){return'<a href="'+F+'">'+F+"</a>"}).replace(/\B@([_a-z0-9]+)/ig,function(F){return F.charAt(0)+'<a href="http://www.twitter.com/'+F.substring(1)+'">'+F.substring(1)+"</a>"});A.push("<span>"+B+'</span> <a style="font-size:85%" href="http://twitter.com/'+E+"/statuses/"+C[D].id+'">'+relative_time(C[D].created_at)+"</a>")}document.getElementById("twitter_gretchen").innerHTML=A.join("")}function relative_time(C){var B=C.split(" ");C=B[1]+" "+B[2]+", "+B[5]+" "+B[3];var A=Date.parse(C);var D=(arguments.length>1)?arguments[1]:new Date();var E=parseInt((D.getTime()-A)/1000);E=E+(D.getTimezoneOffset()*60);if(E<60){return"less than a minute ago"}else{if(E<120){return"about a minute ago"}else{if(E<(60*60)){return(parseInt(E/60)).toString()+" minutes ago"}else{if(E<(120*60)){return"about an hour ago"}else{if(E<(24*60*60)){return"about "+(parseInt(E/3600)).toString()+" hours ago"}else{if(E<(48*60*60)){return"1 day ago"}else{return(parseInt(E/86400)).toString()+" days ago"}}}}}}}; Any insights would be much appreciated! Similar TutorialsHi, I'm creating a new email in javascript via outlook. When i try entering a line break "\n", "\r", "\r\r", etc, Outlook just ignores it completely. I've tried using "%0D%0A" and "fromCharCode(10)" as well but it doesnt seem to read it as a line break. Is there any way to code it so that a line break or a carriage return appears on outlook? Hi I currently have this: var d = new Date() var theDay = d.getDay() switch (theDay) { case 1: document.write("On Air Tonight...") <br> document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break case 2: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break case 3: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break case 4: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break case 5: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break case 6: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break case 7: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") break default: document.write("On Air Tonight...") document.write("ALAN POWELL!") document.write("8pm - 10pm") document.write("CARL KANE!") } Which obviously outputs the following: On Air Tonight...ALAN POWELL!8pm - 10pmCARL KANE! How do i code it so it displays On Air Tonight... ALAN POWELL! 8pm - 10pm CARL KANE! Also in Firefox, its not displaying ANYTHING... is there anything wrong in the code which FF would throw out? CSS validation says everything is ok any help would be fantastic. Thanks in advance UKD. I must have spent around 8 hours looking for the JavaScript code I need for putting text on the screen using onclick. Here is the code I found: http://javascript.internet.com/snipp...functions.html Code: /* This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com Created by: HunBug | http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11430 */ function appendText(node,txt) { node.appendChild(document.createTextNode(txt)); } function appendElement(node,tag,id,htm) { var ne = document.createElement(tag); if(id) ne.id = id; if(htm) ne.innerHTML = htm; node.appendChild(ne); } That works great, but I need to add three lines of text at a time, not just one. I spent at least 4 more hours searching for ways to add a line break with JavaScript, but nothing I have found works with this code. Here's what the onclick code looks like: Code: onclick="appendText(document.getElementById('bb1'),'8,4,6' + '0,0,0' + '16'); <div id="bb1"></div> The page I'm working on will have clickable text and image maps and when you click, three lines of batari Basic code will be added to a DIV. Here's an example of what that code will look like: Code: 8,4,6 0,0,0 16 Click on another link and you'd see something like this: Code: 8,4,6 0,0,0 16 8,12,17 0,0,0 16 It would keep adding three lines of batari Basic code to the list every time you clicked. If somebody can figure out how to stick line breaks in this code that really work, I'll be all set. I have tried <BR>, \n, \r\n and a couple of other things, but nothing works so far. Thanks. I'm trying to get two RSS feeds to display on a page. I'm trying to be good about it and re-use the same code for each by calling the function twice using different parameters for the feed url, feed limit (number of posts to display), and which div to display the output in (cupcake-feed and pie-feed). It works for either of the two feeds, but not both at the same time. If I try calling both, only the second one displays. If I pick just one to call, either one will display. I'm new to object-oriented concepts (if that's even what you would call this?). What am I doing wrong here? Code: function rssfeedsetup(feedurl, feedlimit, feeddivi) { var feedpointer=new google.feeds.Feed(feedurl) //Google Feed API method feedpointer.setNumEntries(feedlimit) //Google Feed API method feedpointer.load(displayfeed) //Google Feed API method feeddiv=feeddivi //sets output div name as a global variable for use below } function displayfeed(result) { if (!result.error) { var thefeeds=result.feed.entries //convert date to friendly format var date=new Date(thefeeds[0].publishedDate) var dateString=date.toLocaleDateString() //create output content and display it in div for (var i=0; i<thefeeds.length; i++) { var rssoutput='<div class="feed-date">' + dateString + '</div>' + '<div class="feed-title"><a href="' + thefeeds[i].link + '">' + thefeeds[i].title + '</a></div>' + '<div id="cupcake-menu" class="hidden">' + thefeeds[i].content + '</div>' document.getElementById(feeddiv).innerHTML=rssoutput } } else { alert("Error fetching feeds!") } } //call function on load for each feed to be displayed window.onload=function(){ rssfeedsetup("http://www.site1.com/feed/", 1, "cupcake-feed"); rssfeedsetup("http://www.site2.com/feed/", 1, "pie-feed"); } I have this piece of javascript code, which enables me to get my Picasa photos without link back feature, in my webpage. The issue is with the hardcoded RSS url feed. I want this to be dynamically passed as a variable to the java script. I use a PHP code, where this javascript is coded. In the below code, if I say var samples = <?php $url_code ?>, the javascript does not recognize. Can someone help on this, as I use the same PHP code, with different url feeds, to display different picasa photo albums ? Code: <script type="text/javascript"> function load() { var samples = "https://picasaweb.google.com/data/feed/base/user/......................../........./.........?alt=rss&kind=photo&authkey=.....................&hl=en_US" var options = { numresults: 2, scaleimages: true, maintainAspectRatio : false, displayTime: 1000, transistionTime: 300, //linkTarget : google.feeds.LINK_TARGET_BLANK }; new GFslideShow(samples, "slideshow", options); } google.load("feeds", "1"); google.setOnLoadCallback(load); </script> I'm a new app developer who's in the process of developing a simple Android application using Titanium Studio. I'm trying to implement an RSS feed in one of my windows, but I keep getting the following error messages when I run the app on my device: [ERROR] : TiExceptionHandler: (main) [107,107] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,107] - In ui/common/NewsWindow.js:1,69 [ERROR] : TiExceptionHandler: (main) [0,107] - Message: Uncaught TypeError: Cannot call method 'add' of null [ERROR] : TiExceptionHandler: (main) [0,107] - Source: fontSize:14},message:"Loading...",style:style,top:20,left:100});win.add(activi [ERROR] : V8Exception: Exception occurred at ui/common/NewsWindow.js:1: Uncaught TypeError: Cannot call method 'add' of null The code for my NewsWindow.js file is below. Any help would be greatly appreciated! Code: var win = Titanium.UI.currentWindow; var style; if (Ti.Platform.name === 'iPhone OS'){ style = Ti.UI.iPhone.ActivityIndicatorStyle.DARK; } else { style = Ti.UI.ActivityIndicatorStyle.DARK; } var activityIndicator = Ti.UI.createActivityIndicator({ color: 'black', font: {fontFamily:'Helvetica Neue', fontSize:14}, message: 'Loading...', style: style, top: 20, left: 100 }); win.add(activityIndicator); activityIndicator.show(); var xmlFeed = 'http://feeds.bbci.co.uk/news/video_and_audio/news_front_page/rss.xml?edition=uk#'; var xhr = Ti.Network.createHTTPClient(); xhr.onload = function() { activityIndicator.hide(); var xml = this.responseXML; Ti.API.info(this.responseText); var channelTitle = xml.documentElement.getElementsByTagName("title").item(0).textContent; var channelLabel = Ti.UI.createLabel({ top: 20, text: channelTitle, color: '#39f' }); win.add(channelLabel); var data = []; var itemsTable = Ti.UI.createTableView({ top: 70, left: 0 }); win.add(itemsTable); var items = xml.documentElement.getElementsByTagName("item"); for(var i = 0; i < items.length; i++) { // create a table row for each item var row = Ti.UI.createTableViewRow({ title: items.item(i).getElementsByTagName("title").item(0).textContent, link: items.item(i).getElementsByTagName("link").item(0).textContent, height: 'auto', hasChild: true }); data.push(row); } // bind the data to the itemsTable itemsTable.data = data; // when the user clicks on a row itemsTable.addEventListener('click', function(e) { // create and open a new window var webView = Titanium.UI.createWebView({ backgroundColor:'#fff', url: e.rowData.link }); var newWindow = Titanium.UI.createWindow({ backgroundColor:'#fff', backButtonTitle: 'Back', title: e.source.title, }); newWindow.add(webView); Ti.UI.currentTab.open(newWindow); }); }; xhr.onerror = function() { activityIndicator.hide(); alert(this.status + ': ' + this.statusText); return false; }; // open the remote feed xhr.open('GET', xmlFeed); // execute the call to the remote feed xhr.send(); Sorry, relative newbie here with what is probably a silly question. When I include the code to create a slideshow found here and then later in the page use the feed informer code to display posts from my blog ( <script type="text/javascript" src="http://app.feed.informer.com/digest3/39SQ9SPCHY.js">...) I am getting a syntax error message at the feedinformer code in dreamweaver and I can not figure out the problem. Any help would be appreciated, thank you I'm quite new to javascript programming, I basically want to parse a JSON string from an external URL. http://cashtrackr.com/piwik/index.ph...9d8d472cc9974a This is the json string URL and I just want to output the contents of "nb_visits" for example. I would also like to know the terms for a JSON string "?" : ? thanks for your time Hello, first time poster here. I have very little understanding of Javascript and have a problem with some I'm using. It's a singleline twitter feed and you can see it top right he http://zest.explosiveapps.com/navigation.php Code: // Compatability with jQuery: jQuery.noConflict(); window.$ = function (element) { return document.getElementById(element); }; /* Header and footer JavaScript */ jQuery(document).ready(function() { var $ = jQuery; function scroll_tweet(li){ var post = li.children("div.post"), pWidth = post.width(); if (pWidth > parseInt(balloon.css('width'))){ var leftEnd = li.find('div.end'); if(leftEnd.length === 0){ leftEnd = $('<div class="end left" />').appendTo(li); } var offsX = parseInt(leftEnd.width()); post.animate({left: offsX - pWidth - 55}, 23000, 'linear', function(){post.css('left', offsX);}); } } function swap_tweets(current_tweet){ var next_tweet = (current_tweet + 1) % 5; /* max five tweets */ var li = $("li#tweet" + next_tweet); $("#tweet" + current_tweet).fadeOut(300); setTimeout(function(){ li.fadeIn(400); }, 400); setTimeout(function(){scroll_tweet(li);}, 3800); display_tweet = next_tweet; setTimeout(function(){swap_tweets(display_tweet);}, 11300); } var balloon = $("#twitterpost div.balloon"); display_tweet = 0; if($("div.balloon ul li#tweet1").html() !== null){ setTimeout(function(){swap_tweets(display_tweet);}, 12000); var firstli = $("li#tweet0"); setTimeout(function(){scroll_tweet(firstli);}, 7500); } }); As you can see from just watching, it has some problems. It doesn't fade out posts before displaying a new one. From what I understand it talks to the CSS to figure out the length. So maybe that's where the problem is. Code: /* twitter-bubble */ #navigation #twitterpost { position: relative; top: -33px; right: 95px; } #navigation #twitterpost .balloon { position: relative; float: right; width: 345px; height: 21px; overflow: hidden; margin-top: 0px; padding: 0; background: url(/navigation/images/bubble.png) 0 0 no-repeat; font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; } #navigation #twitterpost .balloon div { font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif; color: #666666; padding: 0px 0px 12px 10px; font-size: 11px; } #navigation #twitterpost .end { position: absolute; top: 0; z-index: 1; height: 21px; background: url(/navigation/images/bubble.png) no-repeat; } #navigation #twitterpost .end.left { left: 0; width: 0px; background-position: 0 0; } #navigation #twitterpost .end.right { right: 0; width: 0px; background-position: 100% 0; } #navigation #twitterpost ul li .post { position: relative; } #navigation #twitterpost ul li .post { font-size: 11px; white-space: nowrap; position: absolute; top: 3px; } #navigation #twitterpost ul { padding-left: 0px; margin: 0px; list-style-type: none; } Or maybe it has something to do with using this script http://ajax.googleapis.com/ajax/libs.../jquery.min.js Thank you for take a look at my mess! Sorry for being such an amateur. And by the way, everything is wip on that site Cheers M. I have 10 feedburner feeds that are for different categories on a wordpress site. I would like to modify the subscribe form code feedburner supplies to include radio buttons to select which of the feeds to subscribe to. Code: <HTML> <HEAD> <TITLE> Radio Window </TITLE> <script> function OpenWindow(){ for(i=0;i<document.FormName["RB1"].length;i++){ if(document.FormName["RB1"][i].checked){ window.open(document.FormName["RB1"][i].value); break; } } } </script> </HEAD> <BODY> <form name="FormName" style="border:1px solid #ccc;padding:3px;text-align:center;" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="OpenWindow()";return true"> <p>Enter your email address:</p><p><input type="text" style="width:140px" name="email"/></p> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed1&loc=en_US">Option 1<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed2&loc=en_US">Option 2<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed3&loc=en_US">Option 3<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed4&loc=en_US">Option 4<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed5&loc=en_US">Option 5<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed6&loc=en_US">Option 6<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed7&loc=en_US">Option 7<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed8&loc=en_US">Option 8<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed9&loc=en_US">Option 9<BR> <input type="radio" name="RB1" value="http://feedburner.google.com/fb/a/mailverify?uri=feed10&loc=en_US">Option 10<BR> <input type="submit" value="Subscribe"> </form> </BODY> </HTML> This is the code I have put together searching the web, when hitting the subscribe button after entering a email address and selecting an option it load two new windows, one for the relevant feed but does not transfer the email address entered in the text box. The second for to http://feedburner.google.com/fb/a/mailverify All help would be greatly received. I have a twitter feed on my site and although am generally happy with it, the time-stamp for each tweet is hours and hours ahead of my time zone. I've looked through the js files to see if there is anything that allows me to set the timezone but cannot find anything. Anyone know how to reset the time to pacific standard time? I've searched through the values and don't see anywhere to assign the timezone (would like Pacific Time zone, US) Here's the URL http://www.kitchenprose.com/gmtest/index.html Here's the code: Code: $(document).ready(function() { $.Juitter.start({ searchType:"fromUser", // needed, you can use "searchWord", "fromUser", "toUser" searchObject:"gillesmarini", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma. // The values below will overwrite the ones on the Juitter default configuration. // They are optional here. // I'm changing here as a example only lang:"en", // restricts the search by the given language live:"live-125", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates. placeHolder:"juitterContainer", // Set a place holder DIV which will receive the list of tweets example <div id="juitterContainer"></div> loadMSG: "Loading messages...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on imgName: "loader.gif", // Loading image, to enable it, go to the loadMSG var above and change it to "image/gif" total: 4, // number of tweets to be show - max 100 readMo "Read it on Twitter", // read more message to be show after the tweet content nameUser:"text", // insert "image" to show avatar of "text" to show the name of the user that sent the tweet openExternalLinks:"newWindow", // here you can choose how to open link to external websites, "newWindow" or "sameWindow" filter:"sex->*BAD word*,porn->*BAD word*,****->*BAD word*,****->*BAD word*" // insert the words you want to hide from the tweets followed by what you want to show instead example: "sex->censured" or "porn->BLOCKED WORD" you can define as many as you want, if you don't want to replace the word, simply remove it, just add the words you want separated like this "porn,sex,****"... Be aware that the tweets will still be showed, only the bad words will be removed }); $("#aRodrigo").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"fromUser", searchObject:"mrjuitter,rodrigofante", live:"live-120" // it will be updated every 120 seconds/2 minutes }); }); $("#aIphone").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"searchWord", searchObject:"iPhone,apple,ipod", live:"live-20" // it will be update every 20 seconds }); }); $("#aJuitter").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"searchWord", searchObject:"Juitter", live:"live-180" // it will be updated every 180 seconds/3 minutes }); }); $("#juitterSearch").submit(function(){ $.Juitter.start({ searchType:"searchWord", searchObject:$(".juitterSearch").val(), live:"live-20", // it will be updated every 180 seconds/3 minutes filter:"sex->*BAD word*,porn->*BAD word*,****->*BAD word*,****->*BAD word*" }); return false; }); $(".juitterSearch").blur(function(){ if($(this).val()=="") $(this).val("Type a word and press enter"); }); $(".juitterSearch").click(function(){ if($(this).val()=="Type a word and press enter") $(this).val(""); }); }); Many thanks! I have a twitter feed on my site and although am generally happy with it, the time-stamp for each tweet is several hours ahead of my time zone. I've looked through the js files to see if there is anything that allows me to set the timezone but cannot find anything. Anyone know how to reset the time to pacific standard time? Here's the URL http://www.kitchenprose.com/gmtest/index.html Can't for the life of me see anything in the code that controls time zone (would like Pacific Standard time, US) Code: $(document).ready(function() { $.Juitter.start({ searchType:"fromUser", // needed, you can use "searchWord", "fromUser", "toUser" searchObject:"gillesmarini", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma. // The values below will overwrite the ones on the Juitter default configuration. // They are optional here. // I'm changing here as a example only lang:"en", // restricts the search by the given language live:"live-125", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates. placeHolder:"juitterContainer", // Set a place holder DIV which will receive the list of tweets example <div id="juitterContainer"></div> loadMSG: "Loading messages...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on imgName: "loader.gif", // Loading image, to enable it, go to the loadMSG var above and change it to "image/gif" total: 4, // number of tweets to be show - max 100 readMo "Read it on Twitter", // read more message to be show after the tweet content nameUser:"text", // insert "image" to show avatar of "text" to show the name of the user that sent the tweet openExternalLinks:"newWindow", // here you can choose how to open link to external websites, "newWindow" or "sameWindow" filter:"sex->*BAD word*,porn->*BAD word*,****->*BAD word*,****->*BAD word*" // insert the words you want to hide from the tweets followed by what you want to show instead example: "sex->censured" or "porn->BLOCKED WORD" you can define as many as you want, if you don't want to replace the word, simply remove it, just add the words you want separated like this "porn,sex,****"... Be aware that the tweets will still be showed, only the bad words will be removed }); $("#aRodrigo").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"fromUser", searchObject:"mrjuitter,rodrigofante", live:"live-120" // it will be updated every 120 seconds/2 minutes }); }); $("#aIphone").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"searchWord", searchObject:"iPhone,apple,ipod", live:"live-20" // it will be update every 20 seconds }); }); $("#aJuitter").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"searchWord", searchObject:"Juitter", live:"live-180" // it will be updated every 180 seconds/3 minutes }); }); $("#juitterSearch").submit(function(){ $.Juitter.start({ searchType:"searchWord", searchObject:$(".juitterSearch").val(), live:"live-20", // it will be updated every 180 seconds/3 minutes filter:"sex->*BAD word*,porn->*BAD word*,****->*BAD word*,****->*BAD word*" }); return false; }); $(".juitterSearch").blur(function(){ if($(this).val()=="") $(this).val("Type a word and press enter"); }); $(".juitterSearch").click(function(){ if($(this).val()=="Type a word and press enter") $(this).val(""); }); }); Many thanks! Hello, I have this working js twitter feed on my site, but I am trying to generate the topsy retweet button through the .js file via an innerHTML call, but its not working. the innerHTML works if I put test or something in there, so there is something within this line of code that is breaking it. Code: document.getElementById('retweet-button').innerHTML = '<div class="topsy_widget_data"><!--{"url":"'+url+'","title":"inConcert Web Solutions, Inc."}--></div>'; This is the entire script, I really appreciate any help Code: //Twitter window.onload = function() { var ajax_load = "<img class='loader' src='/assets/templates/incon/twitterfeed/loader.gif' alt='Loading...' />"; var url = 'http://twitter.com/statuses/user_timeline/inConcertWeb.json?callback=twitterCallback2&count=1'; var script = document.createElement('script'); $("#twitter_feed").html(ajax_load); script.setAttribute('src', url); document.body.appendChild(script); } function twitterCallback2(twitters) { var statusHTML = []; for (var i=0; i<twitters.length; i++){ var username = twitters[i].user.screen_name; var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { return '<a href="'+url+'" rel="nofollow" target="_blank">'+url+'</a>'; }).replace(/\B@([_a-z0-9]+)/ig, function(reply) { return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>'; }); statusHTML.push('<li class="twitter_date"><a href="http://twitter.com/'+username+'/statuses/'+twitters[i].id+'" rel="nofollow" target="_blank">'+relative_time(twitters[i].created_at)+'</a></li> <li><p>'+status+'</p></li>'); } document.getElementById('twitter_update_list').innerHTML = statusHTML.join(''); //THIS IS WHERE IT IS BREAKING document.getElementById('retweet-button').innerHTML = '<div class="topsy_widget_data"><!--{"url":"'+url+'","title":"inConcert Web Solutions, Inc."}--></div>'; } function relative_time(time_value) { var values = time_value.split(" "); time_value = values[1] + " " + values[2] + " " + values[5] + " " + values[3]; var parsed_date = new Date(); parsed_date.setTime(Date.parse(time_value)); var months = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); var m = parsed_date.getMonth(); var postedAt = ''; postedAt = months[m]; postedAt += " "+ parsed_date.getDate(); postedAt += "," postedAt += " "+ parsed_date.getFullYear(); return postedAt; } hey, i am trying to add events to my website...i have all the events stored in my google calender and i am trying to show only four events at the time for example: 10/01/2011 - John's Birthday 12/01/2011 - Party i found this example on google however i am having problems...the problem i am having is that it works fine on my computer however when i look at it on another computer nothing appears http://gdata-javascript-client.googl...le_sample.html thanks Hello, Ive used feed.informer to display recent updates to my blog but it only seems to allow for them to be displayed vertically. I am looking for a way to display my recent blog posts horizontally on my site in a manner similar to how feed.informer works. Thank you for your help! My page is he http://acq.matthewboehler.com/ I have jQuery script written on my page to create a fade-effect when an image is hovered. See the large, kitchen image in the middle of the screen to see this effect in action. This is done on images with the "fade" class and styled with the second image as its background image. My problem is when I apply the "fade" class to another image, the background image does not appear on a rollover. See the bottom left corner image, when you rollover it goes away. Can someone explain why? I have the following code: Code: <script> $(function() { var inputArr = new Array("#register_id #username_id", "#register_id #email_id", "#register_id #password1_id", "#register_id #password2_id", "#signin_id #email_id", "#signin_id #password_id"); var inputToOverlayDict = new Array(); inputToOverlayDict[inputArr[0]] = "#register_id #usernameOverlay_id"; inputToOverlayDict[inputArr[1]] = "#register_id #emailOverlay_id"; inputToOverlayDict[inputArr[2]] = "#register_id #passwordOverlay1_id"; inputToOverlayDict[inputArr[3]] = "#register_id #passwordOverlay2_id"; inputToOverlayDict[inputArr[4]] = "#signin_id #emailOverlay_id"; inputToOverlayDict[inputArr[5]] = "#signin_id #passwordOverlay_id"; var i; for(i=0; i<6; i++) { $(inputArr[i]).focus(function() { $(inputToOverlayDict[inputArr[i]]).hide(); }); } /* $(inputArr[0]).focus(function() { $(inputToOverlayDict[inputArr[0]]).hide(); }); $(inputArr[0]).blur(function() { if($(this).val().length == 0) $(inputToOverlayDict[inputArr[0]]).show(); }); $(inputArr[1]).focus(function() { $(inputToOverlayDict[inputArr[1]]).hide(); }); $(inputArr[2]).focus(function() { $(inputToOverlayDict[inputArr[2]]).hide(); }); $(inputArr[3]).focus(function() { $(inputToOverlayDict[inputArr[3]]).hide(); }); $(inputArr[4]).focus(function() { $(inputToOverlayDict[inputArr[4]]).hide(); }); $(inputArr[5]).focus(function() { $(inputToOverlayDict[inputArr[5]]).hide(); }); */ }); </script> The whole idea is that if a certain div object comes to focus, something else disappears (using JQuery). For some reason the code in the comments is working fine, but the for loop breaks everything down. Why? |