Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4322226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:50:47+00:00 2026-05-21T08:50:47+00:00

I have created a method to retrieve some data (lat,lon points) and open a

  • 0

I have created a method to retrieve some data (lat,lon points) and open a window to map them.

function openMapWindow (data) {
    alert(data);

    var mapForm = document.createElement("form");
    mapForm.target = "Map";
    mapForm.method = "POST"; // or "post" if appropriate
    mapForm.action = "/map.php";

    var mapInput = document.createElement("input");
    mapInput.type = "text";
    mapInput.name = "addrs";
    mapInput.value = data;
    mapForm.appendChild(mapInput);

    document.body.appendChild(mapForm);

    window.open("", "Map", "status=0,title=0,height=600,width=800");

    mapForm.submit();

}

data variable is populated with the following:

map coorindates

Yet I get the following area on the line:

mapInput.value = data;

ERROR: uncaught exception:
[Exception… “Component returned
failure code: 0x80004005
(NS_ERROR_FAILURE)
[nsIDOMHTMLFormElement.submit]”
nsresult: “0x80004005
(NS_ERROR_FAILURE)” location: “JS
frame :: http://www.xxx.xxx ::
openMapWindow :: line 244″ data: no]

Line 0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:50:47+00:00Added an answer on May 21, 2026 at 8:50 am

    It has to do with your browser’s popup blocker. If you look closely at the error, it’s describing the submit “button” as the problem, not the mapValue.input line.

    The below code is working for me:

    http://jsfiddle.net/WDFNL/

    function openMapWindow (data) {
        alert(data);
    
        var mapForm = document.createElement("form");
        mapForm.target = "Map";
        mapForm.method = "POST"; // or "post" if appropriate
        mapForm.action = "/map.php";
    
        var mapInput = document.createElement("input");
        mapInput.type = "text";
        mapInput.name = "addrs";
        mapInput.value = data;
        mapForm.appendChild(mapInput);
    
        document.body.appendChild(mapForm);
    
        window.open("", "Map", "status=0,title=0,height=600,width=800");
    
        mapForm.submit();
    }
    openMapWindow('-35.308401,149.124298-35.307841,149.124298');
    

    I did get the error you’re describing at first, but it had to do with my popup blocker. Once I authorized jsfiddle.net to be allowed popups, it started working.

    EDIT

    There is an easy way to test for this and alert the user if their popup blocker is disabling the map:

    http://jsfiddle.net/WDFNL/1/

    function openMapWindow (data) {
        var mapForm = document.createElement("form");
        mapForm.target = "Map";
        mapForm.method = "POST"; // or "post" if appropriate
        mapForm.action = "/map.php";
    
        var mapInput = document.createElement("input");
        mapInput.type = "text";
        mapInput.name = "addrs";
        mapInput.value = data;
        mapForm.appendChild(mapInput);
    
        document.body.appendChild(mapForm);
    
        map = window.open("", "Map", "status=0,title=0,height=600,width=800");
    
        if (map) {
            mapForm.submit();
        } else {
            alert('You must allow popups for this map to work.');
        }
    }
    openMapWindow('-35.308401,149.124298-35.307841,149.124298');
    

    Note the map variable. You can test it to see if window.open returned a window handle, and act accordingly depending on the result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody tell me why is this not working. I have created a WCF
We have a database that has decompiled data versions of PDF files stored as
I have the following web service method (.ASMX file): [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat =
I have a wizard in my asp.net MVC application which is built upon this
I have always felt that in general the main work of a class should
I am using Ryan Bate's CanCan gem to define abilities and some basic functionality
I have a pratical question here. I have to access to a site and
I have the following two methods on an interface for my service layer: ICollection<T>
I'm trying to extend the Clojure language to extend ACI-guaranteed refs to ACID-guaranteed drefs
I'm working on a internal web application (only employees can log in) and need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.