473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

javascript only runs one script???

mmect
6
I 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!
Jan 7 '08 #1
9 1699
r035198x
13,262 8TB
I 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!
You will need to provide more details.
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?
Jan 7 '08 #2
chaarmann
785 Expert 512MB
I 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!
You are lucky that both that you want already works. You only need it to work together. This you can achieve easily with "morphing".
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.
Jan 7 '08 #3
gits
5,390 Expert Mod 4TB
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 regards
Jan 7 '08 #4
acoder
16,027 Expert Mod 8TB
If you check the error console, you will see that map.addcontrol is not a function. It should be map.addControl (JavaScript is case-sensitive). This probably prevents the round corner script from working.
Jan 7 '08 #5
mmect
6
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.

Expand|Select|Wrap|Line Numbers
  1. <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<GOOGLE MAP KEY HERE>" type="text/javascript"></script>
  2.  
  3. <script type="text/javascript">
  4.     //<![CDATA[
  5.     function load() {
  6.       if (GBrowserIsCompatible()) {
  7.             var map = new GMap(document.getElementById("map"));
  8.             map.centerAndZoom(new GPoint(-93.025092, 44.984877), 7);
  9.  
  10.             // Miller Tax Service
  11.             var point = new GPoint(-93.025092, 44.984877);
  12.             var marker = new GMarker(point);
  13.             map.addOverlay(marker);
  14.  
  15.             //These are map controls.  You can add more by going to Google Maps - API
  16.             map.addControl(new GLargeMapControl());
  17.             map.addcontrol(new GMapTypeControl());
  18.       }
  19.     }
  20.     //]]>
  21. </script>
  22.  
  23. <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  24. </script>
  25.  
  26. <script type="text/javascript">
  27. _uacct = "UA-2917358-1";
  28. urchinTracker();
  29. </script>
  30.  
  31. <script type="text/javascript" src="rounded_corners.js"></script>
  32.  
  33. <script type="text/javascript">
  34.  
  35.   window.onload = function()
  36.   {
  37.       /*
  38.       The new 'validTags' setting is optional and allows
  39.       you to specify other HTML elements that curvyCorners
  40.       can attempt to round.
  41.  
  42.       The value is comma separated list of html elements
  43.       in lowercase.
  44.  
  45.       validTags: ["div", "form"]
  46.  
  47.       The above example would enable curvyCorners on FORM elements.
  48.       */
  49.       settings = {
  50.           tl: { radius: 15 },
  51.           tr: { radius: 15 },
  52.           bl: { radius: 15 },
  53.           br: { radius: 15 },
  54.           antiAlias: true,
  55.           autoPad: true,
  56.           validTags: ["div"]
  57.       }
  58.  
  59.       /*
  60.       Usage:
  61.  
  62.       newCornersObj = new curvyCorners(settingsObj, classNameStr);
  63.       newCornersObj = new curvyCorners(settingsObj, divObj1[, divObj2[, divObj3[, . . . [, divObjN]]]]);
  64.       */
  65.       var myBoxObject = new curvyCorners(settings, "myBox");
  66.       myBoxObject.applyCornersToAll();
  67.   } 
  68. </script>
  69.  
  70.  
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.

Thank you all for your responses! I appreciate it.
Jan 8 '08 #6
acoder
16,027 Expert Mod 8TB
The 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.
Jan 8 '08 #7
mmect
6
The 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.
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.
Jan 8 '08 #8
acoder
16,027 Expert Mod 8TB
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.
Are 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().
Jan 9 '08 #9
mmect
6
Are 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().
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.

Thanks!
Jan 11 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: alonzo | last post by:
I am working on a piece of javaScript code and using MIE 6.0. I have and error and I would like to use a debugger to locate the error. Is there a debugger for MIE? How do I turn the debugger on...
17
by: Ian | last post by:
Hi there, Can anybody tell me where I can find a standards documents like you have in c#. I am trying to write javascript and would like to know what standards are i.e. Where to put the...
5
by: Steph | last post by:
Hello, Does someone know how can we bring variables from a PHP script to a Javascript one ? I have to build a Javascript function that needs variables generated by a PHP script but i do not...
6
by: simon | last post by:
hello, what code would i use to kick off a javascript script after i had registered it? If (Not Page.IsClientScriptBlockRegistered("jsScript")) Then Page.RegisterClientScriptBlock("jsScript",...
7
by: C.Joseph Drayton | last post by:
I have a problem that I am hoping someone can help me with. First let me describe the problem. I have an HTML form that in one field has an onBlur call to a JavaScript function. When you exit the...
5
by: Martin Walke | last post by:
Hi all, Can someone help me out here? I'm been using ASP and VBScript for some years but have just ventured into the realms of using server side Javascript and apart from hitting various...
4
by: Nate Murray | last post by:
Hey all, I'm having a strange PHP (4.3.10) problem that seems to have something to do with javascript. This is a bit complex, so hold on to your hats. My issue is that a single function is...
7
by: Paulo Roberto | last post by:
Hi everybody, how r u? I hope fine... People, I have a Javascript function wich returns true ou false, how do I assign the result on ASP variable? <% blnResult = Javascript:function() %> ...
84
by: Patient Guy | last post by:
Which is the better approach in working with Javascript? 1. Server side processing: Web server gets form input, runs it into the Javascript module, and PHP collects the output for document prep....
12
by: Anic297 | last post by:
Hi, This is certainly a simple question, but I'm a newbie in JavaScript. Is there a way to know if JavaScript is enabled? My php script uses JavasSript to do something. If JavaScript is not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.