JavaScript - Need Help In Automating The Webpage Logon
Hi,
I need an option to help my family members who does not have computer knowlege in logging onto a online TV channel website. Can you please let us know how to write a script which will open the web page and automatically login with the user id and password. webpage is http://www.yupptv.com/ Thanks in Advance for the help. Regards, scrptlng Similar TutorialsHi please help me with this website. This website is used to list 6 events and then it should accurately countdown to when that event happens. As it is right now it accurately counts days, but hours, minutes, and seconds are counted down incorrectly. Here is the js file: /* New Perspectives on JavaScript, 2nd Edition Tutorial 2 Review Assignment Author: Andrew Duren Date: 8 May 2011 Function List: showDateTime(time) Returns the date in a text string formatted as: mm/dd/yyyy at hh:mm:ss am changeYear(today, holiday) Changes the year value of the holiday object to point to the next year if it has already occurred in the present year countdown(stop, start) Displays the time between the stop and start date objects in the text format: dd days, hh hrs, mm mins, ss secs */ function showDateTime(time) { date = time.getDate(); month = time.getMonth()+1; year = time.getFullYear(); second = time.getSeconds(); minute = time.getMinutes(); hour = time.getHours(); ampm = (hour < 12) ? " a.m." : " p.m."; hour = (hour > 12) ? hour - 12 : hour; hour = (hour == 0) ? 12 : hour; minute = minute < 10 ? "0"+minute : minute; second = second < 10 ? "0"+second : second; return month+"/"+date +"/"+year+" at "+hour+":"+minute+":"+second+ampm; } function changeYear(today, holiday) { var year = today.getFullYear(); holiday.setFullYear(year); year = (today > holiday) ? year + 1 : year; year = holiday.setFullYear(year); } function countdown(start, stop){ time = stop - start; var rawdays = ((time)/(1000*60*60*24)); days = Math.floor(rawdays); //milisec/sec*sec/min*mins/hour*hours/day is what's divided 4 value var rawhours = ((rawdays - days)*24) - 1; hours = Math.floor(rawhours); var rawminutes = (rawhours - hours)*60; minutes = Math.floor(rawminutes); var rawseconds = ((rawminutes - minutes)*60) + 1; seconds = Math.floor(rawseconds); return days + " days, " + hours + " hours, " + minutes + " mins, " + seconds + " secs"; } Here is the html file: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- New Perspectives on JavaScript, 2nd Edition Tutorial 2 Review Assignment Events in Tulsa Author: Andrew Duren Date: 08 May 2011 Filename: events.htm Supporting files: dates.js, logo.jpg, tulsa.css --> <title>Upcoming Events at Tulsa</title> <link href="tulsa.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="dates.js"></script> <script type = "text/javascript"> function timeLeft() { //the today variable contains the current date and time var today = new Date(); var Date1 = new Date("January 14, 2011 10:00:00"); var Date2 = new Date("May 21, 2011 12:00:00"); var Date3 = new Date("July 4, 2011 9:00:00"); var Date4 = new Date("September 1, 2011 12:00:00"); var Date5 = new Date("December 1, 2011 11:30:00"); var Date6 = new Date("December 31, 2011 3:30:00"); //Display the current date and time. document.eventform.thisDay.value = showDateTime(today); changeYear(today, Date1); changeYear(today, Date2); changeYear(today, Date3); changeYear(today, Date4); changeYear(today, Date5); changeYear(today, Date6); document.eventform.count1.value = countdown(today, Date1); document.eventform.count2.value = countdown(today, Date2); document.eventform.count3.value = countdown(today, Date3); document.eventform.count4.value = countdown(today, Date4); document.eventform.count5.value = countdown(today, Date5); document.eventform.count6.value = countdown(today, Date6); } </script> </head> <body onload="setInterval('timeLeft()', 1000)"> <form name="eventform" id="eventform" action=""> <div id="logo"> <img src="logo.jpg" alt="Tulsa Events" /> </div> <div id="links"> <a href="#">Home</a> <a href="#">City Services</a> <a href="#">City Agencies</a> <a href="#">Mayor's Office</a> <a href="#">News Today</a> <a href="#">Upcoming Events</a> <a href="#">Site Map</a> <a href="#">Search Engine</a> <a href="#">Public Notices</a> <a href="#">Survey Form</a> <a href="#">Contact Us</a> <a href="#">E-Government</a> </div> <div id="main"> <h3>Countdown to Upcoming Events</h3> <table> <tr> <th colspan="2" style="text-align: right">Current Date and Time</th> <td><input name="thisDay" id="thisDay" readonly="readonly" size="40" /></td> </tr> <tr> <th>Event</th> <th>Starting Time</th> <th>Countdown to Event</th> </tr> <tr> <td><input value="Heritage Day" readonly="readonly" size="20" /></td> <td><input value="Jan 14 at 10:00 a.m." readonly="readonly" size="20" /></td> <td><input name="count1" id="count1" size="40" /></td> </tr> <tr> <td><input value="Spring Day Rally" readonly="readonly" size="20" /></td> <td><input value="May 21 at 12:00 p.m." readonly="readonly" size="20" /></td> <td><input name="count2" id="count2" size="40" /></td> </tr> <tr> <td><input value="July 4th Fireworks" readonly="readonly" size="20" /></td> <td><input value="Jul 4 at 9:00 p.m." readonly="readonly" size="20" /></td> <td><input name="count3" id="count3" size="40" /></td> </tr> <tr> <td><input value="Summer Bash" readonly="readonly" size="20" /></td> <td><input value="Sep 1 at 12:00 p.m." readonly="readonly" size="20" /></td> <td><input name="count4" id="count4" size="40" /></td> </tr><tr> <td><input value="Holiday Party" readonly="readonly" size="20" /></td> <td><input value="Dec 1 at 11:30 a.m." readonly="readonly" size="20" /></td> <td><input name="count5" id="count5" size="40" /></td> </tr> <tr> <td><input value="New Year's Bash" readonly="readonly" size="20" /></td> <td><input value="Dec 31 at 3:30 p.m." readonly="readonly" size="20" /></td> <td><input name="count6" id="count6" size="40" /></td> </tr> </table> </div> </form> </body> </html> Please tell me what I need to do to make all of them countdown properly and tell me what technique I can use in the future to do this for future websites in case I need to countdown to 30 events. I would appreciate any help. Hi, I'd like to insert a date on a webpage in the following format: Monday, May 10, 2010 However, I want to be able to set the date 6 days before the current date. So, if today's date is Monday, May 10, 2010, I want it to instead display the following: Tuesday, May 4, 2010 Can someone please provide me the javascript and html coding to be able to do this? I'd seriously appreciate it. Thanks much in advance!! Hello all, I'm trying to open up an internal link from my leftnav div into my content div. I used the following JS code from my book but im not quite sure how to make it all work. Any thoughts appreciated. Thank you 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> <!--header script starts here --> <script type="text/javascript"> window.onload = initlinks; function initlinks() { for (var i = 0; i < document.links.length; i++) { document.links[i].onclick = setContent; } } function setContent() { document.getElementById("content").contentWindow.document.location.href = this.href; return false; } </script> <style type="text/css"> html, body { margin: 0; padding: 0; } #container { width: 90%; margin: 10px auto; background-color: #fff; color: #333; border: 1px solid gray; line-height: 130%; } #header { height: 60px; background-color: #ddd; border-bottom: 1px solid gray; } #leftnav { float: left; width: 160px; height: 380px; margin: 0; padding: 1em; } #content { margin-left: 200px; border-left: 1px solid gray; padding: 1em; height: 380px; } </style> <title>JavaScript</title> </head> <body> <div id="container"> <div id="header"> <h1>JavaScript</h1> </div> <div id="leftnav"> <p> <a href='#'>Load Content</a> <br /><br /> <a href='#'>Load Content</a> <br /><br /> <a href='#'>Load Content</a> <br /><br /> <a href='#'>Load Content</a> <br /><br /> <a href='#'>Load Content</a> <br /><br /> </p> </div> <!--Div to load content into--> <div id="content"> <h2>Subheading</h2> <p> Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel erat volutpat. </p> </div> </div> </body> </html> Hi, I would like to ask if there is anyway to get a variable from any webpage source using javascript. Something like javascript: document.getelement? Can someone please show me a working example of how to load a WebPage from an existing WebPage using Javascript! I have tried googling the syntax and not having any luck. Thanks, Blake OK, I appologise in advance if this post is long, but I need this answer, as I'm at my wits end. So I have this code Code: function SizeSelect(){ if(document.getElementById("JarSize").value=="Small") document.getElementById("JarPrice").innerHTML="3.00" else if(document.getElementById("JarSize").value=="Medium") document.getElementById("JarPrice").innerHTML="5.00" else if(document.getElementById("JarSize").value=="Large") document.getElementById("JarPrice").innerHTML="7.00" } Which alters the value of JarPrice, based on which JarSize is selected. Which is the code below here. Code: <select id="JarSize" onchange="SizeSelect();"> <option value="Small" >Small</option> <option value="Medium">Medium</option> <option value="Large">Large</option> </select> <span class="price">$<span id="JarPrice">3.00</span></span></div> Now for the hard part. I need this piece of code Code: <a href="javascript:;" onclick="simpleCart.add('name=Mango and Papaya', 'price=5', 'quantity=1');" class="prod_buy">add to cart</a> to be flexible, so that what ever value JarPrice becomes, that 'price=5' becomes the same. Now, the first piece of code is in a seperate .js file to the other two parts, which sit inside a regular HTML page. As I said, I'm desperate, as this is the only part of my site that isn't working ATM And if you need more information about any part, please don't hesitate to ask, as I will be able to give as much info as I can. How to add an .mp3 file using java-script with HTML. I wish to add an mp3 file as a background music to my webpage. It should load automatically while user viewing my home page. I'm doing a project in php. "Give me a simple and easiest guideline for me" -thank you I maintain a website for a small local restaurant. I do this with FrontPage so I know very little coding. I have an upload manager so the owner can remotely upload a txt or doc file of daily specials to a folder on the server. I would like to put a java script into one of the web pages that would open and display this file on page load. Is that possible and can someone help with the code, Thanks Hi, Can someone direct me to what do i need to get something like this going: When a user clicks on a button to focus a windows program thats already running Thanks I am trying to write a javascript to open multiple websites in the same window for Internet Explorer. However I keep getting the website opening in a new window. Here is my code. Code: var url = [ "http://www.google.com", "http://www.yahoo.com", "http://www.msn.com" ]; var interval = 3000; var startTime = 0; for (i = 0; i < url.length; i++) { startTime = startTime + interval; setTimeout("openWindow("+i+")", startTime); } function openWindow(num) { window.open(url[num],'mywindow','width=800,height=600,menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes'); } So currently, this code behaves like this. Every 3 seconds, it opens up a new website. However this code I wrote opens google.com in a new window, then yahoo.com in a new window and so on. I want it to open all the websites in the same window. How do I achieve this? Complete and utter newb here, so I apologize in advance. I'm trying to create a widget for a website that will show the Recent Comments, but will limit what is shown to 1 comment per unique thread. The idea being that the popular threads don't drown out the unpopular threads in the widget. Alas, I do not know Javascript. I am, however, proficient in XSLT. So I mapped out a little transform to get (essentially) what I want, thus: Input: http://anamardoll.disqus.com/latest.rss XSLT: Code: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template name="RSS_Feed" match="rss"> <xsl:value-of select="'
'"/> <!-- ITERATE THROUGH ALL POST NODES --> <xsl:for-each select="//item"> <!-- IF NOT PREVIOUSLY USED --> <xsl:if test="not(preceding-sibling::item/child::title/node() = current()/child::title/node())"> <xsl:value-of xmlns:dc="http://purl.org/dc/elements/1.1/" select="child::dc:creator/node()"/> <xsl:value-of select="(' posted on 
')"/> <xsl:value-of select="substring-after(child::title/node(), 'Ramblings: ')"/> <xsl:value-of select="('
')"/> <xsl:value-of select="child::link/node()"/> <xsl:value-of select="('

