JavaScript - Added Sharethis Javascript To Page Now My Own Voting Button Doesn't Work
Voting button on the poll in the left column works fine if you take the sharethis javascripts out. Why won't they work together though?
<script type="text/javascript" src="http://www.claimsheaven.co.uk/polls/admin/script.js"></script> <script type="text/javascript">var switchTo5x=true;</script> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript" src="http://s.sharethis.com/loader.js"></script> e.g. on this page: http://www.claimsheaven.co.uk/news/20120305.php Similar TutorialsHi All, Im trying to add some content by JS (which ive done) but i cant click a link i have made; JS: Code: function game() { document.getElementById('title').innerHTML = '<p style="float: left; text-decoration: underline; font-weight: bold;">Deady Teddy</p><img src=css/images/popup/close.png style="float: right; cursor: hand;" href="javascript: hideModal("modalPage");"></img>'; } *Yes i know about the Href but if i put "onClick" it gives errors*; HTML: Code: <a href="javascript:void(0);" onClick="javascript: revealModal('modalPage'); game();">Deady Teddy </a> And place its adding it to: Code: <div id="modalPage"> <div class="modalBackground"></div> <div class="modalContainer"> <div class="modal"> <div class="modalTop" id="title" onselectstart='return false'> </div></div></div></div> Any Idea's? I checked the code for hours and I can't figure out why the form doesn't work. Please, I need help, I need to finish this page. Inside the input form there is a div using visibility:hidden. The div works perfectly when it is selected (show or hide), not problem. The problem is when press the send button the form doesn't send anything, not respond, do nothing!. Any help? Hi! I'm new to JavaScript and I've done some small adjustments to my clients site, but it won't show properly in IE (the shadowbox js at least.). I thought js was accepted in all newer browsers. Do you have a quick fix or idea on why it doesn't work? You can view source on my site, I use mootools, and shadowbox/corners and rightclick blocker. Is it generally a 'bad thing' to use js in webpages I want everyone to view in the same way? I tried the same effects with CSS but it's not supported in the same way corss-browser, unfortunately. The 'no selection' CSS class I have on the site is also not accepted in IE. It's very annoying! http://santinacrolla.ihaarr.com/p thank you in advance! It can be found right he http://arkdesigns.ca/AttilaKomaromiJavaCalculator.htm I have javascript enabled on my browsers but it still doesn't work. I see the calculator but pushing the buttons does nothing Any help is appreciated My code is: 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>Javascript Calculator</title> <style> <!-- CSS STYLES GO HERE --> .container { width:500px; height:500px; } .equ { width:99%; height:20px; font-size:20px; text-align:right; margin-bottom:15px; } table { border:1px solid black; padding:5px; width:100%; } table td { margin:3px; text-align:center; width:20%; } .buttons { width:100%; height:50px; font-size:15px; } </style> <script type="text/javascript" src="javascript.js"> </script> </head> <body> <div class="container"> <table cellspacing="0"> <tr> <td colspan="5"><input class="equ" type="input" disabled="disabled" id="equation" value="0"/><input type="hidden" id="previousType" value="-1"/></td> </tr> <tr> <td><input class="buttons" type="button" name="sin" value="sin" onclick="solve ('sin')" /></td> <td><input class="buttons" type="button" name="cos" value="cos" onclick="solve ('cos')" /></td> <td><input class="buttons" type="button" name="tan" value="tan" onclick="solve('tan')" /></td> <td><input class="buttons" type="button" name="sqrt" value="√" onclick="solve('sqrt')" /></td> </tr> <tr> <td><input class="buttons" type="button" name="back" value="←" onclick="remove ();"/></td> <td colspan="2"><input class="buttons" type="button" name="erase" value="C" onclick="clear_equation ();" /></td> <td><input class="buttons" type="button" name="divide" value="/" onclick="equation (this.value, 1)"/></td> </tr> <tr> <td><input class="buttons" type="button" name="seven" value="7" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="eight" value="8" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="nine" value="9" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="multiple" value="*" onclick="equation (this.value, 1)"/></td> </tr> <tr> <td><input class="buttons" type="button" name="four" value="4" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="five" value="5" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="six" value="6" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="subtract" value="-" onclick="equation (this.value, 1)"/></td> </tr> <tr> <td><input class="buttons" type="button" name="one" value="1" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="two" value="2" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="three" value="3" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="plus" value="+" onclick="equation (this.value, 1)"/></td> </tr> <tr> <td colspan="2"><input class="buttons" type="button" name="zero" value="0" onclick="equation (this.value, 2)"/></td> <td><input class="buttons" type="button" name="decimal" value="." onclick="equation (this.value, 3)"/></td> <td><input class="buttons" type="button" name="equal" value="=" onclick="solve ('');"/></td> </tr> </table> </div> </body> </html> i need help with this code why isnt it redirecting me to my other webpage heres the code
Code: <form name="loginform"> <label>User name</label> <input type="text" name="usr" placeholder="username"> <label>Password</label> <input type="password" name="pword" placeholder="password"> <input type="submit" value="Login" onSubmit="validateForm();" /> </form> <script> function validateForm() { var un = document.loginform.usr.value; var pw = document.loginform.pword.value; var username = "username"; var password = "password"; if ((un == username) && (pw == password)) { window.location = "main.html"; return false; } else { alert ("Login was unsuccessful, please check your username and password"); } } </script> Hi every one, i'm new in this forum and also quite new in coding i wrote some code to login and register with php, also using some function with javascript, everything worked fine also with chrome, but suddenly, without change of any code, chrome doesn't activate js functions while FF and IE do activate them. can anyone suggest what could be the reason? ---Edit: as suddenly as it stopped, now it working again. chrome works in mysterious ways... I'm new to the forum. So hi everyone. The code below works fine on IE and FF but not on Google Chrome. Can someone tell me where I'm doing wrong? Thank you for your answers in advance. Im really looking forward much to hearing from you. You can preview the below code by pasting it to Frontpage, Dreamweaver and etc. Quote: <!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"> <!-- function show(id) { if (document.getElementById(id).style.display == 'none') { document.getElementById(id).style.display = ''; } } //--> <!-- function hide(id) { document.getElementById(id).style.display = 'none'; } //--> </script> </head> <body> <div> <div> <table cellspacing="1" cols="3" border="0"> <tbody> <td><a onfocus="hide('tblB');hide('tblC');show('tblA');" href="#">A</a> <td><a onfocus="hide('tblA');hide('tblC');show('tblB');" href="#">B</a> <td><a onfocus="hide('tblB');hide('tblA');show('tblC');" href="#">C</a> </td> </tr> </tbody> </table> </div> <div> <table id="tblA" style="DISPLAY: none" cols="1" cellpadding="2"> <tbody> <tr valign="top" align="left"> <td> You select A, table tblA is shown </td> </tr> </tbody> </table> </div> <div> <table id="tblB" style="DISPLAY: none" cols="1" cellpadding="2"> <tbody> <tr valign="top" align="left"> <td> You select B, table tblB is shown </td> </tr> </tbody> </table> </div> <div> <table id="tblC" style="DISPLAY: none" cols="1" cellpadding="2"> <tbody> <tr valign="top" align="left"> <td> You select C, table tblC is shown </td> </tr> </tbody> </table> </div> </div> </body> </html> I have a website at: http://www.zionism101.org/defaultfornow.aspx The page works on Google Chrome, Mozilla Firefox, and IE-9. It sort-of works on IE-8, however, the problem is that on IE-8, there is about 2 seconds where everything is shown on top of everything else in a mess. This is bad. The website is unusual in that it uses a menu to slide screens from right to left. This has implications. For instance, I need the menu to appear on all screens, so I use absolute positioning, and then use javascript to calculate the center position. The same goes for a logo image. And on top of that, some screens (which are really DIVs) have items positioned by absolute and relative positioning within them, and those positions are often calculated via javascript (and then set). On IE-8, the result is not good. I think what is happening is that the browser first shows everything as it appears before javascript is run, and then slowly the javascript is run, which puts everything in the correct position. So initially, not only is everything in the wrong position, but different DIVs appear on top of each other. I could tell every user to get IE-9 or chrome, but thats not a good solution. Thanks, Gid P.S. one solution might be to make the screen go black for an instant, until everything has settled down. If thats the only solution, how would I do that? P.P.S. there are actually 3 pages in the site: the login page, the logout page, and the founders page. Everytime the user switches between them, the jumble for 2 seconds occurs. Hi there, I hope I post this in the right section. I'm trying to do a redirect using the below code: <script type="text/javascript"> window.location.href = "http://google.com" </script> FF and IE work as they should. Chrome doesn't. The request above to http://google.com, gets a 'canceled' status in Chrome browser > Development tools > "Network". I've tried several other functions: location.href = url location.replace(url) document.location = url location.assign(url) window.open(url, '_self') Same code pasted within a local html file works fine. Below is the redirect request that it's canceled by chrome: http://pastebin.com/hD36M1RG Any clues? Thanks FF, Safari, Opera all execute this javascript code to refresh the page properly, but in IE version 8.0.6001.18904 the page doesn't seem to refresh on click of orange_refresh button. I have checked out a different version of IE8, don't recall exact version, but it did seem to work fine in that one, whatever version it was probably the latest now that I think of it. Check out code below any sug.'s could be helpful, though its probably a bug.. Code: <a href="javascript:document.location.reload();" onmouseover="window.status='Refresh'; return true" onmouseout="window.status='Page Refreshed'"><img src="image/orange_refresh.png" width="30" height="30" border="0" /></a> Can someone help me to edit this code...? I already tried to modify the script in many ways, but it doesn't work, I deleted the lines from the password in the script and also deleted the html to fill the password and do not work.. I dont really know wht to do.. I search online for a script, but i only find "user name and password" scripts, I just want a unlimited user name with no passwords... I dont need any type of security in the page, that is why I choose this script, but I dont need the password login.. .. This script is easy for me because it has HTML , I know there are other script on php, but are to complicated for me... I know this is very easy, but I dont know Java script, Im learning now.. NOTE: this page has "User name" and "password" to login or redirect to another page.. But I dont need the password option.. I just need the " user name"... I just want he visitor to Enter his/her "user name" and press login and the website will take him/her to a specific page for this user.. I want to have unlimited "user names" with NO passwords.... Can SOMEONE HELP ME WITH THIS... ====================== Here is the code to edit: =============================== <!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 LANGUAGE="JavaScript"> <!-- The JavaScript Source --> <!-- Begin function Login(){ var done=0; var username=document.login.username.value; username=username.toLowerCase(); var password=document.login.password.value; password=password.toLowerCase(); if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; } if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; } if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; } if (done==0) { alert("Invalid login!"); } } // End --> </SCRIPT> </head> <body> <center> <form name=login> <table width=225 border=0 cellpadding=0> <tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr> <tr><td>Username:</td><td><input type=text name=username></td></tr> <tr><td>Password:</td><td><input type=text name=password></td></tr> <tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr> </table> </form> <p> </p> </center> <p> <p> </body> </html> Good evening. I'm trying to code a website that will read data from an Excel file (stored either locally or elsewhere) and input a row of data (searched based on a Drop-Down List) into a table on the web page itself. Every time I open the page (it's currently stored on my local drive, on a laptop running Windows 7) in IE8, though, I get the error "Automation Server Can't Create Object" and nothing happens. The Excel file doesn't get opened and the table is blank. Thing is, though, I tried opening the same web page on another computer with IE6 and Windows 2000, and the Script works perfectly there. I've been searching for a solution to this for a week, and some people suggested elsewhere that it's a problem with IE8's security settings. I lowered them as far as they'll go and enabled Running the Script Not Marked As Safe for all possible zones, same result, the Script refuses to run with the "Automation Server Can't Create Object" error. Here's the applicable lines of code: function loadData() { // try { var Excel, Book; var a = document.getElementById("projectDrop"); Excel2 = new ActiveXObject("Excel.Application"); <--- This is where the error seems to register Book2 = Excel2.Workbooks.Open("TestSheet.xls"); idTmr = window.setInterval("Cleanup();",1000); var sheet2 = Book2.Worksheets("Sheet1"); var b = document.getElementById('tableDisplay').getElementsByTagName('tr'); Excel2.Visible = false; var i=1; while(sheet2.Cells(i,1).Value != null) { if (sheet2.Cells(i,1).Value == a.options[a.selectedIndex].text) { b[0].cells[0].innerHTML = sheet2.Cells(i,1).Value; b[0].cells[1].innerHTML = sheet2.Cells(i,2).Value; b[0].cells[2].innerHTML = sheet2.Cells(i,3).Value; b[0].cells[3].innerHTML = sheet2.Cells(i,4).Value; } i++; } Excel2.Quit(); // } // catch(e) { // } } I'm completely stumped, everyone. Is it some obscure setting I'm forgetting to check in IE8, is my Java not fully updated, or what is it? Again, it works perfectly on my old Windows 2000 w/ IE6 computer, but not on a recent Windows 7 laptop with IE8. I'd appreciate any help. Thank you. I am sorry if this is a stupid question. I have never really used javascript before. I found some code online that I tried to piece together so I might not even be going about this the right way. I want the background to take up 100% and resize with the browser. That works fine. I also want the text "welcome to the ahi life" stick to the bottom left hand corner and the enter button to stick to the bottom right. I would like these to resize with the browser as well. It all kind of works, except the first time you load the page the text and the button are much smaller than I would like them to be. If you refresh the page everything is correct. The url is http://www.ahiapparel.com/landing.html Code: <style> * { margin: 0; padding: 0; } #bg { position: fixed; top: 0; left: 0; } .bgwidth { width: 100%; } .bgheight { height: 100%; } #page-wrap { position:absolute; bottom:0; left:20px; width: 700px; margin: 50px auto;} #welcometext { position: fixed; bottom: 20px; left: 25px; } .welcometextwidth { width: 7%; } .welcometextheight { height: 7%; } #entertext { position: fixed; bottom: 20px; right: 25px; } .entertextwidth { width: 7%; } .entertextheight { height: 7%; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> $(function funct1() { var theWindow = $(window), $bg = $("#bg"), aspectRatio = $bg.width() / $bg.height(); function resizeBg() { if ( (theWindow.width() / theWindow.height()) < aspectRatio ) { $bg .removeClass() .addClass('bgheight'); } else { $bg .removeClass() .addClass('bgwidth'); } } theWindow.resize(function() { resizeBg(); }).trigger("resize"); }); $(function funct2() { var theWindow = $(window), $welcometext = $("#welcometext"), aspectRatio = $welcometext.width() / $welcometext.height(); function resizewelcometext() { if ( (theWindow.width() / theWindow.height()) < aspectRatio ) { $welcometext .removeClass() .addClass('welcometextheight'); } else { $welcometext .removeClass() .addClass('welcometextwidth'); } } theWindow.resize(function() { resizewelcometext(); }).trigger("resize"); }); $(function funct3() { var theWindow = $(window), $entertext = $("#entertext"), aspectRatio = $entertext.width() / $entertext.height(); function resizeentertext() { if ( (theWindow.width() / theWindow.height()) < aspectRatio ) { $entertext .removeClass() .addClass('entertextheight'); } else { $entertext .removeClass() .addClass('entertextwidth'); } } theWindow.resize(function() { resizeentertext(); }).trigger("resize"); }); </script> My best guess is that either the functions or some of the variables are conflicting somehow, but I have tried just about everything to fix it. Any help would be much appreciated. Thanks! Hi, I have a jsp which has a function gets called during the page unload. This jsp has a form with an action attribute to one servlet. Please find below the code snippet. ---- Java script code --- function logoff() { document.forms["FormName"].rel="nofollow" target="_self"; alert('Submitting the form'); document.forms["FormName"].submit(); } --- HTML form code ----- <body onUnload='logOff()'> <form name ="FormName" method="POST" action='<%=sLogoutResponseURL %>'> Whenever the page gets unloaded always logoff function is getting called. I also get the alert message "Submitting the form". But my servrlet does not get invoked. My application supports logging in with the same user id more than once. Scenario it works: User logs in. Close the application. logoff function is called and servlet gets invoked. Scenario it does not work: User logs in one window. Open one more IE window and and open the application with same user id. this can be repeated. Now when i close the application logoff function is called for all of the window close. But servlet does not gets invoked all the time. Sometimes it stops calling servlet. I have searched over the net and found one solution. Below piece of code will make sure form gets always submitted. -------------------------Start ----------------- function fakeSubmit(event) { var target = event ? event.target : this; /* Fire a submit event */ var fakeEvent = $(target).fire("form:submit"); if (fakeEvent.stopped == false) { /* Call the real submit function */ this._submit(); } } if(window.HTMLElement){ /* DOM-compliant Browsers */ HTMLFormElement.prototype._submit = HTMLFormElement.prototype.submit; HTMLFormElement.prototype.submit = fakeSubmit; } else { /* IE does not expose it's HTMLElement object or its children Let the document load so all forms are accounted for */ document.observe("dom:loaded", function(){ for(var i = 0; i < document.forms.length; i ){ document.forms[i]._submit = document.forms[i].submit; document.forms[i].submit = fakeSubmit; } }); } -----------End ------------------ But this resulted in script error while loading the page "object does not support this method or property" at line where document.observe is there. Kindly help at the earliest. Thanks in advance Santosh Hey Everyone, I'm happy to have joined this forum. I have a javascript countdown but the digits countdown like 14 13 12 11 10 9 8 7 ... and I want it to look like 14 13 12 11 10 09 08 07.... I need this done for Days Hours Minutes and Seconds. Here is the code. Thank you in advanced for your help. Code: <script type="text/javascript"> function cd() { var now = <?php echo $now; ?>; var target = <?php echo $target; ?>; var horizvert = '<?php echo $horizvert; ?>'; var daytext = '<?php echo $daytext; ?>'; var daystext = '<?php echo $daystext; ?>'; var hourtext = '<?php echo $hourtext; ?>'; var hourstext = '<?php echo $hourstext; ?>'; var minutetext = '<?php echo $minutetext; ?>'; var minutestext = '<?php echo $minutestext; ?>'; var secondtext = '<?php echo $secondtext; ?>'; var secondstext = '<?php echo $secondstext; ?>'; var whatnow = '<?php echo $whatnow; ?>'; var redirect = '<?php echo $redirect; ?>'; timediff = target - now; var daysleft = 0; var hoursleft = 0; var minutesleft = 0; var secondsleft = timediff; if (timediff >= 60) { secondsleft = timediff % 60; minutesleft = (timediff - secondsleft) / 60; } if (minutesleft >= 60) { timediff = minutesleft; minutesleft = timediff % 60; hoursleft = (timediff - minutesleft) / 60; } if (hoursleft >= 24) { timediff = hoursleft; hoursleft = timediff % 24; daysleft = (timediff - hoursleft) / 24; } var gmctime = document.getElementById("gmctime"); var gmctimetext = ''; var gmccountdown_timer = setInterval(gmcTimer, 1000); function gmcUpdateDivHorizontal() { gmctimetext = ''; gmctimetext += (daysleft) ? daysleft + (daysleft==1 ? ' '+daytext+' ' : ' '+daystext+' ') : ''; gmctimetext += (hoursleft || daysleft) ? hoursleft + (hoursleft==1 ? ' '+hourtext+' ' : ' '+hourstext+' ') : ''; gmctimetext += (minutesleft || hoursleft || daysleft) ? minutesleft + (minutesleft==1 ? ' '+minutetext+' ' : ' '+minutestext+' ') : ''; gmctimetext += secondsleft + (secondsleft==1 ? ' '+secondtext+' ' : ' '+secondstext+' '); gmctime.innerHTML = gmctimetext; } function gmcUpdateDivVertical() { gmctimetext = ''; gmctimetext += (daysleft) ? daysleft + (daysleft==1 ? ' '+daytext+'<br />' : ' '+daystext+'<br />') : ''; gmctimetext += (hoursleft || daysleft) ? hoursleft + (hoursleft==1 ? ' '+hourtext+'<br />' : ' '+hourstext+'<br />') : ''; gmctimetext += (minutesleft || hoursleft || daysleft) ? minutesleft + (minutesleft==1 ? ' '+minutetext+'<br />' : ' '+minutestext+'<br />') : ''; gmctimetext += secondsleft + (secondsleft==1 ? ' '+secondtext+'<br />' : ' '+secondstext+'<br />'); gmctime.innerHTML = gmctimetext; } function gmcTimer() { if (secondsleft == 0 && minutesleft == 0 && hoursleft == 0 && daysleft ==0) { clearInterval(gmccountdown_timer); if (whatnow == 'text') { document.getElementById('gmcpre').style.display = 'none'; document.getElementById('datetime').style.display = 'none'; document.getElementById('gmcpost').style.display = 'none'; document.getElementById('gmcafter').style.display = 'block'; } else { window.location = redirect; } return; } if (secondsleft > 0) secondsleft--; else { secondsleft = (minutesleft || hoursleft || daysleft) ? 59 : 0; if (minutesleft > 0) minutesleft--; else { minutesleft = (hoursleft || daysleft) ? 59 : 0; if (hoursleft > 0) hoursleft--; else { hoursleft = (daysleft) ? 23 : 0; if (daysleft) daysleft--; } } } if (horizvert == 'Horizontal') { gmcUpdateDivHorizontal(); } else { gmcUpdateDivVertical(); } } } window.onload = cd; </script> I do not know much at all about java but the below is the code I have now. I was told I need to use java script to get what I am looking for PLEASE HELP Code: <?php $connect = mysql_connect("host.address.com", "username", "password") or die ("Hey loser, check your server connection."); mysql_select_db("daobrien21"); ?> <?php // Write out our query to get the list of bar names from our DB. $query = "SELECT Bar FROM Test"; // Execute it, or return the error message if there's a problem. $result = mysql_query($query) or die(mysql_error()); $dropdown = "<select name='Bar'>"; //fetch_assoc will get the rows from the $result and put them into an array // the while loop then loops through the array wrapping the html code around the results // thus generating the dropdown with a list of your bar names while($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['Bar']}'>{$row['Bar']}</option>"; } $dropdown .= "\r\n</select>"; echo $dropdown; ?> <?php $query="select * from Test"; $result = mysql_query("SELECT * FROM Test where City='Murfreesboro'"); ?> <table border=1 style="background-color:#F0F8FF;" > <caption><EM>Murfreesboro Bars</EM></caption> <tr> <th>Bar Name</th> <th>City</th> <th>Address</th> <th>Phone</th> </tr> <?php while($row=mysql_fetch_array($result)){ echo "</td><td>"; echo $row['Bar']; echo "</td><td>"; echo $row['City']; echo "</td><td>"; echo $row['Address']; echo "</td><td>"; echo $row['Phone']; echo "</td></tr>"; } echo "</table>"; ?> What I am looking to do is when someone selects the bar name from the drop down it edits the below table to just display that bars information. Code: top.window.moveTo(0, 0); if (document.all) { top.window.resizeTo(screen.availWidth, screen.availHeight); } else if (document.layers || document.getElementById) { if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) { top.window.outerHeight = screen.availHeight; top.window.outerWidth = screen.availWidth; } } function gcd(a, b) { return (b === 0) ? a : gcd(b, a % b); } var i = 0; var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (; i < data.length; i + 1) { var dataString = data[i].string, dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) !== -1) { return data[i].identity; } } else if (dataProp) { return data[i].identity; } } return data[i].identity; }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index === -1) { return parseFloat(dataString.substring(index + this.versionSearchString.length + 1)); } }, dataBrowser: [ { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, { string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" }, { string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: "Version" }, { prop: window.opera, identity: "Opera" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.vendor, subString: "Camino", identity: "Camino" }, { string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } ], dataOS : [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.userAgent, subString: "iPhone", identity: "iPhone/iPod" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ] }; var version; if (dataString.indexOf(dataBrowser.versionSearch) !== -1) { version = parseFloat(string.indexOf(dataBrowser.versionSearch), 1); } else { version = parseFloat(string.indexOf(dataBrowser.identity), 1); } BrowserDetect.init(); if (dataBrowser.identity === "Chrome") { if (version >= 8) { document.location.replace("main/index.htm"); } else if (version >= 3) { document.location.replace("meh/index.htm"); } else { document.location.replace("http://www.browserchoice.eu/"); } } else if (dataBrowser.identity === "Safari") { if (version >= 5) { document.location.replace("main/index.htm"); } else if (version >= 3) { document.location.replace("meh/index.htm"); } else { document.location.replace("http://www.browserchoice.eu/"); } } else if (dataBrowser.identity === "Opera") { document.location.replace("http://www.google.com/"); } else if (dataBrowser.identity === "Firefox") { document.location.replace("http://www.google.com/"); } else if (dataBrowser.identity === "Mozilla") { document.location.replace("http://www.yahoo.com/"); } else if (dataBrowser.identity === "Explorer") { if (version >= 8) { document.location.replace("meh/index.htm"); } else { document.location.replace("http://www.browserchoice.eu/"); } } For some reason, this script was working before I put in the if statements, but after the if statements were placed in, it stopped auto maximizing as well, and no if statements were added around this. Does anyone know what the problem is? (It's supposed to redirect by browser to one of 3 sites based on how good they are) |