FAQ Database Discussion Community


Use parameter of a function as the key to get the value from an array [duplicate]

javascript,jquery,html,arrays,undefined
This question already has an answer here: Dynamically access object property using variable 4 answers I have a javascript/jQuery setup where a page name is given. A function should then take this, get the html data of the page and alert it. HTML var page = $(this).attr('id'); viewPage(page); function...

$.getJSON returns “undefined” values from github

jquery,ajax,json,undefined
I've just recently started getting into some ajax, and I'm trying to figure out how to pull data from a website using jsonp. I'm trying to pull the jQuery github account information and display it in the browser. The only problem being I keep receiving an undefined for the two...

Why does this function return undefined.property in JS?

javascript,object,undefined
I am going over the MDN JavaScript guides and am trying to work along with the example near the bottom of the page. var car = { make: "Ford", model: "Mustang" }; function dump_props(obj, obj_name) { var result = ""; for (var i in obj) { console.log(result += obj_name +...

Undefined variable: content

php,codeigniter,variables,model-view-controller,undefined
My error:Message: Undefined variable: content the "content"variable used in my view is apparently not defined. however, when i do var_dump($result); to test the content.. i get: array(1) { [0]=> array(7) { ["id"]=> string(3) "148" ["description"]=> string(9) "33" ["date"]=> string(10) "2015-05-30" ["status"]=> string(1) "1" ["Title"]=> string(2) "33" ["notes"]=> string(9) "33" ["time"]=>...

How can this be undefined in the constructor of an Angular config class?

angularjs,constructor,typescript,undefined,this
I've found some examples online, where people create TypeScript config classes and pass them on to Angular. When I've tried it, I got the weird exception, that this was undefined. A closer look to the other implementations revealed, they only use the constructor, so, are those examples actually inherently wrong...

Javascript: Some Variables Defined, Some Undefined

javascript,html,random,undefined
I am writing a basic casino javascript game that will randomly pick 3 numbers 1-10. If each number is 7, it will display an alert box saying 'You Win!'. In the function below: function StartSpin(){ var one; var two; var three; var cone; var ctwo; var cthree; var one =...

Unexplainable Uncaught TypeError: undefined is not a function

javascript,undefined
I got this error while running the following code on Chrome: Uncaught TypeError: undefined is not a function, on the line it's written as a comment. I've been looking for similar problems on the internet for days but nothing solved mine. Here the JS code: var myArr = []; function...

Javascript target attribute undefined

javascript,jquery,meteor,undefined
I'm having an issue with my code : I build a notification from accepting a friend request. I can then choose between three actions (accept, refuse or block). HTML <div class="pull-right"> <a href="#" title="{{_ "notifications.accept"}}" id="ok-btn" name=" {{data.talkmateId}}"> <span class="glyphicon glyphicon-ok-circle" id="ok-sign" aria-hidden="true"> </span> </a> <a href="#" title="{{_ "notifications.remove"}}" id="remove-btn"...

Assembler debug of undefined expression

c,assembly,undefined,x86-64
I'm trying to get a better understanding of how compilers produce code for undefined expressions e.g. for the following code: int main() { int i = 5; i = i++; return 0; } This is the assembler code generated by gcc 4.8.2 (Optimisation is off -O0 and I’ve inserted my...

Fatal error: Call to undefined function

javascript,php,function,undefined
I'm trying to validate a string that is entered into an input field on a form using a function defined in a javascript file that I am calling in the head tags, which is the first include in my index.php file. There are a number of checks I am doing...

JavaScript: global array variable returned undefined

javascript,arrays,undefined
JavaScript newbie here. I've searched and searched for answers and can't seem to figure this out. The arrays that I'm passing to a function aren't being passed as references properly. I don't think this is an async issue like many posts allude to but I could be wrong. I have...

Why is my AngularFire push( ) not working?

angularjs,undefined,firebase,angularfire,controllers
I'm trying to learn Angular with Firebase by running through a typical to-do tutorial, but I'm sort of modifying the app as I go. Instead of list of to-dos, I'm actually creating 'Users'. Firebase is set up correctly, pulling object data down from Firebase works as well and I can...

undefined method for #<#:0x007f05d8fa9be8> in Rails

ruby-on-rails,undefined
Hello I am beginner to ruby on rails and I am making a form for taking student's info. I am facing the problem here: My view code is: <div class="row"> <div class="col-md-6 col-md-offset-3"> <%= form_for(@userinfo) do |f| %> <%= render 'shared/error_messages' %> <%= f.label :name %> <%= f.text_field :name, class:...

Why is fgoalattain built-in function not working in MATLAB?

matlab,undefined
I'm trying to invoke an fgoalattain function (computing a function minimum with a goal-attainment algorithm) in MATLAB. According to documentation, it should look like this: [X,FVAL,ATTAINFACTOR] = FGOALATTAIN(@objf_1,x0,goal,weight) where @objf_1 is a function handle for a function defined in objf_1 m-file and the rest are some arguments I set on...

“ReferenceError: handler is not defined” in Node.js

node.js,undefined,handler,referenceerror
This is the first line of my Node.js app: var app = require('http').createServer(handler); When I try to start it doing node index.js the result is: /home/username/public_html/index.js:1 var app = require('http').createServer(handler); ^ ReferenceError: handler is not defined My Node.js version is 0.12.4...

undefined variable error in jquery

jquery,variables,global-variables,undefined
I have this code and I want to show il in the elements which will be created by jquery , but il is undefined : this is code : <script> $(document).ready(function(){ var il = 1 ; $("#btn1").click(function(){ $("p").append(" <b>Appended text</b>."); }); $("#btn2").click(function(){ $("ol").append("<li>Appended item " + il + " </li>");...

debugging an undefined variable, Magento PHP

php,magento,debugging,undefined
I am using the theme "Love Fashion" for magento, however this is just for info if anyone has come across the same problem with this theme before. I get the following error Notice: Undefined variable: deal. The error occurs on two lines, 50 and 61 - however the error shows...

skipe $_POST in php [duplicate]

php,post,undefined,skip
This question already has an answer here: PHP: “Notice: Undefined variable” and “Notice: Undefined index” 11 answers i have a php page which i should post some data to it like this: $player=$_POST['player']; $age=$_POST['age']; $data=$_POST['data']; but some times my page posts data and some times it shouldn't, when i...

array requested by name in variable doesn't works

php,arrays,variables,undefined
I have array in object and his name in variable. When i requests $object->$propertyWithArrayName its return array good but when i want to get value at index from this array it doesn't work. Code: class Foo { public $bar; public function __construct() { $this->bar = array("A" => "a", "B" =>...

Undefined index

php,indexing,mysqli,undefined
why do a I get this ( Undefined index: rating) error ? As you can see I have written "rating" in to the names in the form. $rating = $_POST['rating']; $rate = "INSERT INTO cms_rating (rating, p_id) VALUE ('$rating', '$id')"; if (isset($_POST['submit'])) { $con->query($rate); } else { ?> <form action=""...

Rails Undefined Method in an unknown way

ruby-on-rails,ruby,methods,model,undefined
I cloned a project that runs just fine. I did the bundle install, bundle update, db:create, db:migrate, and whatnot. Now when I run http://localhost:3000/orders/new it returns a NoMethodError in Admin::Orders#new I have this as part of my code under model/admin/area.rb has_many :admin_accounts, :class_name => 'Admin::Account' validates :name, :presence => true...

Uncaught ReferenceError: myVarible is not defined in if statement comparing to undefined

javascript,undefined
Does anyone know why would this happen for below code if(myVarible !=undefined){ myVarible.doSomething() } myVariable is A global object that is used only on some pages I am sure I've done this in a past and it always worked. I also tried if(!!s){} Which I am also sure I've used...

JS Function Gives Me Undefined in Console but I'm Expecting a Number

javascript,arrays,object,undefined
I'm building a JS news ticker that renders strings on a canvas in pixel letters. When the visual length of the rendered string (measured in pixels and represented in the function below by global variable 'calc_w') exceeds the width (represented by global variable 'w' in function below) of the canvas,...

Repeating Error: undefined method `start_with?' for nil:NilClass

methods,undefined
I've gotten this weird error message that keeps me from working on my application. undefined method `start_with?' for nil:NilClass with line 5 highlighted in my app/views/layouts/application.html.erb file: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> The error seems to come out of nowhere. The first time I got it...

Call to undefined function ecrypt()

function,codeigniter,undefined,fatal-error
ERROR:Fatal error: Call to undefined function ecrypt() code all works fine without the ecrypt function call in the anchor. I want to secure it from code injection. why am i getting the above error? view: <?php echo anchor("resetPasswordController/delete_news/".ecrypt($content1['id']), '<i class="fa fa-trash-o fa-fw"></i>Delete','id="actions"', array ('onClick' => "return confirm('Are you sure you...

golang “undefined” function declared in another file?

go,undefined,func
I'm trying to write a basic go program that calls a function on a different file, but a part of the same package. However, it returns: undefined: NewEmployee Here is the source code: main.go package main func main() { emp := NewEmployee() } employee.go package main type Employee struct {...

undefined on this string to array [duplicate]

javascript,node.js,undefined
This question already has an answer here: How to return the response from an asynchronous call? 7 answers ok am starting on nodeJS and am stuck at this code, if i output inside the loop i get the array as i want, but if i do outside the loop...

addClass(undefined) vs. addClass(null)

javascript,jquery,null,undefined,chain
Sometimes I'd like to add class in chain, under some condition. What value would be semantically most appropriate to add no class? Example: $(".element").doSomething().addClass(condition ? "special-class" : undefined).doSomethingElse(); Or: $(".element").doSomething().addClass(condition ? "special-class" : null).doSomethingElse(); ...

Undefined Method für salt_masterkey for Array[]

ruby-on-rails,methods,undefined
I have the problem that my server keeps rejecting my Requests because of the above mentioned Error. Searched like the whole internet. I am at my end. I would be very grateful if somebody could help me. Here is the Code: def login @user = User.find_by_sql(['select s* from users Where...

The method createGUI() is undefined for type JFrame

java,swing,types,jframe,undefined
I am trying to add a title to my JFrame so it reads "CBallMaze Ball Maze Application" but whenever I type that in when I am creating the JFrame, it gives me the error message in the title. This code runs fine if I don't try to add a title...

“Undefined Variable” while trying to read rows

php,mysql,variables,mysqli,undefined
I'm trying to read a bunch of Rows and display them without the usual "ARRAY =>" crap but all I get is this error Notice: Undefined variable: data in C:\xampp\htdocs\sql.php on line 0 This is me code: <?php virtual('/Connections/TDBS_local.php'); $query = "SELECT sub_category FROM sub_category WHERE main_category_id = 2 ";...

“Undefined method PDO::execute()” despite using prepare

php,oop,pdo,undefined
This code has been working before, but I recently added a database class. I get the instance and connection from it: $connection = MYSQLDatabase::getInstance()->getConnection(); $connection->prepare("INSERT INTO users etc etc....... $insertArray = $connection->execute(array( ":username" => $_POST["username"] )); getInstance() returns the database instance. getConnection() returns the connection property which contains: new PDO('mysql:host='...

Java - Random.nextInt compilation error;_; [closed]

java,random,methods,undefined
So I'm trying to learn Java but errors like this are not helping :/ I was following the tutorial and then I got compilation error. I tried in many ways but nothing helps :( Here is example code of what does NOT compile on my Eclipse: public class coin {...

Nashorn ability to pass undefined variables to a function

java,undefined,nashorn
Here is a piece of very simple piece of Java code that evaluates some JavaScript code: public static class Logger { public log(String line) { System.out.println(line); } } public static void main(String[] args) { NashornScriptEngineFactory factory = new NashornScriptEngineFactory(); ScriptEngine engine = factory.getScriptEngine(new String[] { "-strict", "--no-java", "--no-syntax-extensions" }); engine.put("log",...

The method getAllCellInfo() is undefined for the type TelephonyManager [Android]

android,eclipse,undefined,telephonymanager,cellinfo
Using the following code, I'm trying to get the available cell information: import android.telephony.CellInfo; TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService( context.TELEPHONY_SERVICE ); List<CellInfo> cellList = telephonyManager.getAllCellInfo(); Knowing that the method getAllCellInfo() and class CellInfo was introduced in API Level 17, I've set android:minSdkVersion="17" in the AndroidManifest.xml file. However, in Eclipse I'm getting...

Ajax with asp.net aspx returns Undefined

asp.net,ajax,json,undefined
I'm facing the following issue: Whenever I click on the button, the alert shows undefined. Web method: [WebMethod] public static string getTest() { return "testing success"; } Ajax script <script type="text/javascript"> function getTest() { $.ajax({ type: "POST", url: "main.aspx/getTest", data: "{}", datatype: "json", contenttype: "/application/json; charset=utf-8", success: function (msg) {...

AngularJS: TypeError: undefined is not a function with chained selects

javascript,angularjs,events,select,undefined
I have two select boxes, options for one of the boxes are loaded right away, and the second (child) select will get its options from a callback that queries an API. It is not an option to pre-load all possible options because there are 4200 records that would be loaded...

AJAX call returning 'undefined'

jquery,ajax,json,undefined
AJAX call as follows: $.get('file.php') .done(function(data) { console.log(data); }); Console returns: [{"0":"PS001","code":"PS001"}] However if amend the log to console.log(data.code) it returns undefined. Also, traversing JSON using each as such: .done(function, data) { $.each(data, function(key, value) { console.log(value.code); }); )}; results in the following error: [Error] TypeError: [{"0":"PS001","code":"PS001"}] is not a...

JS prototyping Cannot set property 'moveRight' of undefined

javascript,class,properties,prototype,undefined
I've a problem with this simple prototyping: Game = function (moduleConfig, gameConfig) { this.moduleConfig = moduleConfig; this.gameConfig = gameConfig; // Game-Commands this.keyCommands = { moveLeft: false, moveRight: false }; this.catcher = null; this.stage = null; return this; } /** * Left arrow down */ Game.prototype.onKeyboardLeftDown = function () { this.keyCommands.moveLeft...

Undefined expression with a definite answer?

c,undefined
I'm trying to understand the answer to an interview question. The following code is presented: int x = 5; int y = x++ * ++x; What is the value of y? The answers are presented as a list of multiple choice answers, one of them being 35. Writing and running...

JavaFX - Extends Stage, but inherited method is undefined

javafx,undefined
I'm working with JavaFX using Java 8 and I have a class where Stage is extended. I got this code from another student and it works fine for everyone else, but for me I get an error on setAlwaysOnTop. It says the method is undefined, but it is inherited from...

jquery $(this).attr('href') returns undefined

javascript,jquery,undefined,href,attr
I've got a very simple code HTML <a class="qqPopupCTA" href="http://example.com">Button</a> JS $qqPopupCTA = $('.qqPopupCTA'); function showForm(e){ e.preventDefault(); var targetPageUrl = $(this).attr('href'); // do stuff } $qqPopupCTA.on('click', function(e){showForm(e);}); However I keep getting undefined href. Console.log($(this)) returns "window" and console.dir($(this)) returns "e.fn.init[1]" Any idea what am I doing wrong? The code is...

php array returns undefined but print_r shows otherwise [duplicate]

php,arrays,json,undefined
This question already has an answer here: PHP: “Notice: Undefined variable” and “Notice: Undefined index” 11 answers foreach($jsonmediationinfo as $value1) { echo $value1['mstatus']; print_r($jsonmediationinfo); } Output: 1Array ( [0] => Array ( [mstatus] => 1 [mhearingnum] => first [mminutes] => adakjaflafjlarjkelfkalfkd;la ) [1] => Array ( [mhearingnum] => second...

When I pass data to a view I get an “undefined variable” error in Codeigniter

php,codeigniter,variables,view,undefined
Please help me: I get an error when I pass data to a view. I think it's the correct procedure but i get error.. Controller: $data['success']='1'; $this->load->view('user_control/register', $data); View: echo $success; Got Error: A PHP Error was encountered Severity: Notice Message: Undefined variable: success Filename: views/register.php Line Number: 79 ...

Getting Undefined index on PHP foreach each

php,undefined,isset
I have a chunk of PHP code that is giving me an Undefined index message. $order = explode(',', $ass_icon_order); foreach($order as $function){ $function = (isset($function) ? $function : null); if($function != ''){ $css .= '.ass-sortable-li.li-'.$function.' a:hover, .ass-sortable-li.li-'.$function.'.active a { background:'.$colors[$function].' }'; ?> <li id="<?php echo $function; ?>" rel="<?php echo $function;...

Can't access items in javascript array [duplicate]

javascript,arrays,variables,undefined
This question already has an answer here: Access / process (nested) objects, arrays or JSON 6 answers My array is: { "data":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAYAAACadoJwAAAgAElEQ…ACCCCAAAIIIICAvwIEIP760zoCCCCAAAIIIIAAAoES+P992sgQ2E6rdwAAAABJRU5ErkJggg==", "name":"splash.png", "imageOriginalWidth":1024, "imageOriginalHeight":768, "imageWidth":1969, "imageHeight":1477, "width":800, "height":600, "left":-585, "top":-406 } and I have two variables: $image_data = $array['data']; $image_name = $array['name']; Both of...

Undefined function for input arguments of type 'double' [closed]

c++,matlab,function,undefined
I downloaded the MATLAB code from here http://cazencott.info/dotclear/public/code/scones.zip. When I run 'demo', it says "Undefined function 'maxflowmex' for input arguments of type 'double'". In fact there is only a c++ file "maxflowmex.cpp" in the folder (already added to path). Whether it needs a "maxflowmex.m" instead of "maxflowmex.cpp" to run properly?...

test if two variables holds some data javascript

javascript,undefined
I define variables from two input fields - and wants to test if something was actually entered in both fields and then break if more than one field is filled. I think the 'undefined' tricks me when setting the var's to .value - even though they don't contain data. var...

How to search defined class or variable's location

php,undefined,fatal-error
These errors keep coming after changing the PHP website to new server. 1st - Solved by "shaddy" Notice: Undefined variable: es in /home/musthand/public_html/external/site/header.php on line 2 <?php if(!is_object($es)) { require_once('includes/EliteScript.php'); $es = new EliteScript(); $sMemberId = $es->getMemberId(); } // Get the base URL $sBaseUrl = $es->getConfig('baseUrl'); $sImageUrl = $es->getConfig('imageUrl'); $sMemberId...

Undefined variable $http request

javascript,angularjs,undefined,angular-http
I'm performing a GET - request on my back end to retrieve some JSON - data. I want to store a part of the data in a variable because I want to use it after the request. But everytime, the variable is undefined while I did the same thing in...

The operator < is undefined for the argument type

java,types,arguments,undefined,operator-keyword
No hate on my Java programming teacher, but I've had some experience with programming, and for the first project I'd like to wow the teacher. Anyways, I'm new to Java, but have some strong knowledge of C. Just to test out the array system in Java I have designed this...

In JavaScript, is there any difference between typeof x == 'y' and typeof x === 'y'?

javascript,performance,comparison,undefined,typeof
I'm aware of the difference between strict and loose comparison operators. Clearly x == y is different from x === y. But whenever I see code that uses typeof, it always uses ===. If the typeof operator always evaluates to a string (such as 'boolean', 'number', etc.), then wouldn't typeof...

HTML/PHP weird error

php,html,variables,undefined
So i'm working on a website on which you can teach newcommers some codes we need to know. This is on the site: A table, within a form, where you have to write in the correct code in an input field at certain fruits, vegetables and bread (supermarkt things..). So...

requirejs returns undefined without dependency

requirejs,undefined,marionette,circular-dependency
On some occasions, requirejs returns an undefined object to my module. I've looked at a number of posts and most of the answer are related to circular dependencies. However I could find none (I have checked several times). I apologize by advance for pasting a quantity of code that I've...

undefined method `each' for nil:NilClass when calling from another controller

methods,controller,undefined,each
I'm trying to trigger all the posts in a groups/show view, but I'm getting error "undefined method `each' for nil:NilClass". Anyone could help me, please? ~~sorry for my bad coding behaviors posts_controller: class PostsController < ApplicationController def index @posts = Post.all end def show @post = Post.find(params[:id]) end def new...

prepareForSegue (ViewController)

ios,swift,undefined,viewcontroller
Then i try to sent data from one view to another override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "varView" { var viewController = segue.destinationViewController as ViewController var indexPath = self.tableView.indexPathForSelectedRow() viewController.varView = self.exams[indexPath.row] } } I get an error at witch says that ViewController is a undeclared?...

jQuery: undefined on object with the correct selector

javascript,jquery,html,twitter-bootstrap,undefined
I've got a problem with jQuery: I've the following html code: <div class="side-finder"> <div class="brand"><img src="/img/test.net-logo.png" /></div> <div class="finder-content"> <ul class="nav nav-pills nav-stacked" id="finder-menu"> <li> <a href="#!cat/cars" class="slide-left1" data-toggle="slide-left" data-source="#sc1" data-step="1" role="button" aria-expanded="false">Autos &gt;</a> <ul class="hide" id="sc1"> <li> <a href="#!cat/cars" class="slide-left2"...

JQuery + TinyMCE = TypeError: validator is undefined

jquery,validation,tinymce,undefined
StackOverflow! This is my first question here, so be gentle! ;) I have searched SO from top to bottom but could not find a solution for "TypeError: validator is undefined" in my code below. The only thing I found was this Q&A: jQuery validation plugin error: TypeError: validator is undefined...

jQuery.getScript() fails to load function

jquery,function,undefined,getscript
I am trying to load a script with a function like: $.getScript('/js/mymy.js').done(function(){ if(readCookie('my_cookie', 'yes')){ /* do sth here */ } }); or $.getScript('/js/mymy.js',function(){ if(readCookie('my_cookie', 'yes')){ /* do sth here */ } }); where "readCookie" is defined in mymy.js but i get an error "readCookie" is not defined... Here 1 &...

Concatenation of undef and list is undef - proof Haskell

haskell,undefined,proof
How could one prove that the following is true for every list xs: undefined ++ xs = undefined ...

Undefined local variable post

ruby-on-rails,ruby,variables,undefined,local
I write this code: <% @user.posts.each do |post| %> <%= render 'post', locals: { post: post, user: @user} %> <% end %> Then in _post.htm.erb I write follow code: <div class="post-title"> <img src="<%= @user.avatar.url%>" class="img-rounded post-image"> <h4 id="post-name"><%= @user.first_name + ' ' [email protected]_name %> </h4> <div id="post-date"><%= post.created_at.strftime('%d %b -...

PHP returns JSON fine but JavaScript shows it is undefined in onload function

javascript,php,json,xmlhttprequest,undefined
I can't figure out how to solve this problem so I'm asking you to help me with it. I'm trying to parse RSS feed to JSON, but due to XSS problems it can't be done with JS (I'm not using jQuery so don't recommend me plugins). I thought I'll do...

What is the correct syntax to load jQuery via CDN? [closed]

javascript,jquery,syntax,undefined
I have the following line of code in my head: <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/> I have the following lines of code at the beginning of my body: <script> $(function () { alert("JQUERY!"); }); </script> My JavaScript Console gives the following error: Uncaught ReferenceError: $ is not defined I am using Google Chrome....

Printing a subtotal when a value is defined inside an if-elif-else statement? Name error issue [Python 2.7]

python,if-statement,undefined,nameerror
I'm currently working on a project which acts as an airline reservation booking system. As of right now I'm having an issue with calculating and displaying a subtotal which was calculated inside of an if elif else loop statement, if that makes sense. For example, I currently need to calculate...

Undefined variable, how to retrieve data from database in codeigniter?

codeigniter,variables,model-view-controller,undefined
My model is: function get_all_pages() { $query= $this->db->query("SELECT Title FROM news"); return $query->result_array(); } My view is: <table cellpadding="0" cellspacing="0"> <tr> <th>Title</th> </tr> <?php $count=1; if(!empty($content)) { foreach ($content as $content1) { ?> <tr> <td align="left"><?php echo $content1['Title']; ?></td> </tr> <?php }} else{?> <tr> <td align="center" colspan="4"><?php echo "No Record...

Javascript: undefined & for loop issue

javascript,arrays,for-loop,undefined
I am having yet another issue with defining variables. It keeps saying that the variable is undefined. When printing it out it uses the array "rl" and targets the first string, then prints it. It does it repeatedly until it printed out the whole array one by one. When I...

undefined index error - image upload same code is working with another example

php,html,mysql,upload,undefined
The image upload with php is not working for some reason can somebody here solve the problem? HTML code: <td>Business Image<br><td> <input type="file" name="photo"> <td><input id="button" type="submit" name="submit" value="Setup"></td> MYSQL: Table structure for table markers CREATE TABLE IF NOT EXISTS `markers` ( `id` int(11) NOT NULL, `name` varchar(60) NOT NULL,...

JavaScript equivalent of ?? operator in C# [duplicate]

javascript,c#,undefined
This question already has an answer here: Is there a “null coalescing” operator in JavaScript? 7 answers Is there any equivalent of ?? operator as exists in C# in JavaScript to defeat 'undefined' checking? For example: var count = something ?? 0; ...

PHP include / undefined variable

php,variables,undefined,php-include
I am aware there are more topics on this matter, I've read them, but I did not found the answer. I have an index.php, that contains a bunch of .php includes: header.php, navigation.php, box.php, footer.php, and inside the "pages" div, I have the one that needs to be different (based...

function name is undefined in python class

python,undefined
I am relatively new to python and i am experiencing some issues with namespacing. class a: def abc(self): print "haha" def test(self): abc() b = a() b.abc() #throws an error of abc is not defined. cannot explain why is this so ...

Best way to check undefined element in an array

javascript,undefined
I have an array linking integers to objects: var array = []; array[3] = new Something(); array[42] = new OtherSomething(); array[84] = new SomethingAgain(); I want to check if an field exists in an array, and then use it if it does. var field = array[row]; If the array doesn't...

Why does my .data function work in pieChart but not in lineChart in dc.js?

javascript,undefined,dc.js
I want to plot data for a dimension that's not in crossfilter so I'm forced to use .data. All is fine for a pieChart, but when I switch to a lineChar I get the error p is undefined (Firefox) or Cannot read property y of undefined (Chrome). I tried following...

Extending HTMLElement in TypeScript

typescript,undefined,extending
Im trying to extend the HTMLElement using TypeScript. Below is my code which alerts undefined because "this" returns a window object, which seems right. How can I access the calling HTMLElement in a similar fashion? interface HTMLElement { setData(dataObject: any): void; } HTMLElement.prototype.setData = (dataObject: any) => { alert(this.id); //Undefined...

Undefined variable in PHP header file [duplicate]

php,variables,undefined
This question already has an answer here: PHP: “Notice: Undefined variable” and “Notice: Undefined index” 11 answers I am trying to create a small forum as an assignment. I have a header.php file which will change some text depending on whether the user is logged in or not but...

Why can't I set object property to empty string in JavaScript?

javascript,undefined,empty-string
I want to pass the values from my request body into a paramsDict object where I have defined constraint to test the parameters against. I don't require that all possible parameters are sent with every request and also, if a value is deleted on the client, it can be sent...

Return pointer undefined even though it should be

c++,pointers,return,undefined
I have something like this. Why is lastItem undefined? Menu* CreateItem() { Menu* menuPointer = new Menu; //initialize values return menuPointer; } void AnotherFunction() { Menu* lastItem = CreateItem(); } Thanks a lot! EDIT: I just figured it out, but I don't really understand why that wasn't working. The more...

How to tell the difference between undeclared and undefined JavaScript object properties?

javascript,web,undefined
So is there no way to check if an object property has been formally declared vs not?? For example... var obj={}; console.log( non_existent_variable ) //throws not defined error console.log( obj.non_existent_property) //no error,===undefined Consider the following... function m(){ this.prop; } var MyObj=new m(); In this case, I think there should be...

Jquery textarea .val() returning undefined unexpectedly

javascript,jquery,html,undefined
The following code has been working for a few weeks and has started occasionally returning 'undefined' when I use a selector in jquery to get the textarea's value, like so: var text = escape($(this).find('textarea[id*=txtText]').val()); This control is appropriately defined below in the HTML by the following: <asp:TextBox ID="txtText" runat="server" MaxLength="150"...

jQuery File Upload and Validation undefined function

javascript,jquery,undefined
I am using jQuery file upload and validation but it looks like there is some conflict which I am not able to resolve. I have tried to fix it by applying jQuery.noConflict(); but that did not help at all. Error: Uncaught TypeError: undefined is not a function (index):943 (anonymous function)...

Object properties are undefined after localStorage

javascript,local-storage,undefined,javascript-objects
I'm storing a bunch of values in localStorage. An array with JSON objects in it to be specific. When I want to add another object to that array here is how I pull it, parse it, push onto the array and set it again. var clickedItem = sessionStorage.getItem('location'), interest =...

Variable Defining Issue Javascript

javascript,html,undefined
I'm trying to randomize a string depending on how many players their are and assign each player their job/role. In the Chrome Console I am getting the error, "Uncaught ReferranceError: al is not defined." I dont get what the issue is, the variable is defined before using it(defined in first...

posts and attachments, Undefined property: Illuminate\Database\Eloquent\Collection::$name

laravel-4,eloquent,undefined
when i try to get the attachment's name like this: {{$post->attachments->name}} i get the following error Undefined property: Illuminate\Database\Eloquent\Collection::$name (View: C:\wamp\www\Sites\app\views\public\categories\show.blade.php) Post model class Post extends \Eloquent implements SluggableInterface { public function category(){ return $this->belongsTo('Category'); } public function attachments(){ return $this->hasMany('Attachment'); } } Attachment Model class Attachment extends \Eloquent {...

Error on second level object for nodejs response

javascript,node.js,object,undefined,response
I have this situation.., I'm making something like this: app.post('someUrl', function (req, res) { var r = res.data; var a = {}; a.name = r.name || "", a.someotherKey : { id: r.otherKey.id || "" } }); the thing is that when res.data == "", I can assign the value of...

Three.js JSONLoader blender model error: property 'length' undefined

json,3d,three.js,undefined,blender
I have been trying out Three.js lately and i used the exporter addon for Blender to test out making models in blender and exporting so i can use them in a three.js program. I included the add-on to blender, and using just the basic cube model of blender, exported it...