JavaScript - Opening A Link Every Randomly X Seconds.
I am new to javascript and am trying to make a script that would open a link every xx randomly seconds.
So far I have come up with this after searching: Code: <script> function reloadMe() { window.location.reload(); } function getInterval(){ var lowerBound = 30; var upperBound = 60; var randNum = Math.floor((upperBound-lowerBound+1)*Math.random()+lowerBound) * 1000; return randNum; } var interval = getInterval(); var srcInterval = setInterval("reloadMe()",interval); </script> This works on refreashing a page every xx seconds between 30 and 60 seconds. But it does not open a link. Is it possible to make a script that opens a link every xx seconds at random. It would be even greater if it can exclude certian times of the day, or can that be done with a cron job? Similar Tutorialsok so here what i want to do (im a noob): i want a dropdown menu i want a button (go) i want ten different items in the dropdown menu if i choose the first item and click go i want a new page to open in the same window if i choose the second item and click go i want to a different page to open in the same window and so on all ten items lead to a different link when i click go....how do i do this?? thanks!! Hi there Im a relative newbie and am trying to have a searchbar that users can complete, with the text entry being from a pre-defined list. The hope is that a new page will open with the link that relates to the search bar entry. Im using an Autocomplete code but cant work out how to get the link part to work. See below code Code: <html> <head> <script src="jquery-latest.js"></script> <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/main.css" type="text/css" /> <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css" type="text/css" /> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.bgiframe.min.js"></script> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.dimensions.js"></script> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"></script> <script> $(document).ready(function(){ var data = "092 610 343 505 Utilities".split(" "); $("#example").autocomplete(data); }); var data = [ {text:'Link A', url:'/page2'}, {text:'Link B', url: '/page2'} ]; $("...").autocomplete(data, { formatItem: function(item) { return item.text; } }).result(function(event, item) { location.href = item.url; }); </script> </head> <body> Number: <input id="example" /><p></p> </body> </html> Can someone help me complete this code? For example, how can I change the code so that a text entry of "092" opens "www.google.com" when I hit enter after text entry? Your help with this is greatly appreciated Glen Hi there, Ive been asked to find out something in work and I hope someone can help me with this. I am looking to put a search box within a website. Users in work will be searching by 1 of 50 keywords, and each of these key words relates to a different web page that I want the search to open. For Example, typing 'one' in search bar opens link 'one.htm', typing 'two' in search bar opens link 'two.htm' and so on. Ideally it would be great if the seach bar will autocomplete text as well, but anything will be of great help to me!! Is it possible to get a code to do this? As Im a relative newbie, any help you can provide will be greatly appreciated. Many Thanks Glen Alright so for a school assignment I need to create a button with the name of the color it is going to turn the background to. the assignment says nothing about naming the buttons the hex numbers for the color therefo I was curious if someone could show me how to create a button in java script that would generate a random hex number for a color ie: #+()+()+()+()+()+() and the text shown on the button would be the same as the hex number generated. feed back please Hello geniuses. I really need your help and didn't know who else to turn to. Using JavaScript, I require a code that allows me to play .wav sound files randomly and automatically on page start-up, I also need them to loop as they are drum beats. The plan: to load my web page and hear a random drum beat that loops continuously. I need it to be compatible with most, if not all Internet browsers (Chrome, Internet Explorer, Firefox and Opera are crucial) and to state what sound file is playing on the page (allowing me to identify the looping drum beat/sound file), and if possible to provide a link to the actual sound file for download. I've tried endlessly trying to find code to build upon but have failed miserably, I would appreciate any code submissions as it would help me out massively. It's a lot to ask I know, but it would be so very appreciated. My knowledge with JavaScript is sadly minimal. I've also got a quick question, how would I prevent Google Chrome from putting a pause after each sound loop? Of course, being drum beats; I require it to loop in sync and it appears only Google Chrome puts a 1 second period after each play. Please help, I am so stuck. Anyway guys, thanks for reading! I have the following code but it simply writes the path to the webpage. I actually want it to randomly select the .js code in that path and run it. Help please! Code: jsFiles= new Array(3) jsFiles[0]=["assets/base/scripts/itmpiscripts/popupad1/script.js"] jsFiles[1]=["assets/base/scripts/itmpiscripts/popupad2/script.js"] jsFiles[2]=["assets/base/scripts/itmpiscripts/popupad3/script.js"] randno = Math.floor ( Math.random() * jsFiles.length ); document.write(jsFiles[randno]); Thanks Hello geniuses. I really need your help and didn't know who else to turn to. Using JavaScript, I require a code that allows me to play .wav sound files randomly and automatically on page start-up, I also need them to loop as they are drum beats. The plan: to load my web page and hear a random drum beat that loops continuously. I need it to be compatible with most, if not all Internet browsers (Chrome, Internet Explorer, Firefox and Opera are crucial) and to state what sound file is playing on the page (allowing me to identify the looping drum beat/sound file), and if possible to provide a link to the actual sound file for download. I've tried endlessly trying to find code to build upon but have failed miserably, I would appreciate any code submissions as it would help me out massively. It's a lot to ask I know, but it would be so very appreciated. My knowledge with JavaScript is sadly minimal. I've also got a quick question, how would I prevent Google Chrome from putting a pause after each sound loop? Of course, being drum beats; I require it to loop in sync and it appears only Google Chrome puts a 1 second period after each play. Please help, I am so stuck. Anyway guys, thanks for reading! Basically, I want to make it so there is a button, and when you click it, it plays a random song from a list of songs that would be in the code. I am not completely sure if this is possible or not. I know how to make the button, that is simple. Sorry if this is actually easy, I am just learning how to script. This is a weird idea I have- i will try to explain it all (forgive me if i do not). i'm using xml to create dynamic content on the site i'm building for myself. now, i know there is a way to randomly load xml content using php- but i have zero experience with php (though i not afraid to learn it, if it is the only way to do this). here's what i want to do: i have (let's say) 4 "announcement" areas on a page, in addition to a "random info" bar off to the side. in each of these, i want to have randomly loaded xml content each time the page is refreshed/viewed. so if i have a "recent site news" section on the page, i would have a folder for "some code" to look in to pull out an xml file to display. etc etc. basically, i'm wondering if there is a java way to do this (perhaps similar to the choosePic function?). it doesn't have to load a different xml file each time the page is refreshed either- if there's a way to pick a set number of items from any xml file i specify- that would be ok too. any help would be greatly appreciated. Hi All, I have a javascript file that displays a pop up image on the website. This works fine to display the one logo.png file even though the logo.png file is not referenced in the javascript. I believe it does it through the binary numbers. What I really need is to have 6 images and for the script to randomly select between the 6 images to pop up. Each pop up would have a different url behind it, not just one. Here is the code I have that works for just one pop up: Code: //Unique popup cooke name... //nacalo obiazatelino bukva. Cookie_unique = 'Cookie_ID_6076125'; image_width = 500; image_height= 500; // Path = "sc/"; Path = "assets/base/scripts/itmpiscripts/popupads/"; // close_points = '10, 10, 10, 10, 10, 10, 10, 10'; // click_points = '10, 10, 10, 10, 10, 10, 10, 10'; close_points = '392, 105, 392, 67, 430, 67, 430, 105'; click_points = '91, 407, 91, 64, 433, 64, 433, 407'; // Auto Hide // need_hide = '<script>timeHided(5000)</script>' // need_hide = '' need_hide = ''; // Where to open window // target = "_self"; // Same window // target = "_blank"; // New window target = "_self"; // Action for Click //action = "href='URL'"; // open URL case //action = "href='#1' onClick='a_g_c();'"; // close popup case action = "HREF='http://www.aol.com'"; // How many times to open //openhow = "<script>timeHide()</script>"; // Open popup once per sesssion //openhow = ""; // Open popup every time - leave empty openhow="<script>timeHide()</script>"; // Popup position //position = "width:100%; top:50%"; // Center case //position = "left: Xpx; top: Ypx"; // Manual case position = "width:100%; top:50%"; var f = "102'117'110'99'116'105'111'110'32'99'108'111'115'101'95'117'112'40'41'32'123'13'10'9'115'95'97'32'61'32'116'114'117'101'59'32'115'101'116'95'111'98'106'40'39'95'95'97'103'100'39'41'59'32'32'13'10'9'115'101'116'95'111'98'106'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'41'59'32'13'10'9'115'101'116'95'111'98'106'40'39'95'95'109'105'100'39'41'59'32'32'13'10'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'32'13'10'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'32'32'13'10'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'104'105'100'101'39'41'59'32'32'13'10'125'32'32'13'10'13'10'102'117'110'99'116'105'111'110'32'115'101'116'95'111'98'106'40'110'41'32'32'123'32'105'102'32'40'40'111'98'106'61'102'95'79'40'110'41'41'32'33'61'32'110'117'108'108'41'32'123'32'105'102'32'40'111'98'106'46'115'116'121'108'101'41'32'32'123'111'98'106'61'111'98'106'46'115'116'121'108'101'59'111'98'106'46'116'111'112'32'61'32'39'45'50'49'49'49'32'112'120'39'59'125'125'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'102'95'79'40'110'44'32'100'41'32'123'32'32'13'10'9'118'97'114'32'112'44'105'44'120'59'32'32'13'10'9'105'102'40'33'100'41'32'13'10'9'9'100'61'100'111'99'117'109'101'110'116'59'32'13'10'9'9'105'102'40'40'112'61'110'46'105'110'100'101'120'79'102'40'39'63'39'41'41'62'48'38'38'112'97'114'101'110'116'46'102'114'97'109'101'115'46'108'101'110'103'116'104'41'32'123'32'32'13'10'9'9'9'100'61'112'97'114'101'110'116'46'102'114'97'109'101'115'91'110'46'115'117'98'115'116'114'105'110'103'40'112'43'49'41'93'46'100'111'99'117'109'101'110'116'59'32'110'61'110'46'115'117'98'115'116'114'105'110'103'40'48'44'112'41'59'13'10'9'9'125'13'10'9'9'105'102'40'33'40'120'61'100'91'110'93'41'38'38'100'46'97'108'108'41'13'10'9'9'9'120'61'100'46'97'108'108'91'110'93'59'32'13'10'9'9'9'102'111'114'32'40'105'61'48'59'33'120'38'38'105'60'100'46'102'111'114'109'115'46'108'101'110'103'116'104'59'105'43'43'41'13'10'9'9'9'9'120'61'100'46'102'111'114'109'115'91'105'93'91'110'93'59'32'13'10'9'9'9'102'111'114'40'105'61'48'59'33'120'38'38'100'46'108'97'121'101'114'115'38'38'105'60'100'46'108'97'121'101'114'115'46'108'101'110'103'116'104'59'105'43'43'41'13'10'9'9'9'9'120'61'77'77'95'102'105'110'100'79'98'106'40'110'44'100'46'108'97'121'101'114'115'91'105'93'46'100'111'99'117'109'101'110'116'41'59'32'32'13'10'9'9'9'105'102'40'33'120'32'38'38'32'100'46'103'101'116'69'108'101'109'101'110'116'66'121'73'100'41'32'120'61'100'46'103'101'116'69'108'101'109'101'110'116'66'121'73'100'40'110'41'59'32'13'10'9'9'9'114'101'116'117'114'110'32'120'59'32'32'13'10'125'32'32'13'10'13'10'102'117'110'99'116'105'111'110'32'77'97'107'101'95'79'80'40'41'32'123'32'32'32'13'10'9'118'97'114'32'105'44'112'44'118'44'111'98'106'44'97'114'103'115'61'77'97'107'101'95'79'80'46'97'114'103'117'109'101'110'116'115'59'32'32'13'10'9'102'111'114'32'40'105'61'48'59'32'105'60'40'97'114'103'115'46'108'101'110'103'116'104'45'50'41'59'32'105'43'61'51'41'13'10'9'9'105'102'32'40'40'111'98'106'61'102'95'79'40'97'114'103'115'91'105'93'41'41'33'61'110'117'108'108'41'32'123'32'118'61'97'114'103'115'91'105'43'50'93'59'32'32'13'10'9'9'105'102'32'40'111'98'106'46'115'116'121'108'101'41'32'123'32'111'98'106'61'111'98'106'46'115'116'121'108'101'59'32'118'61'40'118'61'61'39'115'104'111'119'39'41'63'39'118'105'115'105'98'108'101'39'58'40'118'61'61'39'104'105'100'101'39'41'63'39'104'105'100'100'101'110'39'58'118'59'32'125'32'32'13'10'32'9'9'111'98'106'46'118'105'115'105'98'105'108'105'116'121'61'118'59'32'9'125'32'32'13'10'125'32'32'13'10'102'117'110'99'116'105'111'110'32'115'101'116'67'111'111'107'105'101'40'110'97'109'101'44'32'118'97'108'117'101'44'32'101'120'112'105'114'101'115'44'32'112'97'116'104'44'32'100'111'109'97'105'110'44'32'115'101'99'117'114'101'41'32'32'9'123'32'13'10'9'112'97'116'104'32'61'32'34'47'34'59'13'10'9'118'97'114'32'99'117'114'67'111'111'107'105'101'32'61'32'110'97'109'101'32'43'32'39'61'39'32'43'32'101'115'99'97'112'101'40'118'97'108'117'101'41'32'43'32'13'10'9'40'40'101'120'112'105'114'101'115'41'32'63'32'39'59'32'101'120'112'105'114'101'115'61'39'32'43'32'101'120'112'105'114'101'115'46'116'111'71'77'84'83'116'114'105'110'103'40'41'32'58'32'39'39'41'32'43'32'13'10'9'40'40'112'97'116'104'41'32'63'32'39'59'32'112'97'116'104'61'39'32'43'32'112'97'116'104'32'58'32'39'39'41'32'43'32'32'13'10'9'40'40'100'111'109'97'105'110'41'32'63'32'39'59'32'100'111'109'97'105'110'61'39'32'43'32'100'111'109'97'105'110'32'58'32'39'39'41'32'43'32'32'13'10'9'40'40'115'101'99'117'114'101'41'32'63'32'39'59'32'115'101'99'117'114'101'39'32'58'32'39'39'41'59'32'32'13'10'9'47'47'97'108'101'114'116'40'99'117'114'67'111'111'107'105'101'41'59'13'10'9'100'111'99'117'109'101'110'116'46'99'111'111'107'105'101'32'61'32'99'117'114'67'111'111'107'105'101'59'32'13'10'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'103'101'116'67'111'111'107'105'101'40'110'97'109'101'41'32'32'9'123'32'9'13'10'9'118'97'114'32'100'99'32'61'32'100'111'99'117'109'101'110'116'46'99'111'111'107'105'101'59'32'13'10'9'118'97'114'32'112'114'101'102'105'120'32'61'32'110'97'109'101'32'43'32'39'61'39'59'32'13'10'9'118'97'114'32'98'101'103'105'110'32'61'32'100'99'46'105'110'100'101'120'79'102'40'39'59'32'39'32'43'32'112'114'101'102'105'120'41'59'32'13'10'9'105'102'32'40'98'101'103'105'110'32'61'61'32'45'49'41'32'123'32'13'10'9'9'98'101'103'105'110'32'61'32'100'99'46'105'110'100'101'120'79'102'40'112'114'101'102'105'120'41'59'32'13'10'9'9'105'102'32'40'98'101'103'105'110'32'33'61'32'48'41'32'114'101'116'117'114'110'32'110'117'108'108'59'32'13'10'9'125'32'13'10'9'101'108'115'101'32'13'10'9'9'98'101'103'105'110'32'43'61'32'50'59'32'118'97'114'32'101'110'100'32'61'32'100'111'99'117'109'101'110'116'46'99'111'111'107'105'101'46'105'110'100'101'120'79'102'40'39'59'39'44'32'98'101'103'105'110'41'59'32'13'10'9'9'105'102'32'40'101'110'100'32'61'61'32'45'49'41'32'13'10'9'9'9'101'110'100'32'61'32'100'99'46'108'101'110'103'116'104'59'32'13'10'9'9'9'114'101'116'117'114'110'32'117'110'101'115'99'97'112'101'40'100'99'46'115'117'98'115'116'114'105'110'103'40'98'101'103'105'110'32'43'32'112'114'101'102'105'120'46'108'101'110'103'116'104'44'32'101'110'100'41'41'59'32'13'10'9'125'32'13'10'9'13'10'102'117'110'99'116'105'111'110'32'116'105'109'101'72'105'100'101'40'41'32'123'32'13'10'9'105'102'32'40'103'101'116'67'111'111'107'105'101'40'67'111'111'107'105'101'95'117'110'105'113'117'101'41'32'33'61'32'110'117'108'108'41'32'123'9'13'10'9'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'13'10'9'9'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'104'105'100'101'39'41'59'13'10'9'125'13'10'9'101'108'115'101'32'123'32'85'78'72'73'68'69'95'80'80'40'41'59'32'32'125'9'13'10'9'118'97'114'32'110'111'119'32'61'32'110'101'119'32'68'97'116'101'40'41'59'32'9'110'111'119'46'115'101'116'84'105'109'101'40'110'111'119'46'103'101'116'84'105'109'101'40'41'32'43'32'51'32'42'32'54'48'32'42'32'49'48'48'48'41'59'32'110'111'119'61'34'34'59'32'115'101'116'67'111'111'107'105'101'40'67'111'111'107'105'101'95'117'110'105'113'117'101'44'32'49'44'32'110'111'119'41'59'32'13'10'9'47'47'97'108'101'114'116'32'40'110'111'119'41'59'13'10'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'116'105'109'101'72'105'100'101'100'40'97'41'32'123'115'101'116'84'105'109'101'111'117'116'40'39'103'111'73'65'49'40'41'39'44'32'97'41'59'125'32'13'10'102'117'110'99'116'105'111'110'32'103'111'73'65'49'40'41'32'123'32'9'13'10'9'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'104'105'100'101'39'41'59'13'10'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'103'111'73'65'40'41'32'123'32'9'13'10'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'115'104'111'119'39'41'59'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'115'104'111'119'39'41'59'9'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'115'104'111'119'39'41'59'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'115'104'111'119'39'41'59'32'13'10'125'32'13'10'102'117'110'99'116'105'111'110'32'85'78'72'73'68'69'95'80'80'40'41'32'123'115'101'116'84'105'109'101'111'117'116'40'39'103'111'85'78'72'73'68'69'95'80'80'40'41'39'44'32'48'41'59'125'32'32'13'10'9'13'10'102'117'110'99'116'105'111'110'32'103'111'85'78'72'73'68'69'95'80'80'40'41'32'123'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'115'104'111'119'39'41'59'125'9'13'10'9'13'10'102'117'110'99'116'105'111'110'32'108'111'97'100'95'97'108'112'104'97'40'109'73'41'123'32'13'10'9'105'102'40'33'109'73'41'32'114'101'116'117'114'110'59'32'32'13'10'9'118'97'114'32'115'116'114'78'101'119'72'84'77'76'32'61'32'34'60'115'112'97'110'32'105'100'61'34'32'43'32'109'73'46'105'100'32'43'32'34'32'115'116'121'108'101'61'92'34'34'32'43'32'34'119'105'100'116'104'58'34'32'43'32'109'73'46'119'105'100'116'104'32'43'32'34'112'120'59'32'104'101'105'103'104'116'58'34'32'43'32'109'73'46'104'101'105'103'104'116'32'43'32'34'112'120'59'34'32'43'32'34'32'100'105'115'112'108'97'121'58'105'110'108'105'110'101'45'98'108'111'99'107'59'32'34'32'43'32'34'59'34'32'13'10'9'115'116'114'78'101'119'72'84'77'76'32'43'61'32'34'102'105'108'116'101'114'58'112'114'111'103'105'100'58'68'88'73'109'97'103'101'84'114'97'110'115'102'111'114'109'46'77'105'99'114'111'115'111'102'116'46'65'108'112'104'97'73'109'97'103'101'76'111'97'100'101'114'40'115'114'99'61'39'34'32'43'32'109'73'46'115'114'99'32'43'32'34'39'44'32'115'105'122'105'110'103'77'101'116'104'111'100'61'39'105'109'97'103'101'39'41'59'92'34'62'60'47'115'112'97'110'62'34'59'32'32'13'10'9'109'73'46'111'117'116'101'114'72'84'77'76'32'61'32'115'116'114'78'101'119'72'84'77'76'59'32'13'10'125'32'13'10'13'10'13'10'32'97'112'32'61'32'110'97'118'105'103'97'116'111'114'46'97'112'112'78'97'109'101'59'115'112'32'61'32'110'97'118'105'103'97'116'111'114'46'117'115'101'114'65'103'101'110'116'59'110'32'61'32'115'112'46'105'110'100'101'120'79'102'40'39'79'112'101'114'97'39'41'59'13'10'32'118'97'114'32'97'100'100'95'112'97'116'104'59'105'102'32'40'110'32'61'61'32'45'49'41'123'97'100'100'95'112'97'116'104'32'61'32'34'32'111'110'76'111'97'100'61'39'108'111'97'100'95'97'108'112'104'97'40'116'104'105'115'41'39'32'34'59'125'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'115'116'121'108'101'62'66'79'68'89'123'84'69'88'84'45'65'76'73'71'78'58'32'108'101'102'116'59'125'60'47'115'116'121'108'101'62'34'41'59'32'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'77'65'80'32'78'65'77'69'61'116'104'101'95'77'97'112'62'60'65'82'69'65'32'83'72'65'80'69'61'39'112'111'108'121'39'32'65'76'84'61'39'67'108'105'99'107'32'104'101'114'101'32'116'111'32'99'108'111'115'101'39'32'67'79'79'82'68'83'61'39'34'43'99'108'111'115'101'95'112'111'105'110'116'115'43'34'39'34'41'59'32'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'97'108'116'61'39'67'108'111'115'101'39'32'111'110'67'108'105'99'107'61'39'99'108'111'115'101'95'117'112'40'41'59'32'39'32'116'97'114'103'101'116'61'95'115'101'108'102'32'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'65'82'69'65'32'83'72'65'80'69'61'39'112'111'108'121'39'32'65'76'84'61'39'39'32'67'79'79'82'68'83'61'39'34'43'99'108'105'99'107'95'112'111'105'110'116'115'43'34'39'32'34'43'97'99'116'105'111'110'43'34'32'116'97'114'103'101'116'61'39'34'43'116'97'114'103'101'116'43'34'39'32'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'47'77'65'80'62'60'100'105'118'32'83'84'89'76'69'61'39'116'101'120'116'45'97'108'105'103'110'58'32'108'101'102'116'59'32'109'97'114'103'105'110'58'97'117'116'111'59'39'62'60'100'105'118'32'105'100'61'39'100'105'118'95'102'39'32'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'110'111'110'101'59'34'41'59'32'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'104'101'105'103'104'116'58'97'117'116'111'59'32'32'116'101'120'116'45'97'108'105'103'110'58'32'99'101'110'116'101'114'59'32'32'34'43'112'111'115'105'116'105'111'110'43'34'32'122'45'105'110'100'101'120'58'50'48'48'48'59'32'39'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'32'105'100'61'39'95'95'109'105'100'39'32'115'116'121'108'101'61'39'112'111'115'105'116'105'111'110'58'114'101'108'97'116'105'118'101'59'32'32'109'97'114'103'105'110'45'108'101'102'116'58'32'97'117'116'111'59'32'32'109'97'114'103'105'110'45'114'105'103'104'116'58'32'97'117'116'111'59'32'104'101'105'103'104'116'58'32'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'59'32'119'105'100'116'104'58'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'59'39'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'32'105'100'61'39'95'95'97'103'100'39'32'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'105'110'104'101'114'105'116'59'32'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'32'32'108'101'102'116'58'32'45'49'112'120'59'32'32'116'111'112'58'32'49'112'120'59'39'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'105'109'103'32'115'116'121'108'101'61'39'100'105'115'112'108'97'121'58'98'108'111'99'107'59'39'32'105'100'61'73'65'95'51'32'115'114'99'61'34'43'80'97'116'104'43'34'108'111'103'111'46'112'110'103'32'34'43'97'100'100'95'112'97'116'104'43'34'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'47'100'105'118'62'60'100'105'118'32'105'100'61'39'95'95'112'104'97'39'32'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'110'111'110'101'59'32'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'119'105'100'116'104'58'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'112'120'59'32'104'101'105'103'104'116'58'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'112'120'59'32'32'116'111'112'58'32'48'112'120'59'32'32'108'101'102'116'58'32'45'49'112'120'59'32'39'32'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'32'105'100'32'61'32'39'95'95'73'65'65'110'105'109'73'109'103'39'32'115'116'121'108'101'61'39'32'119'105'100'116'104'58'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'112'120'59'32'104'101'105'103'104'116'58'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'9'112'120'59'32'102'105'108'116'101'114'58'112'114'111'103'105'100'58'68'88'73'109'97'103'101'84'114'97'110'115'102'111'114'109'46'77'105'99'114'111'115'111'102'116'46'65'108'112'104'97'73'109'97'103'101'76'111'97'100'101'114'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'40'115'114'99'61'34'43'80'97'116'104'43'34'112'105'120'46'103'105'102'44'32'115'105'122'105'110'103'77'101'116'104'111'100'61'105'109'97'103'101'39'32'41'59'62'60'47'100'105'118'62'60'47'100'105'118'62'60'100'105'118'32'105'100'61'39'111'118'101'114'108'97'121'95'95'97'103'100'39'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'105'110'104'101'114'105'116'59'32'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'32'32'108'101'102'116'58'32'45'49'112'120'59'32'32'116'111'112'58'32'49'112'120'59'39'62'32'60'105'109'103'32'105'100'61'39'109'116'39'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'115'114'99'61'39'34'43'80'97'116'104'43'34'112'105'120'46'103'105'102'39'32'119'105'100'116'104'61'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'32'104'101'105'103'104'116'61'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'32'66'79'82'68'69'82'61'48'32'65'76'84'61'39'39'32'85'83'69'77'65'80'61'35'116'104'101'95'77'97'112'62'60'47'100'105'118'62'60'47'100'105'118'62'60'47'100'105'118'62'60'47'100'105'118'62'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'62'60'47'100'105'118'62'34'43'110'101'101'100'95'104'105'100'101'43'111'112'101'110'104'111'119'41'59'32'13'10'32'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'104'105'100'101'39'41'59'13'10'105'102'32'40'110'32'61'61'32'45'49'41'123'108'111'97'100'95'97'108'112'104'97'40'41'59'32'125'13'10'105'102'32'40'97'112'32'61'61'32'39'77'105'99'114'111'115'111'102'116'32'73'110'116'101'114'110'101'116'32'69'120'112'108'111'114'101'114'39'41'123'32'119'105'110'100'111'119'46'97'116'116'97'99'104'69'118'101'110'116'40'39'111'110'108'111'97'100'39'44'32'116'95'67'41'59'125'13'10'101'108'115'101'32'105'102'32'40'97'112'32'61'61'32'39'78'101'116'115'99'97'112'101'39'41'123'119'105'110'100'111'119'46'97'100'100'69'118'101'110'116'76'105'115'116'101'110'101'114'40'39'108'111'97'100'39'44'32'116'95'67'44'32'102'97'108'115'101'41'59'125'13'10'102'117'110'99'116'105'111'110'32'116'95'67'40'41'123'32'85'78'72'73'68'69'95'80'80'40'41'59'125"; var s = f.split("'");d="";for (i=0;i<s.length;i++){d += String.fromCharCode(s[i]);}document.write("<SCRIPT>"+d+"</SCRIPT>"); Any Help is appreciated!!! Thanks Hi all, I want to display varying company information from a javascript array randomly each time the page is refreshed. My problem is that the each piece of company information must be split up into 3-4 array elements since I have set up spans in the body where the information go accordingly and as such I don't how to randomize that. The relevant code is (I will only give two company examples as it's a long list): Code: <script type="text/javascript" language='javascript'> function compInfo(comp){ var companyInfo = new Array(); if(comp == document.getElementById('test').innerHTML) { //insert business name here. companyInfo[0] = 'Test'; //insert business type here. companyInfo[1] = 'Media'; //insert street name here. companyInfo[2] = 'Test Road.'; //insert actual opening time here. companyInfo[3] = '5am - 10pm'; //insert actual closing time here. companyInfo[4] = 'Christmas'; //insert contact info here. companyInfo[5] = 'test'; //insert web address here. companyInfo[6] = '<a href="http://www.test.com" style="color: #0092DD; text-decoration: none;">test.com</a>'; //insert image link here. companyInfo[7] = 'images/test.jpg'; } if(comp == document.getElementById('test1').innerHTML) { //insert business name here. companyInfo [0] = 'Test1'; //insert business type here. companyInfo [1] = 'Club'; //insert street name here. companyInfo[2] = 'Test1 Road.'; //insert actual opening time here. companyInfo[3] = '5am - 10pm'; //insert actual closing time here. companyInfo[4] = 'Christmas'; //insert contact info here. companyInfo[5] = 'test1'; //insert web address here. companyInfo[6] = '<a href="http://www.test1.com" style="color: #0092DD; text-decoration: none;">test1.com</a>'; //insert image link here. companyInfo[7] = 'images/test1.jpg'; } document.getElementById('title').innerHTML =companyInfo[0]; document.getElementById('name').innerHTML = companyInfo[1]; document.getElementById('street').innerHTML = companyInfo[2]; document.getElementById('open').innerHTML = 'Open'; document.getElementById('otime').innerHTML = companyInfo[3]; document.getElementById('close').innerHTML = 'Closed' document.getElementById('ctime').innerHTML = companyInfo[4]; document.getElementById('contact').innerHTML = 'Contact'; document.getElementById('cinfo').innerHTML = companyInfo[5]; document.getElementById('web').innerHTML = companyInfo[6]; document.getElementById('image').style.display = 'block'; document.getElementById('image').src = companyInfo[7]; } </script> </head> <body> <SPAN ID='test' onclick="compInfo(document.getElementById('test').innerHTML);"><b>Test</b></SPAN> <SPAN ID='test1' onclick="compInfo(document.getElementById('test1').innerHTML);"><b>Test1</b></SPAN> //info shown he <div style='text-overflow: ellipsis;'> <table cellpadding='0' cellspacing='0' border='0' style='height:178px; width:185px;'> <tr> <td align="left" style='height:25px;'> <b><SPAN ID='title' ></SPAN></b> </td> </tr> <tr> <td align="left" > <SPAN ID='name' ></SPAN> <br /> <SPAN ID='street'></SPAN> <div style='height:8px;'> </div> <SPAN ID='open'></SPAN> <br /> <SPAN ID='otime'></SPAN> <br /> <SPAN ID='close'></SPAN> <br /> <SPAN ID='ctime'></SPAN> <br /> <div style='height:8px;'> </div> <SPAN ID='contact'></SPAN> <br /> <SPAN ID='cinfo'></SPAN> <SPAN ID='web'></SPAN> <img ID='image' style='display:none;'></img> </td> </tr> </table> </div> </body> So essentially the process is: 1. The person clicks on the company name. 2. Relevant information from the array is shown in the div. But what I want is that on startup, information about a random company is shown automatically. How can I achieve this? Thanks. http://vietnamthereandback.com/mainpage.html The arrows next to the songs previews are randomly appearing/disappearing on page refresh. There are always 8 arrows, but each refresh shows the arrows in different places. This has really got me stumped. If anyone has any thoughts, I'd really appreciate hearing them. The basic button/arrow code is below. The only thing that changes in the MP3 file name. <code> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30"> <PARAM NAME=movie VALUE="http://www.vietnamthereandback.com/Clips/audioplay.swf?file=http://www.vietnamthereandback.com/Clips/reflections.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.vietnamthereandback.com/Clips/buttons/negative_small&bgcolor=0xffffff&mode=playpause"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <embed src="http://www.vietnamthereandback.com/Clips/audioplay.swf?file=http://www.vietnamthereandback.com/Clips/reflections.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.vietnamthereandback.com/Clips/buttons/negative_small&bgcolor=0xffffff&mode=playpause" quality=high wmode=transparent width="30" height="30" align="" TYPE="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> </code> want to get selected text and image values .Since there is an randomly changed text and image on my page.I used window.getSelection() but this will return only selected text values not images ..so please guide me to solve this problem.
how long are these numbers? Code: setImageInterval("ad1", 1000, 3); I know 3 is the max, but the 1000 = how many seconds? Thanks -Tim I need to develop this feature for a charity site displays a number that counts up 1 every 15 seconds. This is to show how many times a kid is abused in this country. I've been researching this and haven't been able to find anything helpful yet. I figured this piece of code was a good start: function doSomething() { setTimeout('doSomething()',15000); } Hi I am creating an animation based on Sam Dunn's tutorial 'Animate Curtains Opening with jQuery' ( http://buildinternet.com/2009/07/ani...g-with-jquery/ ). What i need to do is create a 2 second delay in the curtains opening in order to give enough time for an iframe, thats behind the curtains, to load it's content. Here is Sam's script : ----------------------------------------------------------------- <!-- Animate a Curtain Opening with jQuery index.html By Sam Dunn 2009 Build Internet! www.buildinternet.com --> <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Animate a Curtain Opening with jQuery | Build Internet</title> <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script> <script src="jquery.easing.1.3.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $curtainopen = false; $(".rope").click(function(){ $(this).blur(); if ($curtainopen == false){ $(this).stop().animate({top: '0px' }, {queue:false, duration:350, easing:'easeOutBounce'}); $(".leftcurtain").stop().animate({width:'60px'}, 2000 ); $(".rightcurtain").stop().animate({width:'60px'},2000 ); $curtainopen = true; }else{ $(this).stop().animate({top: '-40px' }, {queue:false, duration:350, easing:'easeOutBounce'}); $(".leftcurtain").stop().animate({width:'50%'}, 2000 ); $(".rightcurtain").stop().animate({width:'51%'}, 2000 ); $curtainopen = false; } return false; }); }); </script> <style type="text/css"> *{ margin:0; padding:0; } body { text-align: center; background: #4f3722 url('images/darkcurtain.jpg') repeat-x; } img{ border: none; } .leftcurtain{ width: 50%; height: 495px; top: 0px; left: 0px; position: absolute; z-index: 2; } .rightcurtain{ width: 51%; height: 495px; right: 0px; top: 0px; position: absolute; z-index: 3; } .rightcurtain img, .leftcurtain img{ width: 100%; height: 100%; } .logo{ margin: 0px auto; margin-top: 150px; } .rope{ position: absolute; top: -40px; left: 70%; z-index: 4; } </style> </head> <body> <div class="leftcurtain"><img src="images/frontcurtain.jpg"/></div> <div class="rightcurtain"><img src="images/frontcurtain.jpg"/></div> <img class="logo" src="images/buildinter.png"/> <a class="rope" href="#"> <img src="images/rope.png"/> </a> </body> </html> ----------------------------------------------------------------- Any help will be greatly appreciated. Thanks. Jet. Hey guys..... I'm wondering how you go about getting a script to run every 30 seconds for example? Thanks a lot! Hi people, I'm building an online psychological experiment in which I need to display an image for 5 seconds on the screen. Does anyone has a simple script for that? I found some script that does image rotation but its not exactly what I am looking for. First, the rotation of the images doesn't stop and second I don't need something so elaborate. This is the script that I found. Code: <SCRIPT LANGUAGE="JavaScript"> <!-- var dimages=new Array(); var numImages=2; for (i=0; i<numImages; i++) { dimages[i]=new Image(); dimages[i].src="images/image"+(i+1)+".jpg"; } var curImage=-1; function swapPicture() { if (document.images) { var nextImage=curImage+1; if (nextImage>=numImages) nextImage=0; if (dimages[nextImage] && dimages[nextImage].complete) { var rel="nofollow" target=0; if (document.images.myImage) rel="nofollow" target=document.images.myImage; if (document.all && document.getElementById("myImage")) rel="nofollow" target=document.getElementById("myImage"); // make sure target is valid. It might not be valid // if the page has not finished loading if (target) { target.src=dimages[nextImage].src; curImage=nextImage; } setTimeout("swapPicture()", 5000); } else { setTimeout("swapPicture()", 500); } } } setTimeout("swapPicture()", 5000); //--> </SCRIPT> Thanks Trying to setup a cookie read/write in JS. Page 1 sets the JS cookie using Flash. Page 2 reads the JS cookie from Flash. I have this working. The problem is that I need the cookie to expire in a matter of seconds. This is my code for creating the cookie and expiration: Code: function setCookie(name, value) { var today=new Date; today.setTime(today.getTime()+3000); document.cookie = name+"="+value; +"; expires="+today.toGMTString(); //alert(name + " "+value); alert("Value is: "+value+"\n Expires in: "+today); } The problem isn't that cookie isn't there. I just can't seem to get it to expire. Please help. I have a welcome message on my site and would like to automatically hide it after several seconds. I can't find anything usable after searching over the internet. Can anyone help? Thanks in advance. |