I have a website (www.taxxman.co m/contacts.html) that contains javascript to round corners and adds a google map on the same page. The problem I'm having is that only the script for google maps works. On the other page, the rounding code works fine. I'm a newbie at javascript, so any help / advice you can give me will be much appreciated. Thanks!
javascript only runs one script???
Collapse
X
-
You will need to provide more details.Originally posted by mmectI have a website (www.taxxman.co m/contacts.html) that contains javascript to round corners and adds a google map on the same page. The problem I'm having is that only the script for google maps works. On the other page, the rounding code works fine. I'm a newbie at javascript, so any help / advice you can give me will be much appreciated. Thanks!
So you say you have two pages. On each of these pages only one script is working? What's the difference between these pages? Do your pages have all the values expected by both scripts? -
You are lucky that both that you want already works. You only need it to work together. This you can achieve easily with "morphing".Originally posted by mmectI have a website (www.taxxman.com/contacts.html) that contains javascript to round corners and adds a google map on the same page. The problem I'm having is that only the script for google maps works. On the other page, the rounding code works fine. I'm a newbie at javascript, so any help / advice you can give me will be much appreciated. Thanks!
Morphing is the process in which you first append the source code of the second page at the end of the first page. Then you take away some unwanted source code parts that came form the second page, one by one, in a way that the code still works. I mean, if you delete some code and one of both desired functions stop working, then undo the changes an try with some other source code parts. At the end you have developed a page where both works.
I want to emphasize that this is a mechanical work, you don't need to understand the source code for it. But of course a little understanding helps much in doing it faster.Comment
-
hi ...
please post the source-code ... simply doing trial&error may get the thing to work ... but i guess that is not the solution for you. lets have a look at it together and you will get explainations why the code is not working and how you may fix it. understanding what you are doing is much better then those simple cut&paste-methods ...
kind regardsComment
-
Here's the script in the header...please let me know if you can help. I'm sure there's some consolidating of the code that I could do...just not sure where to start. Please not that I took out the Google Map Key.
If you go to taxxman.com/contacts, you'll see non-rounded corners...the rest of the site's pages has rounded corners, however...I think the code above is where the problem is.Code:<script src="http://maps.google.com/maps?file=api&v=2&key=<GOOGLE MAP KEY HERE>" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-93.025092, 44.984877), 7); // Miller Tax Service var point = new GPoint(-93.025092, 44.984877); var marker = new GMarker(point); map.addOverlay(marker); //These are map controls. You can add more by going to Google Maps - API map.addControl(new GLargeMapControl()); map.addcontrol(new GMapTypeControl()); } } //]]> </script> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2917358-1"; urchinTracker(); </script> <script type="text/javascript" src="rounded_corners.js"></script> <script type="text/javascript"> window.onload = function() { /* The new 'validTags' setting is optional and allows you to specify other HTML elements that curvyCorners can attempt to round. The value is comma separated list of html elements in lowercase. validTags: ["div", "form"] The above example would enable curvyCorners on FORM elements. */ settings = { tl: { radius: 15 }, tr: { radius: 15 }, bl: { radius: 15 }, br: { radius: 15 }, antiAlias: true, autoPad: true, validTags: ["div"] } /* Usage: newCornersObj = new curvyCorners(settingsObj, classNameStr); newCornersObj = new curvyCorners(settingsObj, divObj1[, divObj2[, divObj3[, . . . [, divObjN]]]]); */ var myBoxObject = new curvyCorners(settings, "myBox"); myBoxObject.applyCornersToAll(); } </script>
Thank you all for your responses! I appreciate it.Comment
-
Thanks for spotting that...i fixed that code. The rounded corners are still not working, however. I can't figure out why. If you look at www.taxxman.com , you can see the rounded corners on the page...go back and forth between contact and home and you'll see the difference. I just can't pinpoint why this happens.Originally posted by acoderThe first problem is line 17 in your code. Compare it to line 16. The "c" in "map.addcontrol " needs to be a capital C. If you check the error console in any decent browser, e.g. Firefox, you would see this error flagged up.Comment
-
Are you sure you've fixed it? On the contacts page, the error still shows up.Originally posted by mmectThanks for spotting that...i fixed that code. The rounded corners are still not working, however. I can't figure out why. If you look at www.taxxman.com , you can see the rounded corners on the page...go back and forth between contact and home and you'll see the difference. I just can't pinpoint why this happens.
You have a window.onload for the rounded corner script and body onload for the Google Map script. Either put the load() function into window.onload or the window.onload into load().Comment
-
I updated the Google map code...that works now. Yes, the rounded corner problem still exists. Thanks for the advice, i'll give that a shot and see if it works.Originally posted by acoderAre you sure you've fixed it? On the contacts page, the error still shows up.
You have a window.onload for the rounded corner script and body onload for the Google Map script. Either put the load() function into window.onload or the window.onload into load().
Thanks!Comment
Comment