JavaScript - Google Sheets Script Help!
Can someone please tell me why my script doesn't work the way its supposed to?
In google sheets If any cell in a row turns red then the firsts cell in that row turns red. its supposed to do the same with yellow and orange. with red always taking priority, so if theres a red cell in the the same row with a yellow or orange it will override the firsts cell with a red background. The yellow and orange codes don't seem to work at all. function MakeRed(){ var book = SpreadsheetApp.getActiveSpreadsheet(); var sheet = book.getActiveSheet(); var first_column = "B"; var first_row = 1; var last_row = sheet.getLastRow(); var last_column = sheet.getLastColumn(); var active_row = 1; var range_input = sheet.getRange(1,1,last_row,last_column); var range_output = sheet.getRange("A1"); var cell_colors = range_input.getBackgroundColors(); var color = "#ff0000"; for(var r = 0; r < cell_colors.length; r++) { var rowWoColA = cell_colors[r].slice(1); if(rowWoColA.indexOf(color)>-1) { cell_colors[r][0]=color; } else { cell_colors[r][0]="#ffffff"; } } range_input.setBackgroundColors(cell_colors);// update sheet colors } function ColorOfCol(){ var book = SpreadsheetApp.getActiveSpreadsheet(); var sheet = book.getActiveSheet(); var range_input = sheet.getDataRange(); var cell_colors = range_input.getBackgrounds(); if (cell_colors.length == 0) throw new Error( 'No data in sheet' ); // List of colors in priority order, default at end. var color = ["#ff0000","#ff9900","#ffff00","#ffffff"]; for (var r = 0; r < cell_colors.length; r++) { // check for all colors EXCEPT our default, the last in color[] for (var b=0; b<color.length-1; b++) { // -1 means not found, but 0 means found in first column, which we don't care about if (cell_colors[r].indexOf(color[b])>0) { // found this color, stop searching, with 'b' == found color break; } } // 'b' will contain the color index. If none found, it will be the last color, our default. cell_colors[r][0]=color[b]; } range_input.setBackgrounds(cell_colors);// update sheet colors } Similar TutorialsIssue 1 - Solved I have this workbook with multiple sheet. I need that the data from the mail sheet gets sorted to the other sheets based on the value in certain cells. https://docs.google.com/a/housing.co...it?usp=sharing IQT 3.0 is the main sheet The condition to copy the data is simple based on data if available in column I to N then the data in that full row should get copied to the sheets with the same name as these columns. multiple entries is possible if you look at the test data Row 2 has data available in 3 columns i,K&L now all the relavent data should get copied to the sheets with the same name as these columns & the data should go under the appropriate columns in these sheets. Issue 2 - Pending Need Help Each error sheet is worked upon by different teams is there a way to ensure that the status of the project in the main sheet cannot be made live till all errors for that particular project have the YES selected under Resolved & Passed by QC. If the Resolved & Passed by QC. are YES for each error in a particular project only then can the status in the main sheet be changed to LIVE & highlighted in green else it should show the status as PENDING only no colour. Once the Status is live then the project should be moved to the archive sheet & also removed from the error sheets so that the only projects visible are the ones pending to be resolved & sorted by process date. also need to ensure that no one except the sheet owner can delete the code or the sheet. I am seeking a way to restyle the google calendar by trying to add a different background color to each day of the month, closest I am getting is this code: Code: @namespace url(http://www.w3.org/1999/xhtml); @-moz-document url-prefix("http://www.google.com/calendar") { .tg-today, .bg-exists .tg-today, .st-bg-today { background-color:#53abdf !important; } .lv-today { /* background-color:#ffffcc !important;*/ } } taken from this small artticle: http://userstyles.org/styles/20934/g...-color-obvious The way I see it, if this code can change the bg color for one day then why can't it work for ANY day "ahead" of time? Hello i have a problem i need to resolve here is the script Code: script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script> <script type="text/javascript"> var map = null; var geocoder = null; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); geocoder = new GClientGeocoder(); } } function showAddress(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(address); } } ); } } </script> </head> <body onload="initialize()" onunload="GUnload()"> <form action="#" onsubmit="showAddress(this.address.value); return false"> <p> <input type="text" size="60" name="address" value="1600 Amphitheatre Pky, Mountain View, CA" /> <input type="submit" value="Go!" /> </p> <div id="map_canvas" style="width: 500px; height: 300px"></div> </form> </body> its all working well but i need to use it differently. Is there a way to make the form submit automatically , i already have the address and i will <php> it from my database. i want that the map will show in the page as soon as the user clicked on an ad(real estate ad). Basically what we need here is: To know how to call the functions and give the address from the database. <body onload="initialize()" onunload="GUnload()"> <form action="#" onsubmit="showAddress(this.address.value); return false"> <p> <input type="text" size="60" name="address" value="1600 Amphitheatre Pky, Mountain View, CA" /> <input type="submit" value="Go!" /> </p> <div id="map_canvas" style="width: 500px; height: 300px"></div> </form> </body> Is there a way just to use this command without the form onsubmit="showAddress(this.address.value); return false">? And give the address as a variable ? and when the page is uploading it will have already passed the address and the map will show Danny I need help making this script output a route on the map on top of the dollar amount it outputs right now. Here is a link to what im working on http://stallionshockey.org/testweb/ Any help would be greatly appreciated Thanks, Josh Hi, I need to allow some other websites to show certain portions of my website as though it were part of theirs. Simplest way would be in an iframe, but I would prefer to make the content available similar to the google map api where something like this is included in the header:- Code: <script src="http://maps.google.com/maps?file=api&v=2&sensor=true&key=blahblahblah" type="text/javascript"> </script> and in the body something like this:- Code: <div id="map" style="width: 740px; height: 520px; margin: 5px 0px 20px 0px; padding: 5px; border: 3px solid #FFDD00;"></div> So I am guessing that something in the file being called in the src of the script tag is replacing the div with id="map" with other contents. Can someone give me a simple example of doing this? Thanks. Hi, I'm having a head against wall session and would appricate some help with modifying a google maps script.... I need the orginal script below; Code: //<![CDATA[ $(document).ready(function() { function initialize() { var myLatlng = new google.maps.LatLng(54.2385,-6.9846); var myOptions = { zoom: 8, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var contentString = '<div id="content">'+ '<h3><? echo $org_name;?></h3>'+ '<div>'+ '<p><a href="#" class="bluelink">Link to profile'+ '#</a></p>'+ '</div>'+ '</div>'; var infowindow = new google.maps.InfoWindow({ content: contentString, maxWidth: 300 }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: '<? echo $org_name;?>', clickable: false, icon: 'http://google-maps-icons.googlecode.com/files/school.png' }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); } // Function added to help reset map and container boundaries $("#showMap").click(function() { $("#tab2").css({'display':'block'}); $("#map_canvas").css({'width':'630px', 'height':'400px'}); initialize(); //alert('showMap Clicked!'); }); initialize(); }); changed to Code: //<![CDATA[ var customIcons = { restaurant: { icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' }, bar: { icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png', shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png' } }; function load() { var map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng(53.943155, -7.437744), zoom: 13, mapTypeId: 'roadmap' }); var infoWindow = new google.maps.InfoWindow; // Change this depending on the name of your PHP file downloadUrl("phpsqlajax_genxml3.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("name"); var address = markers[i].getAttribute("address"); var type = markers[i].getAttribute("type"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customIcons[type] || {}; var marker = new google.maps.Marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindInfoWindow(marker, map, infoWindow, html); } }); } function bindInfoWindow(marker, map, infoWindow, html) { google.maps.event.addListener(marker, 'click', function() { infoWindow.setContent(html); infoWindow.open(map, marker); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function doNothing() {} //]]> In order for the amended code to work I need to include the; // Function added to help reset map and container boundaries $("#showMap").click(function() { $("#tab2").css({'display':'block'}); $("#map_canvas").css({'width':'630px', 'height':'400px'}); initialize(); //alert('showMap Clicked!'); }); initialize(); so that the map will load in a jquery tab... PLEASE HELP ME!!! I have been trying to find out how i can change this basic search script to be able to open on the same page, at the moment when you do a search it opens up on another page, i would like to be able to make this open on the same page, any help would be great! <script language="JavaScript" type="text/javascript"> <!-- function search_google(){ window.open("http://www.google.co.uk/#hl=en&source=hp&q="+document.search.query.value); } //--> </script> <form name="search" onsubmit = "search_google()"> <input type="text" name="query" value=""> <input type="submit" value="Search Google" > </form> Would someone as be so kind to check my google maps script. For some reason the map is centering yet no marker (and info window) is being displayed. I'm (foolishly) using php to echo out the lat and long and the info window content yet everything seems to output okay...... Did a quick java de-bug and found the following error; Quote: Error: myLatlng is not defined Source File: xxx Line: 45 However the lat and lng are echo' out okay and the map is centered on the co-ordinates???? Much thanks!!!! Code: <script type="text/javascript"> function initialize() { var myOptions = { center: new google.maps.LatLng(53.989723,-7.361760), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var contentString = '<div>'+ '<h3 id="fs">Alcohol Early Intervention Project (Cavan/Monaghan)</h1>'+ '<div>'+ '<p>Click here for a streetview map</p>'+ '</div>'+ '</div>'; var infowindow = new google.maps.InfoWindow({ content: contentString }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"Alcohol Early Intervention Project (Cavan/Monaghan)" }); var marker = new google.maps.Marker({ position: map.getCenter(), map: map, title: 'Click to zoom' }); google.maps.event.addListener(marker, 'click', function() { if (map.getZoom() == 13) { map.setZoom(4); } else { map.setZoom(8); } }); } </script> I want to be able to read and write on a Google spreadsheet using a Greasemonkey script that runs on Facebook webpage. I have tried the example made by Google( http://gdata-javascript-client.googl...y_manager.html ) but it doesn't seem to work anymore. Are there any other implementations-examples of a userscript using Google data API to store data? I want to be able to retrieve encryption and decryption passwords on a userscript running on Facebook so it can encrypt-decrypt text. I am having trouble implementing this script. I am not a coder so please give exact, idiot proof advise. :-) Thank You. <script> (function() { var cx = 'user_id:field_id1'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); // This basically takes the value of the radio button (requires jQuery) $("input:radio[name='GCSField']").change(function() { cx = $(this).val(); }); })(); </script> <label for="user1"> <input name=GCSField id="user1" type="radio" value="user_id:field_id1" checked >User Field 1 </label> <label for="user2"> <input name=GCSField id="user2" type="radio" value="user_id:field_id2">User Field 2 </label> <gcse:search></gcse:search> Here is my html. <!DOCTYPE html> <html> <head><meta charset="UTF-8"> <!--[if lt IE 9]><script src=http://html5shiv.googlecode.com/svn/trunk/html5.js></script><![endif]--> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <title>TEST</title> <meta name="robots" content="noindex, nofollow"> <meta name="viewport" content=" width=device-width, initial-scale=1"><meta name="HandheldFriendly" content="true"><meta name="MobileOptimized" content="320"> <style>body{width:100%;max-width:25em;margin-left:auto;margin-right:auto;font-family:Verdana,'Palatino Linotype',Palatino,'Book Antiqua',Arial,Helvetica,sans-serif;text-align:justify;font-size:105%;background-color:#000;background:#000;}p{margin-bottom:1%;}strong{font-size:115%;font-weight:bold;}a{line-height:200%;text-decoration:underline;color:#0007C6;}article{margin: 0 0 1% 0; color:#000;background:#FEE800;background-color:#FEE800; text-align: center;}</style> </head><body> <article> <div><script> (function() { var cx = 'user_id:field_id1'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); // This basically takes the value of the radio button (requires jQuery) $("input:radio[name='GCSField']").change(function() { cx = $(this).val(); }); })(); </script> <label for="user1"> <input name=GCSField id="user1" type="radio" value="011565775292567206849:xkh-s7ljiug" checked >User Field 1 </label> <label for="user2"> <input name=GCSField id="user2" type="radio" value="partner-pub-4173665486685435:n2tml3-z5vf">User Field 2 </label> <gcse:search></gcse:search></div> <div><gcse:searchresults></gcse:searchresults></div> </article> </body></html> Here is the above page off a server TEST Thanks again. Can anyone tell me how I can combine multiple sheets into one?
We've been attempting to set up a drop-down selection box with hidden tables under it for use on a company website. The site has a lot of CSS sheets (like 20 of them) and more could be added at any point so we'd like to write the code to cycle through each one of them to find the correct variable associated with the selections in the drop-down. The code below works fine in dreamweaver, even with the multiple sheets attached, but stops working immediately when putting it in a browser. Any thoughts/suggestions are greatly appreciated. Code: <style type="text/css"> .al {display:none} .ca {display:none} .ct {display:none} .ga {display:none} .il {display:none} .la {display:none} .ma {display:none} .mi {display:none} .mn {display:none} .mo {display:none} .ms {display:none} .nc {display:none} .ne {display:none} .nh {display:none} .nv {display:none} .ny {display:none} .or {display:none} .sc {display:none} .tn {display:none} .tx {display:none} .va {display:none} .vt {display:none} .wa {display:none} .wi {display:none} </style> <script type="text/javascript"> function showHide(cls, show) { for (var i=0; i<document.styleSheets.length; i++) { // browser-compatibility var rule = document.styleSheets[i].rules ? document.styleSheets[i].rules : document.styleSheets[i].cssRules; for (var j = 0; j < rule.length; j++) { if (rule[j].selectorText == "." + cls) { //find css selector rule[j].style.display = (show) ? 'block' : 'none'; } } } } function selAction(sel) { for (var i = 0; i < sel.options.length; i++) { showHide(sel.options[i].value, i == sel.selectedIndex); } } </script> </head> <body> <table> <tr> <td colspan="3"> <select name="type" onchange="selAction(this);"> <strong><option value="et"> Please Select Your State: </option> <option value="al">Alabama</option> <option value="ca">California</option> <option value="ct">Connecticut</option> <option value="ga">Georgia</option> <option value="il">Illinois</option> <option value="la">Louisiana</option> <option value="ma">Massachusetts</option> <option value="mi">Michigan</option> <option value="mn">Minnesota</option> <option value="mo">Missouri</option> <option value="ms">Mississippi</option> <option value="nc">North Carolina</option> <option value="ne">Nebraska</option> <option value="nh">New Hampshire</option> <option value="nv">Nevada</option> <option value="ny">New York</option> <option value="or">Oregon</option> <option value="sc">South Carolina</option> <option value="tn">Tennessee</option> <option value="tx">Texas</option> <option value="va">Virginia</option> <option value="vt">Vermont</option> <option value="wa">Washington</option> <option value="wi">Wisconsin</option></strong> </select> </td> </tr> <tr class="al"> <td> No issues in your state at this time.</td> </tr> <tr class="ca"> <td> No issues in your state at this time. </td> </tr> <tr class="ct"> <td> No issues in your state at this time. </td> </tr> <tr class="ga"> <td> No issues in your state at this time. </td> </tr> <tr class="il"> <td> No issues in your state at this time. </td> </tr> <tr class="la"> <td> No issues in your state at this time. </td> </tr> <tr class="ma"> <td> No issues in your state at this time. </td> </tr> <tr class="mi"> <td> No issues in your state at this time. </td> </tr> <tr class="mn"> <td> No issues in your state at this time. </td> </tr> <tr class="mo"> <td> No issues in your state at this time. </td> </tr> <tr class="ms"> <td> No issues in your state at this time. </td> </tr> <tr class="nc"> <td> No issues in your state at this time. </td> </tr> <tr class="ne"> <td> No issues in your state at this time. </td> </tr> <tr class="nh"> <td> No issues in your state at this time. </td> </tr> <tr class="nv"> <td> No issues in your state at this time. </td> </tr> <tr class="ny"> <td> No issues in your state at this time. </td> </tr> <tr class="or"> <td> No issues in your state at this time. </td> </tr> <tr class="sc"> <td> No issues in your state at this time. </td> </tr> <tr class="tn"> <td> No issues in your state at this time. </td> </tr> <tr class="tx"> <td> No issues in your state at this time. </td> </tr> <tr class="va"> <td> No issues in your state at this time. </td> </tr> <tr class="vt"> <td> No issues in your state at this time. </td> </tr> <tr class="wa"> <td> No issues in your state at this time. </td> </tr> <tr class="wi"> <td> No issues in your state at this time. </td> </tr> </table> </center></td> </tr> </table> </body> </html> I have a page with a GoogleMap with a GoogleBar and I would like the GoogleBar to appear with something written in it already and to have that search executed. In other words, I would like to "write something to the GoogleBar and press Enter" automatically as soon as the map loads. How can I do this? btw: By GoogleBar, I mean the search bar that appears on the map after using the enableGoogleBar() function. Hi, I'm not sure where I have translated this incorrectly. I have one google map embedded on my page which works fine. But I wanted to add a second one. I thought the easiest way to do this would be to have a second page which is called later on with all the details on it for the second map. However although I think (this I presume is where I went wrong) I have replicated the instructions correctly the place holder for the second map just remains blank. This is the code for my called page with the instructions for the second map: PHP Code: <?php echo $_POST['Map'] . '<br />'; ?> <div id="placemap_canvas"></div> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html {height:250px} body {height:250px} #placemap_canvas {width:100%; height:150px;} </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true" /> </script> <script type="text/javascript"> var latlng = new google.maps.LatLng ( <?php include("dbconnect.php"); $result = mysql_query("SELECT * FROM regions WHERE RegionPId='{$_POST['Map']}'"); while($row = mysql_fetch_array($result)){ echo $row['maplink']; } mysql_close($con); ?> ); var myOptions = { zoom: 4, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("placemap_canvas"), myOptions); } </script> And this is the script of the main page, just in case I would be better off keeping them both in one place. Code: <head> <script type="text/javascript"> function loadSubPlace(File,ID,Msg,Eile,EID,Esg){ loadXMLDoc1(File,ID,Msg); var mimer = setTimeout(function(){loadXMLDoc1(Eile,EID,Esg)},5000); } </script> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html {height:250px} body {height:250px} #map_canvas {width:30%; height:250px;} </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true" /> </script> <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng ( <?php include("dbconnect.php"); $result = mysql_query("SELECT * FROM countries WHERE Country='{$_SESSION['Country']}'"); while($row = mysql_fetch_array($result)){ echo $row['Map']; } mysql_close($con); ?>); var myOptions = { zoom: 4, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } </script> </head> <body onload="initialize()"> <div class="countryright" id="map_canvas"> include("dbconnect.php"); $snowball=explode(';',$_POST['syringa']); $turnsol=$snowball[1]; $violet =$snowball[2]; $wakerobin=$snowball[3]; global $turnsol; global $violet; global $wakerobin; echo '<center><b><big>' . $wakerobin. '</big></b></center><br /><br />'; $result=mysql_query("SELECT * FROM regions WHERE country='{$turnsol}' AND region='{$violet}' AND place='{$wakerobin}' AND sub !='' ORDER BY sub ASC"); while($row = mysql_fetch_array($result)){ $wheat="{$row['RegionPId']};{$turnsol};{$violet};{$wakerobin};{$row['sub']}"; $tigerlilly=$row['RegionPId']; echo '<input type="button" class="button3" name="place" id="place" value="' . $row['sub'] . '" onclick="loadSubPlace(\'getPlace.php\',\'txtHintPlaceSub\',\'hepatica=' . urlencode($wheat) . '\',\'getPlaceMap.php\',\'placemapcanvas\',\'Map=' . urlencode($tigerlilly) . '\');" />'; } echo '<input type="button" class="button3" name="addplace" id="addplace" value="Add Place" onclick="loadXMLDoc1(\'getAddPlaceSub.php\',\'txtHintPlaceSub\', encodeURI(\'addsubplace=' . $_POST['syringa'] . '\'));" />'; echo '<br /><br /><div id="txtHintPlaceSub"></div><br /><br />'; mysql_close($con); ?> I've cut out the script that doesn't relate to this so I hope I haven't missed anything important. Can the Google API replace scraping? You can get blocked by Google if you scrape, but can you get the same info from the Google API at no risk?
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 I'm completely at a loss how to embed a map with the new google maps api setup. I found a snippet of code that I dropped in with some small database variables pulled in and was done. Then an error came that the API was no good. So I went in and set up an anaccount, got an api and now I just simply have no clue what their instructions are saying I need to do. Gah! Here's what I originally had: I now have a Client ID, client secret and stuff. But no clue how to set up this url, etc. Code: </script> <script src="//maps.google.com/maps?file=api&v=2&key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI" type="text/javascript"></script> <script type="text/javascript"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(<?php echo $c_row['location_longitude']; ?>,<?php echo $c_row['location_latitude']; ?>), 13); // Add the latitude/longitude marker to the map var point = new GLatLng(<?php echo $c_row['location_longitude']; ?>,<?php echo $c_row['location_latitude']; ?>); map.addOverlay(new GMarker(point)); map.setUIToDefault(); } } </script> <b>Map:<br><br><div id="map_canvas" style="width: 500px; height: 300px; z-index:4000;border-width:medium;border-color:#030;"></div></b> |