JavaScript - My Code Stopped Working - Has Moz Firefox Changed How They Deal With New Windows ?
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 Similar TutorialsI changed the code and it didn't work, so I tried to put it back to what it was. Now, the whole thing isn't working. I am a lost little child. Can someone help me please. http://www.boothemusic.com/ Here is the code: Code: <html xmlns="http://www.w3.org/1999/xhtml"> <head xmlns=""> <title>Boothe Brothers Music</title> <script type="text/javascript"> function loadContent(page) { switch(page) { case "home": document.getElementById("middle").src = "http://boothemusic.com/middle.html"; break; case "store": document.getElementById("middle").src = "http://boothemusic.com/catalog"; break; case "Electric Guitars": document.getElementById("middle").src = "http://boothemusic.com/catalog/index.php?main_page=index&cPath=1&zenid=9feb6660698a06a51571cc4cef1c3e60"; I left out most of the code because I only edited the line "case "store".....". 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, 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/ I 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 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>") I am ripping my hair out trying to figure out why my innerHTML code is not working. It only works in IE, but keeps failing in Chrome and Firefox. I am using a form text field for customers to enter a Gallery ID (text value in the form field) which I have set up for them in an external js file. I use this code to change the content of div's after it checks the js file for a matching text value. Here is what is happening-- the proper content shows up for a second in Chrome or Firefox if the username value matches, but it pops away really fast and goes back to the login field prompt. Javascript: Code: <head> <script type="text/javascript"> function setinitialvalues(){ document.getElementById('loginblock').style.visibility = 'visible'; document.getElementById('galleryinfo2').style.visibility = 'hidden'; document.getElementById('expiredmessage').style.visibility = 'hidden'; document.getElementById('republish').style.visibility = 'hidden'; document.getElementById('logoutmessage').innerHTML = ""; document.getElementById('logoutmessage2').innerHTML = ""; document.getElementById('logoutmessage').style.visibility = 'hidden'; document.getElementById('logoutmessage2').style.visibility = 'hidden'; } </script> <script type="text/javascript"> function loadcustomer(){ document.getElementById('galleryinfo').innerHTML = ""; document.getElementById('galleryinfo2').innerHTML = ""; document.getElementById('expdatemessage').innerHTML = ""; document.getElementById('expiredmessage').innerHTML = ""; document.getElementById('republish').innerHTML = ""; document.getElementById('logoutmessage').style.visibility = 'hidden'; document.getElementById('logoutmessage2').style.visibility = 'hidden'; document.getElementById('loginblock').innerHTML = "<br /><h4>If you know your Gallery ID, you can enter it here to access your proofing gallery and order page.<br /><br />ENTER GALLERY ID:</h4><form name='form' action='' method='post'><input style='color:#000;' name='username' id='username' onfocus='clearinvalid()' onKeyDown='clearinvalid()'><br /><br /><input style='background-color:#33A1C9;' class='button' id='submitbutton' type='submit' value='Submit' onClick='return galleryid(this.form)'></form><h4><div style='color:#ff0000;' id='invalidmessage'></div></h4><br />Sample Gallery ID: demo<br />(Then click the Submit button. Some browsers do not accept the Enter key.)<br /><br /><a href='#' class='btn btn-lg btn-default'>Back to Menu</a><br /><br />This works on Internet Explorer, Firefox, Opera and Google Chrome. Please use one of these web browsers to log in."; document.getElementById('loginblock').style.visibility = 'visible'; } </script> <script language="javascript" type="text/javascript" src="customergallery.js"></script> </head> HTML: Code: <div style="text-align:center;" id="loginblock"></div> <div id="galleryinfo"></div> <div id="galleryinfo2"></div> <div style="color:#ff0000;" id="expdatemessage"></div> <div style="color:#ff0000;" id="expiredmessage"></div> <div id="republish"></div> <div id="logoutmessage"></div> <div id="logoutmessage2"></div> External customer js file: Code: function Submit(){ if(event.keyCode == 13) { galleryid(); return false; } } function galleryid(){ if (document.getElementById('username').value == 'demo') { var name = "My Photomatic Photo Session"; var sessiondate = "02/22/2014"; var location = "Any town, USA"; var orderlink = "<a href='../../accounts/brown/20140222/myphotomatic20140222.html' target='_blank'>CLICK HERE TO VIEW GALLERY</a>"; var todayDate = new Date(); var expdate = new Date(2015,05,30); comparedate(); } else if (document.getElementById('username').value == '') { document.getElementById('invalidmessage').innerHTML = 'Please enter a value in this field.'; } else { document.getElementById('invalidmessage').innerHTML = 'Invalid Gallery ID. Please try again.'; } document.getElementById('username').value = ""; return false; function comparedate() { if (todayDate >= expdate) { document.getElementById('galleryinfo2').innerHTML = "<br /><br />" + name + "<br />Session Date: " + sessiondate + "<br />" + location + "<br /><br />"; document.getElementById('expiredmessage').innerHTML = "This gallery has expired on " + (expdate.getMonth()+1) + "/" + expdate.getDate() + "/" + expdate.getFullYear(); document.getElementById('republish').innerHTML = "<br />If you would like to have this gallery republished, please email me .<br /><br />"; document.getElementById('logoutmessage2').innerHTML = "<a href='javascript:void(0);' onclick='loadcustomer(); clearusername(); setinitialvalues();' class='btn btn-lg btn-default'>Click here to return to the Login</a><br /><br />"; document.getElementById('galleryinfo2').style.visibility = 'visible'; document.getElementById('expiredmessage').style.visibility = 'visible'; document.getElementById('republish').style.visibility = 'visible'; document.getElementById('logoutmessage2').style.visibility = 'visible'; document.getElementById('loginblock').innerHTML = ""; document.getElementById('loginblock').style.visibility = 'hidden'; } else { loadcustomer(); document.getElementById('galleryinfo').innerHTML = "<br /><br />" + name + "<br />Session Date: " + sessiondate + "<br />" + location + "<br /><br />" + orderlink + "<br /><br />"; document.getElementById('expdatemessage').innerHTML = "This gallery will expire on " + (expdate.getMonth()+1) + "/" + expdate.getDate() + "/" + expdate.getFullYear() + ".<br /><br />"; document.getElementById('logoutmessage').innerHTML = "<a href='javascript:void(0);' onclick='loadcustomer(); clearusername(); setinitialvalues();' class='btn btn-lg btn-default'>Click here to return to the Login</a><br /><br />"; document.getElementById('logoutmessage').style.visibility = 'visible'; document.getElementById('loginblock').innerHTML = ""; document.getElementById('loginblock').style.visibility = 'hidden'; } } } function clearinvalid(){ document.getElementById('invalidmessage').innerHTML = ''; } function clearusername(){ document.getElementById('username').value = ""; } Where am I going wrong and what can I do to make this work in Chrome and Firefox? It works great in IE. Thanks! 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. Dear friends, I am using a Javascript which perfectly worked in all relevant browsers, including IE6 and IE7. Its advantage has been to be able to specify the window-size + to decide, whether there should be scrollbars or the option to resize it. It is also fully standards-compliant. It opens a new popup window and is triggered via the rel="popup" or rel="popup nofollow" attributes in the specified external links, e.g.: Code: <a href="http://www.codingforums.com/" rel="popup">CodingForums</a> <a href="http://www.codingforums.com/" rel="popup nofollow">CodingForums</a> The code however does not do its job in IE8. It follows the link, but does so in the old window, not a new popup window, and thus recurs to standard behavior of links. Here is the Javascript-Code, included in the header: Code: var properties = { width: 900, height: 450, scrollbars: 'yes', resizable: 'yes' }; function popup(){ var link = this.getAttribute( 'href' ); var prop_str = ''; for( prop in properties ){ prop_str = prop_str + prop + '=' + properties[prop] + ','; } prop_str = prop_str.substr( 0, prop_str.length - 1 ); var newWindow = window.open( link, '_blank', prop_str ); if( newWindow ){ if( newWindow.focus ) newWindow.focus(); return false; } return true; } function setupPopups(){ var links = document.getElementsByTagName( 'a' ); for( var i=0; i<links.length; i++ ){ if( links[i].getAttribute( 'rel' ) && (links[i].getAttribute( 'rel' ) == 'popup' || links[i].getAttribute( 'rel' ) == 'popup nofollow')) links[i].onclick = popup; } } window.onload = function(){ setupPopups(); } Since I am not an expert, I would greatly appreciate help to make this efficent code workable in IE8. Thanks in advance! CodeMat Hello, I have found this JS code that makes a window popunder on the first click when someone clicks anywhere on the page. This code seems to bypass any inbuilt browser pop up blockers. Code: // JavaScript Document var stagedPopFrequency = "1 days"; var stagedCookieName = "__name"; if (!document.currentStage) document.currentStage = 0; document.currentStage++; if (document.currentStage == 1) { function stagedGetCookie(Name) { var search = Name + "="; var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { // if cookie exists offset += search.length; // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue = unescape(document.cookie.substring(offset, end)); } } return returnvalue; } function stagedSetCookie(Name, Value, Expire) { if (Expire != null) { var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + parseInt(Expire)); document.cookie = Name+"="+Value+";path=/;expires=" + expireDate.toGMTString(); } else { document.cookie = Name+"="+Value+";path=/"; } } function stagedResetCookie(Name) { var expireDate = new Date(); expireDate.setDate(expireDate.getDate() - 10); document.cookie = Name+"=;path=/;expires=" + expireDate.toGMTString(); } function stagedPopUnder() { if (stagedGetCookie(stagedCookieName) == '') { var thisStage = 1; var stageFunc = eval('window.popUnderStage'+thisStage); if (stageFunc != undefined) { stageFunc(); stagedSetCookie(stagedCookieName, thisStage + 1, stagedPopFrequency); } } else { var thisStage = parseInt(stagedGetCookie(stagedCookieName)); var stageFunc = eval('window.popUnderStage'+thisStage); if (stageFunc != undefined) { stageFunc(); stagedSetCookie(stagedCookieName, thisStage + 1, stagedPopFrequency); } } } function stagedAttachBody() { if (document.body) { if (document.all) { document.body.attachEvent('onclick', stagedPopUnder); } else { document.body.addEventListener('click', stagedPopUnder, false); } } else { setTimeout('stagedAttachBody()', 200); } } stagedAttachBody(); } if( parseInt(navigator.appVersion) > 3 ) { winWidth = screen.availWidth; winHeight = screen.availHeight; } else { winWidth = "1024"; winHeight = "768"; } var stagedTmpFunc = function() { var pu = window.open("http://www.domain.com", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1"); pu.blur(); window.focus(); } eval('window.popUnderStage'+document.currentStage+' = stagedTmpFunc;'); stagedTmpFunc = null; This will work across IE, FF and Chrome. What im trying to do is get this code to pop 2 windows on the first click. Ive tried calling this script twice in the html but this causes one window to pop on the first click and another on the second. Ive tried to do this: Code: var stagedTmpFunc = function() { var pu = window.open("http://www.domain1.com", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1"); pu.blur(); window.focus(); var pu = window.open("http://www.domain2.com", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1"); pu.blur(); window.focus(); } But this causes IE to keep popping the windows on every single click, I tried another variation, I numbered the second window "var pu2" or something like that, I cant quite remember. But this still did not work. It just caused errors. If this code cannot be edited to pop 2 windows on the first click, does anyone have another code which can and still bypass the pop up blockers built into browsers? Thanks Hello Can anyone help with the following problem On the following page http://www.stroudskittles.co.uk/signingon.html I have a Body onload event (to load the chained Menu) and a windows.onload event (to load the IFrame Ticker) If I open the page in Internet explorer both scripts function; however in Firefox I'm having problems. The Chained Menu works, however the IFrame Ticker does not display. Both events ahave ben placed on the boady tag. Can anyone advise how I can get both to display in Firefox Can anyone 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 I don't understand why this trivial code won't work. I tried to write my own function to handle key events. Looking at w3schools, it seemed there was nothing to it. So I wrote my function, set up the listeners, and it didn't work. O-O So after some tinkering w/ my own code, I figured I HAD to be doing something wrong. So I checked someone elses code on the web, and his doesn't work either. html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="js/js.js"></script> <link rel="stylesheet" type="text/css" href="css/css.css" /> </head> <body onkeypress="captureKey(event);"> </body> </html> js: Code: function captureKey(e) { if (e.keyCode) { keycode=e.keyCode; // works with the DOM } else { keycode=e.which; // Netscape compatible } move = String.fromCharCode(keycode); alert(move); } I know that javascript is enabled because the tut that I pulled this code from works for me...it's just that the stuff I write doesnt work. I never have these weird problems except with javascript... Hello, Im hoping someone can help me, Im trying to pass fields to a javascript function that will check the value of each field and it its empty then it will turn the field color red which is what its doing at the moment, but i want to be able to use this function globaly through out my project, so is there a way of not saying how many fields go in to that array, it will just deal with the amount of fields it gets passed? Thanks Hey everyone here is my code for looking up a city, and state by zip code. I am getting no errors and i believe it should work, but the code does not seem to want to function. Any ideas? Here is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>City and State Lookup</title> <style type="text/css"> h1 { font-family:Arial; color:navy; } p, td { font-family:arial; font-size:11px; } </style> <script type="text/javascript"> /* <![CDATA[ */ var httpRequest = false; function getRequestObject() { try { httpRequest = new XMLHttpRequest(); } catch (requestError) { try { httpRequest = new ActiveXObject ("Msxm12.XMLHTTP"); } catch (requestError) { try { httpRequest = new ActiveXObject ("Microsoft.XMLHTTP"); } catch (requestError) { window.alert("Your browser does not support AJAX!"); return false; } } } return httpRequest; } function updateCityState() { if (!httpRequest) httpRequest = getRequestObject(); httpRequest.abort(); httpRequest.open("get","zip.xml"); httpRequest.send(null); httpRequest.onreadystatechange=getZipInfo; } function getZipInfo() { if (httpRequest.readyState==4 && httpRequest.status == 200) { var zips = httpRequest.responseXML; var locations = zips.getElementsByTagName("Row"); var notFound = true; for (var i=0; i<locations.length; ++i) { if (document.forms[0].zip.value == zips.getElementsByTagName( "ZIP_Code")[i].childNodes[o].nodeValue) { document.forms[0].city.value = zips.getElementsByTagname( "City") [i].childNodes[0].nodeValue; document.forms[0].state.value = zips.getElementByTagName( "State_Abbreviation")[i].childNodes[0].nodeValue; notFound = flase; break; } } if (notFound) { window.alert("Invalid ZIP code!"); document.forms[0].city.value = ""; document.forms[0].state.value = ""; } } } /* ]]> */ </script> </head> <body> <h1>City and State Lookup </h1> <form action=""> <p>Zip code <input type="text" size="5" name="zip" id="zip" onblur="updateCityState()" /></p> <p>City <input type="text" name="city" /> State <input type="text" size="2" name="state" /></p> </form> </body> </html> Hi, I'm new to JS and been thrown in at the deepend as our developer has just left! You are dealing with a total newbie! I have the following script that is not working in FF but is fine in Chrome and IE can anyone tell me what is wrong with it please?! Code: function showTotalCost(val) { if(val=='yes') { if(document.getElementById('secondaryeventtype').value == 'adventure') { document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) + 100).toFixed(2) + ' (including insurance)'; } else { document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) + 27).toFixed(2) + ' (including insurance)'; } } else { document.getElementById('totalcost').innerText = document.getElementById('cost').value; } } Code: function calculateGroupMembers() { var iMultiplier; if(document.getElementById('txtGroup1Firstname').value != '' || document.getElementById('txtGroup1Surname').value != '' || document.getElementById('txtGroup1Email').value != '') { iMultiplier=2; } if(document.getElementById('txtGroup2Firstname').value != '' || document.getElementById('txtGroup2Surname').value != '' || document.getElementById('txtGroup2Email').value != '') { iMultiplier=3; } if(document.getElementById('txtGroup3Firstname').value != '' || document.getElementById('txtGroup3Surname').value != '' || document.getElementById('txtGroup3Email').value != '') { iMultiplier=4; } if(document.getElementById('txtGroup4Firstname').value != '' || document.getElementById('txtGroup4Surname').value != '' || document.getElementById('txtGroup4Email').value != '') { iMultiplier=5; } if(document.getElementById('txtGroup5Firstname').value != '' || document.getElementById('txtGroup5Surname').value != '' || document.getElementById('txtGroup5Email').value != '') { iMultiplier=6; } document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) * iMultiplier).toFixed(2) + ' (inc group members)'; } It is fired from an onblur event in the div below once the chkbox is ticked, the link to the page is https://www.doitforcharity.com/book-...eid=1990&cid=0 but you may need to progress through https://www.doitforcharity.com/book-....aspx?eid=1990 first: Code: <div id="pnlGroupBooking"> <label class="boldfieldlabel" for="chkGroupBooking">Do you wish to book for others too? </label> <input id="chkGroupBooking" type="checkbox" language="javascript" onclick="__doPostBack('chkGroupBooking','')" checked="checked" name="chkGroupBooking"> (you may book up to 5 additional people) <div id="pnlGroupBookingNames" style="border: 1px solid LightGrey; width: 500px;" styles="padding:10px;"> <strong>Group Member Names</strong> <br> <p> </p> <p> </p> <p style="vertical-align: top;"> <strong>1) </strong> <input id="txtGroup1Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup1Firstname"> <input id="txtGroup1Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup1Surname"> <input id="txtGroup1Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup1Email"> <br> <strong>2) </strong> <input id="txtGroup2Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup2Firstname"> <input id="txtGroup2Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup2Surname"> <input id="txtGroup2Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup2Email"> <br> <strong>3) </strong> <input id="txtGroup3Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup3Firstname"> <input id="txtGroup3Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup3Surname"> <input id="txtGroup3Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup3Email"> <br> <strong>4) </strong> <input id="txtGroup4Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup4Firstname"> <input id="txtGroup4Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup4Surname"> <input id="txtGroup4Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup4Email"> <br> <strong>5) </strong> <input id="txtGroup5Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup5Firstname"> <input id="txtGroup5Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup5Surname"> <input id="txtGroup5Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup5Email"> </p> </div> </div> Thanks! Hello all, I have a property of text box which works well in firefox but not in IE ..I am unable to understand why ..andy help is appreciated ? Code: onfocus="this.style.backgroundColor='#F1CC8E';" |