Not showing up in Console Log?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BaseballGraphs
    New Member
    • Sep 2010
    • 75

    Not showing up in Console Log?

    Hello,

    I am troubleshoot errors with my code, however, it is not showing up in the console log. Can you please take a look and let me know if anything stands out for why this may not be showing up in the log?

    Thanks for your help!
    Code:
    <script>
    definitions = <?= json_encode ($def); ?>
    
    function refreshDefinition( stat_id ) {
    var definition = definitions[ stat_id ];
    var div = $('<div id="definition"><span class="statdefinition">'+definition.name+': </span>'+definition.definition+'</div>');
    $('#definition').replaceWith( div );
    }
    
    $('input[type=checkbox]').change( function(){
      if ( ! $(this).is(':checked') )
        return false;
      var stat_id = $(this).attr( 'id' ).replace( /checkbox_/, '' );
      refreshDefinition( stat_id );
    } );
    </script>
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    What browser are you using?

    The only thing that really stands out to me is that you haven't set the type attribute in the script tag.
    <script type="text/javascript">

    It is possible that even if your script is not performing as you think it should that there are no errors.

    If that is the case could you elaborate on the results you are trying to achieve and we can help you find a solution.

    Comment

    • BaseballGraphs
      New Member
      • Sep 2010
      • 75

      #3
      Hi,
      Thanks so much for your response. I actually resolved the problem.

      It appears as though I had previously encoded $def, so performing the following was double encoding it and therefore the results were undefined and no errors were returning in the console.
      Code:
      definitions = <?= json_encode ($def); ?>
      I was using Google Chrome obviously. The best browser in all the land...

      Comment

      Working...