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!
9 1699
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?
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.
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
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.
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. -
<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>
-
-
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.
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.
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.
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().
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!
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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",...
|
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...
|
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...
|
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...
|
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() %>
...
|
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....
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |