Google Map works in IE's but not working in Firefox and other browser...

 I have added the google map in asp master content page please i request you please give me solutions.


<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg" type="text/javascript">
</script>

<div id="map_canvas" style="width: 80%; height: 500px;">

<!--here my maps :)-->

</div>

<script type="text/javascript">
var map=false;
var geocoder=false;
var location="";
    function abc()
    {
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(37.4419,  -122.1419), 11);
    mapControl = new GMapTypeControl();
    map.addControl(mapControl);
    map.addControl(new GLargeMapControl())
    geocoder = new GClientGeocoder();
    }
    document.body.onload=abc;
    function showAddress()
    {
        location=(document.getElementById("ctl00_ContentPlaceHolder1_DDLLocationList").options[document.getElementById("ctl00_ContentPlaceHolder1_DDLLocationList").selectedIndex].text); // doppdown list that display cities
        if (geocoder)
        {
                geocoder.getLatLng(location, function(point)
                {
                                                if (!point)
                                                {
                                                    alert("Unable to found your location.");
                                                }
                                                else
                                                {
                                                    map.setCenter(point, 11);
                                                    var marker = new GMarker(point);
                                                    map.addOverlay(marker);
                                                    //marker.openInfoWindowHtml(point);
                                                }
                                            });
          }
    }
</script>

 Whats the problem occurs i use the

<asp:DropDownList ID="DDLLocationList" runat="server" onchange="showAddress()">
</asp:DropDownList>

on page loag all the list of cities are bound please help me it doesn't work in FireFox...


Remember to click “Mark as Answer” on the post, if it helps you.
0
dangerouschotu
11/29/2008 5:04:28 PM
asp.net.ajax-discussion 13973 articles. 0 followers. Follow

7 Replies
396 Views

Similar Articles

[PageSpeed] 28

Hello,

ASP.NET Ajax question? :-) 

First, you should try to not write dynamic control id's in javascript. If you have to refer some control id when using master pages, placeholders..., its always a good idea to write that kind of id's from codebehind using ClientID. In your case, you can simply use 'this' in onchange event (onchange="showAddress(this)") and
function showAddress(locationList) {
        var location = locationList.options[locationList.selectedIndex].text;

But, main problem is document.body.onload=abc; line - not working i FF.
You can use <body onload="javascript:abc()"> or just call that method in an inline script after body tag.

0
netlpa
11/30/2008 8:30:29 PM

 Thanx Big Smile netlpa, 

I apply your ideas and tricks in my project and the same problem occurs means this works fine in IE and FF not working

when the FF map page loads it goes to refresh now n number of times.Super Angry

 


Remember to click “Mark as Answer” on the post, if it helps you.
0
dangerouschotu
12/1/2008 5:00:59 PM

You are using "location" as var name, and that is already js property (document, window). Just, change it to for instance 'placement', or use 'location' only as local variable (like I did (in that case you need to delete var location=""; line)).

0
netlpa
12/1/2008 6:27:32 PM

hey dude thanx but it doesn't work so give me your contact mail addres so i send u the sample project application.

 


Remember to click “Mark as Answer” on the post, if it helps you.
0
dangerouschotu
12/1/2008 8:31:01 PM

Hi,

Try to look first at this html. It should work in all browsers. I have tested that in FF, IE and Opera.

<html>
<head>

<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg" type="text/javascript">
</script>

<script>
var map=null;
var geocoder=null;

function abc()
{
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(37.4419,  -122.1419), 11);
    mapControl = new GMapTypeControl();
    map.addControl(mapControl);
    map.addControl(new GLargeMapControl())
    geocoder = new GClientGeocoder();
}


function showAddress(locationList)
{
    var location = locationList.options[locationList.selectedIndex].text;
if (geocoder)
    {
        geocoder.getLatLng(location, function(point)
        {
            if (!point)
            {
                alert("Unable to found your location.");
            }
            else
            {
                map.setCenter(point, 11);
                var marker = new GMarker(point);
                map.addOverlay(marker);
                //marker.openInfoWindowHtml(point);
            }
        });
    }
}

</script>

</head>
<body id="test" onload="javascript:abc()">

<div id="map_canvas" style="width: 80%; height: 500px;">
</div>

<select id="LocationList" onchange="showAddress(this)">
<option value="Austin">Austin</option>
<option value="Los Altos">Los Altos</option>
</select>

</body>

</html>

 
0
netlpa
12/1/2008 9:34:10 PM
Millions of thanks. Big Smile

Remember to click “Mark as Answer” on the post, if it helps you.
0
dangerouschotu
12/3/2008 8:49:51 PM

You are welcome! Smile

0
netlpa
12/3/2008 9:53:48 PM
Reply:

Similar Artilces:

AJAX not working in IE but works on Firefox
I have an ASP.NET application using AJAX.net. However the ajax does not work on IE and everytime I do something it does a full postback. Everything works on firefox except the updating panel does not show up while processing the request. Workls perfectly on local machine. Any idea on why it does not work on IE would be appreciated. Hi, I am afraid we cannot find out the exact root cause without further information captured when the problem occurs. May this helps you: http://forums.asp.net/t/1084001.aspx To troubleshoot this issue, we really need the source code to reproduce the problem,...

In my bank site a browser control that offuscated the key don't works in Firefox but in IE works
Name: Allen Polo Email: polodotallenatgmaildotcom Product: Firefox Release Candidate Summary: In my bank site a browser control that offuscated the key don't works in Firefox but in IE works Comments: In my bank site a browser control that offuscated the key don't works in Firefox but in IE works. The control receive by the keyword clicking on the site avoiding typing on the keyboard. When you made clicks on letters the control works fine but when you click a number the cursor is repositioned at the beginning of the field, if the user is not careful of repositioning t...

I love Firefox! But I just got a new computer with Windows 7, and half the time Firefox wouldn't work for about 3 weeks. It's working now, but I don't know for how long. Please make sure you are comp
Name: Product: Firefox Summary: I love Firefox! But I just got a new computer with Windows 7, and half the time Firefox wouldn't work for about 3 weeks. It's working now, but I don't know for how long. Please make sure you are compatible with Windows 7. Thank you. Comments: See above. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sen...

Healthmap based on google map won't display in Firefox. Works in IE
Name: Matt Email: mpk23biz SNORT yahoo point com Product: Firefox Summary: Healthmap based on google map won't display in Firefox. Works in IE Comments: http://www.healthmap.org/en From URL: http://hendrix.mozilla.org/ ...

Ajax working fine in Firefox but not working in IE
Hi Everyone!   I have a simple HTML page from where I am trying to send User name and Password through ajax to check credentials.  Its works first time fine in IE but after logging out from account and again on trying to login, control stays on same page itself. Its not getting to redirected to User home page even on entring correct details At the same time if I give wrong details, it will show corresponding error.   I am not understanding the problem, please someone help me with this issue.    For reference code is below: //calling login() from the pag...

AJAX page not working with Firefox but works fine with IE
I have an AJAX enabled page that is working great in IE but in firefox, the hyperlinks and buttons within updatepanels are not clickable. This is very odd. There are no javascript errors on the page but in the status bar, a message is constantly displayed saying "transfering data from localhost.....". Does anyone have a clue what could be causing these problem. Update - I removed all of the AJAX update panels on the page and I still am unable to click any links or linkbuttons. The "tranfering data from localhost" message has also disappeared. This led me to believe that something was w...

