JavaScript - Everything Works Great In Ie But Not In Ff
I have three java functions running on a form and everything works great, but I cannot figure out why Firefox isn't working... This is very frustrating... Any suggestions would be greatly appreciated. Thanks!
Link to form Similar Tutorialsi have a great idea about a website where people make a profile and then make a music playlists based on there moods. but i cant find how to make user accounts. i have a code for the sign up and login sheets, but they lead to nothing. I am a a really new beginner at coding, so any help would be very thankful. This is the code for the sign up sheets: PHP Code: <form id='login' action='login.php' method='post' accept-charset='UTF-8'> <fieldset > <legend>Login</legend> <input type='hidden' name='submitted' id='submitted' value='1'/> <label for='username' >UserName*:</label> <input type='text' name='username' id='username' maxlength="50" /> <label for='password' >Password*:</label> <input type='password' name='password' id='password' maxlength="50" /> <input type='submit' name='Submit' value='Submit' /> </fieldset> </form> AND THIS IS the code for the log in sheet: PHP Code: <form id='register' action='register.php' method='post' accept-charset='UTF-8'> <fieldset > <legend>Register</legend> <input type='hidden' name='submitted' id='submitted' value='1'/> <label for='name' >Your Full Name*: </label> <input type='text' name='name' id='name' maxlength="50" /> <label for='email' >Email Address*:</label> <input type='text' name='email' id='email' maxlength="50" /> <label for='username' >UserName*:</label> <input type='text' name='username' id='username' maxlength="50" /> <label for='password' >Password*:</label> <input type='password' name='password' id='password' maxlength="50" /> <input type='submit' name='Submit' value='Submit' /> </fieldset> </form> Okay so as you could tell by the unfamiliar name, I am a newbie. I have completed the codeacedmy Javascript course and while I know it's not the best for actually getting GOOD at at, it's still taught me a bit. I'm, working with a buddy of mine who is urging me to begin working on something ASAP so that we can start a project together. I suggest making a short RPG, but I'm unsure how I can begin with something like that and what I would need to work on. Or if you have any other projects you can suggest as a good first project to get my feet wet I would be extremely grateful for the help. Thanks in advance!
Can anyone see why this code only shows the image in IE? I realise I could write out the tags in full, but that's not the reason, is it... Code: <script> if (screen.width <= 1024) { document.write("<div style=\"position: absolute; width: 122px; height: 86px; z-index: 1; left: 0px; top: -1px\" id=\"layer2\">"); } if (screen.width == 1920) { document.write("<div style=\"position: absolute; width: 122px; height: 86px; z-index: 1; left: 400px; top: -1px\" id=\"layer2\">"); } else { document.write("<div style=\"position: absolute; width: 122px; height: 86px; z-index: 1; left: 100px; top: -1px\" id=\"layer2\">"); } document.write("<img border=\"0\" src=\"assets/images/flourish4.gif\" width=\"124\" height=\"125\"></div>"); </script> Thanks Something in this function causes it to not work in IE7, but work fine in FF3.5 and IE8. Any idea what it could be? I am creating a list of input boxes in a form. Code: function createOneList() { var formElement = document.getElementById('theGrid'); if (formElement && formElement.parentNode && formElement.parentNode.removeChild) { formElement.parentNode.removeChild(formElement); } //Removes the previous 'theGrid' if you choose another calculation or graph var numberOfData = document.forms[0].datacount.value; //Option number of data points var form = document.createElement("form"); // create a form form.setAttribute("name", "theGrid"); // give form a name form.setAttribute("id", "theGrid"); // give form an id //form.setAttribute("action", "./calculate.php"); // give form an action form.setAttribute("method", "GET"); // give form a method document.body.appendChild(form); // append form to body for (var i=1; i<=numberOfData; i++) { var input = document.createElement("input"); // create an input element input.setAttribute("name", "data[]"); // give input a name input.setAttribute("type", "text"); // make it a text input input.setAttribute("value", ""); // give input a value form.appendChild(input); // append input to form form.appendChild(document.createElement("br")); // create a br tag } form.appendChild(document.createElement("br")); // create a br tag var input = document.createElement("input"); // create an input element input.setAttribute("type", "button"); // make it a submit button input.setAttribute("value", "Calculate"); // give input a value input.onclick = new Function("Display()"); // if Caluclate button is clicked, Display() function is run form.appendChild(input); // append input to form document.getElementsByTagName("body")[0].appendChild(form); // append form to body element } So I have this code listed below: Code: <script type="text/javascript"> if (!window.console) { window.console = { log: function(obj){ /* define own logging function here, or leave empty */ } }; } region=[//2 dimensional array containing area codes and region pairs ["201","nj"], ["202","dc"], ] function getRegion(code){ index=0; while(true){ console.log(index); if(region[index][0]==code){ return(region[index][1]); } index++; if(index>=region.length){ return(undefined); } } } function getLocation(number){ out=document.getElementById('output'); var answer; if(number.length<3){ return(void(0)); } else{ var code=number.substring(0,3); answer=getRegion(code) if(answer==undefined){ out.innerText="unknown area code"; } else{ out.innerText=answer; } } } </script> ... <form> <input type="text" id="number" onkeyup="getLocation(this.value)"> </form> <div id="output"> </div> It works perfectly fine in IE but as soon as I load it in FF it does nothing. Is there something that I am missing? Any help would be appreciated. Go figure huh??? Anyways I have a script a co-worker wrote and it works in FF and Chrome but IE will not work. Get's a 'activeTab' is null or not an object error, I checked for commas and fixed a semi-colon that was missing in two spots but not change in IE. Anyone willing to throw me a bone? code below: Code: <table class="tan-header rounded-box" style="padding:0px;border:0px;width:560px" cellspacing=0 cellpadding=0> <tr class="headerrow"> <td class="main"> <div style="font-weight:bold;padding-top:4px;"> <span ID="Sample Pricing _show" class="arrow-box" style="display:none;"><a href="javascript:Expand('Sample Pricing ');"> <img alt="Click arrow to expand this panel" src="images/right.png" border=0 align="absmiddle"></a></span> <span ID="Sample Pricing _hide" class="arrow-box"><a href="javascript:Contract('Sample Pricing ');"> <img alt="Click arrow to collapse this panel" src="images/down.png" border=0 align="absmiddle"></a></span> Sample Pricing </div> </td> <td class="end"></td> </tr> <tr class="contentrow"> <td class="main"> <div id="Sample Pricing "> <p><em>Based on the following spec's: </em></p> <ul> <li>8.5 x 11 </li> <li>70# high quality opaque paper</li> </ul> <p align="center"> </p> <div align="center"> <table id="pricing_table_tabs"> <th> <td id="option1" class="active_pricing_table_tab">Option 1</td> <td id="option2" class="">Option 2</td> </th> </table> <table width="494" border="1" id="pricing_table1" class="active_table"> <tr> <th width="80" height="30" scope="col">Quantity</th> <th width="95" scope="col">1 Color </th> <th width="95" scope="col">2 Colors</th> <th width="95" scope="col">4 Colors</th> <th width="95" scope="col"> </th> </tr> <tr> <td><div align="center">250</div></td> <td><div align="center">$197.69</div></td> <td><div align="center">$221.58</div></td> <td><div align="center">$420.26</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">500</div></td> <td><div align="center">$210.78</div></td> <td><div align="center">$233.79</div></td> <td><div align="center">$434.75</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">1000</div></td> <td><div align="center">$238.92</div></td> <td><div align="center">$262.30</div></td> <td><div align="center">$446.18</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">2000</div></td> <td><div align="center">$298.84</div></td> <td><div align="center">$316.78</div></td> <td><div align="center">$481.68</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">2500</div></td> <td><div align="center">$328.26</div></td> <td><div align="center">$345.55</div></td> <td><div align="center">$499.10</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">3000</div></td> <td><div align="center">$358.50</div></td> <td><div align="center">$373.05</div></td> <td><div align="center">$513.08</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">4000</div></td> <td><div align="center">$416.68</div></td> <td><div align="center">$430.29</div></td> <td><div align="center">$548.58</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">5000</div></td> <td><div align="center">$476.63</div></td> <td><div align="center">$485.45</div></td> <td><div align="center">$585.15</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">10000</div></td> <td><div align="center">$713.26</div></td> <td><div align="center">$758.94</div></td> <td><div align="center">$751.91</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">15000</div></td> <td><div align="center">$879.51</div></td> <td><div align="center">$925.01</div></td> <td><div align="center">$919.47</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">20000</div></td> <td><div align="center">$1041.92</div></td> <td><div align="center">$1092.30</div></td> <td><div align="center">$1085.25</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> </table> <table width="494" border="1" id="pricing_table2" class="inactive_table"> <tr> <th width="80" height="30" scope="col">Quantity</th> <th width="95" scope="col">1 Color </th> <th width="95" scope="col">2 Colors</th> <th width="95" scope="col">4 Colors</th> <th width="95" scope="col"> </th> </tr> <tr> <td><div align="center">250</div></td> <td><div align="center">$1</div></td> <td><div align="center">$2</div></td> <td><div align="center">$4</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">500</div></td> <td><div align="center">$2</div></td> <td><div align="center">$2</div></td> <td><div align="center">$4</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">1000</div></td> <td><div align="center">$238.92</div></td> <td><div align="center">$262.30</div></td> <td><div align="center">$446.18</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">2000</div></td> <td><div align="center">$298.84</div></td> <td><div align="center">$316.78</div></td> <td><div align="center">$481.68</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">2500</div></td> <td><div align="center">$328.26</div></td> <td><div align="center">$345.55</div></td> <td><div align="center">$499.10</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">3000</div></td> <td><div align="center">$358.50</div></td> <td><div align="center">$373.05</div></td> <td><div align="center">$513.08</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">4000</div></td> <td><div align="center">$416.68</div></td> <td><div align="center">$430.29</div></td> <td><div align="center">$548.58</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">5000</div></td> <td><div align="center">$476.63</div></td> <td><div align="center">$485.45</div></td> <td><div align="center">$585.15</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">10000</div></td> <td><div align="center">$713.26</div></td> <td><div align="center">$758.94</div></td> <td><div align="center">$751.91</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">15000</div></td> <td><div align="center">$879.51</div></td> <td><div align="center">$925.01</div></td> <td><div align="center">$919.47</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> <tr> <td><div align="center">20000</div></td> <td><div align="center">$1041.92</div></td> <td><div align="center">$1092.30</div></td> <td><div align="center">$1085.25</div></td> <td><div align="center"><a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Place_An_Order/form.mdl&FORM_Form_ID=15221">buy now</a></div></td> </tr> </table> </div> <p align="center"> </p> <p align="center"><strong>Can't find what you are looking for - <a href="https://www.secured-site6.com/printcenter/index.iml?mdl=Request_Estimate/form.mdl&FORM_Form_ID=42195">click here</a> to request a custom quote. </strong></p> </body> </html> </div> <div ID="Sample Pricing _instr" class="detail" style="display:none"> (Click the triangle above to expand this panel.) </div> </td> <td class="end"></td> </tr> <tr class="footerrow"> <td class="main"></td> <td class="end"></td> </tr> </table> <br> <style> #pricing_table_tabs{ border-collapse: collapse; } #pricing_table_tabs td{ border: 2px solid #ccc; padding: 5px; font-size:1.2em; font-weight:bold; } #pricing_table_tabs td:hover{ cursor: pointer; } .active_pricing_table_tab{ background-color: black; border-style: inset; color:white; } .active_table{display:block;} .inactive_table{display:none;} </style> <script language="javascript" type="text/javascript"> var activeTab = document.getElementById("option1"); var activePricingTable = document.getElementById("pricing_table1"); function activateTab() { if(activeTab) { activeTab.className = ""; activeTab = document.getElementById(this.id); activeTab.className = "active_pricing_table_tab"; activatePricingTable(activeTab.id); } else { activeTab = document.getElementById(this.id); activeTab.className = "active_pricing_table_tab"; activatePricingTable(activeTab.id); } } function activatePricingTable(activeTabId) { if(activePricingTable) { activePricingTable.className = "inactive_table"; activePricingTable = document.getElementById("pricing_table" + activeTabId.charAt(activeTabId.length - 1)); activePricingTable.className = "active_table"; } else { activePricingTable = document.getElementById("pricing_table" + activeTabId.charAt(activeTabId.length - 1)); activePricingTable.className = "active_table"; } } for(i=1; i<=2; i++){ if (window.addEventListener){ document.getElementById("option" + i).addEventListener("click", activateTab, false); } else{ document.getElementById("option" + i).attachEvent("onclick", activateTab); } } </script> Hi, I'm a JS newbie, but I came up with a (doubtless flawed) script to swap out flash videos according to the selection from an html form. The script works in IE, and used to work for me in FF3, but no longer works for me in FF3.5.2. The code is as follows: Code: <html> <head> <script type="text/javascript"> function changeEp() { var chosen = prepisodes.value; var swapStr = '<embed src="http://c.brightcove.com/services/viewer/federated_f8/1119352258"\n' + 'bgcolor="#FFFFFF"\n' + 'flashVars="videoId=' + chosen + '&playerId=1119352258&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&"\n' + 'base="http://admin.brightcove.com" name="flashObj"\n' + 'width="100%" height="509" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true"\n' + 'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'; document.getElementById('swapDiv').innerHTML = swapStr; } </script> </head> <body> <div id="swapDiv"> <embed src="http://c.brightcove.com/services/viewer/federated_f8/1119352258" bgcolor="#FFFFFF" flashVars="videoId=6069547001&playerId=1119352258&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&" base="http://admin.brightcove.com" name="flashObj" width="100%" height="509" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed> </div> <div> <select name="prepisodes" id="prepisodes" style="background:white;border:red;width:100%;color:red;font-size:100%;font-family:constantia;" onChange="changeEp();"> <option value="6069547001" style="background:gold;">episode 1: arrival</option> <option value="6081338001">episode 2: the chimes of big ben</option> <option value="6081339001" style="background:gold;">episode 3: a b and c</option> <option value="6081340001">episode 4: free for all</option> <option value="6081341001" style="background:gold;">episode 5: the schizoid man</option> <option value="6081342001">episode 6: the general</option> <option value="6081343001" style="background:gold;">episode 7: many happy returns</option> <option value="6081344001">episode 8: dance of the dead</option> <option value="6081346001" style="background:gold;">episode 9: checkmate</option> <option value="6081349001">episode 10: hammer into anvil</option> <option value="6081345001" style="background:gold;">episode 11: it's your funeral</option> <option value="6081348001">episode 12: a change of mind</option> <option value="6081359001" style="background:gold;">episode 13: do not forsake me oh my darling</option> <option value="6081347001">episode 14: living in harmony</option> <option value="6081350001" style="background:gold;">episode 15: the girl who was death</option> <option value="6081351001">episode 16: once upon a time</option> <option value="6081352001" style="background:gold;">episode 17: fall out</option> </select> </div> </body> </html> I used the name attribute, as it allowed the script to work in IE, and the id attribute, as it allowed the script to work in FF (at least before I upgraded). Any assistance with this would be much appreciated. Hi friends, Im using javascript for my gallery with slideshow, its perfectly working in 3 browsers like safari, Firefox and chrome but not working in IE7. There is an alignment problem + scripting problem, Pls help me friends asap. Thanks. I just discovered one of my scripts doesn't work quite right on an older version of Firefox(3.622). It does when I reload the page, but not automatically on initial load Any thoughts on what to change? Here's what I have... Code: <script type="text/javascript" src="author_find.js"></script> <img src=/storage/image.gif onload="javascript:doit();" /> <div id="author"></div> Here is the script it is referencing: Code: function doit() { if($('div').hasClass('single-journal-entry-wrapper')) { var theURL = null; var spans = document.getElementsByTagName("span"); for ( var s = 0; s < spans.length; s++ ) { // searching through spans for the class name: var span = spans[s]; if ( span.className.indexOf("posted-by") >= 0 ) { var useit = span.getElementsByTagName("a")[0]; theURL = useit.href; break; // just the one } } if ( theURL == null ) { // alert("failed!"); } else { var parts = theURL.split('/'); var result = parts[parts.length-1]; if (result == "somebodysname") { var txt=document.getElementById("author"); txt.innerHTML="<table width=100px border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr><td>content1</td></tr></table>"; } else if (result == "anothername") { var txt=document.getElementById("author"); txt.innerHTML="content2"; } } }else { } } Hey guys, Working on a large project. Ive created a form that when an anchor is clicked it calls the following javascript. This code executes fine in FF and creates a new select box, input box, and delete anchor. When i attempt this code in IE 8, an error occurs. The error message below and referes to the lines in which i have used the newField array. Code: <script type="text/javascript"> var counter = 0; function moreFields() { var newFields = document.getElementById('rowline').cloneNode(true); var insertHere = document.getElementById('inputgroup'); var newField = newFields.childNodes; counter = document.getElementsByTagName('select').length; newField[2].name = 'item' + counter; counter = document.getElementsByTagName('input').length; newField[5].name = 'amount' + counter; newField[7].style.display = 'block'; insertHere.parentNode.insertBefore(newFields,insertHere); } </script> Error: Object doesn't support this property or method Im guessing this refers to the attempt to use .name/.style . Does anyone know why this is the case or an alternative way to do this? Thanks. Matthew King i got this code from this thread http://www.codingforums.com/showthread.php?t=241809(THanks to jmrker) and i was wondering if you could explain how it works(The creating textboxes and the randomization). Edit: SOrry i forgot to include the code Code: <!DOC HTML> <html> <head> <title> Untitled </title> <script type="text/javascript"> // From: http://www.codingforums.com/showthread.php?t=241809 var maxSeats = 341; var rndSeats = 10; function randOrd() { return (Math.round(Math.random())-0.5); } function createDisplay() { var seating = [];; var str = ''; for (var i=0; i<maxSeats; ++i) { seating.push(0); } for (var i=0; i<maxSeats; i++) { str += '<input type="text" size="1" id="s'+i+'" value="'+seating[i]+'">'; if ((i % 33) == 32) { str += '<br>'; } } document.getElementById('auditorium').innerHTML = str; } var sarr = []; function randomize() { for (var i=0; i<maxSeats; i++) { sarr[i] = i; } sarr.sort(randOrd); } var tptr; var ptr = 0; function pauseDisplay() { document.getElementById('s'+sarr[ptr]).value = 'x'; document.getElementById('s'+sarr[ptr]).style.backgroundColor = 'red'; if (ptr < (maxSeats-rndSeats)) { ptr++; tptr = setTimeout("pauseDisplay()",250); } } window.onload = function() { createDisplay(); randomize(); tptr = setTimeout("pauseDisplay()",250); } </script> </head> <body> <div id="auditorium"></div> </body> </html> Basically, i am creating an expandable/collapsible menu. which works fin in FF and chrome, but not in IE. this is the code i can narrow it down to that is not working: Code: window.addEvent('domready', function() { SqueezeBox.initialize({}); $$('a.modal').each(function(el) { el.addEvent('click', function(e) { new Event(eX).stop(); SqueezeBox.fromElement(el); }); }); }); it keeps giving me errors, but when i take it out, it stops. it works in FF just fine and in chrome just fine. but in IE, it loads with errors and then the function is not working. this is the code for the actual placement of the function: Code: echo '<div class="abstract">'; echo '<div class="top">'; echo '<h2 class="gold bold md-2">'; echo wordwrap($row['vp_name'], 50, '<br>'); echo '</h2>'; echo '<span class="md">'; echo 'Hotel: '; echo '</span>'; echo '<strong class="md">'; echo wordwrap($row['vp_hotel'], 50, '<br>'); echo '</strong>'; echo '<br />'; echo '<span class="md">'; echo 'Price Range: '; echo '</span>'; echo '<strong class="md">'; echo $row['vp_price']; echo '</strong>'; echo '<br />'; echo '<p>'; echo 'Details: '; echo '<span class="expand blue">Expand</span> | <span class="collapse blue">Collapse</span>'; echo '</p>'; echo '</div>'; echo '<div style="overflow:hidden;">'; echo '<div class="more-details clear">'; echo '<ul>'; echo '<li>'; echo $row['vp_desc']; echo '</li>'; if(!empty($row['vp_terms'])){ echo '<li>'; echo $row['vp_terms']; echo '</li>'; } if(!empty($row['vp_website'])){ echo '<li>'; echo '<a href="' . $row['vp_website'] . '" title="" rel="nofollow" target="_blank" class="md">Visit Website</a>'; echo '</li>'; } echo '</ul>'; echo '</div>'; echo '</div>'; echo '</div>'; Hi All I have a content slider, but it only seems to work in FF and not any of the other browsers. I am using Wordpress but its not a plugin This is what I have: page.php Code: <?php if (is_front_page()) { include ("homepage-slider.php"); } ?> homepage-slider.php Code: <!-- Inner content DIVs should always carry "contentdiv" CSS class --> <!-- Pagination DIV should always carry "paginate-SLIDERID" CSS class --> <div id="slider1" class="sliderwrapper"> <div class="contentdiv"> <div class="home-div1"> <div class="home-div-logo"></div> </div> </div> <div class="contentdiv"> <div class="home-div2"> <span></span> </div> </div> <div class="contentdiv"> <div class="home-div3"> <span></span> </div> </div> </div> <div id="paginate-slider1" class="pagination" style="display:none;"> </div> <script type="text/javascript"> featuredcontentslider.init({ id: "slider1", //id of main slider DIV contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"] toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc] nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide. revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover" enablefade: [true, 0.2], //[true/false, fadedegree] autorotate: [true, 4000], //[true/false, pausetime] onChange: function(previndex, curindex){ //event handler fired whenever script changes slide //previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc) //curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc) } }) </script> There are 2 other external files : contentslider.js contentslider.css Click Here to see site. If someone could help I would really appreciate it, been bugging me big time. Cheers, Jay Hi I am new to programming have tried to write a simple HTML page and servlet. Using tomcat. Added a javascript validation function. However when I type wrong it works the first time, displays alert and returns to entry form. on second attempt type in wrong again, expected to see alert and return to entry form but it submits. I am new to programmng and could do with some help can not find any clue, answer to this problem. Have checked javascript is ticked in Firefox 5.0. Set up is I have a HTML page with one javascript check function at present for test development. It is linked to a servlet in tomcat. Problem is when I enter wrong the first time, get alert message and it returns to the HTML orginal page. However if I click on entry field and enter wrong again. It submits the form, does not give an alert or return to the orginal form? Has any one got a solution or is this how validation should work. Code is: Code: <HTML><head><title>Creation of POs</title> <H1>Purchase Order</h1> <script type="text/javaScript"> function check() { check = document.forms[0].SLine1.value; if(check=="wrong"){ alert("enter correct info"); return false; } else { return true; } } </script></head><body bgcolour="yellow"> <form method="GET" action="Distest_session30a_vs1" onSubmit="return check()"> various inputboxes and messages <table> <tr><td><input type="text" name="SLine1"></td></tr> various other lines of inputs boxes </table> <Input type="submit" value="Send now"> </form></body></html> Thanks in advance for any help people can give spent a lot of time on this already and can think of nothing else to try to resolve. Using firefox 5.0, check and javascript is enabled? Any ideas on how I can make this work in IE as well?? It is a code that shows a divide on click and then hides the rest at the same time. live code is also at chryscreations.com/ns/boynames.html Javascript: Code: function showstuff(divID) { els=document.getElementsByName('mydiv') for (var i = 0; i < els.length; i++) { els[i].style.visibility="hidden"; els[i].style.display="none"; } document.getElementById(divID).style.visibility="visible"; document.getElementById(divID).style.display="block"; } HTML Code: <head> <script> window.onload=function() { showstuff(''); } </script> </head> <body> <a href="javascript:showstuff('adivide')">A</a> <a href="javascript:showstuff('bdivide')">B</a> <div name="mydiv" id="adivide"></div> <div name="mydiv" id="bdivide"></div> <body> I have a userscript that helps me move things around on a vB based forum that I moderate. I am using the following to quickly select and submit my selection, however, when it hits the document.vbform.submit(); part of the code the pages just sits there. It does work if the forum ID's I have in place don't line up with any of the forum ID's on the forums but it just will ooad the page and say no such forum exists. So I know submit(); can work..... Code: // INJECT FUNCTION TO PAGE FOR LATER USE window.InjectFunction = function(reg) { if (reg == "na") { var theScr = "" + "function des(id) {" + "\nvar destination = document.getElementsByName('destforumid')[0];" + "\nvar radio = document.getElementsByName('redirect');" + "\nif (id == '39') {" + "\nradio[0].checked = true;" + "\n}" + "\nelse {" + "\nradio[2].checked = true;" + "\n}" + "\nfor ( var i = 0; i < destination.options.length; i++ ) {" + "\nif ( destination.options[i].value == id ) {" + "\ndestination.options[i].selected = true;" + "\nreturn;" + "\n}" + "\n}" + "\ndocument.vbform.submit();" + "\n}" } var scrTag = document.createElement("script") var scrHead = document.getElementsByTagName("head")[0]; scrTag.setAttribute('type', 'text/javascript'); scrTag.appendChild(document.createTextNode(theScr)); scrHead.appendChild(scrTag); } // ADD MENU THAT WILL PASS FORUM IDs AND CALL INJECTED FORUMS window.NewMenu = function(reg) { var divTag = document.createElement("div"); divTag.id = "div1"; divTag.setAttribute("align","left"); divTag.style.margin = "0px auto"; divTag.style.backgroundColor = "#f5edc3"; divTag.style.position = "fixed"; divTag.style.bottom = "0px"; divTag.style.left = "50%"; divTag.style.width = "196px"; divTag.style.marginLeft = "-98px"; divTag.style.height = "auto"; divTag.className ="dynamicDiv"; divTag.zIndex = "1000"; document.body.appendChild(divTag); if (reg == "na") { var dBody = '<div class="newmenu" onClick="des(\'2\');">SELECTION 2 </div>' + '\n<div class="newmenu2" onClick="des(\'43\');">SELECTION 2 </div>' + '\n<div class="newmenu" onClick="des(\'41\');">SELECTION 3 </div>' + '\n<div class="newmenu2" onClick="des(\'15\');">SELECTION 4 </div>' + '\n<div class="newmenu" onClick="des(\'4\');">SELECTION 5 </div>' + '\n<div class="newmenu2" onClick="des(\'3\');">SELECTION 6 </div>' + '\n<div class="newmenu" onClick="des(\'19\');">SELECTION 7 </div>' + '\n<div class="newmenu2" onClick="des(\'39\');">TRASH </div>' ; } divTag.innerHTML = dBody; } var location = window.location.toString(); var region = location.substring((location.indexOf("//") + 2), location.indexOf(".")); var view = location.substring((location.indexOf("board/") + 6), location.indexOf(".php")); if (view == "forumdisplay") { HideMoveClose(); ColorThreads(); } else if (view == "postings") { var destination = document.getElementsByName('destforumid')[0]; if ( destination != null) { ChangeRedirect(); InjectFunction(region); NewMenu(region); ApplyCSS(); window.scrollTo(0,document.body.scrollHeight); } } else if (view == "search") { ColorThreads(); } else { //alert(); } Please note I have edited out a large portion of this code to make the search for the problem a little easier and the code that remains is relevant to the issue. As you can see there are other functions and blah blah but those all work correctly. On the if statements I removed the else if's and else since they are basically just the same thing as the if portion just with a different region code. I have wrapped this whole deal in try {} catch() {} but no errors get thrown. Please any thoughts? Hi, this is a bit of a long question, but I'm not sure what's relevant, so feel free to ignore the irrelevant bits. I have this function: Code: function searchLocations() { var found = false; var input = document.getElementById('autocomplete').value; var inp = input.toLowerCase(); var count = 0; map.closeInfoWindow(); for (var j = 0; j < gmarkers.length; j++) { gmarkers[j].hide(); elabels[j].hide(); var str=gmarkers[j].myname.toLowerCase(); var patt1=inp; if (str.match(patt1)) { found = true; gmarkers[j].show(); var point = gmarkers[j].getPoint(); bounds.extend(point); elabels[j].show(); count++; var q=j; } } if (count==1) { map.setZoom(15); myclick(q); elabels[q].hide(); } else if (count>1) { centerZoom(); } else { alert("No matches found. Please check your spelling or refine your search."); } } which does the following: - checks for matches in the array vs the input from the text box - shows the matching markers on the map - takes note of where the markers are and increases the bounds area to be displayed (this is the var point = gmarkers[j].getPoint(); bounds.extend(point); bit - keeps count of how many matches were made - if it's one match, zooms the map to 15, shows an infowindow - if it's more than one match, fires centerZoom();, another function that either zooms the map in or out (depending on the bounds) so that the matched markers are displayed. Which is all great, as you can see if you type "par" into the search box top right here. The problem is when you type in the second partial match - say "bl" - then it doesn't just use the 3 points from the match, but all the points from the array, meaning that the map zooms out as if it were going to show every marker, even though it only shows a few. So my question (finally) is how can I make sure that the var point = gmarkers[j].getPoint(); bounds.extend(point); bit only picks up the markers that are currently matched? thanks in advance for any suggestions I have been interested in APIs in the last time and i want to know exactly how it works from the server side. so i tried to figure out how the client side API working , first step i took the Google Plus One JS client side code and i tried to figure out how it works , mostly i tried to find how it gets connect to the server side. i couldn't find what this whole code doing , mainly because i focused to find Ajax requests , but there is none of them. this is the api I checked : https://apis.google.com/js/plusone.js now , my questions is simple , i want to know how API connect to the server side , do they use AJAX? what exactly they use to send request to server side ? i need you're help to know more on how api working on Client side , mainly on the connect to the server. so , how it get's done? Hi, I'm making a Google Map that reads info from a database and pulls Twitter usernames from it to plot points on a map. In the infowindow of these points I have some code that displays the Twitter users latest tweet. There's alot of code for this map so i'll only show you the part i'm working on: Code: function readData() { var request = GXmlHttp.create(); request.open("GET", "phpsqlinfo_result.php", true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = GXml.parse(request.responseText); // obtain the array of markers and loop through it i=[0]; markers=[0]; map.getInfoWindow().hide(); gmarkers = []; map.clearOverlays(); side_bar_html = ""; var markers = xmlDoc.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { // obtain the attribues of each marker var lat = parseFloat(markers[i].getAttribute("lat")); var lng = parseFloat(markers[i].getAttribute("lng")); var point = new GLatLng(lat,lng); var label = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var type = markers[i].getAttribute("type"); var html = '<' + 'script src="http://twitter.com/javascripts/blogger.js"><' + '/script><' + 'script type="text/javascript" src="http://twitter.com/statuses/user_timeline/' + label + '.json?callback=twitterCallback2&count=1"><' + '/script><br /><div id="twitter_update_list" style="list-style:none"></div>'; // create the marker var marker = createMarker(point,label,html); map.addOverlay(marker); } // put the assembled side_bar_html contents into the side_bar div document.getElementById("side_bar").innerHTML = side_bar_html; } } request.send(null); } var html is where it's all happening. I'm using the Twitter script from http://limetouch.com/article/valid-x...vascript-code/ and I have it laid out with all them ' + ' to break it up so it doesn't end the actual javascript used to create the map. I'm new to Javascript so I don't know too much. I know that this method is a really backwards way of doing it, but it works for Firefox. I'm able to retrieve the users latest tweet when I click on their map marker. What I want to know is why it doesn't work in any other browser? I've tried IE7+8, Google Chrome, Opera, and Safari and no tweet displays. Sub-question: While a tweet does display in Firefox, the infowindow doesn't resize with the dynamic content. Any way to fix that? hello. ok my problem is that i have to submit 2 or more lines of text to my shopping cart. each line of text has its own form and you cant put more then one line in one form. please help me make this work <NOSCRIPT>This shopping-cart needs JavaScript. Please enable JavaScript in your browser's preferences.</NOSCRIPT> <script> if(typeof navigator.cookieEnabled=="boolean" && !navigator.cookieEnabled) alert("You need to enable Cookies in your browser, before this shopping-cart will work for you!"); </script> <!-- <script src=noper-language-pdt.utf8.js></script> --> <script src=http://www.mlpdecals.com/cgi/nopercart.js></script> <!-- nopERcart Shopping-Cart, from http://ereimer.net/nopercart.htm --> <FORM action="shoppingcart.htm" method=GET onSubmit="return AddToCart(this)"> <font class=bigtext><b>Special Instructions:</b></font><br> <input type=text size=32 maxlength=200 name=USERTEXT> <input type=hidden _PRICE="0.00" _QUANTITY="1" _NAME="special-instructions" _ID="nSPCI"> <input type=submit value="Add Instructions to Cart" class=bigbutton> </FORM> |