')"/> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet> Output: Code: Ana Mardoll posted on Twilight: It's All About The Protagonist, Baby http://www.anamardoll.com/2011/09/twilight-its-all-about-protagonist-baby.html#comment-320798527 Thepepboy posted on eReader: Running CM7 on a Nook Color from SD Card (REPOST) http://www.anamardoll.com/2011/07/ereader-running-cm7-on-nook-color-from.html#comment-320690496 Jckeeml posted on Narnia: The Clean and Tidy Poor http://www.anamardoll.com/2011/09/narnia-clean-and-tidy-poor.html#comment-320649311 chris the cynic posted on Metapost: Newsletter Subscriptions http://www.anamardoll.com/2011/09/metapost-newsletter-subscriptions.html#comment-320586205 (And here is why I say the output is "essentially" what I want -- I'd PREFER the links to be linked around the preceding texts, but that's an advanced step at this point in the game.) Is there an easy way in Javascript to just invoke an XSLT on a webpage and display the results? I've read online that there is, but can find no examples that work for me. I do appreciate any help provided and thank you in advance! (Also, for background: This will be going into the Blogger HTML/Javascript Widget tool, so... yeah.) I went to the PHP section of this site and posted this same question, but someone told me it's a javascript question. I'm trying to carry a string from one webpage to another. The user inputs some data on page 1, the info gets tested for certain elements, then gets sent to page 2. The problem is the strings aren't transferring and I don't know how to use sessions to transfer them. I need recipeNameEl, ingredientsEl, and descriptionsEl to be stored to a string and then transferred to the page the form's action="" attribute points to. How can I accomplish this? Code: <script> function checkFields() { var recipeNameEl = document.getElementById( 'recipeName' ); var ingredientsEl = document.getElementById( 'ingredients' ); var descriptionEl = document.getElementById( 'description' ); var helperMsg1 = 'You have not filled in all required fields.'; var helperMsg2 = 'I thought I said no measurements! (No Numbers)'; return notEmpty( recipeNameEl, ingredientsEl, descriptionEl, helperMsg1, helperMsg2 ); } </script> <script type="text/javascript"> function notEmpty( recipeNameEl, ingredientsEl, descriptionEl, helperMsg1, helperMsg2 ){ if(recipeNameEl.value.length == 0){ alert(helperMsg1); recipeNameEl.focus(); return false;} if(ingredientsEl.value.length == 0){ alert(helperMsg1); ingredientsEl.focus(); return false;} if(descriptionEl.value.length == 0){ alert(helperMsg1); descriptionEl.focus(); return false;} var alphaExp = /^[a-zA-Z]+$/; if(ingredientsEl.value.match(alphaExp)){ return true; }else{ alert(helperMsg2); ingredientsEl.focus(); return false;} return true; } </script> I'm trying getting one of my webpage XHTML 1.0 Strict. There is only one error left, namely: document type does not allow element "br" here at this line: Code: container.innerHTML = result.translation.replace(/mdw/g, '<br />'); Obviously this is part of my javascript coding, but it's where the validation goes wrong. I can't put the javascript in an external file since several javascript variables are getting filled by php. I've tried several options, but I ain't a javascript expert.. so perhaps someone can help me out. I have the ability to remotely upload a text file to a folder on my web server. Periodically during the day I update that file and re-upload it which overwrites the previous file. I am looking for a script to insert in a webpage that will "get" and display the current version of that file on page load. Thanks in advance. Hello. It is Friday. I thought this will be a simple question, but it seen like hard to find a fast and simple solution. I am working on an online sign in tool. Two browser windows are open at the same time. One is for people to sign in with password and submit their information; another one is for Administrator to see who sign in. I am trying to refresh the Administrator page whenever user finished sign in and submitted their information. These two pages cannot be parent and child page. What will be the easiest way to solve this in ColdFusion or JavaScript? Thank you so much for your time. Have a wonderful weekend.
Hi, The Problem I am trying to create a Google Translate widget on my webpage, with just one language pair, Latin to English. Unfortunately the Google Translate AJAX API only supports a subset of all languages available, and Latin is not included. However, Latin IS included on the Google Translate website. Apparently languages that are in beta are available there, via a different server, while only fully released languages are available via the AJAX Translate API. My Attempts at Solutions a) I wrote a script that generated the XMLHttpRequest() call to the server the Google Translate website uses, but it always returned a '0' status code. I have since found out that this is normal, as these kinds of calls can only be made between pages on the same server. b) I then wrote a script that created a popup, and used the baseURL+params for the URL, , and this produced a pop-up window containing the translation result. However, as that page came from a different server to the server containing the script, I could not access the results on it. The code for that is he Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,locationbar.visible=false,status=0,menubar=1,resizable=0,width=500,height=400,left = 710,top = 400');"); window.focus(); } // End --> </script> </head> <body> <form> <input type=button value="Open the Popup Window" onClick="javascript:popUp('http://translate.google.com/translate_a/t?client=t&q=vicecomes&sl=la&tl=en&pc=0')"> </form> </body> </html> c) So, in final desperation I wrote a small script with an IFrame in it that shows the Google Translate webpage, using this code: Code: <iframe name="frame1" src="http://translate.google.com/?sl=la&tl=en#la|en|" frameborder="0" scrolling="auto" style="width:100%;height:280px;"></iframe> The result can be seen here (click on the Latin-Help tab): http://www.blanshard.org/ Not too bad. Now I would like to just to tidy this up (until Latin comes out of beta and is moved to the Google Translate AJAX API server) I would like to move the Google Translate page up a few px so that the top menu does not show, and disable the scrollbars, so I am just framing the Translation box and result area. It appears that the top-left corner of the called page always aligns with the top-left corner of the IFrame, but I want to add offsets. Is it possible to offset the called page anywhere within the IFrame so I can frame just the part I want? Thanks for any help, Wibs |