JavaScript - Script That Suggests Town/city And Timezone?
I need to have a script which suggests a list of towns, their longitude/lattitudes and timezones based on the user filling in a field.
I've seen scripts like this on many different web pages, so you type in "London" and then it suggests "London, England", "London Ontario" etc. and you can select the correct one. Is there a widely used method of generating a script like this? I'm thinking Google API might be used for this type of thing but I'm not sure. Similar TutorialsI found a little script online, and it seems to work pretty good. But my question is, if someone lives in another time zone, will it display differently for them or will they see what I see? I'm not sure if this is grabbing the timezone from the server or from the users pc. Could anyone help? Code: <script type="text/javascript"> var before="left until your track needs to be in." var current="Deadline is up." var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") function countdown(yr,m,d){ theyear=yr;themonth=m;theday=d var today=new Date() var todayy=today.getYear() if (todayy < 1000) todayy+=1900 var todaym=today.getMonth() var todayd=today.getDate() var todayh=today.getHours() var todaymin=today.getMinutes() var todaysec=today.getSeconds() var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec futurestring=montharray[m-1]+" "+d+", "+yr dd=Date.parse(futurestring)-Date.parse(todaystring) dday=Math.floor(dd/(60*60*1000*24)*1) dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1) dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1) dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1) if(dday==0&&dhour==0&&dmin==0&&dsec==1){ document.forms.count.count2.value=current return } else document.forms.count.count2.value=+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+before setTimeout("countdown(theyear,themonth,theday)",1000) } //enter the count down date using the format year/month/day countdown(2010,04,23) </script> hi, I would like to show a list of pubs in a town that the user has selected from the drop down list http://www.mypubspace.com/dashtest/order.html it is all there working but in a different way If you type Brighton into the Town search, it shows a list of pubs in that town, GREAT! If you click the 'show towns list' link, a drop down appears, (this is where my problem is) When you click the town, I would like to get the list of pubs in that town basically get rid of the form where you type in the box and click the button here is my code HTML and Javascript Code: <html> <body> <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunction(){ var townRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari townRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ townRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ townRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server townRequest.onreadystatechange = function(){ if(townRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = townRequest.responseText; } } var name = document.getElementById('name').value; var county = document.getElementById('county').value; var town = document.getElementById('town').value; var queryString = "?name=" + name + "&county=" + county + "&town=" + town; townRequest.open("GET", "http://www.mypubspace.com/dashtest/pubs.php" + queryString, true); townRequest.send(null); } function townlistFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxTownlist'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } ajaxRequest.open("GET", "http://www.mypubspace.com/dashtest/town-select.php", true); ajaxRequest.send(null); } function countylistFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxCountylist'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } ajaxRequest.open("GET", "http://www.mypubspace.com/dashtest/county-select.php", true); ajaxRequest.send(null); } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <a href="#" onClick="townlistFunction();">show towns list</a> <a href="#" onClick="countylistFunction();">show counties list</a> <div id="ajaxTownlist"></div> <div id="ajaxCountylist"></div> <form name='myForm'> Pub Name: <input type='text' id='name' /> <br /> County: <input type='text' id='county' /> <br /> Town: <input type='text' id='town' /> <input type='button' onclick='ajaxFunction()' value='Query MySQL' /> </form> <div id='ajaxDiv'></div> </body> </html> here is my pubs.php code Code: <?php $dbhost = "xxx"; $dbuser = "xxx"; $dbpass = "xxx"; $dbname = "xxx"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); // Retrieve data from Query String $name = $_GET['rsPubName']; $sex = $_GET['rsTown']; $wpm = $_GET['rsCounty']; // Escape User Input to help prevent SQL Injection $name = mysql_real_escape_string($name); $town = mysql_real_escape_string($town); $county = mysql_real_escape_string($county); //build query $query = "SELECT * FROM pubs WHERE rsTown = '$town'"; $qry_result = mysql_query($query) or die(mysql_error()); //Build Result String $display_string = "<table>"; $display_string .= "<tr>"; $display_string .= "<th>Region</th>"; $display_string .= "<th>Pub Name</th>"; $display_string .= "<th>Town</th>"; $display_string .= "<th>County</th>"; $display_string .= "</tr>"; // Insert a new row in the table for each person returned while($row = mysql_fetch_array($qry_result)){ $display_string .= "<tr>"; $display_string .= "<td>$row[Region]</td>"; $display_string .= "<td>$row[rsPubName]</td>"; $display_string .= "<td>$row[rsTown]</td>"; $display_string .= "<td>$row[rsCounty]</td>"; $display_string .= "</tr>"; } $display_string .= "</table>"; echo $display_string; ?> here is my town_select.php code Code: <?php $dbhost = "xxx"; $dbuser = "xxx"; $dbpass = "xxx"; $dbname = "xxx"; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); // Retrieve data from Query String $town = $_GET['rsTown']; // Escape User Input to help prevent SQL Injection $town = mysql_real_escape_string($town); //build query $query = "SELECT DISTINCT rsTown, COUNT(PUBID) As PubCount FROM pubs GROUP BY rsTown ORDER BY rsTown ASC"; $qry_result = mysql_query($query) or die(mysql_error()); // Insert a new row in the table for each person returned $display_string .= "<form name=\"form3\" method=\"post\" action=\"\">"; $display_string .= "<select name=\"menu2\" onChange=\"MM_jumpMenu('parent',this,0)\" class=\"textbox\">"; $display_string .= "<option value=\"\">Search by Town...</option>"; while($row = mysql_fetch_array($qry_result)){ $display_string .= '<option value="rsTown='.$row['rsTown'].'" onclick=\"ajaxFunction()\" id=\"town\">'.$row['rsTown'].' ('.$row['PubCount'].')</option>'; } $display_string .= "</select>"; $display_string .= "</form>"; echo $display_string; ?> Here is what I'm envisioning: The user selects a state, then in the 'Cities' box, he starts typing the name of his city. However, it autocompletes the name for him based on the state he chose. So if he chose California and started typing in "Los Angeles", it would autocomplete "Los Angeles" for him. Does that make sense? Is there a script out there that can do this? Hi all, Running Firefox 3.6.16 under Linux (64 bit Ubuntu 10.10), I found that the Javascript Date object incorrectly returns the time zone as "EST" (Eastern Standard Time) (I am in New York, USA, GMT-5/GMT-4). It is, however, returning the proper time OFFSET (i.e. GMT-4). Running Firefox 3.6.16 under Windows XP, the Date object correctly returns "EDT" (Eastern Daylight Time) as well as the correct GMT-4. Does Javascript in the browser get it's time info from the OS? Or more specifically, is this error a bug in FIREFOX, or in LINUX? Thanks...... -- Roger The webpage doesn't display the proper times when I load it up. The GMT variable deals with the Greenwich timezone, which that time is used with offset variables in order to get the right times from each respective time zone in the branch offices. So far it seems only houston and new york display the right times or close to it all the other ones are way off. Please help me find the right formulas thank you. <?xml version="1.0" encoding="UTF-8" ?> <!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> <!-- New Perspectives on JavaScript, 2nd Edition Tutorial 2 Case Problem 3 Jackson Electronics World Clock Author: Andy Duren Date: Filename: world.htm Supporting files: je.css, logo.mpg, map.jpg, zones.js --> <title>Jackson Electronics World Clock</title> <link href="je.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="zones.js"></script> <script type = "text/javascript"> function worldClock() { var today = new Date(); var offSet = today.getTimezoneOffset() * 60 * 1000; var GMT = addTime(today, offSet); var houstonoff = -360 * (60 * 1000); var time1 = addTime(GMT, houstonoff); //houston office time var washoff = -480 * (60 * 1000); var time2 = addTime(GMT, washoff); //washington office time var nyoff = -300 * (60 * 1000); var time3 = addTime(GMT, nyoff); //new york office time var englandoff = 0 * (60 * 1000); var time4 = addTime(GMT, englandoff); //london office time var japanoff = 540 * (60 * 1000); var time5 = addTime(GMT, japanoff); //tokyo office time var aussieoff = 660 * (60 * 1000); var time6 = addTime(GMT, aussieoff); //sydney office time document.zones.place1.value = showTime(time1); document.zones.place2.value = showTime(time2); document.zones.place3.value = showTime(time3); document.zones.place4.value = showTime(time4); document.zones.place5.value = showTime(time5); document.zones.place6.value = showTime(time6); } </script> </head> <body onload="setInterval('worldClock()', 1000)"> <form id="zones" name="zones" action=""> <div id="headbar"> <img src="logo.jpg" alt="Jackson Electronics" /> <h2>Corporate Headquarters World Clock</h2> </div> <div id="timemap"> <input id="place1" name="place1" size="7" /> <input id="place2" name="place2" size="7" /> <input id="place3" name="place3" size="7" /> <input id="place4" name="place4" size="7" /> <input id="place5" name="place5" size="7" /> <input id="place6" name="place6" size="7" /> <img src="map.jpg" alt="World Map" id="map" /> <table> <tr> <th id="name1">Houston</th> <th id="name2">London</th> <th id="name3">New York</th> <th id="name4">Seattle</th> <th id="name5">Sydney</th> <th id="name6">Tokyo</th> </tr> </table> <table> <tr> <td id="address3"> <p><b>Jackson Electronics USA</b><br /> 10010 Park Street<br /> New York, NY 10001<br /> <b>Phone: </b>(212) 555-1209<br /> <b>Fax: </b>(212) 555-4001 </p> </td> <td id="address4"> <p><b>Jackson Electronics Ltd.</b><br /> 2349 Mitchell Street<br /> Seattle, WA 65091<br /> <b>Phone: </b>(381) 555-5499<br /> <b>Fax: </b>(381) 555-3181 </p> </td> <td id="address1"> <p><b>Jackson Electronics Latin America</b><br /> 5150 Shasta Lane<br /> Houston, TX 32821<br /> <b>Phone: </b>(817) 555-8190<br /> <b>Fax: </b>(817) 555-2881 </p> </td> </tr> <tr> <td id="address2"> <p><b>Jackson Electronics Europe</b><br /> 18 Northland Avenue<br /> London, England WC2N 5EA<br /> <b>Phone: </b>(+44) 0 870 555 7081<br /> <b>Fax: </b>(+44) 0 870 555 1788 </p> </td> <td id="address5"> <p><b>Jackson Electronics Pacifica</b><br /> 171-105 Thomas Street<br /> Sydney NSW 2000, Australia<br /> <b>Phone: </b>(+61) 2 5555 8993<br /> <b>Fax: </b>(+61) 2 5555 7171 </p> </td> <td id="address6"> <p><b>Jackson Electronics Asia</b><br /> 1-2-99 Sumiyoshi<br /> Hakata-Ku<br /> Tokyo 140-8781 Japan<br /> <b>Phone: </b>(+81) 3 5551 7817<br /> <b>Fax: </b>(+81) 3 5551 2398 </p> </td> </tr> </table> </div> </form> </body> </html> Hi there, I'm new here in this forum and I've registered to ask a question about JavaScript or Jquery. I don't know which to use. I have my code php like that: <?php //Get the data from system and return in EU format function ShowDate() { $Date = date("d"."/"."m"."/"."Y"); return $Date; } //Get the time from system function ShowTime() { $Time = date("H".":"."i"); return $Time; } ?> Now I have two input box <html> <head> </head> <body> Type the date:<input name="txtdate" type="text" class="input" id="txtdate" title="e.g dd/mm/yyyy" value="<?php echo ShowDate(); ?>" size="9" maxlength="10"> <br> Type the time:<input name="txttime" type="text" id="txttime" value="<?php echo ShowTime(); ?>" size="5" maxlength="5"> <br> London: Friday May 21 2010 05:12:00 <br> New York: Friday May 21 2010 00:12:00<br> Hong Kong: Friday May 21 2010 12:12:00<br> Tokyo: Friday May 21 2010 13:12:00<br> </body> </html> So.... the important is the user can interactive with the date. If I change the date or time all this values will be change as well. Someone knows how can I do this? The field txtdate I will get from a calendar plugin (javascript) that I already put in my code. Thank you for your help. Andrei Andrade Ok Codies .... I am still new to javascript and trying to learn on my own to incress my productivity with my job so this is what I need .... I have to call customers back in a two hour window but that two hour window has to be entered on mountain time ... than I am in central time .. than what ever time zone my client is in. So what I am trying to do is ... I hit a drop down and select the Time zone ... than that pulls the two hour windows in the next drop down will give me the resulting 2 hour window for the Moutain time. I now its a simple convertion but when your dealing with 50 clients a day and trying not to over book each two hour slot ... well i start making mistakes. Any advice on a way I could build this ... I have tryed to nest an if statement to a drop down in html and it blew up on me. hiya guys im just trying to get some javascript working that will display on one html page multiple ticking digital clocks representing the accurate time of a host of differents countrys. i currently have managed to get a ticking clock on the page using +++++++++++++++++++++++++ var thetime=new Date(); var nhours=thetime.getHours(); var nmins=thetime.getMinutes(); var nsecn=thetime.getSeconds(); ++++++++++++++++++++++++++++++++ i now need to get other clocks on same page but with the live ticking time from other countrys. i tried for hours searching sites but could not find a solution i understood. i did however add simply add ++++++++++++++++++++ var nhours=thetime.getHours() +7; +++++++++++++++++++ the plus 7 i added was intended to add 7 hours to the clock then i could use this method for all the clocks and it did work it did change the time but there was a problem hong kong is about 8 hours ahead of the uk when its 8pm here its 2am there and if i use this method and i add 6 hours to the getHours variable it then makes the time 26hours rather than 3am here is my code i hope you can be of some help ++++++++++++++++++++++++++++++++++++++++++++++ <html> <HEAD> <TITLE>JavaScript Clock</TITLE> <SCRIPT language="JavaScript"> <!-- function ukclock() { var thetime=new Date(); //var mins=new Date(); //var secn=new Date(); var nhours=thetime.getHours(); //the line below same as above except the +num can be used to add hours to the clock //var nhours=thetime.getHours() +6; var nmins=thetime.getMinutes(); var nsecn=thetime.getSeconds(); var AorP=" "; if (nhours>=12) AorP="P.M."; else AorP="A.M."; if (nhours>=13) nhours-=12; if (nhours==0) nhours=12; if (nsecn<10) nsecn="0"+nsecn; if (nmins<10) nmins="0"+nmins; document.clockform.clockspot.value=nhours+": "+nmins+": "+nsecn+" "+AorP; setTimeout('ukclock()',1000); } //--> </SCRIPT> </head> <BODY onload="ukclock()"> <FORM name="clockform"> Current Time in UK: <INPUT TYPE="text" name="clockspot" size="15"> <br /> </FORM> </body> ++++++++++++++++++++++++++++++++++++++++++++++ I have a site where users enter there certain timezome (+1, +4, -8 etc) and i want to display a clock with the local time on their profile page so when people view there profile they can see currently what time it is for them. I currently a have this. Code: function timeclock() { var t=setTimeout("startclock()",500); } function startclock() { var x = new Date(); var hour = x.getHours(); var min = x.getMinutes(); var sec = x.getSeconds(); if (hour<10){hour="0"+hour} if (min<10){min="0"+min} if (sec<10){sec="0"+sec} document.getElementById("clock").innerHTML=hour+":"+min+":"+sec; timeclock(); } Is it possible to alter the date dependent on the timezone? Maybe put startclock(timezone) andchange it to new Date(timezone);? Hi guys! Very new to registering here, but have lurked the forums for quite a while, and love the help I see the members give to those in need! Well, it's time to call myself: one of those in need! I'm building a "clan" website, and as such, there's things like clan events, competitions, and clan vs clan battles. However, the problem we have is that when listing the time, some people get confused with time zones, and as such, forget we Australians are a day ahead. As such, the easiest way to resolve this would be to have a date and time on the home page which we can then "refer" to when speaking about particular times an event is going to take place. What I pretty much want is something to say in text: "2:30am, Friday the 30th of October 2010" The GMT is going to be set to that of the server, so I'd like it to be GMT-7, so that when people visit the official game's server and see the time, they can then refer it back to our own time zone. I understand that a javascript script for date and time is available quite publically that can add or take 7 hours from your local time and call that the "GMT-7", but not everyone is on GMT+0, and as such, it gives multiple people different timings. I also want the time to update instantly (without refreshing the page). If I could PLEASE get some help, that would be greatly appreciated. I recently designed the website to be Halloween-related, and as such, want to launch it VERY soon (gosh, only 1 day to Halloween! HAPPY HALLOWEEN!), this is the only thing holding me back at the moment... Thank you for any help, I do very much appreciate it. (oh, p.s: I'm VERY new to javascript, and understand VERY little of it, if you give me a script and say "you can change the GMT to -7, please clearly indicate where I can do this as I won't be able to find it myself).. Thank you, thank you, thank you! I have a twitter feed on my site and although am generally happy with it, the time-stamp for each tweet is several hours ahead of my time zone. I've looked through the js files to see if there is anything that allows me to set the timezone but cannot find anything. Anyone know how to reset the time to pacific standard time? Here's the URL http://www.kitchenprose.com/gmtest/index.html Can't for the life of me see anything in the code that controls time zone (would like Pacific Standard time, US) Code: $(document).ready(function() { $.Juitter.start({ searchType:"fromUser", // needed, you can use "searchWord", "fromUser", "toUser" searchObject:"gillesmarini", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma. // The values below will overwrite the ones on the Juitter default configuration. // They are optional here. // I'm changing here as a example only lang:"en", // restricts the search by the given language live:"live-125", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates. placeHolder:"juitterContainer", // Set a place holder DIV which will receive the list of tweets example <div id="juitterContainer"></div> loadMSG: "Loading messages...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on imgName: "loader.gif", // Loading image, to enable it, go to the loadMSG var above and change it to "image/gif" total: 4, // number of tweets to be show - max 100 readMo "Read it on Twitter", // read more message to be show after the tweet content nameUser:"text", // insert "image" to show avatar of "text" to show the name of the user that sent the tweet openExternalLinks:"newWindow", // here you can choose how to open link to external websites, "newWindow" or "sameWindow" filter:"sex->*BAD word*,porn->*BAD word*,****->*BAD word*,****->*BAD word*" // insert the words you want to hide from the tweets followed by what you want to show instead example: "sex->censured" or "porn->BLOCKED WORD" you can define as many as you want, if you don't want to replace the word, simply remove it, just add the words you want separated like this "porn,sex,****"... Be aware that the tweets will still be showed, only the bad words will be removed }); $("#aRodrigo").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"fromUser", searchObject:"mrjuitter,rodrigofante", live:"live-120" // it will be updated every 120 seconds/2 minutes }); }); $("#aIphone").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"searchWord", searchObject:"iPhone,apple,ipod", live:"live-20" // it will be update every 20 seconds }); }); $("#aJuitter").click(function(){ $(".jLinks").removeClass("on"); $(this).addClass("on"); $.Juitter.start({ searchType:"searchWord", searchObject:"Juitter", live:"live-180" // it will be updated every 180 seconds/3 minutes }); }); $("#juitterSearch").submit(function(){ $.Juitter.start({ searchType:"searchWord", searchObject:$(".juitterSearch").val(), live:"live-20", // it will be updated every 180 seconds/3 minutes filter:"sex->*BAD word*,porn->*BAD word*,****->*BAD word*,****->*BAD word*" }); return false; }); $(".juitterSearch").blur(function(){ if($(this).val()=="") $(this).val("Type a word and press enter"); }); $(".juitterSearch").click(function(){ if($(this).val()=="Type a word and press enter") $(this).val(""); }); }); Many thanks! Hi All, I have two scripts which I want to try and integrate. I am using a nice gallery script to show thumbnails which are appended to a an image wrapper which on click of the thumbnail shows the larger image in the image wrapper, I am trying to implement cloud zoom which is a plugin which uses image srcs to then point to an anchor href to show another larger zoom image either in the same place.. which is what I am trying to do or in another div beside. I have had to set me img srcs up in a certain way to easily enter some product details. and I need to try an manipulate the code to make it work to suit my file layout. I am using a var= images [ with a series of file locations and info such as below { src: 'romanticabride/thumbs/tn_Shauna.jpg', srcBig: 'romanticabride/images/Shauna.jpg', title: 'Shauna', longDescription: '<b><H1>Shauna</H1></b><br><b>Romantica Of Devon <br><br><h2>Sizes Available:</h2><br> 6 - 32.<b><br><b><br><b><b><b><H2>Colours Available:</h2><b><br>Various<br>Please Enquire Below<br><br><br><br><a href="mailto:tracy@cherishbridal.co.uk?subject=Web Enquiry Regarding Romantica Shauna Bridal Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>' }, what I need is for cloud zoom to work when the main image wrapper is hovered over which means it will need to add a class or when the whichever srcBig: is hovered over it gets wrapped by href to make the script work . one of my pages is http://www.cherishbridal.co.uk/romaticabride.html the cloud zoom script is at http://www.professorcloud.com/mainsite/cloud-zoom.htm.. I am happy to share a jsfiddle with someone or explain further or post some code. Thank you in advance I have a script that works in seamonkey(my html editor) but when I use it in IE8 it says errors happen. Here's the code (the first line is on line 7 of the html file): Code: <script type="text/javascript"> function enlarge(imageNum) { var numToString = ""; if(parseInt(imageNum) < 10){ numToString = "0" + imageNum; } else { numToString = imageNum + ""; } window.open("images/LgScreenshot"+numToString+".jpg","Screenshot "+imageNum,"status=0,height=675,width=900,resizable=0"); } </script> And the errors: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB0.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.3; .NET CLR 3.0.30729) Timestamp: Wed, 10 Feb 2010 14:58:16 UTC Message: Object expected Line: 150 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html Message: Invalid argument. Line: 18 Char: 1 Code: 0 URI: http://samssc2site.co.cc/Features.html does any expert know how to pass parameters in the <script ..> tag? for instance; Code: <script type="text/javascript" src="script.js ?param1=val1¶m2=val2&etc "> in the javascript script.js, how would we read the params after the question mark? for example, google this; google shopping cart /v2_2/cart.js I need to assign a key in the javascript to actually make the javascript work,. I have a bookmark in chrome , a javascript , which actually works when clicked on it .,. but how can i edit it so that i can actually make it work on click a key or combination of keys. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. i want to declare the key or keycombo in the script itself .,. the script is for catching the selected text on the webpage and opening a new tab(or window) and doing an exact search search of the selected text using google.com .,., So I want it to work it this way ., select the text press a key and it opens a new tab (or window) with an xact search .,. Thanks in advance ., Nani On this website: http://evancoleman.net/index.php I really like on the top how the menu has like 5 or 6 icons, and when you hover over them it shows a bubble with the name in them. Does anybody know where I can find this script? Thanks. Hello again . If these questions concerning Regular Expressions are inappropriate in this forum please let me know . Thank You. This expression <script[^>]*>.*?</script> matches ... Code: <script type="text/javascript">var cnnIsHomePage = true;</script> but not ... Code: <script type="text/javascript"> var cnnIsHomePage = true; </script> Please , how can i match the latter ? Sorry if this isn't JavaScript What would the script be to get something like the image below, when you click the tab, then the picture and headline pops up? Thanks. Hi there, I'm not too familiar with js, so I'm asking for help I have this script below which loads flash object after clicking fb like button. My question is how to do it after clicking the fb like button automatically to recognize youtube flash object or an object from another tube site? Is it possible? Thank you in advance! Code: <script type='text/javascript'> window.fbAsyncInit = function() { FB.init({appId: "0000000000000", status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement("script"); e.async = true; e.src = document.location.protocol + "//connect.facebook.net/en_US/all.js"; document.getElementById("fb-root").appendChild(e); }()); FB.Event.subscribe('edge.create', function(href, widget) { setTimeout("playvideo1();", 0); }); function playvideo1() { document.getElementById('playvideo1').innerHTML = '<object ....... </object>'; } </script> hi, can any tell me that which script they are using?? and plz if u have share it Thanx http://www.nation4all.org/mf/ regards Fawad |