undefined

javascript says JSON object property is undefined although it's not

徘徊边缘 提交于 2019-12-19 18:27:49
问题 I have a json-object, which I print to the screen (using alert()-function): alert(object); Here is the result: Then I want to print the value of the id to the screen: alert(object["id"]); The result is this: As you can see, the value of key "id" is not(!!!) undefined. What the hell is going on here?! 回答1: Looks like your json object is not really an object, it's a json string. in order to use it as an object you will need to use a deserialization function like JSON.parse(obj) . Many

IE throws JavaScript Error: The value of the property 'googleMapsQuery' is null or undefined, not a Function object (works in other browsers)

冷暖自知 提交于 2019-12-19 16:09:10
问题 I'm having a real problem with JavaScript scope in IE 9. This is inside the body of my document (yes, I realize script should go in the head for proper HTML, but I've never had it break a script before). The script is in the body because I don't want to mess with a shared header page for a script that is only relevant for this page: <script type="text/javascript"> function googleMapsQuery(accountNum) { // function code is here (omitted for brevity) } </script> This is inside a td block inside

getResources does not work / undefined Java

假如想象 提交于 2019-12-19 09:15:34
问题 I have a problem with caling the getResources() function in an standard class. All imports must be there to use the function. Is there any special class I need to extend my class? Thanks for the immediate help. package com.example.helloandroid; import android.app.Activity; import android.content.ContentValues; import android.content.Context; import android.content.ContextWrapper; import android.content.res.Resources; import android.content.Intent; import android.os.Bundle; //import android

Adding Google_analytics for iOS is not working tried many ways?

ぐ巨炮叔叔 提交于 2019-12-19 06:06:08
问题 Hi I'm getting following error and so far not able to fix it. Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GAI", referenced from: objc-class-ref in AppDelegate.o objc-class-ref in HomeViewController.o "_OBJC_CLASS_$_GAITrackedViewController", referenced from: _OBJC_CLASS_$_HomeViewController in HomeViewController.o "_OBJC_METACLASS_$_GAITrackedViewController", referenced from: _OBJC_METACLASS_$_HomeViewController in HomeViewController.o ld: symbol(s) not found for architecture

React Native: React Navigation StackNavigator not working. Getting error: “undefined is not an object (evaluating 'this.props.navigation.navigate')”

微笑、不失礼 提交于 2019-12-19 04:50:12
问题 I am trying to use React Navigation and StackNavigator to navigate around my app. I have a button with onPress={() => navigate('DetailsScreen') , and I was hoping that would take me to the DetailsScreen , but I'm getting the following error: E ReactNativeJS: undefined is not an object (evaluating 'this.props.navigation.navigate') What do I need to add in order to get this working? See my code here: https://gist.github.com/chapeljuice/bef4b0a4dedef2994c81f3634b81aa43 回答1: You component is not

Can a sass @mixin accept an undefined number of arguments?

若如初见. 提交于 2019-12-18 11:02:11
问题 I'm trying to create a sass mixin for transitions. This is what I have so far. @mixin transition($var) -webkit-transition: $var transition: $var I want to be able to pass it multiple arguments like this @include transition(color .5s linear, width .5s linear) Unfortunately, I get the following error Syntax error: Mixin transition takes 1 argument but 2 were passed. Is there a way to do this so it produces the following output in css while still accepting an undefined number of arguments?

Method undefined for type Java

倖福魔咒の 提交于 2019-12-18 09:46:23
问题 Having real trouble figuring out where i'm going wrong on this one. Building a system using WEKA in java to study associations and am trying to implement the Apriori algorithm. Currently this is the code: package model; import weka.associations.*; import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; public class Apriori { public static void main(String args[]) throws Exception { String dataset = "/Users/andrew/workspace/Movies/src/data/tagsfinal.arff"; DataSource

onChange function is not defined

落爺英雄遲暮 提交于 2019-12-18 07:41:18
问题 This has got to be something simple. I searched the internet and only found syntax errors as the cause of this problem, but I can't find a syntax error. Here's the javascript : <script type="text/javascript" src="http://localhost/acrilart/javascript/jquery-1.6.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ function hi(){ alert('hi'); } hi(); }); </script> And the HTML : <input type="text" name="cep" value="" id="cep" class="required cep field" onChange="hi()

Firefox Javascript: Why does .all not work?

狂风中的少年 提交于 2019-12-18 07:04:54
问题 In IE, I can go like: var x = document.getElementById("header"); alert(x.all[0].tagName); If I try that in Firefox, I get the error "all is undefined". What is the Firefox equivalent of IE's .all property? 回答1: .all is a Microsoft-specific extension to the DOM, and is not supported by any other browsers (except Opera, I believe, who simulate it in order to improve compatibility with sites written for IE). You can use things like x.children and x.childNodes , or x.getElementById() and x

PHP: Call to undefined function gzdecode()

时间秒杀一切 提交于 2019-12-18 04:42:35
问题 I am getting a strange error message with the following piece of PHP code (I am not a PHP expert): if ( $file_loc != NULL ) { if ( file_exists($file_loc) ) { printf(" file exists"); $handle = fopen($file_loc, "rb"); $contents = fread($handle, filesize($file_loc)); fclose($handle); $result = gzdecode($contents); } } I am basically trying to load text content from a gzipped file. I get the following error: Fatal error: Call to undefined function gzdecode() in ...\sites\MyScripts\fw2.php on line