How can I get out of my Mozilla's browser the Winamp browser and get back the Google's or Mozilla's browser.
Please I have got to my browser ( I don't know how.) the Winamp browser he behave like virus stick in.But he doesn't has uninstalation section so I can't do anything to get him away from Mozilla's file. I'm not happy of Winamp's behave its like advertisement against a customer's will. Please is there any way to get him away from Mozilla?Please send me exact direction I have tried many ways but he is deeply inside the systeme so when I install new Mozilla he is always here ready to pester me. Thank you for an answer. Richard ...

TreeView in IE works doesn't work in FireFox
I have a treeview that works great in IE, but it doesnt work in FireFox. It gives an extra space and a link to a __doPostBack function. Here is the source code from each:from FireFox: <tr class="FreeText">  <td id="_tdManagersTree" align="left" colspan="4">     <div class="SubHeadingBackground" id="_tvManagers" class="SubHeadingBackground">      <table CELLSPACING="0" CELLPADDING="0" BORDER="0">           <TR>        ...

What work with IE does NOT work in FireFox
Name: Bill Schultz Email: altmailatbresnandotnet Product: Firefox Summary: What work with IE does NOT work in FireFox Comments: If you open http://www.allseeingeye.whatshisface.org in Internet Explorer and click on the links you will hear Audio Files play that are attached to the different web pages. You will also notice dissolve transitions between the pages. When you click on the 1st small eyeball you will see a form appear. Now run the same Web Site in FireFox. 1. No Audio. 2. No page transitions. 3. Instead of the form appearing, FireFox gives an error message. It...

Javascript calls aren't working in FireFox, but work in IE
Hello,I wrote some AJAX calls to populate some divs with dynamic content. The links ar ethe up a down arrows on the bottom of Music, Users, New People, etc.  http://www.wisetopic.com/ Notice in IE these work ok, but in firefox they just jump to the top of the screen. Any suggestions? Thanks, -- shawn shawn If you check Error console of FireFox browser, you will find below error on click of those arrows :Error: document.getElementById("artist_start") has no propertiesSource File: http://wisetopic.com/_inc/js/landingPage.jsLine: 93 i think the control "artist_start" ...

JavaScript Calendar Doesn't work in Firefox but works fine in IE
Hello, I am trying to implement a javascript based pop-up calendar in my web app and also add some ATLAS functionality. The calendar works fine in IE 6.0 but just pops-up in Firefox (ver 1.5.0.6) and does nothing else.  As soon as I remove the ATLAS Scriptmanager tag, and all other ATLAS update panels, it work fine.  Here is a sample of the page code without the ATLAS code:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MISys.aspx.vb" Inherits="MISys" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transit...

Collapsible Panel doesn't work in IE with MasterPage (Works in FireFox)
Hi, I have a collapsible panel extender inside a content page using a masterpage <asp:Content ID="Content1" ContentPlaceHolderID="cphPageLayoutContentPlaceHolder" runat="server"> <toolkit:CollapsiblePanelExtender ID="cpeFiltersPanel" runat="server" TargetControlID = "pnlFilters" ExpandControlID = "pnlFiltersHeader" CollapseControlID = "pnlFiltersHeader" Collapsed="true" ImageControlID="imgUpDownArrow" ></toolkit:CollapsiblePanelExtender> This code works in FireFox but not in IE. The collapsible panel works without the masterpage The problem is it doesn't work with I...

<br/> doesn't work with Firefox (work in IE)
 Here is an example of my code:<ajaxToolkit:TabPanel ID="TabPanel5" runat="server" HeaderText="CDE" >                <HeaderTemplate>                    General <br /> Marketing  "General Marketing" showed as 1 line with firefox... How can I fix this problem?Plz HelpThanks.  Hi Davidvoyage, Same control sometimes may have different beh...

CSS style doesn't work in IE, works in firefox, preview
Hi, I am using a CSS file for most of the styling on one of my webpage. When I make a modification to the font size, nothing changes in IE.  The new font size is appears in my design preview and in Firefox.  Does anybody know what could cause that ??Thansk, Max  Post your CSS so we can see what might be the problem. I've never encountered a problem where IE blatantly disregarded a font-size change, so I wouldn't know offhand what the issue is....

Web resources about - Google Map works in IE's but not working in Firefox and other browser... - asp.net.ajax-discussion

Resources last updated: 12/17/2015 4:22:18 PM