JavaScript - Can You Randomly Load Xml Items Or Files With Java?
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. Similar TutorialsHey guys, I've just started with javascript so please, be gentle I am making a wordpress plug-in which puts a banner-rotator on the front page which is able to load both images and flvs'. It has a carousel menuand the images/objects are loaded as you hover over the thumbnails. I have made an js array in a php loop so that every element of the menu list gets assigned a different onMouseOver function when it is generated. Because I was not able to change FlashVars with js I have put the whole object embed code in one variable and insert that in a div with innerHTML when mouseOver. This works fine in firefox but not at all in any other browsers!! What can I do? The website is located at: www.mediapod.org/jwp Here is the code: Code: function wp_main_player() { global $wpdb; $noChartsID = $wpdb->get_col($wpdb->prepare("SELECT * FROM wp_term_relationships WHERE term_taxonomy_id = 5")); $noCharts = count($noChartsID); ?> <div class="box" style="height:350px;"> <div id="maind" style="height:280px;"> <div id="icont"> <a id="link" href="#"><img name="main" height="280" width="560" src="" /></a> </div> <div id="fcont" style="display:none; width:100%; height:100%; background:#fff;"> </div> </div> <a class="pprev" style="float:left; width:10px; height:60px; margin-top:10px;" href="javascript:void(0)"></a> <div class="player" style="float:left; margin-top:11px; width:540px !important;"> <script> var myCode = []; </script> <ul style="float:left;"> <?php if ($noCharts > 0) { for ($i = 0; $i < $noCharts; $i += 1) { $posts = $wpdb->get_row("SELECT * FROM wp_posts WHERE id = $noChartsID[$i]", ARRAY_A); $link = $wpdb->get_row("SELECT * FROM wp_postmeta WHERE post_id = $noChartsID[$i] AND meta_key ='link'", ARRAY_A); $link = $link['meta_value']; $image = $posts['post_content']; $flv = strpos($image, 'flv:'); if ($flv==1){ $flv = str_replace("-flv:", "", $image); $flv = substr(rstrstr($flv, '-img:'),0 ,-6); $image = substr(strstr($image, '-img:'), 5); ?> <script> myCode[<?php echo $i; ?>]=<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="560" height="280" id="FlashXMLShoutcastRadioPlayerV4.0" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.mediapod.org/jwp/wp-content/plugins/JRockControll/FLVPlayer_Progressive.swf" /> <param name="menu" value="false" /> <param name="quality" value="high" /> <param name="wmode" value="opaque" ></param> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=http://www.mediapod.org/jwp/wp-content/plugins/JRockControll/Corona_Skin_1&streamName=<?php echo $flv; ?>&autoPlay=true&autoRewind=false" /> <param name="bgcolor" value="#111111" /> <embed bgcolor="#111111" wmode="opaque" src="http://www.mediapod.org/jwp/wp-content/plugins/JRockControll/FLVPlayer_Progressive.swf" menu="false" FlashVars ="&MM_ComponentVersion=1&skinName=http://www.mediapod.org/jwp/wp-content/plugins/JRockControll/Corona_Skin_1&streamName=<?php echo $flv; ?>&autoPlay=true&autoRewind=false" quality="high" width="560" height="280" name="FlashXMLShoutcastRadioPlayerV4.0" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>; </script> <li class="p_img"><img onmouseover="document.getElementById('icont').style.display='none';document.getElementById('fcont').style.display=''; document.getElementById('fcont').innerHTML=myCode[<?php echo $i; ?>]; document.main.src='<?php echo $image;?>'; document.getElementById('link').href='<?php echo $link;?>';" src="<?php echo $image;?>" height="52" width="102" /></li> <?php } else { ?> <li class="p_img"><img onmouseover="document.getElementById('icont').style.display=''; document.getElementById('fcont').innerHTML=''; document.getElementById('fcont').style.display='none'; document.main.src='<?php echo $image;?>'; document.getElementById('link').href='<?php echo $link;?>';" src="<?php echo $image;?>" height="52" width="102" /></li> <?php } } } ?> </ul> </div> <a class="pnext" style="float:right; width:10px; height:60px; margin-top:10px;" href="javascript:void(0)"></a> <script type="text/javascript"> jQuery(function() { jQuery(".player").jCarouselLite({ btnNext: ".pnext", btnPrev: ".pprev", speed: 300, visible: 5 }); }); </script> </div> <?php } It is an absolute mess Thank you. hi i need to merge this code in 1 file the files in attach the code for auto popup window withe cookis i need merge it for switch it to vb mood i think the job very easy but am not java script cooder Hey there. I'm creating my web-site now. I'm planing to have some slide/object change by itself. I know Java Script perform this task. I have get the code and apply to the image I want. It works. My idea is each of my image upper left corner have the representative number of the slide. When the slide1 go to slide 2 automatically, the number will change colour from 1 to 2. When the user click the number, the slide will change according to the number. Let said I have 3 slide. Each slide and have no 1 ,2 ,3 move forward, move backward icon on the upper left corner. I have slide1 ,slide2, slide3 change by itself within 2.5 second. When the user go thru slide 1, slide 2 and till slide3, user find out he/she interested on slide 1 and by clicking 1 on the upper left corner, the slide will change back to slide 1. Something like showing on the home page at www.easyjet.com.EN or http://www.thomascook.com/ . Both home page show a slide. This is what exactly I want. I learn HTML code before but not Java Script. I have borrow many Java Script reference book. but no idea how to inside the number on the upper left corner on each slide and how the number work accordingly with the slide. So sorry if you can't understand what I was talking about. But, anyone who understand me or have any idea how can I mortify the Java script to what I want. Just answer or email me to trista_soo@yahoo.com or facebook me on sym107@hotmail.com. Thanks for your time and efforts. Your help I really appreciate. Cheers! I have several js files to include in Hml so was thinking if there is any way that i can includes all the files in one file and then include that file in the main html file so that i don't need to chnage the main file again and again How can i do that just like we use import in css Hi all Is there a way to get the image(s) to load into the table after the page has loaded instead of the way I have it now? I have 4 tabs, but I would like the imgs in tabs 2,3,4 to load after page load. Example of how the tabs look. Code: <div class="tabbertab"> <h2>Australia_____</h2> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFCC"> <caption class="highlight_Red">澳洲 Australia </caption> <tr> <td><a href="pages/promotion.html#aus_ACE" rel="nofollow" target="_blank"><img src="pages/images/Pics/AUS/ace.jpg" alt="ACE / ATTC" width="110" height="69" border="0" align="left" class="ozimg_L"/> ...a few more images etc the other tabs look the same. LT 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 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? 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! 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! 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 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. 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> This script displays a link to a registration/login form that loads in a light box for Joomla. I've been goin nuts trying to figure out how to get this to load on page load with a delay. Anyone know how to get this done? PHP Code: <?php JHTML::_('behavior.mootools'); $document = JFactory::getDocument(); $document->addStyleSheet(JURI::base() . 'media/system/css/modal.css'); $document->addScript(JURI::base() . 'media/system/js/modal.js'); $document->addScriptDeclaration("window.addEvent('domready', function() {SqueezeBox.initialize({});});"); $user = & JFactory::getUser(); $uri = JFactory::getURI(); $url = $uri->toString(); $return = base64_encode($url); ?> <div id="lbframeid" style="position:absolute;top:1px;left:1px;height:0px;width:0px;overflow:hidden"> <a href="http://www.wowjoomla.com/"><h1>Joomla Login LightBox powered by WowJoomla.com</h1> </a> </div> <?php if ($user->get('guest')) :?> <a href="<?php echo JRoute::_('index.php?option=com_loginbox')?>" onclick="SqueezeBox.fromElement(this); return false;" rel="{handler: 'iframe', size: {x: 660, y: 500}}"><?php echo JText::_('SIGNUP_LOGIN')?></a> <?php else: ?> <?php echo JText::sprintf( 'HINAME', $user->get('name') ); ?> <br> <a href="javascript:void(0);" onclick="LB_onLogout(); return false;"><?php echo JText::_('LOGOUT')?></a> <?php endif; ?> <script type="text/javascript"> function LB_onLogout() { var form = new Element('form'); form.setProperty('method', 'POST'); form.setProperty('target', '_self'); form.setProperty('action', 'index.php'); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'option'); input.setProperty('value', 'com_user'); form.appendChild(input); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'task'); input.setProperty('value', 'logout'); form.appendChild(input); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'return'); input.setProperty('value', '<?php echo $return; ?>'); form.appendChild(input); $E('body').appendChild(form); form.submit(); } </script> 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.
Hi guys, I am trying to insert the following call into my page; Code: <script type="text/javascript" defer="true"> $('#query').autocomplete({ serviceUrl:'service/autocomplete.ashx', minChars:1, delimiter: /(,|;)\s*/, // regex or character maxHeight:400, width:250, deferRequestBy: 0, //miliseconds params: { country:'Yes' }, //aditional parameters // local autosugest options: lookup: ['January', 'February', 'March', 'April', 'May'] //local lookup values }); </script> It works fine in all browsers except ie(6,7,8) Code: Internet Explorer can not open website. Operation Aborted. I understand it is caused by the jquery autocomplete function loading before the page / DOM has fully loaded. I tried adding Defer="true" to the script however this doesn't seem to work. Could someone please tell me what i must add to the script so that it loads after the dom has fully loaded? Thanks guys George Essentially, I have an ASP.net page where I load a record set server side and upload it into a listbox. I'm trying to do all the movement functionalities of the listbox items client side. Specifically, I'm trying to figure out how to copy selected listbox items from one listbox to another -- on button click. I've searched for a while, but every example that I found moves the actual item into another listbox, I just want to copy the selected item to another listbox. I'm very new to JavaScript, so ff someone can provide an example or pseudo code, I would greatly appreciate it. I am looking for a way to add multiple items with a single URL to my shopping cart. any ideas? cheers, |