JavaScript - Question About Rss Feeds
Hello,
There is an .aspx page (http://gcn.com/rss-feeds/state-local.aspx) with news articles that I would like to embed into my own site. I would like to display the news articles in a small window at the bottom of my page which would scroll the news articles vertically like a news ticker. The .aspx page with the news articles is updated by someone else comletely so I would just like the contents of the .aspx page to scroll at the bottom of my page. Is this possible? Thanks. Similar TutorialsThis may be a newbie question but I am stuck on a prob regarding RSS feeds. I am using AJAX, which passes in a parameter to an ASP page. The parameter determines which RSS feed to load. Only prob is the code: Code: <script type="text/javascript" src="http://p3k.org/rss/proxy.r?textColor=black&align=&width=200&fontFace=&url=http%3A%2F%2Fwww.essexcountystandard.co.uk%2Fnews%2Fecsnews%2Frss%2F&compact=&frameColor=black&showXmlButton=&boxFillColor=white&_=1254328845643&titleBarColor=lightblue&maxItems=7&titleBarTextColor=black&"></script> which works fine on its own, doesn't work in Ajax (or in any Javascript function) because I had to create a new script tag to display the feed. So I basically am asking if there is an alternative to using the following which would work: Code: <script type="text/javascript"> <script type="text/javascript" src="http://p3k.org/rss/proxy.r?textColor=black&align=&width=200&fontFace=&url=http%3A%2F%2Fwww.essexcountystandard.co.uk%2Fnews%2Fecsnews%2Frss%2F&compact=&frameColor=black&showXmlButton=&boxFillColor=white&_=1254328845643&titleBarColor=lightblue&maxItems=7&titleBarTextColor=black&"></script> </script> Thanks in advance for any assistance. So, say I want to grab two twitter feeds from 2 people and put them together in one feed on a page (not using the built in twitter 'goodies'). How can I do this? I'm sure it's possible...
hello all ive been asked to create a javascript slideshow.... and i don't really understand it that much i know a little javscript but not much........ is thier any helpful sites that i can use to teach you step by step to make a javascript slide show???? also if don't want loads of code to be used, i want the code to be clean insted of loads and loads of code what is just unessary. i will be linking the javascript file to the html file so i need to keep the code to a min LOL CHEERS I'm not sure if this is the correct forum or not, but here goes. I want to make a very simple XUL document. Just a simple basic window to be opened up, but, i want the XUL to Load and Render an HTML File. I'm not sure about what function(s) to call to achieve this, can anyone give me any ideas to go on? here's what i have so far use my JavaScript Function called LoadFromDisk(FileName), if the file is there or the load is sucessfull, it can be stored as a variable. And then i have a single Division in the XUL document called RenderWindow. From there i set the innerHTML of the RenderWindow to the data that was loaded from the disk. Is this the right way? thanks Could someone please take a look at my code? It's a simple quiz with one multiple choice question and one fill in the blank. When the user clicks on 'submit' I tried to show some kind of response with correct/incorrect images next to the question. It works with the multiple choice question, but not with the fill in the blank. How can I get the fill in the blank question to work. It always shows the answer as being wrong. Thank you. Quote: answer_list = [ ['False'], ['body','hips','knees'] // Note: No comma after final entry ]; response = []; function setAnswer(question, answer) { response[question] = answer; } function CheckAnswers() { var correct = 0; var flag, resp, answ; for (var i = 0; i < answer_list.length; i++) { flag = false; for(var j=0; j<answer_list[i].length; j++){ resp = response[i].toLowerCase(); answ = answer_list[i][j].toLowerCase(); ################################################################################################# if (response[0] == answer_list[0]) { flag = true; document.myquiz.a1c.style.backgroundImage="url('correct.gif')"; } else{ document.myquiz.a1c.style.backgroundImage = "url('incorrect.gif')"; document.myquiz.a1c.value = " ANS: False. Position the head snugly against the top bar of the frame and then bring the foot board to the infant's feet."; } if (response[1] == answer_list[1]) { flag = true; document.myquiz.a1d.style.backgroundImage="url('correct.gif')"; } else{ document.myquiz.a1d.style.backgroundImage = "url('incorrect.gif')"; } ################################################################################################### } if (flag) { correct++; } } document.writeln("You got " + correct + " of " + answer_list.length + " questions correct!"); } </SCRIPT> </HEAD> <FORM name="myquiz"> <B>1. When measuring height/length of a child who cannot securely stand, place the infant such that his or her feet are flat against the foot board.</B> <label><INPUT TYPE=radio NAME=question0 VALUE="True" onClick="setAnswer(0,this.value)">True</label> <label><INPUT TYPE=radio NAME=question0 VALUE="False" onClick="setAnswer(0,this.value)">False</label> <textarea rows="2" cols="85" name="a1c" style="background-repeat:no-repeat"></textarea> <B>2. When taking a supine length measurement, straighten the infant's <INPUT id="test" TYPE=text NAME=question1 size=10 onChange="setAnswer(1, this.value)">, <INPUT id="test" TYPE=text NAME=question1 size=10 onChange="setAnswer(1, this.value)">, and <INPUT id="test" TYPE=text NAME=question1 size=10 onChange="setAnswer(1, this.value)">.</B> <textarea rows="2" cols="85" name="a1d" style="background-repeat:no-repeat"></textarea> <INPUT TYPE="button" NAME="check" VALUE="Check Answers" onClick=CheckAnswers()> </FORM> </div> </FONT> </BODY> </HTML> I was asked to redo a menu for this site: http://www.listlabs.com/index.php It was originally an imaged based menu, but they wanted it all changed to css/html. I used quickmenu and it used JS to produce the arrows at the top of each menu item. Now to my question... I'm trying to program the menu items to stay active when on the current page. At first, it looks correct, but if you hover back over the menu, it changes back to the inactive state. Any help would be great! Thanks. Hi all I am doing an assigment and have gotten to the end and cannot get the unordered list to work. If I try having my </script> tag below the </ul> it does not display anything If i have it above it will only display the varible names or what ever I type between the <li> </li> tag and not the varible assigment. num1,2,3,4 being the varible name. ie. </script> <ul> <li>num1</li> I have tryed <li>+num2+</li> also tryed <li>(num3)</li> also tryed <li>'num4'</li> also tryed and does not display </ul> </head> </html> The following does not display any thing <ul> <li>num1</li> I have tryed <li>+num2+</li> also tryed <li>(num3)</li> also tryed <li>'num4'</li> also tryed </ul> </script> </head> </html> I need to get the <li></li> to display not what I type in there but the assigment of the varible name I put in there.,or the output the varible calculation produces. Hope that was easy to understand lol Any advise would be awesome, cheers Shayne Darcy. You are given a mathematical expression containing integers and the basic operations: *,+,-, /. Find the number of unique results that can be obtained by parenthesizing the expression differently. i.e., by changing the order of evaluation of the operations. Note that all operations are integer operations. For example, if the input is 2 ∗ 3 + 6/2, your output should be 4. Plzz help me with this qs......... Ok i have been working on this for a while now. I have to have 3 fish swim across the screen in both direction. I have tried a few things but nothing is working. Can someone please explain to me what I am doing wrong. here is my code for you guys to look at it. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Fish tank</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> // <![CDATA[ var fishPos = new Array(3); fishPos[0] = "fish1.gif"; fishPos[1] = "fish2.gif"; fishPos[2] = "fish3.gif"; var fillPosition = 10; for(var i = 0; i < 50; ++i) { horizontal[i] = fillPosition; fillPosition += 10; } function fishSwim(fishNumber) { document.getElementById("fishPos").style.left = horizontal + "px"; ++fishPos[fishNumber]; if (fishPos[fishNumber] == 49) fishPos[fishNumber] = 0; } function startSwimming() { setInterval(fish1Swim, 100); } // ]]> </script> </head> <body onload="startSwimming();"> <p><span id="fish1" style= "position:absolute; left:10px; top:10px"><img src="fish1.gif" alt="Image of a fish" /></span></p> <p><span id="fish2" style= "position:absolute; left:10px; top:120px"><img src="fish3.gif" alt="Image of a fish" /></span></p> <p><span id="fish3" style= "position:absolute; left:10px; top:250px"><img src="fish2.gif" alt="Image of a fish" /></span></p> </body> </html> I am really not understanding and in my book it only give me a page to read about the animation. I am still new to it. Thanks for looking Hello, i haven't understood how to find the id from buttons, links, button images to auto click yet for example, i want to CLICK HERE how can i do that? how i find the id (I Own firefox with firebug and know basic html) it will be something like javascript:document.GetElementById('id').click(); right? but just want to know how to find or create ids on sites for auto click thanks Hi all, I am trying to do a simple "animation" of the background color of a button. I want it to do 10 different colors in the course of 1 second. I have a loop like this (pseudo code): Code: var e = "the button element"; var c = 10; while (c--) { setTimeout(function(){ e.style.backgroundColor=(random color); }, (c * 100)); } I expect that 10 instances of "setTimeout" would be created, each one timing out 0.1 seconds later than the previous one, giving me an "animation" of 10 different colors over the course of 1 second. Strangely, it doesn't work. All it does is WAIT one second, then set the background to the LAST color. What am I doing wrong? I can't see it. Thanks! -- Roger Edit: I also tried to do the loop forward instead... no difference. I would like to type something into my textbox and then press ENTER, it will execute a function. I tried onFocus, onChange and onBlur but it doesn't do what I want it to. Here's an example I use for onChange. Code: Application: <input type="text" onchange="execProg(0);"> Any comments or suggestions is greatly ok tell me if I wrote this properly Code: eval('windowBody' + windowCount + '.style.backgroundColor = "black";'); I'm attempting to be able to create multiple windows on my page http://opentech.durhamcollege.ca/~in...rittains/labs/ Hi Chaps, I have a PHP form with one input and a button. A jQuery script ('loading' animated gif) is triggered on the click of the submit button. I also have a Spry Validation field linked to the input. At the moment, if the validation is triggered, the animated gif continues and won't stop. The furthest I've managed to get with it, is to click the validation message to stop the animation, but what I'm really after is to stop the animation when the validation is visible/triggered, but I can't find a suitable Event. Code: <script type="text/javascript"> $(function() { $("#button_download") .click(function() { }) .throbber(); $("#sprytextfield1") .click(function(sprytextfield1) { $.throbberHide(); }) }); </script> If someone can point me in the right direction, that would be sweet. I have been searching through the forums and have not been able to find exactly what I am looking for. I built my web site a while back using Flash. Right now I am trying to convert it to a non-Flash site. I am trying to duplicate my slideshow, with a caption, and forward/back button in javascript. If anyone can offer advice on how to do this I would greatly appreciate it. my current flash site: http://moparch.com/moparch/architecture/msbe/msbe.html Thanks in advance. P.S. I am brand new to javascript. My experience is limited to the few online tutorials that I have worked through. I was planning on using Dreamweaver (which I am already familiar with) to assemble the final site once I get the necessary javascript figured out. Is there a way to store user input or a way to send user input to an email or log file, so that it is stored.. Or would I have to use something else to do this, like php..?? Dont really know much about php, so was wanting to know if i could use javascript doing this??? Here is my code... Code: <LINK href="color.css" rel="stylesheet" type="text/css"> <script type= "text/javascript"> <-- <-![CDATA[ function validatForm() { if (document.forms[0].userName.value == "" ) { alert("Name field cannot be empty."); return false; } //end if if (document.forms[0].userAge.value < 18) alert("You must be 18 or older to join."); return false; } //end if if (document.forms[0].userEmail.value == "" ) { alert("Email field cannot be empty."); return false; } //end if if (document.forms[0].userPassword.value == "" ) { alert("Password field cannot be empty."); return false; } //end if alert("Thank you for filing out the register"); return true; }// end function validatForm // ]]> --> </script> Code: <form method="post" action="http://webdevfoundations.net/scripts/formdemo.asp" onsubmit="return validateForm();"> <table> <tr> <td> <label for="userName">Name:</label> </td> <td> <input type="text" name="userName" id="userName"/> </td> </tr> <tr> <td> <label for="userAge">Age:</label> </td> <td> <input type="text" name="userAge" id="userAge"/> </td> </tr> <tr> <td> <label for="userEmail">Email:</label> </td> <td> <input type="text" name="userEmail" id="userEmail"/> </td> </tr> <tr> <td> <label for="userPassword">Password:</label> </td> <td> <input type="text" name="userPassword" id="userPassword"/> </td> </tr> <tr> <td colspan="2"> <input type="submit" value="Send information" /> </td> </tr> </table> </form> Ok, i am new to JavaScript and i am self teaching myself as i type this. Now here is my question: Is there a way using JavaScript or another web programming language to see where users came from before visiting your site. If it was a specific page I created could you have JavaScript functions that would change components on the website. (see example for better detail) Here is an example: My website home page, lets call it "HomePage" has an image called "LogoA" on the top of the page. Now if a user visited a specific page I created with in my website, we can call it "LandingPageA", and on LandingPageA they clicked a link that sent the user to my HomePage, could there be a command in JavaScript or another programming language that would say, Ok if user came from LandingPageA then load LogoA on HomePage. If user came from LandingPageB then load LogoB on HomePage if user came from LandingPageC then load LogoC on HomePage? If it is a confusing question i apologize. I can clarify if you needed it. I appreciate any help or info to lead me to a solution. Thanks -B Is there a way to have functions execute sequentially, rather than additively, using setTimeout? The problem here is varying browser speeds. Say we have some functions and they're set to fire after certain intervals, to create a rhythm. If you set them this way: Code: fn1(); setTimeout('fn2()',3000); setTimeout('fn3()',5000); and fn2() takes approx 1600ms to complete, there should be a 400ms pause before fn3(). But no two browsers are the same: the rhythm is at the mercy of browser speed. In some browsers, fn3() will fire before fn2 is finished. It sounds finicky, but it's like looking at a cut in a film: it's either smooth and not noticed, or it jars. Is there a way to execute which says: "do fn1(); when it's finished, wait 3 seconds and do fn2(); when it's finished, wait 400ms and do fn3()" ? cheers. hi guys, l am trying to learn javascript, although certain things seem to be easy to understand, l still have plenty of questions. so l was reading some articles on w3schools and l was an interesting table about operations. http://i1087.photobucket.com/albums/...kesnosense.png if you check above's table you will see at the increment section as well decrement , you will see that in some cases the x and y dont have the same value, now l was just wondering, what is the difference between x=++y and x=y++ ? |