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 7711425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:22:20+00:00 2026-06-01T01:22:20+00:00

(function( $ ){ $.fn.openlayers = function( mapElementId, options ) { alert(console.log); console.log(options); … }

  • 0
(function( $ ){ $.fn.openlayers = function( mapElementId, options ) {
        alert(console.log);
        console.log(options);
        ...
    }
});

Im trying to extend functionality in a javascript library, but much to my suprise, when i got started i realized that nothing was being logged by console.log.. I know that the code is being executed due to the alert() firing properly. However the returned response from the alert function seems to be "function(){}", is that correct? or is in fact console.log and empty function?

So any clues on what’s going on here, and why console.log isn’t working?


I think i might have found the culprit. Im working with a OpenLayers javascript file, and i can see that their library sets

OpenLayers.Console={log:function(){},...

However, this is uppercase Console, but maybe that doesn’t make a difference? I also have to be in the OpenLayers scope, which i can’t really see that i am. So i’m still a little baffled. But it would explain why i’m seeing an empty function


This is the output i get from typing “console” in the debug window of chrome after loading the application where this error occurs.

assert: function (){}
count: function (){}
debug: function (){}
dir: function (){}
dirxml: function (){}
error: function (){}
group: function (){}
groupEnd: function (){}
info: function (){}
log: function (){}
profile: function (){}
profileEnd: function (){}
time: function (){}
timeEnd: function (){}
trace: function (){}
warn: function (){}
__proto__: Object

So it would seem that something, possibly the openlayers javascript is overriding the native console.

  • 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-06-01T01:22:21+00:00Added an answer on June 1, 2026 at 1:22 am

    Add the following line before OpenLayer script to tell it not to override the console functions.

    <script type="text/javascript">
        console.firebug=true;
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with a Javascript library (openlayers) and am trying to optimize some
I am trying to pass 2 parameters to a javascript function.This code webview.loadUrl(javascript: function_to_call(););
I want to set EPSG:4326 as the projection of an OpenLayers map, but when
I'm using Patrick Wied's OpenLayers Heatmap layer, but only for locations in the UK.
I've got a function: function saveToJ(feature) { var str = new OpenLayers.Format.GeoJSON(out_options).write(feature, true); str
i'm using openlayers and geoExt. what i have is this: var options = {
I am using OpenLayers and jQuery Mobile and trying to upload an image to
I'm trying to parse a javascript code that generates a map, so that I
I am very new to Openlayers and I am trying out TMS layer for
I'm trying to add a button to the OpenLayers map that is supposed to

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.