JavaScript - Javascript Stopped Working After Combination
Hi,
Well I had lots of scripts so what I did is that I combined all of them into one script file, which contains files like Jquery library too. But now the problem is that it has stopped working, I don't know why did this happen. What I did is that I took every script copied and pasted it and then I gave some space under it by pressing enter a few times and then I used to paste other script, I was told this was the method to combine scripts but now the scripts don't work. Here is the link to combined scripts http://files.cryoffalcon.com/bloghut...NCOMPRESSED.js And the link to a live example is http://bloghutsbeta.blogspot.com/ Similar TutorialsI hate javascript.... OK, here's my latest challenge with Javascript. I recently went into twp php files and made a few very minor changes to some outdated $date functions. Now, I have three small icons for 'copy', 'paste','delete' using the javascript 'onclick' function that have stopped working. In fact, when I replace the two recently revised files with the originals, these icons no longer work there either. Any help would be appreciated. I'm simply at a total loss for ideas here. From the primary php file is the relevant lines of source code....As far as I can tell, the second paragraph in each area is returning a 'null' value; i.e. o1a.options.selectedIndex is null. Code: function aCopy(dt){ o1a = document.getElementById("avail_1a_" + dt); o1b = document.getElementById("avail_1b_" + dt); o2a = document.getElementById("avail_2a_" + dt); o2b = document.getElementById("avail_2b_" + dt); o3a = document.getElementById("avail_3a_" + dt); o3b = document.getElementById("avail_3b_" + dt); avail_1a = o1a.options.selectedIndex; avail_1b = o1b.options.selectedIndex; avail_2a = o2a.options.selectedIndex; avail_2b = o2b.options.selectedIndex; avail_3a = o3a.options.selectedIndex; avail_3b = o3b.options.selectedIndex; } function aPaste(dt){ o1a = document.getElementById("avail_1a_" + dt); o1b = document.getElementById("avail_1b_" + dt); o2a = document.getElementById("avail_2a_" + dt); o2b = document.getElementById("avail_2b_" + dt); o3a = document.getElementById("avail_3a_" + dt); o3b = document.getElementById("avail_3b_" + dt); o1a.options.selectedIndex = avail_1a; o1b.options.selectedIndex = avail_1b; o2a.options.selectedIndex = avail_2a; o2b.options.selectedIndex = avail_2b; o3a.options.selectedIndex = avail_3a; o3b.options.selectedIndex = avail_3b; } function aDelete(dt){ o1a = document.getElementById("avail_1a_" + dt); o1b = document.getElementById("avail_1b_" + dt); o2a = document.getElementById("avail_2a_" + dt); o2b = document.getElementById("avail_2b_" + dt); o3a = document.getElementById("avail_3a_" + dt); o3b = document.getElementById("avail_3b_" + dt); o1a.options.selectedIndex = 0; o1b.options.selectedIndex = 0; o2a.options.selectedIndex = 0; o2b.options.selectedIndex = 0; o3a.options.selectedIndex = 0; o3b.options.selectedIndex = 0; From the supporting php file are the following lines of code.... Code: $s .= "<td nowrap=nowrap class=calendar style='border-left:1px dashed #000;'>"; $s .= "<a href='javascript:void(0);' onclick=\"aCopy('$year-$month-$d');\"><img src='../admin/_calendar/Copy.gif' alt='Copy Availability' width='16' height='16' border='0' /></a>"; $s .= " <a href='javascript:void(0);' onclick=\"aPaste('$year-$month-$d');\"><img src='../admin/_calendar/Paste.gif' alt='Paste Availability' width='16' height='16' border='0' /></a>"; $s .= " <a href='javascript:void(0);' onclick=\"aDelete('$year-$month-$d');\"><img src='../admin/_calendar/Delete.gif' alt='Delete/No Availability' width='16' height='16' border='0' /></a>"; $s .= "</td>"; None of these lines of code were changed or altered when I was updating the code. Any thoughts or suggestions would be deeply appreciated? Talltom I am using javascript to change the buttons on my website so that they load up a different image when hot spots on the buttons are hovered over. Everything has been working great, but this morning I tried checking out my site and for some reason the javascript wasn't working in Chrome, or on my iphone using Safari. I tried it in IE and everything still works. Any ideas on why it would stop working for those two browsers? Here is the javascript: Code: function init(){ document.getElementsByTagName('area')[0].onmouseover=function(){ document.getElementById('crocodileImg').src='Images/crocodileHover.png'; this.onmouseout=function() { document.getElementById('crocodileImg').src='Images/crocodile.png'; } } document.getElementsByTagName('area')[1].onmouseover=function(){ document.getElementById('historyImg').src='Images/historyHover.jpg'; this.onmouseout=function() { document.getElementById('historyImg').src='Images/history.jpg'; } } document.getElementsByTagName('area')[2].onmouseover=function(){ document.getElementById('applyImg').src='Images/applyHover.jpg'; this.onmouseout=function() { document.getElementById('applyImg').src='Images/apply.jpg'; } } document.getElementsByTagName('area')[3].onmouseover=function(){ document.getElementById('applyImg').src='Images/membersHover.jpg'; this.onmouseout=function() { document.getElementById('applyImg').src='Images/apply.jpg'; } } document.getElementsByTagName('area')[4].onmouseover=function(){ document.getElementById('mediaImg').src='Images/mediaHover.jpg'; this.onmouseout=function() { document.getElementById('mediaImg').src='Images/media.jpg'; } } } if(window.addEventListener){ window.addEventListener('load',init,false); } else { if(window.attachEvent){ window.attachEvent('onload',init); } } I'm not sure if seeing the html the js is referencing will help at all, but here it is just in case: Code: <div id="crocodile"> <img id="crocodileImg" src="Images/crocodile.png" usemap="#crocodileImg" border="0" width="436" height="147" alt="Home" /> <map id="crocodileImg" name="crocodileImg"> <area id="crocArea" shape="poly" coords="41,9,23,21,20,58,40,78,72,78,82,86,88,112,117,129,140,126,257,126,274,107,274,79,401,78,420,66,419,26,404,6,369,7,366,0,294,0,291,7," href="index.html" alt="Home" title="Home" /> </map> </div> <div id="history"> <img id="historyImg" src="Images/history.jpg" usemap="#historyImg" border="0" width="350" height="256" alt="Home" /> <map id="historyImg" name="historyImg"> <area id="historyArea" shape="poly" coords="18,77,18,167,48,170,79,208,124,233,174,238,228,218,257,188,266,176,280,184,306,182,338,102,331,93,271,92,254,54,226,27,196,11,169,4,137,7,109,17,82,33,65,51,52,74," href="history2.html" alt="History" title="History" /> </map> </div> <div id="apply"> <img id="applyImg" src="Images/apply.jpg" usemap="#applyImg" border="0" width="280" height="223" alt="Apply" /> <map id="applyImg" name="applyImg"> <area id="applyArea" shape="poly" coords="17,43,17,57,15,72,20,84,39,83,43,79,56,76,62,62,65,49,77,42,76,36,70,22,65,14,52,14,45,21,38,24,31,32," href="apply.html" alt="Apply" title="Apply" /> <area id="membersImg" shape="poly" coords="112,49,97,55,77,71,64,89,61,99,47,104,44,123,44,149,46,164,57,168,70,172,82,186,102,197,125,206,146,208,168,201,188,189,201,177,208,166,231,165,254,165,260,150,262,133,262,113,254,97,238,95,221,97,213,97,205,85,197,74,183,63,172,55,159,51,145,48,134,47,"href="members.html" alt="Members" title="Members" /> </map> </div> <div id="media"> <img id="mediaImg" src="Images/media.jpg" usemap="#mediaImg" border="0" width="182" height="149" alt="Media" /> <map id="mediaImg" name="mediaImg"> <area id="mediaArea" shape="poly" coords="0,102,16,103,26,117,44,129,67,133,92,128,108,115,118,102,165,102,170,88,173,65,172,52,161,49,141,49,132,42,121,42,110,30,96,22,76,16,60,14,44,18,30,29,19,36,13,48,0,51," href="media.html" alt="Media" title="Media" /> </map> </div> Thank you for any replies. I am very new to javascript. At least when it comes to writing scripts. The only thing I'm trying to do with the following script is make it so when you click on the right numbers of the image it will take you to a new page. If you click the wrong numbers it will forward you to an error page explaining that the code/numbers you clicked on were wrong. The code of numbers is four numbers long. When I try the correct numbers or the incorrect numbers nothing happens either way. I'm not sure why. Code: <html><head><title>Untitled</title> <script type="text/javascript"> var combination; var comboAnswer = "7256"; combination = ""; function keycode(n) { if (combination.length < (opener.top.comboAnswer.length - 1)) { combination = combination + n; } else { combination = combination + n; checkCode(); } } function checkCode() { if (combination == opener.top.comboAnswer) { window.location.href = "disarmed.html"; } else { window.location.href = "armed.html"; } } </script> <body bgcolor="#000000"> <center> <div style="text-align:center; width:527px; margin-left:auto; margin-right:auto;"> <img id="combination" src="image.png" usemap="#combination" border="0" alt="" /> <map id="_combination" name="combination"> <area shape="rect" coords="255,184,288,210" href="javascript:keycode(1)" alt="" title="" /> <area shape="rect" coords="288,184,321,210" href="javascript:keycode(2)" alt="" title="" /> <area shape="rect" coords="321,184,354,210" href="javascript:keycode(3)" alt="" title="" /> <area shape="rect" coords="255,213,288,239" href="javascript:keycode(4)" alt="" title="" /> <area shape="rect" coords="288,213,321,239" href="javascript:keycode(5)" alt="" title="" /> <area shape="rect" coords="320,213,353,239" href="javascript:keycode(6)" alt="" title="" /> <area shape="rect" coords="256,240,289,266" href="javascript:keycode(7)" alt="" title="" /> <area shape="rect" coords="288,240,321,266" href="javascript:keycode(8)" alt="" title="" /> <area shape="rect" coords="320,240,353,266" href="javascript:keycode(9)" alt="" title="" /> <area shape="rect" coords="288,265,321,291" href="javascript:keycode(0)" alt="" title="" /> <area shape="default" nohref> </map> </div> </center> </body></html> Hi Guys, i have two different arrays with the same number of element. The 1st array holds the ID's and the 2nd one holds the Items.. i want to use both of them in a Jquery autocomplete plugin.. showing the the 2nd one values but getting the value of the 1st arr. I was wondering if there is a way to combine both in one in Javascript like Arr3 =[arr1, arr2] where i display arr2 elemnt and pass arr1 elements? thanks I am using a JavaScript page that acts as a 'side-by-side' tester. It sends the same form in a POST to two different servers. One server is usually the production server the other a server under test. The results returned by the servers are displayed in two frames aligned side by side on the page. This page has worked in Firefox for several years. It worked up till early last week. Now, instead of populating the two frames, a new window opens up to display the response received from the Server. Nothing has changed in the code so I'm thinking that possibly the latest release of Firefox (10.0.2) has somehow broken this page. Here is the code that is envolved: Code: // setting up the frames <frameset rows="400,*"> <frame src="file:///C:/TestSanity/controller.htm" name="controller"/> <frameset cols="50%,50%"> <frame src="leftFrameInitialContent.html" name="leftWindow" onload='parent.controller.stopLeftFrameClock() ;'/> <frame src="rightFrameInitialContent.html" name="rightWindow" onload='parent.controller.stopRightFrameClock();'/> </frameset> </frameset> // sending a request whose response will be displayed in a frame // pick the form that matches the current command formToSubmit = document.getElementById(command + "_FORM") ; // set the left frame destination url (action) from the value on the UI formToSubmit.setAttribute("action", document.getElementById('leftFrameBaseUrl').value ); // send left window request formToSubmit.setAttribute("target", "leftWindow"); formToSubmit.submit(); I don't have any idea what to look for as a cause. Any help and/or suggestions would be appreciated. Thanks, bkey Hi all, thanks in advance for any help. For a lot of years now I've used a javascript that does a simple rollover image swap, but also changes another alternate image at the same time. It's always worked like a charm. Lately I realized that the script no longer works in IE, though it used to in older versions of IE (I think it stopped working in anything past IE 7). It still works fine in Firefox, Safari, etc. I haven't been able to find a good alternative for this script, so I'm really trying to get it to work again in IE, but so far no luck. Here's the link to the actual script itself. http://www.jsmadeeasy.com/javascript...nges/index.htm (you can see that even the example on this page doesn't work in IE anymore) You can also see it in action at this site: http://www.augustroad.com/ (notice when you roll over the menu bar an alternate image appears in FF, but not in IE). Again, thanks in advance for any help. I truly appreciate it! Jordan On my website www.thepriceoflust.com you can upload videos... These videos are supposed to be linked from youtube... When I try to upload a video it keeps on coming up as an invalid video... It gives me an example of what a proper youtube link should be but even when I enter the example it doesn't work... Does anyone have any ideals? I have already asked in the other forums and they said that is was a JavaScript error or has something to do in javascript... I am fairly new to programming and this is my first website so please be patient... To get to the video upload page follow these insturctions... you have to be in your user profile... log in using this information... User Name: supramaniac Password: lakeella After you log in go to the Member Menu on the left side bar and click on Your Videos...
Hi everyone; I have searched all of the forums before posting this, every year I have a Halloween Party and post it with this script for the continuous countdown? Now it is not working it seems to be off by one day? Daylight savings Time Problem? Or a Leap year problem Thank you to anyone who can help me with this ... Code: var today=new Date() //Enter the occasion's MONTH (1-12) and DAY (1-31): var theoccasion=new Date(today.getFullYear(),10 ,31 ) //Customize text to show before and on occasion. Follow grammer below: var beforeOccasionText="Left until our Annual Halloween Party" var onOccasiontext="It is Little Spook Day, Happy Halloween!" var monthtext=new Array("January","February","March","April","May","June","July","August","September","October","November","December") theoccasion.setMonth(theoccasion.getMonth()-1) //change to 0-11 month format var showdate="("+monthtext[theoccasion.getMonth()]+" "+theoccasion.getDate()+")" //show date of occasion var one_day=1000*60*60*24 var calculatediff="" calculatediff=Math.ceil((theoccasion.getTime()-today.getTime())/(one_day)) if (calculatediff<0){ //if bday already passed var nextyeartoday=new Date() nextyeartoday.setFullYear(today.getFullYear()+1) calculatediff=Math.ceil((nextyeartoday.getTime()-today.getTime())/(one_day)+calculatediff) } //Display message accordingly var pluraldayornot=(calculatediff==0)? "Day" : "Days" if (calculatediff>0) document.write("<center><b>"+calculatediff+" "+pluraldayornot+" "+beforeOccasionText+" "+showdate+"<br><br></b><center>") else if (calculatediff==0) document.write("<b>"+onOccasiontext+" <br> "+showdate+"!<br><br></b>") Hi, On my website, I have one of those trust seals that opens a new window to display account details. Last week it worked fine, but today it is not working. I am sure that I didn't change the code. It still works in IE but the Mox Firefox window opens with no address. This is my js code for the new window: Code: <script language="javascript" type="text/javascript"> <!-- var win=null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition=300; TopPosition=150; settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=yes,directories=no,status=no,menubar=no,toolbar=no,resizable=yes'; win=window.open(mypage,myname,settings); if(win.focus){win.focus();}} function hidestatus(){ window.status='' return true } if (document.layers) document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT) document.onmouseover=hidestatus document.onmouseout=hidestatus // --> </script> And this is my HTML Code: <!-- // SF-Code Affiliate Marketing ##ak18d54kt** // --> <a href="http://www.support-focus.com/check.php?key=SFM64912" onclick="NewWindow(this.href,'','860','700','yes','default'); return false" onfocus="this.blur()" > <img src="http://www.support-focus.com/image_load.php?id=SFM64912" alt="Support-Focus Membership Click to Verify - Before you Buy" border="0" ></a><br><br> The actual trust seal code appears at the bottom of ths page: Affiliate Marketing test page Can anyone see any problems with the code ? I think I did get a firefox update about a week ago has anyone noticed any changes ? ( I hope its just my code that is wrong ) Oh BTW if I just enter the link from the trust seal directly into the browser, it opens fine. Thanks Hi All Not sure if this is the right place to post but could do with some help. Scenario: 1 Box holds 3 items, Complete box weighs 75g, each item 25g, customer chooses their own 3 combo items. This could be the same all the same item or 3 different items. I need a script that will require the selections to make up 75g in order to continue the process. i.e customer can only continue when 3 items / 75g worth are selected. Here is a short version, I have about 12 selectors at the moment and possible more will be created (if that matters). Code: <form name="cart_quantity" action="myProduct?action=add_product" method="post" enctype="multipart/form-data"> < <div class="placeholder"> <img src="" alt="Image Placeholder" /> </div> <label class="attribsSelect" for="attrib-6">Hard Boiled 1</label><br /> <select name="id[6]" id="attrib-6"> <option value="">Select Portion</option> <option value="24">25g</option> <option value="25">50g</option> <option value="26">75g</option> </select> <div class="placeholder"> <img src="" alt="Image Placeholder" /> </div> <label class="attribsSelect" for="attrib-7">Hard Boiled 2</label><br /> <select name="id[7]" id="attrib-7"> <option value="">Select Portion</option> <option value="27">25g</option> <option value="28">50g</option> <option value="29">75g</option> </select> <div class="placeholder"> <img src="" alt="Image Placeholder" /> </div> <label class="attribsSelect" for="attrib-8">Hard Boiled 3</label><br /> <select name="id[8]" id="attrib-8"> <option value="">Select Portion</option> <option value="30">25g</option> <option value="31">50g</option> <option value="32">75g</option> </select> <div class="placeholder"> <img src="" alt="Image Placeholder" /> </div> <label class="attribsSelect" for="attrib-9">Hard Boiled 4</label><br /> <select name="id[9]" id="attrib-9"> <option value="">Select Portion</option> <option value="33">25g</option> <option value="34">50g</option> <option value="35">75g</option> </select> </form> The section of the form is just the portion with selctors, there are other fields with radio buttons for color choice etc. I have searched for something like this all over but cant find it. Please please please could some genius out there help. Thanks in advance I hope I have this post in the right place! Any help would be very much appreciated... I have a feature on my website that allows users to choose the website background (using alternate css sheets) and then uses an externally linked javascript file to store the background choice as a cookie so it is consistent throughout the website. This works perfectly locally (i.e. when previewing my website on my computer) but now it is uploaded to my host it doesn't appear to be working. (with the same browser) My javascript is he http://www. b r p - e n v .com/javascript/backgroundchange.js (with no spaces) The website that the javascript file is linked to is http://www. b r p - e n v .com (with no spaces) In the head I have: <script type="text/javascript" src="../javascript/backgroundchange.js"></script> ...then I have: <body onload="set_style_from_cookie()"> ...and for users to choose which background: <form> <input type="image" src="../images/white-background-thumb.jpg" onclick="switch_style('bg1');return false;" name="theme" value="White" id="bg1"> etc... </form> My problem is: The background reverts back to the default when moving to a different page. This would indicate that the background choice is not being saved in cookies. But this works locally! I have tried putting the javascript directly onto each page but I still had the same problem. I hope someone can help, I will be so grateful if I can get this to work. Many thanks indeed! hereis the html file and javascripton click of this button a html ***************************** <table class=matcolor id=topnav cellspacing=0 cellpadding=0 width=550 border=0 bgcolor="#FFCCCC"> <tbody> <tr align=middle> <td id=menu1 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Desk Top Publishing </font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu2 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Transcription</font></div> </td> <td width=1 bgcolor=#ff9900 class="mat"></td> <td id=menu3 onMouseOver="this.className='mPrimaryOn';showmenu(this);" onClick="this.document.location.href=''" onMouseOut="this.className='mPrimaryOff';hidemenu(this);" class="mat" height="20"> <div align="center"><font color="#FF0000">Accounts Processing </font></div> </td> </tr> </tbody> </table> ***************************************** <script language=JavaScript> ix = document.getElementById('tblmenu1').getBoundingClientRect(); new ypSlideOutMenu("menu1", "right",ix.left + ix.right ,ix.bottom + 10); </script> **any thing i have to alter to work in firefox please help on this site. There are no validation errors. firebug says my linkOut function is not defined... but I have this: Code: function linkOut(link) { var image = link.getElementsByTagName("IMG")[0]; image.src = image.src.replace("H2.png","H.png"); } not sure where to go from here. Hello guys, I've made a music playlist where you should be able to listen to music (of course). All works fine, i am capable too listen to all the music in my playlist. But, when i reload my website and click on a song, it send me an error message - "Adobe Flash Player has stopped a potentially unsafe operation. If you want the program to communicate with Internet, click on settings." When i click on settings, i get another message - "Sorry, this page is not available". I had also another Option instead of settings which where, "ok". When i click on OK it works fine and it's no problem to scroll through the musiclist and listen to all of the soft songs. But i don't even want the message to appear from the very first time. Do you know what i should do to get rid of the message? Here's my code: Code: <!-- BEGIN JAVASCRIPT PLAYER EMBED CODE --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> <div id="player-holder"></div> <script type="text/javascript"> var options = {}; options.playlistXmlPath = "playlist.xml"; var params = {}; params.allowScriptAccess = "always"; swfobject.embedSWF("OriginalMusicPlayerPlaylist.swf", "player-holder", "250", "250", "9.0.0",false, options, params, {}); </script> <!-- END PLAYER EMBED CODE --> Regards Webjoker wat's good.I tried the script at http://www.javascriptkit.com/script/script2/dropdownpanel.shtml but it's not working the right way.I followed what the tut suggests but still issue over issue.when I click on panel button it goes back but not on the page content.i don't know if need to change something in the css file or the js file. Appreciate your help! Hi, currently we are using IE 7 in that for showing submenu we are using the following code but it is not working in google chrome and firefox..basically it is a seperate .js file where functions are stored Code : Code: if( typeof ( gCSSList ) == 'undefined' || gCSSList == null ) var gCSSList= new Array();gCSSList[1]= Array('MENU_BLOCK_1','MENU_ITEM_1','MENU_ITEM_HL_1','MENU_ITEM_SL_1','MENU_ITEM_COL_LEFT_1','MENU_ITEM_COL_LEFT_HL_1','MENU_ITEM_COL_LEFT_SL_1','MENU_ITEM_COL_RIGHT_1','MENU_ITEM_COL_RIGHT_HL_1','MENU_ITEM_COL_RIGHT_SL_1','MENU_ITEM_HEADING_1','SUBMENU_BLOCK_1'); var gMainmenuFrm = 'left'; var gSubmenuFrm = 'right'; if( typeof ( gTimer ) == 'undefined' || gTimer == null ) var gTimer = new Array(); if( typeof ( HLItemList ) == 'undefined' || HLItemList == null ) var HLItemList = new Array(); if( typeof ( MenuList ) == 'undefined' || MenuList == null ) var MenuList = new Array(); function vMenu_AddtoHLList ( pCtrlId, pItemId ) { if( typeof ( HLItemList[pCtrlId] ) == 'undefined' || HLItemList[pCtrlId] == null ) HLItemList[pCtrlId] = pItemId+ ','; else HLItemList[pCtrlId] = HLItemList[pCtrlId] + pItemId+ ','; } function vMenu_AddtoMenuList ( pCtrlId, pMenuID ) { if( typeof ( MenuList[pCtrlId] ) == 'undefined' || MenuList[pCtrlId] == null ) MenuList[pCtrlId] = pMenuID + ','; else MenuList[pCtrlId] = MenuList[pCtrlId] + pMenuID + ','; } function vMenu_HideSubmenu ( pCtrlId, pMenuLevel ) { try { var MenuStr = new String(); objFrm = window.parent.frames(gSubmenuFrm); if( typeof ( MenuList[pCtrlId] ) == 'undefined' || MenuList[pCtrlId] == null ) return; MenuStr = MenuList[pCtrlId]; MenuArr = MenuStr.split(','); for( i=0; i < ( MenuArr.length - 1 ); i++ ) { MenuIds = MenuArr[i].split('_'); if( MenuIds[2] > pMenuLevel ) { object = objFrm.document.getElementById(MenuArr[i]); object.style.visibility = "hidden"; objFrm.document.getElementById('IF_'+object.id).style.visibility="hidden"; MenuStr = MenuStr.replace(MenuArr[i]+',',''); } } MenuList[pCtrlId] = MenuStr; } catch(e) { } } function vMenu_UnHilightItems ( pCtrlId, pLevel ) { objFrm = window.parent.frames(gSubmenuFrm); var ItemStr = new String(); ItemStr = HLItemList[pCtrlId]; if( typeof ( HLItemList[pCtrlId] ) == 'undefined' || HLItemList[pCtrlId] == null ) return; ItemArr = ItemStr.split(','); for( i=0; i < ( ItemArr.length - 1 ); i++ ) { ItemIds = ItemArr[i].split('_'); if(ItemIds[2] >= pLevel ) { if( ItemIds[2] == 1 ) { objmfr = window.parent.frames(gMainmenuFrm); object = objmfr.document.getElementById(ItemArr[i]); object.className = gCSSList[pCtrlId][1]; objmfr.document.getElementById(object.id+'_1').className = gCSSList[pCtrlId][4]; objmfr.document.getElementById(object.id+'_2').className = gCSSList[pCtrlId][7]; } // case : Item will be on submenu frame, use submenu frame reference to unhighlight item else { object = objFrm.document.getElementById(ItemArr[i]); object.className = gCSSList[pCtrlId][1]; objFrm.document.getElementById(object.id+'_1').className = gCSSList[pCtrlId][4]; objFrm.document.getElementById(object.id+'_2').className = gCSSList[pCtrlId][7]; } ItemStr = ItemStr.replace(ItemArr[i]+',',''); } } HLItemList[pCtrlId] = ItemStr; } function vMenu_HighlightItems ( pCtrlId, pEventItemId, EventFrm ) { objFrm = window.parent.frames(EventFrm); objFrm.document.getElementById(pEventItemId).className = gCSSList[pCtrlId][2]; objFrm.document.getElementById(pEventItemId+'_1').className = gCSSList[pCtrlId][5]; objFrm.document.getElementById(pEventItemId+'_2').className = gCSSList[pCtrlId][8]; } function vMenu_MenuItem_OnClick ( pTargetPage, pTargetType, pEventItem, pTargetFeatures, pReplace ) { var EventItemId = pEventItem.id; var IDs = EventItemId.split('_'); var CtrlId = new Number(IDs[1]); vMenu_HideSubmenu( CtrlId, 0 ); vMenu_UnHilightItems( CtrlId, 0 ); window.open( pTargetPage, pTargetType, pTargetFeatures, pReplace ); } item function vMenu_MenuItem_OnMouseOut ( pEventItem ) { var EventItemId = pEventItem.id; var IDs = EventItemId.split('_'); var CtrlId = new Number(IDs[1]); var Level = new Number(IDs[2]); vMenu_setMenuTimer ( CtrlId ); } function vMenu_MenuItem_OnMouseOver ( pEventItem ) { var EventItemId = pEventItem.id; var EventFrm = window.name; // split item id, to get detail about item var IDs = EventItemId.split('_'); var CtrlId = new Number(IDs[1]); var Level = new Number(IDs[2]); var ItemType = new Number(IDs[3]); var ItemIndex = new Number(IDs[4]); vMenu_clearMenuTimer ( CtrlId ); if( ( ItemType == 1 ) || ( ItemType == 4 ) ) return; vMenu_HideSubmenu ( CtrlId, Level ); vMenu_UnHilightItems( CtrlId, Level ); if( ItemType == 3 ) { MenuId = 'MNU_' + CtrlId + '_' + (Level+1) + '_' + ItemIndex; vMenu_ShowSubmenu ( EventItemId, MenuId ); vMenu_AddtoMenuList ( CtrlId, MenuId ); } vMenu_HighlightItems ( CtrlId, EventItemId, EventFrm ); vMenu_AddtoHLList ( CtrlId, EventItemId ); } function vMenu_ShowSubmenu ( pEventItemId, pMenuID ) { try { var IDs = pEventItemId.split('_'); var Level = new Number(IDs[2]); var SFrm; if ( Level == 1 ) { SFrm = window.name; objectfrm = window.parent.self; } else { SFrm = gSubmenuFrm; objectfrm = window.parent.frames(SFrm); } objtgtfrm = window.parent.frames(gSubmenuFrm); windowHeight = vMenu_GetWindowHeight ( SFrm ); windowYOffset = vMenu_GetWindowYOffset ( SFrm ); TopVal = vMenu_GetObjectTop ( pEventItemId, SFrm ); object = objtgtfrm.document.getElementById ( pMenuID ); tMenuHeight = object.offsetHeight; if ( Level == 1 ) { windowSubHeight = vMenu_GetWindowHeight ( gSubmenuFrm ); TopVal = TopVal - windowYOffset; windowSubYOffset = vMenu_GetWindowYOffset ( gSubmenuFrm ); TopVal = TopVal + windowSubYOffset; if ( ( TopVal + tMenuHeight ) > ( windowSubHeight + windowSubYOffset ) ) { TopVal = windowSubHeight + windowSubYOffset - tMenuHeight; if(TopVal < 0) TopVal = 0; } } else { if ( ( TopVal + tMenuHeight ) > ( windowHeight + windowYOffset ) ) { TopVal = windowHeight + windowYOffset - tMenuHeight; if(TopVal < 0) TopVal = 0; } } windowXOffset = vMenu_GetWindowXOffset ( gSubmenuFrm ); if ( Level == 1 ) { LeftVal = windowXOffset; } / else { windowWidth = vMenu_GetWindowWidth ( gSubmenuFrm ); LeftVal = vMenu_GetObjectLeft ( pEventItemId, gSubmenuFrm ); object = objectfrm.document.getElementById ( pEventItemId ); ParentWidth = object.offsetWidth; object = objtgtfrm.document.getElementById ( pMenuID ); tMenuWidth = object.offsetWidth; LeftVal = ParentWidth + LeftVal; if (LeftVal + tMenuWidth > windowWidth + windowXOffset) { LeftVal = LeftVal-ParentWidth-tMenuWidth; // case : calculated left is out of window area, set left to zero if(LeftVal<0) LeftVal = 0; } } // set left and top of menu object(table) object.style.left = LeftVal; object.style.top = TopVal; // set visibility of menu object to true object.style.visibility = "visible"; // set iframe position and dimension in such a way that it is displayed // at the same location and of the same dimention object_if = objtgtfrm.document.getElementById('IF_'+object.id); object_if.style.width = object.offsetWidth; object_if.style.height = object.offsetHeight; object_if.style.top = object.style.top; object_if.style.left = object.style.left; // set visibility of iframe related to menu object_if.style.visibility = "visible"; } catch (e) { // debug // alert ('exception:'+e); } } // function determines width of specified frame window // ???? Unsure which condition gives value under which scenario. function vMenu_GetWindowWidth ( pFrm ) { var value = 0; objectfrm = window.parent.frames(pFrm); if ( objectfrm.document.documentElement && objectfrm.document.documentElement.clientWidth ) { value = objectfrm.document.documentElement.clientWidth; } else if ( objectfrm.document.body ) { value = objectfrm.document.body.clientWidth; } if ( isNaN ( value ) ) { value = top.innerWidth; } return (value); } // function determines height of the specified frame window // ???? Unsure which condition gives value under which scenario function vMenu_GetWindowHeight ( pFrm ) { var value = 0; objectfrm = window.parent.frames(pFrm); if ( objectfrm.document.documentElement && objectfrm.document.documentElement.clientHeight ) { value = objectfrm.document.documentElement.clientHeight; } else if ( objectfrm.document.body ) { value = objectfrm.document.body.clientHeight; } if ( isNaN ( value ) ) { value = top.innerHeight; } return (value); } // function that determines verticle offset of specified frame window (based on verticle scroll position) // ???? Unsure which condition gives value under which scenario function vMenu_GetWindowXOffset ( pFrm ) { var value = 0; objectfrm = window.parent.frames(pFrm); if ( objectfrm.document.documentElement && objectfrm.document.documentElement.scrollLeft ) { value = objectfrm.document.documentElement.scrollLeft; } else if ( objectfrm.document.body ) { value = objectfrm.document.body.scrollLeft; } return (value); } // function that determines horizontal offset of specified frame window (based on verticle scroll position) // ???? Unsure which condition gives value under which scenario function vMenu_GetWindowYOffset ( pFrm ) { var value = 0; objectfrm = window.parent.frames(pFrm); if ( objectfrm.document.documentElement && objectfrm.document.documentElement.scrollTop ) { value = objectfrm.document.documentElement.scrollTop; } else if ( objectfrm.document.body ) { value = objectfrm.document.body.scrollTop; } return (value); } // calculate Left position of given object from left of the document function vMenu_GetObjectLeft ( pObjectName, pFrm ) { var value = 0; objectfrm = window.parent.frames(pFrm); object = objectfrm.document.all(pObjectName); // Loopthru parents to calculate left value // until parent is Body or does not have parent container while ( object.tagName != "BODY" && object.offsetParent ) { // retrives reference to the container object of given object object = object.offsetParent; value += object.offsetLeft; } return (value); } // calculates Top position of given object from tope of the document function vMenu_GetObjectTop ( pObjectName, pFrm ) { var value = 0; objectfrm = window.parent.frames(pFrm); object = objectfrm.document.all(pObjectName); value = object.offsetTop; // Loopthru parents to calculate top value // until parent is Body or does not have parent container while ( object.tagName != "BODY" && object.offsetParent ) { // retrives reference to the container object of given object object = object.offsetParent; value += object.offsetTop; } return (value); } // this function sets timer, and Function to be executed after timer time out // settimeout function returns reference, whcih can be used to clear timer // this function is called on mouse out of Menu item, so that Menu is closed automatically after some time function vMenu_setMenuTimer ( pCtrlId ) { gTimer[pCtrlId] = setTimeout('vMenu_HideSubmenu('+pCtrlId+',0);vMenu_UnHilightItems('+pCtrlId+',0);', 1000); } // this function clears timer using timer reference available, called onmouse over of menu item function vMenu_clearMenuTimer ( pCtrlId ) { clearTimeout(gTimer[pCtrlId]); } Hello, I have a website that has some javascript on it, this works fine in Chrome, Opera, Safari and Firefox but not IE (any version I've tried). I've installed Firebug to try to help debug it but that doesn't pick up any issues. I'm not very good when it comes to javascript so would appreciate any assistance. The page with the javascript is he http://www.fantasy-f1-league.com/team3.php You will need to login, please use these details: user: test pw: test The javascript is supposed to update the "Remaining Budget" as you choose options from the dropdowns, it also does a few other things such as prevents submission of invalid team selections. Thanks for any assistance. David I have this problem with a javascript in Internet Explorer 7 and maybe 6. in all browsers it's working fine, but not in IE 7. i've tried security settings and adding to safe websites, but it's not working. the code if to disable some elements when the other is clicked. here's the code, what is wrong with it? Code: function checkthebox() { $('#toggleElement').attr('checked', true); if ($('#toggleElement').is(':checked')) { $('#vastematen .required').attr('disabled', true); $('#eigenmaten').removeAttr('disabled'); } else { $('#vastematen .required').removeAttr('disabled'); $('#eigenmaten').attr('disabled', true); } } function toggleStatus() { if ($('#toggleElement').is(':checked')) { $('#vastematen .required').attr('disabled', true); $('#eigenmaten :input').removeAttr('disabled'); } else { $('#vastematen .required').removeAttr('disabled'); $('#eigenmaten :input').attr('disabled', true); } } thanks in advance I thank you for the help in advance. I am a total noob when it comes to Javascript but I am working on learning it. I am working on a site and used this script http://livepipe.net/ It works in ie fine on their site, but not on mine. On my site it runs on every browser except IE and generates the errors below. It is probably a small issue but please don't get fustrated with my ignorance on js. I am very new to javascript. I usually pay for somebody to do it for me but my connect is not around right now so I am stuck fixing this issue. Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; Comcast Install 1.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729) Timestamp: Fri, 7 May 2010 15:55:29 UTC Message: Object doesn't support this property or method Line: 472 Char: 464 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 12 Char: 2854 Code: 0 URI: http://roadhouserestoration.com/site...y.js?ver=1.3.2 Message: Object doesn't support this property or method Line: 1 Char: 1 Code: 0 URI: http://roadhouserestoration.com/site...pts.js?ver=2.2 Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js Message: Object doesn't support this property or method Line: 460 Char: 1 Code: 0 URI: http://roadhouserestoration.com/js/all.js The actual address to the website is http://roadhouserestoration.com/site |