http://stackoverflow.com/comment/43248441
score: 1
has text: @helpermethod: `_.pick` only works with first level object members. It won't work with deep(er) object graphs. I'm also not sure how it handles array members...
type: Comment
comment on: http://stackoverflow.com/q/27401063
type: QuestionComment

firebase
tags question: http://stackoverflow.com/q/27369731
tags question: http://stackoverflow.com/q/27453915
tags question: http://stackoverflow.com/q/27333123
tags question: http://stackoverflow.com/q/27383940
tags question: http://stackoverflow.com/q/27371720
tags question: http://stackoverflow.com/q/27363130
tags question: http://stackoverflow.com/q/27336414
tags question: http://stackoverflow.com/q/27474546
tags question: http://stackoverflow.com/q/27315302
tags question: http://stackoverflow.com/q/27371484
tags question: http://stackoverflow.com/q/27350357
tags question: http://stackoverflow.com/q/27348238
type: Tag
tag name: firebase
tags question: http://stackoverflow.com/q/27367289
tags question: http://stackoverflow.com/q/27389157

http://stackoverflow.com/a/27448834
has comment: http://stackoverflow.com/comment/43336808
has comment: http://stackoverflow.com/comment/43336707
answers question: http://stackoverflow.com/q/27448655
upvote count: 2
has comment: http://stackoverflow.com/comment/43348100
type: Answer
has comment: http://stackoverflow.com/comment/43336829
has comment: http://stackoverflow.com/comment/43336547
score: 2
has comment: http://stackoverflow.com/comment/43336603
has body: I prefer this method: http://jsfiddle.net/71mLyk28/1/ var LibraryName = function () { //constructor stuff } LibraryName.prototype = { someValue: 0, firstFunc: function (stuff) { this.someValue = 99; this.secondFunction(); }, secondFunction: function () { this.doSomething(this.someValue); }, doSomething: function(){ console.log("success"); } } var l = new LibraryName(); // instantiate a LibraryName object l.firstFunc(); Adding to the prototype instead of directly to the object helps with memory usage (if you have more than one of this object) and with inheritance. See JS - Why use Prototype?
downvote count: 0

http://stackoverflow.com/a/27460674
downvote count: 2
answers question: http://stackoverflow.com/q/27460065
score: -2
has body: My jsfiddle example: http://jsfiddle.net/larryjoelane/tbeog5o9/38/ &lt;img class="resize" src="http://cdn.moneycrashers.com/wp-content/uploads/2012/03/apple-imac-27.jpg"/&gt; &lt;img class = "resize" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcR-pya5LcLCg82HTG3R36aS9B59SSjNzewp8tAHFZrjFjRb1rXI"/&gt; CSS: img.resize{ max-width:150px;/*rendered height will be 103px and width will be 150px*/ } You will have to change the img tag url's in my example to match your image url's of course and add the class resize to your img tags. The rendered height of the image will be 103px but the image will not look distorted.
upvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43359730

http://stackoverflow.com/q/27314145
tagged with: object
has comment: http://stackoverflow.com/comment/43088622
has answer: http://stackoverflow.com/a/27374078
accepted answer: http://stackoverflow.com/a/27374078
tagged with: javascript
has comment: http://stackoverflow.com/comment/43088921
has body: I have fixed the issue with ajax on typo3. Now comes another issue in hand. This time is related to returning the object found in the action to Javascript. So I tell you what I do exactly. here is first my ajax call function: function getContent(id) { console.log("Starting process ..."); $.ajax({ async: 'true', url: 'index.php', type: 'POST', data: { eID: "ajaxDispatcher", request: { pluginName: 'listapp', controller: 'Pays', action: 'getMyCompanys', arguments: { 'id': id } } }, dataType: "json", success: function(result) { var data = JSON.parse(result) console.log(data.nom); }, error: function(error) { console.log(error); } }); } and here is the "getMyCompanys" action: public function getMyCompanysAction() { $argument = $this-&gt;request-&gt;getArguments('id'); $company = $this-&gt;entrepriseRepository-&gt;findBypays(2); // just to test with the id 2 $result = (array) $company; return json_encode($result); } Now on the console I get this Output: {"\u0000*\u0000dataMapper":{},"\u0000*\u0000persistenceManager":{},"\u0000*\u0000query":{},"\u0000*\u0000queryResult":null} So at the first glance , i thought the object was not passed to the javascript , but when I tried to add an attribute to the object $company ($company->att = 'val';) I get this output : {"\u0000*\u0000dataMapper":{},"\u0000*\u0000persistenceManager":{},"\u0000*\u0000query":{},"\u0000*\u0000queryResult":null**,"att":"val"}** notice that the added attribute and its value get showed so I now I'm convinced that there is something wrong with the object. I am also 100 % sure that the method findBypays(2); is working, I tried it in a listAction. I don't really know what could be the problem :/ Just for your Information: this is part of an extension in typo3 that I developed myself using JBuilder
has comment: http://stackoverflow.com/comment/43088485
score: 0
has comment: http://stackoverflow.com/comment/43088682
tagged with: typo3
has title: A Mystery in my Code
has comment: http://stackoverflow.com/comment/43088742
answer count: 1
has comment: http://stackoverflow.com/comment/43088737
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43088533
has comment: http://stackoverflow.com/comment/43089517
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43089547
type: Question

http://stackoverflow.com/a/27474963
has body: There is a bug in the Ext.dom.Helper (ietable method) of the ExtJS 4.1.0 framework. Apply this override to fix it: (function() { // kill repeat to save bytes var detachedDiv = document.createElement('div'); Ext.define('Ext.override.dom.Helper', { override: 'Ext.dom.AbstractHelper', ieTable: function(depth, openingTags, htmlContent, closingTags){ detachedDiv.innerHTML = [openingTags, htmlContent, closingTags].join(''); var i = -1, el = detachedDiv, ns; while (++i &lt; depth) { el = el.firstChild; } // If the result is multiple siblings, then encapsulate them into one fragment. ns = el.nextSibling; if (ns) { el = document.createDocumentFragment(); while (ns) { el.appendChild(ns); ns = ns.nextSibling; } } return el; } }, function() { Ext.ns('Ext.core'); Ext.DomHelper = Ext.core.DomHelper = new this; }); }()); Fiddle: https://fiddle.sencha.com/#fiddle/f1v
upvote count: 3
type: Answer
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/27447310
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27447310

http://stackoverflow.com/q/27433016
tagged with: coffeescript
upvote count: 1
has body: I'm an Angularjs newbie and I'm trying to create a settings panel in Ionic Framework. I want to save the setting into localStorage, but for now I'm just logging the scope change. But it doesn't work and I'm getting crazy. My HTML is Exam Type and my controller is class Settings extends Controller constructor: ($localStorage) -> @examType = { checked: 'entro' } @examTypeChange = () -> console.log('exam type change', @examType.checked) return I'm using ng-classify, compiled in javascript the result is: function() { var Settings; Settings = (function() { function Settings($localStorage) { this.examType = { checked: 'entro' }; this.examTypeChange = function() { console.log('exam type change', this.examType.checked); }; } return Settings; } Log doesn't work: when I switch toggle nothing happen. Any idea?
type: Question
has title: Angularjs Controller in Coffeescript doesn't work
tagged with: javascript
tagged with: ionic-framework
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
score: 1

http://stackoverflow.com/comment/43319879
score: 0
type: Comment
type: QuestionComment
has text: it also catches all requests for template html, that's why I thought it should help with iframe.
comment on: http://stackoverflow.com/q/27420367

http://stackoverflow.com/q/27336550
has answer: http://stackoverflow.com/a/27347823
has body: I am making a bubble chart using dimplejs. That part is done. I also want to add the owner name (bubble label) inside the bubble and not just as a list outside the chart but this is not working. How should I go ahead? Link to the jsfiddle. all_data = [{"Size": 126, "x": 0.57713748637776141, "y": -0.23994977513487858, "Owner": "a"}, {"Size": 394, "x": -0.23305704511539499, "y": -0.39183313136189662, "Owner": "b"}, {"Size": 127, "x": 0.12093459993205866, "y": 0.56390700220806189, "Owner": "c"}, {"Size": 624, "x": -0.46501504119442505, "y": 0.06787590428871329, "Owner": "d"}] var svg = dimple.newSvg("#chartContainer", 600, 200); var myChart = new dimple.chart(svg, all_data); myChart.setBounds(25, 25, 550, 150) var x = myChart.addMeasureAxis("x", "x"); var y = myChart.addMeasureAxis("y", "y"); x.hidden = true; y.hidden = true; myChart.addLegend(25, 5, 550, 20, "right"); myChart.addMeasureAxis("z", "Size"); var s = myChart.addSeries("Owner", dimple.plot.bubble); myChart.draw();
score: 0
tagged with: data-visualization
tagged with: dimple.js
tagged with: d3.js
has title: Show labels inside each bubble in dimplejs bubble chart
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27347823
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43257040
type: AnswerComment
score: 0
type: Comment
has text: I had not explained the problem correctly. I've posted new code illustrating the problem.
comment on: http://stackoverflow.com/a/27393370

jquery
tags question: http://stackoverflow.com/q/27406862
tags question: http://stackoverflow.com/q/27348149
tags question: http://stackoverflow.com/q/27432395
tags question: http://stackoverflow.com/q/27390733
tags question: http://stackoverflow.com/q/27406763
tags question: http://stackoverflow.com/q/27412775
tags question: http://stackoverflow.com/q/27329784
tags question: http://stackoverflow.com/q/27429280
tags question: http://stackoverflow.com/q/27428154
tags question: http://stackoverflow.com/q/27339297
tags question: http://stackoverflow.com/q/27320099
tags question: http://stackoverflow.com/q/27365581
tags question: http://stackoverflow.com/q/27436284
tags question: http://stackoverflow.com/q/27452887
tags question: http://stackoverflow.com/q/27353690
tags question: http://stackoverflow.com/q/27327001
tags question: http://stackoverflow.com/q/27376380
tags question: http://stackoverflow.com/q/27394259
tags question: http://stackoverflow.com/q/27348589
tags question: http://stackoverflow.com/q/27360407
tags question: http://stackoverflow.com/q/27427793
tags question: http://stackoverflow.com/q/27335522
tags question: http://stackoverflow.com/q/27322208
tags question: http://stackoverflow.com/q/27340133
tags question: http://stackoverflow.com/q/27423130
tags question: http://stackoverflow.com/q/27345027
tags question: http://stackoverflow.com/q/27363532
tags question: http://stackoverflow.com/q/27380567
tags question: http://stackoverflow.com/q/27423346
tags question: http://stackoverflow.com/q/27420687
tags question: http://stackoverflow.com/q/27441714
tags question: http://stackoverflow.com/q/27323474
tags question: http://stackoverflow.com/q/27451518
tags question: http://stackoverflow.com/q/27385691
tags question: http://stackoverflow.com/q/27400615
tags question: http://stackoverflow.com/q/27413260
tags question: http://stackoverflow.com/q/27350538
tags question: http://stackoverflow.com/q/27327016
tags question: http://stackoverflow.com/q/27427978
tags question: http://stackoverflow.com/q/27338085
tags question: http://stackoverflow.com/q/27344560
tags question: http://stackoverflow.com/q/27388376
tags question: http://stackoverflow.com/q/27422185
tags question: http://stackoverflow.com/q/27437746
tags question: http://stackoverflow.com/q/27470404
tags question: http://stackoverflow.com/q/27404477
tags question: http://stackoverflow.com/q/27422409
tags question: http://stackoverflow.com/q/27405846
tags question: http://stackoverflow.com/q/27318094
tags question: http://stackoverflow.com/q/27356338
tags question: http://stackoverflow.com/q/27424705
tags question: http://stackoverflow.com/q/27434616
tags question: http://stackoverflow.com/q/27318570
tags question: http://stackoverflow.com/q/27351876
tags question: http://stackoverflow.com/q/27399612
tags question: http://stackoverflow.com/q/27451154
tags question: http://stackoverflow.com/q/27377882
tags question: http://stackoverflow.com/q/27392314
tags question: http://stackoverflow.com/q/27426195
tags question: http://stackoverflow.com/q/27333937
tags question: http://stackoverflow.com/q/27414192
tags question: http://stackoverflow.com/q/27388413
tags question: http://stackoverflow.com/q/27376798
tags question: http://stackoverflow.com/q/27405291
tags question: http://stackoverflow.com/q/27455354
tags question: http://stackoverflow.com/q/27350716
tags question: http://stackoverflow.com/q/27339751
tags question: http://stackoverflow.com/q/27327904
tags question: http://stackoverflow.com/q/27360275
tags question: http://stackoverflow.com/q/27411366
tags question: http://stackoverflow.com/q/27369848
tags question: http://stackoverflow.com/q/27336349
tags question: http://stackoverflow.com/q/27319228
tags question: http://stackoverflow.com/q/27449621
tags question: http://stackoverflow.com/q/27321107
tags question: http://stackoverflow.com/q/27413924
tags question: http://stackoverflow.com/q/27450528
tags question: http://stackoverflow.com/q/27444404
tags question: http://stackoverflow.com/q/27415228
tags question: http://stackoverflow.com/q/27395087

http://stackoverflow.com/comment/70959658
has text: Hi , Suppose "/mobile/custom/******/deviceVersion/:deviceType" is my request . could you please tell me how to check "deviceType" against undefined?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27339339
type: Comment

http://stackoverflow.com/comment/43146037
comment on: http://stackoverflow.com/a/27344672
has text: @T J : Nopes, it wont work for objects having different values. It is concatenating the newArray1 to diff.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27354162
has comment: http://stackoverflow.com/comment/43161830
type: Answer
upvote count: 1
has body: Yes you should be making a watcher. $scope.$watchCollection('items', function (newValue, oldValue) { if (newValue) { buildTemplate(newValue); } }); Note: I used watchCollection because it is an array. If it were an object or simple value $watch would be used instead.
score: 1
answers question: http://stackoverflow.com/q/27354013
downvote count: 0

http://stackoverflow.com/comment/43130911
comment on: http://stackoverflow.com/q/27336047
type: Comment
type: QuestionComment
has text: @FabrícioMatté, Yes.
score: 0

http://stackoverflow.com/comment/43270266
score: 0
type: QuestionComment
type: Comment
has text: I assume your percentage calculation doesn't work because the equation `5 % 20` reads as `five modulo twenty`. For the latter, just either record every input into a variable, or extract it from the input field using `.value` (if the math should be visible, it is currently not).
comment on: http://stackoverflow.com/q/27412886

http://stackoverflow.com/a/27464465
downvote count: 0
has comment: http://stackoverflow.com/comment/56817975
answers question: http://stackoverflow.com/q/27460658
upvote count: 2
type: Answer
has body: I've never used orient-db, but looking at the github page it looks like it offers a connection pool and returns promises. Based on that I would do something like this: // in utils/oriento.js or similar // instantiate it once and share in multiple places(models), since it offers // connection pooling var Oriento = require('oriento'); var server = Oriento({ host: 'localhost', port: 2424, username: 'root', password: 'yourpassword' }); var db = server.use({ name: 'mydb', username: 'admin', password: 'admin' }); module.exports = db; then for models: // models/item.js var db = require('../utils/oriento.js'); var Item = function(props){ }; Item.findById = function(id){ // db.query returns a promise return db.query('select from OItem where id=:id', { params: { id: id }, limit: 1 }); } // add getters, setters, find etc... module.exports = Item; then in controllers: // server.js or wherever var Item = require('./models/item'); app.get('/:id', function *(){ var id = this.params.id; this.body = yield Item.findById(id); } Hopefully this helps You might want to checkout my screencasts on koajs at http://knowthen.com
score: 2

http://stackoverflow.com/a/27433334
answers question: http://stackoverflow.com/q/27433275
downvote count: 1
has comment: http://stackoverflow.com/comment/43307916
score: 0
upvote count: 1
has body: The function AgeDale isn't defined. You need to call a function, not a variable called ageDale
type: Answer

http://stackoverflow.com/q/27461184
answer count: 1
has answer: http://stackoverflow.com/a/27462429
tagged with: asynchronous
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 2
upvote count: 2
type: Question
tagged with: javascript
has body: I have an application where I'm loading a login modal asynchronously so it's available across the multiple platforms that make up the application. I'm loading and binding the HTML for the modal, but I can't find a way to initialize the Angular controller that is IN the modal after loading it asynchronously. Here's the basic idea: LOG IN // Once loaded, I need to initialize the AngularJS in here, fr'ex: {{item.blerg}} Note, I'm not actually using ng-init, I'm loading via a service. This is a super-dumbed-down version because making JSBins takes a poopload of time.
has title: Angular.js : Initializing a controller on an asynchronously loaded template?
downvote count: 0

http://stackoverflow.com/q/27462154
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
tagged with: checkbox
score: 0
has body: I have following inputs in table: &lt;input type="checkbox" name="slection" ng-click="addEntryToSelection(entry)" value="{{entry.defaultName}}"&gt; How can i get which items are cheked and get their values after button ng-click or how can i add value into array if is checked and remove after uncheck? Thanks for any help.
type: Question
has title: Angular JS - how to add checked input into array and how to remove after uncheck?
linked to: http://stackoverflow.com/q/27421619
tagged with: javascript
has answer: http://stackoverflow.com/a/27462310
duplicate of: http://stackoverflow.com/q/27421619

http://stackoverflow.com/comment/43160309
comment on: http://stackoverflow.com/a/27353231
has text: You can´t add it to the textarea with `.insertNode` The textarea text is not a DOM element. You must use value to get the string, alter the text and write it back in the textarea with `.value()`
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/58138740
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27415742
has body: The alt attribute can be applied to an image to specify an alternate text. Ex: &lt;img src="smiley.gif" alt="Smiley face"&gt; You can wrap an image inside the &lt;a and specify alt attribute for the image. &lt;a href="&lt;data:post.url/&gt;"&gt; &lt;image src="your image source" alt="This is my image"&gt; &lt;/a&gt;

http://stackoverflow.com/q/27458618
has answer: http://stackoverflow.com/a/27458644
possible better answer: http://stackoverflow.com/a/27458650
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27458650
has title: can't acces method of parent controller from child controller
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27458644
has body: My html Lokale 0" ng-click="getLocals(city.Id)">{{city.Name}} {{local.Name}} ng-click="getDetails()" Nie znaleziono and js angular.module('sandboxApp') .controller('MainCtrl', function ($scope, API) { API.newRequest('getCitiesList').success(function (data, status, headers, config) { $scope.cities = data.data; }); $scope.getDetails = function () { console.log("test") }; }) .controller('LocalsCtrl', function ($scope, API) { $scope.locals = {}; $scope.getLocals = function (cityid) { $scope.activeCityLeft = cityid; API.newRequest('getLocalList', { params: { 'city_id': cityid.toString() }, cache: true }).success(function (data, status, headers, config) { $scope.locals[cityid] = data.data; }); }; }) If i understand correctly i should be able to invoke 'getDetails' method anywhere because it is defined on main controller, even from elements which got their won controllers but are nested within element attached to main controller. but it does'nt work, when i click on element which should invoke getDetails, instead it displays 'ng-click="getDetails()' as html text.
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43354252
tagged with: javascript

http://stackoverflow.com/comment/43372124
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27468403
has text: You can give an argument to `index`, and it will find its position within that collection.

http://stackoverflow.com/a/27437005
has comment: http://stackoverflow.com/comment/43315196
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/27436680
answers question: http://stackoverflow.com/q/27436680
has comment: http://stackoverflow.com/comment/43315444
has comment: http://stackoverflow.com/comment/43315564
type: Answer
has comment: http://stackoverflow.com/comment/43315407
has body: You can get back some of your code, but almost all function names will be lost and local variables tend to get replaced. Take for example the default code at the link you provided: ORIGINAL function NewObject(prefix) { var count=0; this.SayHello=function(msg) { count++; alert(prefix+msg); } this.GetCount=function() { return count; } } var obj=new NewObject("Message : "); obj.SayHello("You are welcome."); OBFUSCATED var _0x5601=["\x53\x61\x79\x48\x65\x6C\x6C\x6F","\x47\x65\x74\x43\x6F\x75\x6E\x74","\x4D\x65\x73\x73\x61\x67\x65\x20\x3A\x20","\x59\x6F\x75\x20\x61\x72\x65\x20\x77\x65\x6C\x63\x6F\x6D\x65\x2E"];function NewObject(_0xa158x2){var _0xa158x3=0;this[_0x5601[0]]=function (_0xa158x4){_0xa158x3++;alert(_0xa158x2+_0xa158x4);} ;this[_0x5601[1]]=function (){return _0xa158x3;} ;} ;var obj= new NewObject(_0x5601[2]);obj.SayHello(_0x5601[3]); STEP 1 - Decode variable array Firstly we need to decode the variable array (the part that starts var _0x5601= and ends just before the first function). I find the easiest way to do this is to copy and paste the array into Chromes developer console. Just paste the whole line and hit enter, then in the console type the variable name and you'll get something like this: ["SayHello", "GetCount", "Message : ", "You are welcome."] STEP 2 - String Replace code for variable array item Next we employ the help of whichever programming language you'd like to parse this new array back into the js. In essence, take your newly decoded array, and perform a string replace the rest of the code. I had PHP handy, so i did this: &lt;?php // decoded array $_0x5601 = array("SayHello", "GetCount", "Message : ", "You are welcome."); // rest of the obfuscated code $code = "function NewObject(_0xa158x2){var _0xa158x3=0;this[_0x5601[0]]=function (_0xa158x4){_0xa158x3++;alert(_0xa158x2+_0xa158x4);} ;this[_0x5601[1]]=function (){return _0xa158x3;} ;} ;var obj= new NewObject(_0x5601[2]);obj.SayHello(_0x5601[3]);"; // loop over array for($x = 0; $x &lt; count($…

http://stackoverflow.com/comment/43255488
comment on: http://stackoverflow.com/a/27405362
score: 0
type: AnswerComment
type: Comment
has text: Well it looks like he is clearing the fields in a form so this solution would do that in 2 lines of code for all fields.

http://stackoverflow.com/comment/43243835
has text: I'm not sure what do you mean by "tracking", but Chrome supports the currently experimental [Object.observe](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe) with which you can "listen" to changes on an object, and might as well log every change to Chrome's console.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27398794
score: 1

http://stackoverflow.com/comment/43205265
has text: yes its fine but your question said that the date object like `new Date(2014, 10, 21, 07, 30)`
type: Comment
comment on: http://stackoverflow.com/a/27376729
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43252342
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27403277
type: Comment
has text: taht code would execute the function in the timeout even if you released the button before the two secs.

http://stackoverflow.com/comment/43270486
has text: I put the 'time' argument in checkIfRecordedAndPlay and then I modified my buffer sound loader to have an argument that sets the start time and I placed the 'time' argument in the invoked sound function
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27383367
score: 0

http://stackoverflow.com/comment/43218302
type: QuestionComment
comment on: http://stackoverflow.com/q/27384844
has text: What do you mean with ` == "MSIE"();`?
score: 0
type: Comment

javascript
tags question: http://stackoverflow.com/q/27470684
tags question: http://stackoverflow.com/q/27371558
tags question: http://stackoverflow.com/q/27322309
tags question: http://stackoverflow.com/q/27417160
tags question: http://stackoverflow.com/q/27463885
tags question: http://stackoverflow.com/q/27412532
tags question: http://stackoverflow.com/q/27448789
tags question: http://stackoverflow.com/q/27324716
tags question: http://stackoverflow.com/q/27389157
tags question: http://stackoverflow.com/q/27414701
tags question: http://stackoverflow.com/q/27465030
tags question: http://stackoverflow.com/q/27381744
tags question: http://stackoverflow.com/q/27341269
tags question: http://stackoverflow.com/q/27357313
tags question: http://stackoverflow.com/q/27364181
tags question: http://stackoverflow.com/q/27360712
tags question: http://stackoverflow.com/q/27346037
tags question: http://stackoverflow.com/q/27359867
tags question: http://stackoverflow.com/q/27438358
tags question: http://stackoverflow.com/q/27387009
tags question: http://stackoverflow.com/q/27474569
tags question: http://stackoverflow.com/q/27404490
tags question: http://stackoverflow.com/q/27370728
tags question: http://stackoverflow.com/q/27398874
tags question: http://stackoverflow.com/q/27442861
tags question: http://stackoverflow.com/q/27431870
tags question: http://stackoverflow.com/q/27314944
tags question: http://stackoverflow.com/q/27334701
tags question: http://stackoverflow.com/q/27368537
tags question: http://stackoverflow.com/q/27433928
tags question: http://stackoverflow.com/q/27382492
tags question: http://stackoverflow.com/q/27317785
tags question: http://stackoverflow.com/q/27364532
tags question: http://stackoverflow.com/q/27358696
tags question: http://stackoverflow.com/q/27344650
tags question: http://stackoverflow.com/q/27461163
tags question: http://stackoverflow.com/q/27404102
tags question: http://stackoverflow.com/q/27419602
tags question: http://stackoverflow.com/q/27331937
tags question: http://stackoverflow.com/q/27417815
tags question: http://stackoverflow.com/q/27335550
tags question: http://stackoverflow.com/q/27320792
tags question: http://stackoverflow.com/q/27428277
tags question: http://stackoverflow.com/q/27337364
tags question: http://stackoverflow.com/q/27397848
tags question: http://stackoverflow.com/q/27462216
tags question: http://stackoverflow.com/q/27397295
tags question: http://stackoverflow.com/q/27463511
tags question: http://stackoverflow.com/q/27336930
tags question: http://stackoverflow.com/q/27318420
tags question: http://stackoverflow.com/q/27417899
tags question: http://stackoverflow.com/q/27322585
tags question: http://stackoverflow.com/q/27423978
tags question: http://stackoverflow.com/q/27425117
tags question: http://stackoverflow.com/q/27377986
tags question: http://stackoverflow.com/q/27380383
tags question: http://stackoverflow.com/q/27335148
tags question: http://stackoverflow.com/q/27322849
tags question: http://stackoverflow.com/q/27458755
tags question: http://stackoverflow.com/q/27433051
tags question: http://stackoverflow.com/q/27458542
tags question: http://stackoverflow.com/q/27333812
tags question: http://stackoverflow.com/q/27324352
tags question: http://stackoverflow.com/q/27387658
tags question: http://stackoverflow.com/q/27474756
tags question: http://stackoverflow.com/q/27352565
tags question: http://stackoverflow.com/q/27450003
tags question: http://stackoverflow.com/q/27373748
tags question: http://stackoverflow.com/q/27428834
tags question: http://stackoverflow.com/q/27321859
tags question: http://stackoverflow.com/q/27406202
tags question: http://stackoverflow.com/q/27318995
tags question: http://stackoverflow.com/q/27472421
tags question: http://stackoverflow.com/q/27405974
tags question: http://stackoverflow.com/q/27473364
tags question: http://stackoverflow.com/q/27331917
tags question: http://stackoverflow.com/q/27393066
tags question: http://stackoverflow.com/q/27359687
tags question: http://stackoverflow.com/q/27388472
tags question: http://stackoverflow.com/q/27473787

http://stackoverflow.com/q/27346326
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has title: AJAX form script isn't executed
favorite count: 0
has comment: http://stackoverflow.com/comment/43147677
accepted answer: http://stackoverflow.com/a/27346353
has answer: http://stackoverflow.com/a/27346343
tagged with: php
has comment: http://stackoverflow.com/comment/43147658
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27346343
score: 1
upvote count: 1
has body: I want to use a form via AJAX, so I got this Code Snippet from another post on stackoverflow. It didn't work, so I added an alert to check, if the script is even executed. That doesn't seem to be the case and I'm wondering why.
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/27346353
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/q/27457427
tagged with: jquery-plugins
answer count: 1
downvote count: 1
tagged with: jquery
has title: Clicking on an image upload button using JS or JQuery
favorite count: 0
has comment: http://stackoverflow.com/comment/43352185
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43352234
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43352149
upvote count: 0
has comment: http://stackoverflow.com/comment/43352090
has body: I have the following code, http://fiddle.jshell.net/hvLf8yua/ When I click on the image upload button using my mouse, it opens file dialog as expected. However, I couldn't trigger this using JQuery or JS. Could anyone tell me how I can achieve this? What I want is to open the file dialog box when such script is called.
type: Question
has comment: http://stackoverflow.com/comment/43352213
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27457478
has comment: http://stackoverflow.com/comment/43351974

http://stackoverflow.com/q/27331941
tagged with: javascript
tagged with: gulp
accepted answer: http://stackoverflow.com/a/27333245
favorite count: 0
linked to: http://stackoverflow.com/q/28754685
tagged with: node.js
type: AnsweredQuestion
tagged with: node-modules
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27333245
has title: How to tell Gulp when a task is finished?
score: 1
answer count: 1
downvote count: 0
has body: I am trying to write a gulp plugin which will count the number of files in the stream. I used this as a starting point: function count() { var count = 0; function countFiles(data) { count++; // added this as per official docs: this.queue(data); } function endStream() { console.log(count + " files processed"); // not doing this as per original post, as it "ends" the gulp chain: //this.emit("end"); // so doing this instead as per official docs: this.queue(null); } return through(countFiles, endStream); } module.exports = count; And here is a sample task: gulp.task("mytask", function () { gulp .src("...files...") .pipe(count()); // &lt;--- here it is .pipe(changed("./some/path")) .pipe(uglify()) .pipe(rename({ extname: ".min.js" })) .pipe(gulp.dest(./some/path)) .pipe(count()); // &lt;--- here it is again }); It works perfectly, except that it does not begin/end as expected: [14:39:12] Using gulpfile c:\foo\bar\baz\gulpfile.js [14:39:12] Starting 'mytask'... [14:39:12] Finished 'mytask' after 9.74 ms 9 files processed 5 files processed That means that the thing is running asynchronously and finishes after the task is complete. The docs say that you must use a callback or return a stream. It seems to be doing just that. How do I make this function behave? Is it because I'm using the through rather than the through2 plugin?

http://stackoverflow.com/q/27336503
upvote count: 3
answer count: 5
has answer: http://stackoverflow.com/a/27336534
accepted answer: http://stackoverflow.com/a/27336534
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27336522
has answer: http://stackoverflow.com/a/27336525
has title: Jquery keyup on page load
has answer: http://stackoverflow.com/a/27336567
has answer: http://stackoverflow.com/a/27336515
type: AnsweredQuestion
score: 3
type: Question
has body: I am using jquery keyup to calculate fees ,the keyup is working fine but the problem is on page load fees are not showing that means it is only works when a key is pressed but i want to calculate fees on page load.Here is my code HTML: Amount Fee(5%) $ Net amount $ Jquery: $(document).ready(function(){ $('#amount').on('keyup change', function(){ $('#fees').text($('#amount').val()*(5/100)); $('#net').text($('#amount').val() - ($('#amount').val()*5/100)); }); });
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27336515

jquery-mobile
tags question: http://stackoverflow.com/q/27325799
tags question: http://stackoverflow.com/q/27392946
tags question: http://stackoverflow.com/q/27424148
type: Tag
tags question: http://stackoverflow.com/q/27457747
tags question: http://stackoverflow.com/q/27315489
tags question: http://stackoverflow.com/q/27427015
tags question: http://stackoverflow.com/q/27331917
tags question: http://stackoverflow.com/q/27317784
tags question: http://stackoverflow.com/q/27417586
tags question: http://stackoverflow.com/q/27446934
tags question: http://stackoverflow.com/q/27441962
tags question: http://stackoverflow.com/q/27409303
tags question: http://stackoverflow.com/q/27456656
tags question: http://stackoverflow.com/q/27420878
tags question: http://stackoverflow.com/q/27383907
tags question: http://stackoverflow.com/q/27420567
tags question: http://stackoverflow.com/q/27390733
tags question: http://stackoverflow.com/q/27441714
tags question: http://stackoverflow.com/q/27358842
tags question: http://stackoverflow.com/q/27408252
tags question: http://stackoverflow.com/q/27321512
tags question: http://stackoverflow.com/q/27362108
tags question: http://stackoverflow.com/q/27456363
tags question: http://stackoverflow.com/q/27313885
tags question: http://stackoverflow.com/q/27377013
tag name: jquery-mobile
tags question: http://stackoverflow.com/q/27374479

http://stackoverflow.com/q/27444569
tagged with: angularjs-scope
tagged with: angularjs-directive
tagged with: javascript
has body: Html code: Select From Date From Date Should be less than To Date Select To Date To Date should be greater than From Date Js Code: app.directive('validateToDate', function($log) { return { restrict : 'A', require : 'ngModel', link : function(scope, element, attr, controller) { controller.$parsers.unshift(function(value) { var toDate = Date.parse(value); var fromDate = Date.parse(attr.validateToDate); var valid; if (value == '' && fromDate != '') { controller.$setValidity('enterToDate', false); valid = false; } else { valid = true; controller.$setValidity('enterToDate', true); if (fromDate <= toDate) { valid = true; controller.$setValidity('validateToDate', true); } else { valid = false; controller.$setValidity('validateToDate', false); } } return valid ? value : undefined; }) } }; }) app.directive('validateFromDate', function($log) { return { restrict : 'A', require : 'ngModel', link : function(scope, element, attr, controller) { controller.$parsers.unshift(function(value) { var toDate = Date.parse(attr.validateFromDate); var fromDate = Date.parse(value); var valid; if (value == '' && toDate != '') { controller.$setValidity('enterFromDate', false); valid = false; } if (fromDate <= toDate) { valid = true; controller.$setValidity('validateFromDate', true); } else { valid = false; controller.$setValidity('validateFromDate', false); } return valid ? value : undefined; }) } }; }) What I am trying to do here is: 1) either both dates should be selected or none 2) if only one date is selected other should prompt error saying please select date 3) from date should be greater that to date Can some one please help how can I get this done, any help is highly appreciated, thanks
accepted answer: http://stackoverflow.com/a/27444841
type: AnsweredQuestion
tagged with: validation
has title: angularjs comparing two dates
favorite count: 0
tagged with: angularjs
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27457475
downvote count: 1
has answer: http://stackoverflow.com/a/27444841
score: 0
possible better answer: http://stackoverflow.com/a/27457475
upvote count: 1

http://stackoverflow.com/q/27325096
type: UnansweredQuestion
tagged with: css
has body: I am trying to make this example in D3js, http://bl.ocks.org/nsonnad/4481531 but I would like to make the graph responsive to window size. How would I do that? I tried searching online and it looks like making the svg responsive seem to be the solution, but I can't seem to implement it to make it work. Would someone please help?
answer count: 0
has title: How do I make D3js script responsive to window size?
has comment: http://stackoverflow.com/comment/43110971
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43109503
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43114691
tagged with: d3.js

http://stackoverflow.com/q/27371711
type: AnsweredQuestion
has title: Angular JS Change Class on ng-mouseover
downvote count: 0
score: 17
tagged with: dom
has answer: http://stackoverflow.com/a/27371761
accepted answer: http://stackoverflow.com/a/27371761
type: Question
has comment: http://stackoverflow.com/comment/43228752
tagged with: javascript
possible better answer: http://stackoverflow.com/a/34433675
answer count: 3
has answer: http://stackoverflow.com/a/58665896
upvote count: 17
has comment: http://stackoverflow.com/comment/43195645
favorite count: 0
has body: Am trying to add a class (blue) to a button when ever you hover the button using AngularJS. HTML Add and Optimize AngularJS $scope.hover = function (iets) { var Dit = this; Dit.add("blue"); }; Anyone can help me out? Preferable a small example, it would be very appreciated!
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43194840
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/34433675

http://stackoverflow.com/comment/43097054
score: 0
comment on: http://stackoverflow.com/q/27318727
type: Comment
type: QuestionComment
has text: Just tried the first set of code using Chrome on JS Fiddle ... works. http://jsfiddle.net/rfornal/7fwxteka/

http://stackoverflow.com/comment/43275198
type: Comment
type: QuestionComment
score: 0
has text: @vp_arth Thanks man! but in this case Object.keys would be just the index number?! Could you please elaborate your solution...
comment on: http://stackoverflow.com/q/27415001

http://stackoverflow.com/a/27326824
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27326772
type: Answer
has body: Try using .outerHeight() to get the height of the navbar. From jQuery API docs: "The top and bottom padding and border are always included in the .outerHeight() calculation; if the includeMargin argument is set to true, the margin (top and bottom) is also included." http://api.jquery.com/outerheight/
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27326772
type: AcceptedAnswer

http://stackoverflow.com/q/27409204
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43263001
has comment: http://stackoverflow.com/comment/43271891
accepted answer: http://stackoverflow.com/a/27410073
has answer: http://stackoverflow.com/a/27409667
type: Question
has comment: http://stackoverflow.com/comment/43262917
possible better answer: http://stackoverflow.com/a/27409906
has answer: http://stackoverflow.com/a/27409906
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43263004
favorite count: 0
has title: SMOOTH Javascript Animations?
answer count: 3
has comment: http://stackoverflow.com/comment/43262806
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27410073
score: -1
tagged with: animation
tagged with: css
has body: I have this Javascript animation: Fun with animations Hi Hey Basically, I have a header div. I want the header to slide down and up when clicked. It slides down pretty well, but when it reaches the end it starts glitching out, until you click on it again, which normally stops it. Then when you click on it AGAIN, to bring it back up, it REALLY starts glitching out, and doesn't ever go up or stop. How do I make a relatively glitch-free script that will produce good animations?
downvote count: 1

http://stackoverflow.com/comment/43292069
score: 0
has text: @Cerbrus I'm loading HTML dynamically, then copying certain node values to the loaded `window.document`. I'm trying to load `next` and `previous` comics using AJAX and preload them so that I don't have to wait... :)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27423863

http://stackoverflow.com/q/27366063
type: AnsweredQuestion
score: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/43184058
has answer: http://stackoverflow.com/a/27366120
possible better answer: http://stackoverflow.com/a/27366113
accepted answer: http://stackoverflow.com/a/27366120
type: Question
tagged with: javascript
upvote count: 4
answer count: 2
has body: When using window.location.href I'm running into an infinite loop (even though it is placed inside a function that is only called once during startup). function onYouTubeIframeAPIReady() { // only called one time once API's are ready window.location.href = ("?name=" + new Date().getTime()); //is EPOCH time window.location.hash works just fine (but I can't use that) ...
has comment: http://stackoverflow.com/comment/43184111
has answer: http://stackoverflow.com/a/27366113
favorite count: 0
has title: Window.location.href infinite loop

http://stackoverflow.com/q/27429919
has comment: http://stackoverflow.com/comment/43303813
has comment: http://stackoverflow.com/comment/43303922
tagged with: transclusion
has body: I'm trying to create a directive that can transclude two things into separate places, one of which is an ng-repeat, however in my compile function using $transclude breaks if returning undefined is not a function, however if I do it in pre-compile it works but the ng-repeat has no content. My code looks something like this .directive('sidebarItem', ['_', function(_) { return { replace: true, transclude: true, scope: { title: '@', state: '@', activeState: '=', dropdown: '=' }, compile: function(ele, attrs, transclude) { transclude(ele) // This returns error return { pre: function(scope, ele,attrs, ctrl, trns) { trns(scope) // This has my transcluded content but the ng-repeat is empty } } } } } I've also tried doing a manual transclude which returns an empty ng-repeat trns(scope.$parent, function(tEle, tScope) { var repeat = tEle[1].querySelector('[repeat]'), newEle = angular.element('&lt;li ng-repeat="item in studentDropdown"&gt;&lt;/li&gt;'), dropdown = ele[0].querySelector('.dropdown') tScope.studentDropdown // Can access here newEle.append(repeat.innerHTML) angular.injector(['ng']).get('$compile')(newEle) // returns ng-repeat comment but no items angular.element(dropdown).append(newEle) }) Template of sidebar-item li.sidebar-item(ng-class='{active: active, dropdown: dropdown, "dropdown-open": isDropdownOpen}') .sidebar-content a.sidebar-item-link(ng-if='!dropdown' ui-sref='{{state}}') a.sidebar-item-link(ng-if='dropdown' ng-click='toggleDropdown()') .icon(ng-transclude) .title {{ title }} .down-arrow(ng-if='dropdown') ul.dropdown(ng-if='dropdown') Use of directive sidebar-item div(has-dropdown) div(icon) //icon stuff div(dropdown) li(ng-repeat='item in dropdown') | {{ item }} Alternate use sidebar-item div(has-dropdown) div(icon) //icon stuff div(dropdown) li Item 1 li Item 2
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
favorite count: 0
tagged with: angularjs-ng-transclude
type: Question
has comment: http://stackoverflow.com/comment/43303867
has title: Angular transcluding ng-repeat inside compile breaks
tagged with: angularjs
upvote count: 1

http://stackoverflow.com/comment/43105413
score: 0
comment on: http://stackoverflow.com/q/27318523
type: QuestionComment
type: Comment
has text: Your first fiddle wasn't including highcharts.js and the data was out of order, but otherwise it only displays the 2 requested data points on the xAxis. Is there another problem? http://jsfiddle.net/PyYnF/55/

http://stackoverflow.com/comment/43248362
has text: Thanks for the updated fiddle! Wasn't able to make something like that myself. Regarding 3, it's a part of my code that I didn't post. Look here: http://jsfiddle.net/pef719qx/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27390402

http://stackoverflow.com/comment/43253925
has text: The OP never actually post any JSON, he posted what the parsed JSON would look like in JavaScript, and did so with a browser specific syntax issue. As the posting was really just pseudo code and no actual JSON was ever posted, there is no way to know if the OP actually has a JSON formatting issue.
type: Comment
comment on: http://stackoverflow.com/a/27404078
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43258866
score: 0
type: Comment
has text: I just copy your code but same error appears in console
comment on: http://stackoverflow.com/a/27396977
type: AnswerComment

http://stackoverflow.com/q/27409016
has body: I'm having trouble with trying to hide a row when clicking the checkbox. The problem is that disappears when click and I want to show it when click. Can anybody tell me whats the problem? I have this JavaScript code: and this html code: Devuelvo el auto en otra ciudad Ciudad de devolución
has title: checkbox hide row when click
type: Question
has answer: http://stackoverflow.com/a/27409215
tagged with: javascript
tagged with: jquery
tagged with: show-hide
accepted answer: http://stackoverflow.com/a/27409159
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
answer count: 4
possible better answer: http://stackoverflow.com/a/27409186
has answer: http://stackoverflow.com/a/27409260
has answer: http://stackoverflow.com/a/27409186
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27409159
has comment: http://stackoverflow.com/comment/43262529

http://stackoverflow.com/q/27444739
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27445035
has body: So I have the following setup: SomeText ChildText OtherText ChildText DifferentText How do I remove the text "sometext", "othertext" and "DifferentText" in javascript (not Jquery) without removing the child text. Setting the innerHTML = ""; removes the contents, using the Jquery .text() or JavaScript .textContent = ""; doesn't work either. I had a look at the first answer below, but this would only return the first SomeText (what I'm really looking for is something that would remove or select all the text xin the topDiv without affecting the spans. The text can't be hidden either, it has to be removed Thanks for any help!
tagged with: javascript
has comment: http://stackoverflow.com/comment/43328398
has comment: http://stackoverflow.com/comment/43328559
answer count: 2
downvote count: 0
has title: Remove text in div ONLY but not in child elements - NOT JQUERY
has answer: http://stackoverflow.com/a/27444863
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1571076
score: 1

http://stackoverflow.com/a/27396033
answers question: http://stackoverflow.com/q/27394365
type: Answer
has comment: http://stackoverflow.com/comment/43529677
has comment: http://stackoverflow.com/comment/43465368
has body: It will result success because the url is correct. The error in your code is in here action: 'ajaxurl', add add_action( 'wp_ajax_ajaxurl', 'my_action_callback' ); to your ajaxurl and function my_action_callback(){}
has comment: http://stackoverflow.com/comment/43274137
has comment: http://stackoverflow.com/comment/43413389
score: 0
has comment: http://stackoverflow.com/comment/43266763

http://stackoverflow.com/a/27392759
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27392669
downvote count: 0
has body: Try something like this... var ob = new parent[type]( ops ); Also, read about factory methods, or the factory pattern: http://addyosmani.com/resources/essentialjsdesignpatterns/book/#factorypatternjavascript

http://stackoverflow.com/comment/43132688
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27338028
has text: can't up vote yet, but thanks!

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/27314374
tags question: http://stackoverflow.com/q/27358081
tags question: http://stackoverflow.com/q/27423003
type: Tag
tags question: http://stackoverflow.com/q/27361423
tags question: http://stackoverflow.com/q/27420580
tags question: http://stackoverflow.com/q/27424777

http://stackoverflow.com/comment/43122135
has text: The done promises are not kept around once they are resolved. Only the last one is stored in `filesOperation` (and subsequent ones overwrite this variable). You might store them however somewhere else, as `createTaskForFile` returns each of them.
type: Comment
comment on: http://stackoverflow.com/a/27319607
score: 0
type: AnswerComment

http://stackoverflow.com/q/27419016
downvote count: 0
tagged with: javascript
has body: I want to put that page up where I have a selection of cloudcasts worth listening. And I want to launch them with a custom interface. It works well on desktop, but not at all on mobile devices: the player won't start the playlist. It keeps on spinning and spinning and never starts. The mixcloud team didn't reply to my question. So, I have 2 codepen with 2 different techniques that I tried to make it work: The first one employs the Mixcloud Widget API and tries to invoke when ready the player.play() method. It doesn't work on mobile, nor does player.load("/some/tape", true). Test it: http://codepen.io/zipang/debug/KwVOpB Full sources: http://codepen.io/zipang/pen/KwVOpB The second one uses a less subtile approach: it regenerates the iframe with the autoplay=true parameter and inserts it into the DOM. With no further results on mobile. Test it: http://codepen.io/zipang/debug/azdQmR Full sources: http://codepen.io/zipang/pen/azdQmR Does anyone know if there is a reason why? Or is there a workaround?
favorite count: 0
linked to: http://stackoverflow.com/q/15090782
has title: Mixcloud Player autoplay not working on mobile devices
has answer: http://stackoverflow.com/a/27427144
linked to: http://stackoverflow.com/q/26066062
linked to: http://stackoverflow.com/q/21506721
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/27427144
linked to: http://stackoverflow.com/q/11916451
tagged with: mobile
answer count: 1

http://stackoverflow.com/comment/43360326
type: Comment
type: QuestionComment
has text: Whats wrong with the regex you have? Just add a capture group. `text = text.replace( /Foo:([a-z])/ig, 'Foo: $1');`
comment on: http://stackoverflow.com/q/27461828
score: 0

http://stackoverflow.com/comment/43372281
score: 0
type: QuestionComment
type: Comment
has text: Can you please post the relevant code in your question?
comment on: http://stackoverflow.com/q/27468188

http://stackoverflow.com/q/27331370
answer count: 3
has comment: http://stackoverflow.com/comment/43120635
favorite count: 0
has answer: http://stackoverflow.com/a/27331445
has body: I have an array like this: var animals=["cat","dog","snake","rhino"]; But sometimes I have to delete this array(remove it from the dom). I have tried animals.remove; and $(animals).remove() and animals.remove() but none of them did the trick.Any ideas?
has comment: http://stackoverflow.com/comment/43120586
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43120632
score: -3
has answer: http://stackoverflow.com/a/27331418
accepted answer: http://stackoverflow.com/a/27331418
has comment: http://stackoverflow.com/comment/43120631
has title: Remove an array-Javascript
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27331414
has comment: http://stackoverflow.com/comment/43120674
linked to: http://stackoverflow.com/q/134845
downvote count: 3
has comment: http://stackoverflow.com/comment/43120552
linked to: http://stackoverflow.com/q/16963066
type: Question
has comment: http://stackoverflow.com/comment/43120546
upvote count: 0
tagged with: arrays
tagged with: javascript
linked to: http://stackoverflow.com/q/1232040
has answer: http://stackoverflow.com/a/27331414

http://stackoverflow.com/comment/43219976
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27384754
has text: This is a classic case of race conditions. The for loop in your controller is executed in parallel with your `res.json` call which means that the server responds to the client request before the first loop is done executing. You need to restructure your code. I would suggest looking at the `async` library.

http://stackoverflow.com/q/27358228
answer count: 3
has title: I cannot get Base64 string from a canvas
possible better answer: http://stackoverflow.com/a/27358577
has answer: http://stackoverflow.com/a/27358577
accepted answer: http://stackoverflow.com/a/27359130
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27358745
type: Question
tagged with: canvas
has answer: http://stackoverflow.com/a/27359130
tagged with: javascript
tagged with: base64
score: 0
has body: I've been trying to get a Base64 string from a canvas. But I cannot. The following code does nothing. It should be insert an image into document.body. On the other hand I've tried to get base64 string and converting an image. But again I cannot. what should I do? http://jsfiddle.net/27hdp4y6/1/ var image1 = new Image(); image1.src = "http://www.w3.org/html/logo/downloads/HTML5_Logo_128.png"; var image2 = new Image(); image2.src = "http://prismitsolutions.com/images/icons/css3.png"; var canvas = document.createElement('canvas'); canvas.width = 220; canvas.height= image1.height; var context = canvas.getContext("2d"); image1.onload = function() { context.drawImage(image1, 0, 0); context.drawImage(image2, 80, 0); }; var base64 = canvas.toDataURL('image/png'); var img = document.createElement('img'); img.src=base64; document.body.appendChild(img); //document.body.appendChild(canvas);
linked to: http://stackoverflow.com/q/20424279

http://stackoverflow.com/a/27354970
has body: I found a nice post on efficiency using different methods of comparing things. I still suggest using a switch-block instead of if/else, but it's technically not better than your solution, but as I thinks it nicer to read. Here is a code snippet: switch (true) { case (0 &lt;= val &amp;&amp; val &lt; 1000): /* do something */ break; case (1000 &lt;= val &amp;&amp; val &lt; 2000): /* do something */ break; ... case (29000 &lt;= val &amp;&amp; val &lt; 30000): /* do something */ break; } Taken from this post. There's also an interesting table (in the first answer) Switch statement for greater-than/less-than and different methods of making this work. I know this is actually not a solution for your answer, but it might come in handy if you need to add more if/else and are doing some huge lists with values.
score: 0
answers question: http://stackoverflow.com/q/27354665
has comment: http://stackoverflow.com/comment/43162990
type: Answer

http://stackoverflow.com/q/27339737
upvote count: 0
has answer: http://stackoverflow.com/a/27339744
accepted answer: http://stackoverflow.com/a/27339744
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43136035
score: -1
has comment: http://stackoverflow.com/comment/43135995
has body: I am trying to change the color of div using its ID . String is working but Hex value is not working. Working :-- var div = document.getElementById('1'); div.style.backgroundColor = 'red'; Not working :-- var div = document.getElementById('1'); div.style.backgroundColor = #3e4046; div.style.backgroundColor = 0x3e4046; How to change colour of div using hex value ?
answer count: 1
has comment: http://stackoverflow.com/comment/43135910
downvote count: 1
has title: changing color of div -- using ID
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/27416638
tagged with: mongodb
has title: Can't get MongoDB update query to work in Node.JS
has comment: http://stackoverflow.com/comment/43277300
upvote count: 1
answer count: 1
tagged with: node-mongodb-native
has body: I've been through the docs, tutorials and SO. I just can't seem to find the right answer on how to properly update an entry that's already in the database. I can insert data just fine but the second I try to update it using the below query, it fails. It's wrong in some way but I can't figure it out. I copied from the docs, tuts, etc. Still no go. My insert works fine so it can't be a connection issue. This is my update code db.collection("usercollection").findOne({ 'playerName': sPlayerName, 'playerId': sPlayerID}) db.collection("usercollection").update({ 'playerName': sPlayerName },{$set: { 'playerScore': sPlayerScore}}); I'm trying to update the "playerScore" field using $set. From what I understand, I have to "findOne" entry first then update it. I just keep getting "TypeError: object is not a function" error message when I run the update code in my Node.JS app. Here's my whole function: function insertEntry(sPlayerName, sPlayerID, sPlayerScore, sPlayerHealth) { var Db = require('mongodb').Db, MongoClient = require('mongodb').MongoClient, Server = require('mongodb').Server, ReplSetServers = require('mongodb').ReplSetServers, ObjectID = require('mongodb').ObjectID, Binary = require('mongodb').Binary, GridStore = require('mongodb').GridStore, Grid = require('mongodb').Grid, Code = require('mongodb').Code, BSON = require('mongodb').pure().BSON, assert = require('assert'); var db = new Db('mdata', new Server('localhost', 27017)); db.open(function(err, db) { if(!err) { // Fetch a collection to insert document into var collection = db.collection("usercollection"); if(sPlayerScore &lt; 101) { db.collection("usercollection").insert({ 'playerName': sPlayerName, 'playerId': sPlayerID, 'playerScore': sPlayerScore}, { w: 0 }); } else if(sPlayerScore &gt; 190) { db.collection("usercollection").findOne({ 'playerName': sPlayerName, 'playerId': sPlayerID}) db.collection("usercollection").update({ 'playerName': sPlayerName },{$set: { 'playerScore': sPlayerScore}}); } } }); } I kn…
favorite count: 0
tagged with: node.js
has answer: http://stackoverflow.com/a/27438612
accepted answer: http://stackoverflow.com/a/27438612
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43277391
downvote count: 1
has comment: http://stackoverflow.com/comment/43303248
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/43275043
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27415536
score: 0
has text: no, I am new to html5 video

http://stackoverflow.com/q/27383718
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27384297
accepted answer: http://stackoverflow.com/a/27384297
score: 1
has body: I have structure like this: 200.00грн. Нет в наличии I need on click $(".variation-select").last().click(function () { }) change Нет в наличии like this: `$("p.stock").prependTo(".single_variation");` move p.stock to be first element of .single_variation. I need to do this on click because first when page load there no .single_variation_wrap it's hidden. After click the last .variation-select .single_variation_wrap become to be visible. For better understand i load my page on hosting and adding link here. Also I add screenshot where I explain what I need to do. page link: Product page link
has comment: http://stackoverflow.com/comment/43216619
upvote count: 1
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/43216841
tagged with: javascript
tagged with: jquery
has title: jQuery on click change outer element
has comment: http://stackoverflow.com/comment/43216431
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43216483

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/27457469
tags question: http://stackoverflow.com/q/27356244
tags question: http://stackoverflow.com/q/27328438
tags question: http://stackoverflow.com/q/27335297
tags question: http://stackoverflow.com/q/27447755
tags question: http://stackoverflow.com/q/27435945
tags question: http://stackoverflow.com/q/27368188
tags question: http://stackoverflow.com/q/27412861
tags question: http://stackoverflow.com/q/27465061
tags question: http://stackoverflow.com/q/27354789
tags question: http://stackoverflow.com/q/27380584
tags question: http://stackoverflow.com/q/27398092
tags question: http://stackoverflow.com/q/27373990
tags question: http://stackoverflow.com/q/27364838
tags question: http://stackoverflow.com/q/27464947
tags question: http://stackoverflow.com/q/27370654
tags question: http://stackoverflow.com/q/27343300
tags question: http://stackoverflow.com/q/27429601
tags question: http://stackoverflow.com/q/27381735
tags question: http://stackoverflow.com/q/27391462
tags question: http://stackoverflow.com/q/27368778
tags question: http://stackoverflow.com/q/27334033
tags question: http://stackoverflow.com/q/27414030
tags question: http://stackoverflow.com/q/27416744
tags question: http://stackoverflow.com/q/27462247
tags question: http://stackoverflow.com/q/27361635
tags question: http://stackoverflow.com/q/27354455
tags question: http://stackoverflow.com/q/27393328
tags question: http://stackoverflow.com/q/27380237
tags question: http://stackoverflow.com/q/27384422
tags question: http://stackoverflow.com/q/27465159
tags question: http://stackoverflow.com/q/27366950
tags question: http://stackoverflow.com/q/27376472
tags question: http://stackoverflow.com/q/27431352
tags question: http://stackoverflow.com/q/27397036
tags question: http://stackoverflow.com/q/27428448
tags question: http://stackoverflow.com/q/27376931
tags question: http://stackoverflow.com/q/27387709
tags question: http://stackoverflow.com/q/27399208
tags question: http://stackoverflow.com/q/27406323
tags question: http://stackoverflow.com/q/27347506
tags question: http://stackoverflow.com/q/27364607
tags question: http://stackoverflow.com/q/27427577
tags question: http://stackoverflow.com/q/27434444
tags question: http://stackoverflow.com/q/27341881
tags question: http://stackoverflow.com/q/27450120
tags question: http://stackoverflow.com/q/27349696
tags question: http://stackoverflow.com/q/27452478
tags question: http://stackoverflow.com/q/27387475
tags question: http://stackoverflow.com/q/27410772
tags question: http://stackoverflow.com/q/27433269
tags question: http://stackoverflow.com/q/27406869
tags question: http://stackoverflow.com/q/27322170
tags question: http://stackoverflow.com/q/27413399
tags question: http://stackoverflow.com/q/27435299
tags question: http://stackoverflow.com/q/27444378
tags question: http://stackoverflow.com/q/27316846
tags question: http://stackoverflow.com/q/27409303
tags question: http://stackoverflow.com/q/27365054
tags question: http://stackoverflow.com/q/27442610
tags question: http://stackoverflow.com/q/27370283
tags question: http://stackoverflow.com/q/27382114
tags question: http://stackoverflow.com/q/27380864
tags question: http://stackoverflow.com/q/27324630
tags question: http://stackoverflow.com/q/27456939
tags question: http://stackoverflow.com/q/27319499
tags question: http://stackoverflow.com/q/27444227
tags question: http://stackoverflow.com/q/27450861
tags question: http://stackoverflow.com/q/27380545
tags question: http://stackoverflow.com/q/27416932
tags question: http://stackoverflow.com/q/27466969
tags question: http://stackoverflow.com/q/27381248
tags question: http://stackoverflow.com/q/27411261
tags question: http://stackoverflow.com/q/27362765
tags question: http://stackoverflow.com/q/27347631
tags question: http://stackoverflow.com/q/27320333
tags question: http://stackoverflow.com/q/27377156
tags question: http://stackoverflow.com/q/27392274
tags question: http://stackoverflow.com/q/27433746
tags question: http://stackoverflow.com/q/27367276

http://stackoverflow.com/a/27397443
score: 3
downvote count: 0
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/27397297
has body: Use serialize function using jQuery &lt;script type="text/javascript"&gt; (function ($) { $('#formID').on('submit', function (e) { e.preventDefault(); $.ajax({ type: 'POST', url: '/pathTo/process_form.php', data: $('#formID').serialize() }); }); })(jQuery); &lt;/script&gt;

http://stackoverflow.com/q/27324170
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/43107562
has answer: http://stackoverflow.com/a/27324257
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: My headings in my carousel are cut off when I visit my page in mobile view. Website here... www.jocatcreative.com Screen shot if issue linked below https://i.sstatic.net/NAIPZ.jpg Below is my HTML for the carousel... Will update with CSS info if needed. Welcome to my portfolio. I've developed a website from scratch to showcase my passion for web design. Please exlpore the page and links to various projects. Special thanks to the One Month guys in NYC for inspiring me. I would love to work for a Startup in NYC. There is a huge startup boom in NYC that seems fun, new, and exciting. New York attracts some of the brightest, most intelligent, and creative people who are willing to take risks. I want in! Please scroll below for more info. Thanks for taking the time to visit. Feel free to e-mail me for inquiries, questions, or comments. Also follow me on Twitter ---EDITED FOR CSS--- /*----------------------------------------------------------------------------- =MAIN STYLES -----------------------------------------------------------------------------*/ .banner img { width: 100%; } .marketing .row { text-align: center; } .navbar { margin-bottom: 0; /* removes default excess margin */ } .divider { margin: 80px 0; } .featurette-heading { font-weight: 300; line-height: 1; letter-spacing: -1px; } .companies h3 { margin-bottom: 40px; } .companies img { margin: 50px 0; } footer { background: url('../images/grey-texture.jpg'); padding: 40px; } a { color: gray; } .custom-navbar { background: transparent; border: 0px; } @media (max-width:767px) { .custom-navbar .name { font-size: 20px; float: left; margin: 0; padding: 15px 0 15px 15px; } .custom-navbar .navbar-toggle { margin: 10px 15px 0 0; float: right; } } @media (min-width:768px) { .custom-navbar .navbar-header { width: 100%; margin: 0; } .custom-navbar .name { text-align: center; float: none; } }
upvote count: 1
tagged with: css
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43108881
has title: Heading in Mobile View Cut Off
downvote count: 0
answer count: 1

angularjs
tags question: http://stackoverflow.com/q/27462373
tags question: http://stackoverflow.com/q/27389666
tags question: http://stackoverflow.com/q/27413451
tags question: http://stackoverflow.com/q/27427012
tags question: http://stackoverflow.com/q/27452259
tags question: http://stackoverflow.com/q/27369804
tags question: http://stackoverflow.com/q/27317519
tags question: http://stackoverflow.com/q/27316686
tags question: http://stackoverflow.com/q/27455276
tags question: http://stackoverflow.com/q/27384751
tags question: http://stackoverflow.com/q/27401771
tags question: http://stackoverflow.com/q/27408022
tags question: http://stackoverflow.com/q/27390005
tags question: http://stackoverflow.com/q/27437882
tags question: http://stackoverflow.com/q/27320940
tags question: http://stackoverflow.com/q/27354139
tags question: http://stackoverflow.com/q/27324241
tags question: http://stackoverflow.com/q/27342809
tags question: http://stackoverflow.com/q/27370837
tags question: http://stackoverflow.com/q/27328890
tags question: http://stackoverflow.com/q/27400603
tags question: http://stackoverflow.com/q/27439904
tags question: http://stackoverflow.com/q/27371711
tags question: http://stackoverflow.com/q/27328912
tags question: http://stackoverflow.com/q/27410336
tags question: http://stackoverflow.com/q/27326220
tags question: http://stackoverflow.com/q/27471613
tags question: http://stackoverflow.com/q/27448338
tags question: http://stackoverflow.com/q/27350733
tags question: http://stackoverflow.com/q/27458854
tags question: http://stackoverflow.com/q/27344038
tags question: http://stackoverflow.com/q/27414199
tags question: http://stackoverflow.com/q/27432271
tags question: http://stackoverflow.com/q/27321411
tags question: http://stackoverflow.com/q/27392914
tags question: http://stackoverflow.com/q/27421023
tags question: http://stackoverflow.com/q/27449740
tags question: http://stackoverflow.com/q/27405846
tags question: http://stackoverflow.com/q/27414529
tags question: http://stackoverflow.com/q/27371810
tags question: http://stackoverflow.com/q/27363130
tags question: http://stackoverflow.com/q/27411561
tags question: http://stackoverflow.com/q/27450734
tags question: http://stackoverflow.com/q/27347095
tags question: http://stackoverflow.com/q/27319228
tags question: http://stackoverflow.com/q/27354522
tags question: http://stackoverflow.com/q/27394841
tags question: http://stackoverflow.com/q/27365588
tags question: http://stackoverflow.com/q/27379276
tags question: http://stackoverflow.com/q/27356847
tags question: http://stackoverflow.com/q/27329403
tags question: http://stackoverflow.com/q/27452520
tags question: http://stackoverflow.com/q/27417834
tags question: http://stackoverflow.com/q/27317093
tags question: http://stackoverflow.com/q/27443254
tags question: http://stackoverflow.com/q/27389187
tags question: http://stackoverflow.com/q/27386846
tags question: http://stackoverflow.com/q/27463094
tags question: http://stackoverflow.com/q/27471917
tags question: http://stackoverflow.com/q/27372092
tags question: http://stackoverflow.com/q/27426539
tags question: http://stackoverflow.com/q/27315796
tags question: http://stackoverflow.com/q/27396586
tags question: http://stackoverflow.com/q/27382686
tags question: http://stackoverflow.com/q/27466809
tags question: http://stackoverflow.com/q/27389821
type: Tag
tags question: http://stackoverflow.com/q/27420555
tags question: http://stackoverflow.com/q/27409298
tags question: http://stackoverflow.com/q/27427507
tags question: http://stackoverflow.com/q/27441268
tags question: http://stackoverflow.com/q/27433383
tags question: http://stackoverflow.com/q/27406464
tags question: http://stackoverflow.com/q/27314510
tags question: http://stackoverflow.com/q/27462220
tags question: http://stackoverflow.com/q/27411474
tags question: http://stackoverflow.com/q/27446227
tags question: http://stackoverflow.com/q/27330284
tags question: http://stackoverflow.com/q/27377875
tags question: http://stackoverflow.com/q/27446071

http://stackoverflow.com/comment/45600252
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27320573
has text: The [doc](http://www.gwtproject.org/articles/superdevmode.html) says that this option is for "chrome devtools." Is it supposed to work with Safari? Have you tried with Chrome?
score: 0

http://stackoverflow.com/comment/43155513
score: 0
has text: You need to configure your server to send that header.
type: QuestionComment
comment on: http://stackoverflow.com/q/27350540
type: Comment

http://stackoverflow.com/comment/43147658
comment on: http://stackoverflow.com/q/27346326
type: Comment
type: QuestionComment
has text: please check console and find what errors you are getting ?
score: 0

http://stackoverflow.com/a/27413981
answers question: http://stackoverflow.com/q/27406234
type: Answer
downvote count: 0
score: 1
upvote count: 1
has body: This is more of a browser related issue rather than a coding issue. In browsers like Chrome this interference in inevitable. It has to do a lot with security concern. Hackers can create a fake webpage for a banking site as a part of phishing and hack peoples password. Most of the latest browsers disable hiding the location bar, although in some browsers, setting location=no will disable the address bar from being modified. But from a coding perspective you have some options, Some of them are listed below. You can use a localStrorage object that persists any saved data indefinitely on the user's computer and across browser tabs (similar to JavaScript cookies). Here is a demo code: This code works on FF3+, Chrome4+, Safari4+, Opera10.5+, or IE8+ If you have windows popping up that ask for the location you can try out this simple solution by making window.open=null; on the instance that is responsible for fetching out the location.

http://stackoverflow.com/q/27367134
answer count: 2
has body: I have problem with CMS. I need to change css that the page could be responsive. One of the div has data-height, data-weight and height, width in style in html that it looks like that div class="classOf" id="idOf" data-width="755" data-height="125" style="width: 755px; height: 125px;" I can't use my new css due to is not working if I select this id and change properties. This is CMS so I can only console to append new css and js. My question is how to neutralize this set properties on html and apply css with max-width:100% that will work ?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27367383
score: 0
has title: Responsive image in CMS
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/27367245
type: Question

http://stackoverflow.com/comment/43145436
type: Comment
has text: @rineez I've changed my question. Looking over it again I didn't like what I was asking either. I imagined that given how popular cookies are there must be some methods to use with them to make grabbing this kind of data more convenient than writing out a function, as much of the internet seems to suggest. Having said that, what method would you recommend?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27344864

http://stackoverflow.com/q/27335774
favorite count: 0
possible better answer: http://stackoverflow.com/a/27335951
has comment: http://stackoverflow.com/comment/43129093
has answer: http://stackoverflow.com/a/27335951
accepted answer: http://stackoverflow.com/a/27336405
answer count: 5
tagged with: css
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43128385
has comment: http://stackoverflow.com/comment/43129113
has comment: http://stackoverflow.com/comment/43128984
has comment: http://stackoverflow.com/comment/43129054
has answer: http://stackoverflow.com/a/27335945
type: Question
upvote count: 0
linked to: http://stackoverflow.com/q/17975922
has answer: http://stackoverflow.com/a/27336003
has comment: http://stackoverflow.com/comment/43128956
has title: Active link after click
linked to: http://stackoverflow.com/q/13349046
has answer: http://stackoverflow.com/a/27336405
tagged with: javascript
tagged with: jquery
score: -1
has body: I cant find a way to add a class to an "a" element of a nav bar. This is the html nav and the jQuery (applied to test.html url only, to test it): $(document).ready(function() { $("a").click(function() { var actRef = $(this).attr("href"); if (actRef === "test.html") { $("a[href='test.html']").addClass("active"); } }); }); Inicio Test Item test2 This isnt working, it just doesnt do anything, but if i change the .click to .hover it works fine adding the class but doesnt go to the link so the info of the page wont change. I also tried this: How to change active class while click to another link in bootstrap use jquery? but neither works because of the e.preventDefault();... If i take out the preventDefault it wont add the class but it will forward to the link... PD: The aim is to let the user know on which tab he is actually on depending on the menu link he clicked.
has answer: http://stackoverflow.com/a/27335940
has comment: http://stackoverflow.com/comment/43128506
duplicate of: http://stackoverflow.com/q/13349046
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27468384
answer count: 4
has answer: http://stackoverflow.com/a/27470537
tagged with: string
has body: I am writing JScript to be run using Windows Script Host. Say I have a simple string variable: s1 = '\n' I want to build s2 from two separated chars: \ & n. naively I would like to do: s2 = ''; s2 += '\\'; s2 += 'n'; But this of course lead to s1 != s2 Can I build s2 in such way that it has the same interpreted meaning as s1? Example: WScript.Echo("1\n2") var s; s += '1'; s += '\\'; s += 'n'; s += '2'; WScript.Echo(s) I'd wish both WScript.Echo() to print exactly the same thing. Note I'm well aware that this question seems completely idiotic. I would probably think the same had I read it without knowing all the details. I don't expect anyone to understand the purpose . just curious to see whether it is feasible or do I need to re-think the whole thing.
favorite count: 0
tagged with: jscript
tagged with: wsh
has answer: http://stackoverflow.com/a/27468446
type: Question
score: -2
has comment: http://stackoverflow.com/comment/43372060
upvote count: 3
has title: JavaScript - how to build string with escape character?
has comment: http://stackoverflow.com/comment/43372036
tagged with: escaping
has comment: http://stackoverflow.com/comment/43372430
has answer: http://stackoverflow.com/a/27468506
tagged with: javascript
downvote count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/33188871

http://stackoverflow.com/comment/43226744
type: Comment
type: QuestionComment
has text: Post your HTML - also, what happens when you click? Is the form posting back and refreshing the page? Are there errors in the console?
comment on: http://stackoverflow.com/q/27389425
score: 0

http://stackoverflow.com/a/27383867
score: 0
has body: ajax request is asynchronous so fact that 2nd .log is lower in code desnt mean it will be execute after you get response. instead create function that will update data on page (or wathewer -instead of 2nd .log) and run int from calback.
type: Answer
answers question: http://stackoverflow.com/q/27383738

http://stackoverflow.com/a/27396749
type: Answer
score: 0
has body: $('#validationForm').bootstrapValidator(); $('#validationForm').on('error.field.bv', function(e, data) { // $(e.target) --&gt; The field element // data.bv --&gt; The BootstrapValidator instance // data.field --&gt; The field name // data.element --&gt; The field element data.bv.disableSubmitButtons(false); }); $('#validationForm').on('success.field.bv', function(e, data) { // e, data parameters are the same as in error.field.bv event handler // Despite that the field is valid, by default, the submit button will be disabled if all the following conditions meet // - The submit button is clicked // - The form is invalid data.bv.disableSubmitButtons(false); });
answers question: http://stackoverflow.com/q/27396414

http://stackoverflow.com/q/27387359
has comment: http://stackoverflow.com/comment/43222760
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27387433
has comment: http://stackoverflow.com/comment/43222863
has body: So this is what I've got so far: Fonts! Hello. Goodbye. Hello. This is a paragraph. It is meant to test this font. What do you think? Do you like this font? I think I do, although I'm not sure. That's why I'm writing this paragraph. Eh? Bigger you say? I agree. Let's make it bigger. Yeah, you know what, I'm using this. Allong with that Hagin thing. Some sexy shit. And when the window drops below 300 px, nothing happens. I'm using Google Chrome. I also tried just if (width < 300) { but that didn't work either. Ideas?
has title: How to Detect Window Width w/ Javascript
type: Question
tagged with: width
tagged with: javascript
score: 0
answer count: 3
tagged with: window
has answer: http://stackoverflow.com/a/27387574
has answer: http://stackoverflow.com/a/27388133

http://stackoverflow.com/q/27461635
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43359599
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43359856
has comment: http://stackoverflow.com/comment/43359572
has comment: http://stackoverflow.com/comment/43360260
has answer: http://stackoverflow.com/a/27461967
type: AnsweredQuestion
has title: Table: Show only the first row of table tbody. How to hide the succeeding 1st rows?
has comment: http://stackoverflow.com/comment/43360061
accepted answer: http://stackoverflow.com/a/27461675
tagged with: php
has comment: http://stackoverflow.com/comment/43359974
has comment: http://stackoverflow.com/comment/43360202
type: Question
has comment: http://stackoverflow.com/comment/43360160
has answer: http://stackoverflow.com/a/27461675
has body: The very 1st row of EVERY tbody is the row header (contains the column Names). The rest of EVERY tbody succeeding 1st rows are not necessary and wanted to hide them. Classes used: toprowHeader = 1st row that holds every column names recordsRow = holds the other record details For now it shows like this: -------------------------------------------- | MessageID | Sender | Message | -------------------------------------------- | 1 | admin |my admin message | -------------------------------------------- | MessageID | Sender | Message | -------------------------------------------- | 2 | sender1 |reply to admin | Here is the sample structure I wanted to achieve: -------------------------------------------- | MessageID | Sender | Message | -------------------------------------------- | 1 | admin |my admin message | | 2 | sender1 |reply to admin | Though I have some options to make it easier but the requirement says that every record should be inside a tbody Here is my Sample Table structure: ... ... ... ... ... ... Added requirement: A lot of you questioned the table structure above but the main reason why I placed it inside individual tbody its because I also have a button to be able to move the 1st tbody to the bottom/last of the table. I use PHP to display records
possible better answer: http://stackoverflow.com/a/27461967
tagged with: html-table
score: 0
has comment: http://stackoverflow.com/comment/43359689
answer count: 2
has comment: http://stackoverflow.com/comment/43360097
has comment: http://stackoverflow.com/comment/43360131

http://stackoverflow.com/a/27428384
has comment: http://stackoverflow.com/comment/43298628
accepted answer of: http://stackoverflow.com/q/27427978
answers question: http://stackoverflow.com/q/27427978
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43298766
has body: To explain... CSS change to display:none: #loader { display: none; width: 100px; height: 100px; margin: 100px; } Javascript Change this: function ShowLoader() { $('#loader').css('display', 'block'); } and this: $('.reveal').on('click', function(e) { var $that = $(this); e.preventDefault(); ShowLoader(); var link = $(this).attr('href'); $('.page').load(link, function(){ HideLoader(); // this puts it in the load callback, so that this stuff $that.show(); // happens when the load is complete }); $('#leftmenu').css('width', '70px'); $("#leftmenu b,li ul").hide(); $('li').unbind('click'); });
type: Answer
upvote count: 1

http://stackoverflow.com/q/27330512
has title: call a function when value is changed javascript
score: -2
accepted answer: http://stackoverflow.com/a/27331022
tagged with: javascript
tagged with: jquery
downvote count: 2
has answer: http://stackoverflow.com/a/27331022
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43119031
favorite count: 0
has comment: http://stackoverflow.com/comment/43119067
upvote count: 0
has comment: http://stackoverflow.com/comment/43119009
has comment: http://stackoverflow.com/comment/43118993
has comment: http://stackoverflow.com/comment/43135657
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43119025
has comment: http://stackoverflow.com/comment/43118984
has comment: http://stackoverflow.com/comment/43119248
type: Question
has body: hi i want to call the function when the value changes &lt;script&gt; function calculom(cantidad,promedio,inputtext,inputtextt){ // Calculo del subtotal subtotal = promedio*cantidad; subtotall = promedio*cantidad; inputtext.value=subtotal; inputtextt.value=subtotall; } function calculos(cantidad,promedio,inputtext){ // Calculo del subtotal subtotal = promedio+cantidad; inputtext.value=subtotal; } &lt;/script&gt; and the html &lt;div id="form-signin"&gt; &lt;input type="text" id="platanos" placeholder="Cantidad" onChange="calculom(this.value,precioplatanos.value,totalplatanos,totalplatanos4);"&gt; &lt;input type="text" id="precioplatanos" placeholder="Promedio" onChange="calculom(this.value,platanos.value,totalplatanos,totalplatanos4);"/&gt; &lt;input type="text" size="8" id="totalplatanos" name="tot" placeholder="Derp"&gt; &lt;hr&gt; &lt;input type="text" id="platanos2" placeholder="Cantidad" onChange="calculom(this.value,precioplatanos2.value,totalplatanos2,totalplatanos5);"&gt; &lt;input type="text" id="precioplatanos2" placeholder="Promedio" onChange="calculom(this.value,platanos2.value,totalplatanos2,totalplatanos5);"/&gt; &lt;input type="text" size="8" id="totalplatanos2" name="tot2" placeholder="Derp" onclick="calculos(this.value,totalplatanos.value,totalplatanos3);"&gt; &lt;hr&gt; &lt;input type="text" size="8" id="totalplatanos3" placeholder="Subtotal"&gt; but its not working this line: &lt;input type="text" size="8" id="totalplatanos2" name="tot2" placeholder="Derp" onchange="calculos(this.value,totalplatanos.value,totalplatanos3);"&gt; at least if i made a change manually in that input the value changes fine i want to make it automatic

http://stackoverflow.com/q/27399988
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/27400375
has title: Add an image in title bar in a dialog box
has body: In this example, how can i add a small image side by side with the title? http://jsfiddle.net/F9uR3/ anyone? thanks. English .ui-dialog-content div { background: url(https://www.google.com/logos/2014/worldcup14/opening/cta.png) no-repeat !important; } $(function() { $('#dialog').dialog({ resizable:false, autoOpen: false, buttons: { "Enrol": function() { $(this).dialog('close'); choice(true); }, "Cancel Enrol": function() { $(this).dialog('close'); choice(false); } } }); $( ".dialog" ).click(function(){ $('#dialog').dialog("open"); }); });
type: Question
tagged with: dialog
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43258992
score: 0
type: Comment
type: QuestionComment
has text: Is this shortcode from a plugin or theme? I think that the problem could be in attribute value, since WP accepts values enclosed in single or double quotes, or no quotes if value does not contain spaces, but this value looks like starts and ends with &#8221; HTML entity.
comment on: http://stackoverflow.com/q/27405925

http://stackoverflow.com/a/27398195
score: 0
type: AcceptedAnswer
has body: A map must have a zoom. You didn't initially set a zoom for the map. When you use fitBounds() the zoom will be set automatically, but when you didn't use it the zoom is still missing. Solution: set a zoom in mapOptions
type: Answer
accepted answer of: http://stackoverflow.com/q/27397962
answers question: http://stackoverflow.com/q/27397962

http://stackoverflow.com/q/27382945
has answer: http://stackoverflow.com/a/27383199
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27383518
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43215076
has title: How to apply :hover on :after to certain div in CSS
has body: Made an in-depth search and learnt on how to create some stylish custom created textboxes to achieve a better graphic look. I have two issues to complete this mesh-up of textboxes so that they serve a total functioning of a common textbox. I'm unable to execute the :focus on the parent div container, although the code is perfectly fine in CSS because when going by Inspect Element (Chrome), Force Element to> :focus it does what I want but in the real-time it never does nevertheless clicking on its children or itself. I want to add the :hover effect on the child div container (the left black coloured div) in which it'll expand the :after transition for a certain amount of pixels (assuming +20px/+30px). The desired and the final result should look like in the picture below: #submitForm { border:2px grey inset; border-radius:10px; display:table; margin: 10px auto 0; height: 500px; position:relative; width: 800px; } #submitForm #btnSend { bottom:20px; display:block; height: 50px; position:absolute; right: 20px; width:100px; } #submitForm .highlights { border-bottom:5px solid #2E8DEF; border-radius:15px; float:left; height: 45px; margin-top: 40px; margin-left:40px; width: 520px; } #submitForm .highlights:focus { border-bottom:none; outline: 0; -webkit-box-shadow: 0px 0px 6px 2px rgba(105, 185, 250, 0.8); -moz-box-shadow: 0px 0px 6px 2px rgba(105, 185, 250, 0.8); box-shadow: 0px 0px 6px 2px rgba(105, 185, 250, 0.8); } #submitForm .tags, #submitForm .textarea { float:left; font-size: 25px; font-family: calibri; font-style: italic; height: 40px; position:absolute; text-align: center; } #submitForm .tags { border-bottom-left-radius: 10px; border-top-left-radius: 10px; background: #333333; color: #2E8DEF; height:40px; padding-top:5px; text-align: center; width: 120px; z-index:3; } #submitForm .tags:after { background: #333333; content:" "; display: block; left: 90px; height: 100%; position:absolute; top: 0; width: 30%; z-index:-1; transform-origin: bottom left; -ms-transform: …
favorite count: 0
accepted answer: http://stackoverflow.com/a/27383518
upvote count: 1
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43214836
score: 1
possible better answer: http://stackoverflow.com/a/27383199

http://stackoverflow.com/a/27457286
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/43352496
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/43352617
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27457261
answers question: http://stackoverflow.com/q/27457261
has body: Have a look at innerHTML like: document.getElementById("demo").innerHTML = "value"; Or JQ way $(selector).html("value");

http://stackoverflow.com/q/27466577
has comment: http://stackoverflow.com/comment/43373182
has answer: http://stackoverflow.com/a/27474327
has comment: http://stackoverflow.com/comment/43380483
has title: Can't find variable: DS in Ember CLI
tagged with: ember-cli
type: Question
tagged with: ember.js
has comment: http://stackoverflow.com/comment/43371353
score: 0
answer count: 1
tagged with: ember-data
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43380821
has body: TL;DR - Ember Data is not working in basic Ember CLI app that is running v1.9.0 of Ember.js I'm sorta/not-really new to Ember and Ember CLI and I just created a new project to try out version 1.9.0 of Ember.js here's a link: http://emberjs.com/blog/2014/12/08/ember-1-9-0-released.html I'm at a point in my app (not very deep, I'll admit) where I was setting up FIXTURES to test some data but then this happened: Console Error while processing route: dashboard.index Cannot read property 'find' of undefined TypeError: Cannot read property 'find' of undefined at __exports__.default.Ember.Route.extend.model (focus-haven/routes/dashboard.js:9:24) at EmberObject.extend.deserialize (http://0.0.0.0:4200/assets/vendor.js:38356:21) at applyHook (http://0.0.0.0:4200/assets/vendor.js:61082:30) at Object.HandlerInfo.runSharedModelHook (http://0.0.0.0:4200/assets/vendor.js:59103:22) at Object.subclass.getModel (http://0.0.0.0:4200/assets/vendor.js:59329:21) at http://0.0.0.0:4200/assets/vendor.js:60956:19 at tryCatch (http://0.0.0.0:4200/assets/vendor.js:61405:16) at invokeCallback (http://0.0.0.0:4200/assets/vendor.js:61417:17) at publish (http://0.0.0.0:4200/assets/vendor.js:61388:11) at http://0.0.0.0:4200/assets/vendor.js:42960:9 After doing a little investigating and running ember test, I got this: not ok 14 PhantomJS 1.9 - ApplicationAdapter: it exists --- actual: &gt; null message: &gt; Setup failed on it exists: Can't find variable: DS Log: &gt; ... not ok 15 PhantomJS 1.9 - Dashboard: it exists --- actual: &gt; null message: &gt; Setup failed on it exists: Can't find variable: DS Log: &gt; ... not ok 16 PhantomJS 1.9 - Task: it exists --- actual: &gt; null message: &gt; Setup failed on it exists: Can't find variable: DS Log: &gt; ... ... and I found this in my console: DEBUG: ------------------------------- DEBUG: Ember : 1.9.0 DEBUG: Handlebars : 2.0.0 DEBUG: jQuery : 1.11.1 DEBUG: ------------------------------- I may be wrong, but I figured that Ember Data was not being …
has comment: http://stackoverflow.com/comment/43390608

http://stackoverflow.com/q/27403466
has answer: http://stackoverflow.com/a/27403510
has answer: http://stackoverflow.com/a/27403523
has body: what i Need i need that on appending variable data url should in proper format. url url : "http://local-login.times.com/ticket_transaction/autosubmit_advance/"+evt_id/user+"?visitor_flag=1&amp;source=get-direction-oneclick. value of evt_id=2244 and user=45566. problem is on appending these variable in url in jquery. on click on link output http://local-login.10times.com/ticket_transaction/autosubmit_advance/0.012915232373744963?visitor_flag=1&amp;source=get-direction-oneclick but output should be http://local-login.10times.com/ticket_transaction/autosubmit_advance/2244/4566?visitor_flag=1&amp;source=get-direction-oneclick. where i have done wrong. any suggestion are most welcome.
type: Question
has comment: http://stackoverflow.com/comment/43251550
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has title: Variables are not appended in url in javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43251574

http://stackoverflow.com/q/27351894
has body: Why my function not work ( set 2 decimal number) using javascript ? http://jsfiddle.net/A4wxX/102/ when fill number, my code will set 2 decimal your number. EG fill 123 will alert 123.00 fill 123.1 will alert 123.10 fill 123.1234 will alert 123.12 But not work , how can i do that ? &lt;input type="text" id="xxx" onchange="fn_1()"/&gt; &lt;script language="JavaScript" type="text/javascript"&gt; function fn_1() { var xxx_val = document.getElementById('xxx').value var n = xxx_val.indexOf("."); var res = xxx_val.replace(".", ""); var res_length = res.length; var decimal_length = (res_length - n); if(n != '-1') { if(decimal_length &gt; '1') { // 2 decimal and morethan // //var x = parseFloat(Math.round(xxx_val * 100) / 100).toFixed(2); var x = Math.floor(xxx_val * 100) / 100 } else { // 1 decimal // var x = xxx_val.toFixed(2) } } else { // not decimal // var x = xxx_val.toFixed(2) } alert(x); } &lt;/script&gt;
answer count: 1
has title: Why my function not work ( set 2 decimal number) using javascript?
has answer: http://stackoverflow.com/a/27351954
accepted answer: http://stackoverflow.com/a/27351954
has comment: http://stackoverflow.com/comment/43157872
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/43224655
score: 0
has text: "*I have no idea what is going on*" is the key here. Don't get flummoxed... step through the problem logically and the answers begin to appear.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27388342

http://stackoverflow.com/q/27447848
has comment: http://stackoverflow.com/comment/43335286
has comment: http://stackoverflow.com/comment/43335374
score: 0
has comment: http://stackoverflow.com/comment/43335847
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/43336322
has comment: http://stackoverflow.com/comment/43335447
tagged with: javascript
has title: How to process data read from database
has comment: http://stackoverflow.com/comment/43336462
has comment: http://stackoverflow.com/comment/43335372
has comment: http://stackoverflow.com/comment/43335510
answer count: 1
has answer: http://stackoverflow.com/a/27449054
has comment: http://stackoverflow.com/comment/43335610
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43335187
has body: I am processing data read from database on the server using the following code: module.exports = mongoose.model('Todo', { text : {type : String, default: ''}, created_at : Date }); var processTodos = function ( todos ){ for (var i = todos.length - 1; i &gt;= 0; i--) { // Following update is not happening todos[i].created_at = "Custom date"; }; console.dir(todos); return todos; }; I am not able to figure out how to update this. Is there a syntax issue that is causing this. I am using MEAN stack for my application. // Following update is not happening todos[i].created_at = "Custom date"; What am i missing here. Here is the console log for "console.dir(todos);": { _id: 5489dda3f23f159400475dba, created_at: Thu Dec 11 2014 23:38:35 GMT+0530 (India Standard Time), __v: 0, text: 'Testing sorting at server side' } { _id: 5489ddacf23f159400475dbb, created_at: Thu Dec 11 2014 23:38:44 GMT+0530 (India Standard Time), __v: 0, text: 'It works' } { _id: 5489f31a12fa54cc127f3e1d, created_at: Fri Dec 12 2014 01:10:10 GMT+0530 (India Standard Time), __v: 0, text: 'time to add more data' }
tagged with: node.js
has comment: http://stackoverflow.com/comment/43335211

http://stackoverflow.com/q/27333808
has body: Currently I am making a script that when injected into Google Chrome console, it will gather some information and form it in a string, take that string and convert the text to each characters respective char code. My issue lies in trying to get jQuery to simulate a key press on an input field, and input the charcodes into that field. Take a look at my code: var text = $('[id^="nhwMiddlegwt-uid"]').html(); var text_middle = $('[id^="nhwMiddleCommagwt-uid"]').html(); var text_after = $('[id^="nhwRightgwt-uid"]').html(); var finished = text + text_middle + text_after; console.log(finished); var output, output_format = ""; for(i=0; i&lt;finished.length; i++) { if(output != "") output += ", "; output += finished.charCodeAt(i); } The output variable contains text like this, "87, 101, 98, 32, 68, 101, 118, 101, 108, 111, 112, 109, 101, 110, 116" which is the char code characters for, "Web Development". Now I need to take the char code string "output" and change the value of an input field. I have tried using this something similar to this: var e = jQuery.Event("keydown"); e.which = 84; // # Some key code value $(".txtInput").val(String.fromCharCode(e.which)); $(".txtInput").trigger(e); Now this works if you're only trying to trigger the keypress simulation for one key, 84, but will not work for my whole output variable. I've tried looping through in a for loop, but the .trigger() event won't allow me to do that because the .which command that is added to the end of a variable is not allowed in a for loop, look below: for(i=0; i&lt;finished.length; i++) { if(output != "") output += ", "; output.which += finished.charCodeAt(i); } So, how can I get .trigger(); to loop through every char code in the option variable? Edit: Just to clarify, I do NOT want to just change the input value. I want to simulate a keypress on an input field, using the "output" variable char codes.
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Simulating Multiple key-presses with .trigger();
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
score: 2
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27334212
type: Question

http://stackoverflow.com/a/27465632
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/43407692
answers question: http://stackoverflow.com/q/27465378
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27465378
has comment: http://stackoverflow.com/comment/43410604
upvote count: 3
has comment: http://stackoverflow.com/comment/43406399
has body: When you first associate the data with the selection var elems = ddisp.selectAll('g').data(dataset, function(d) { return d.id; }); you're associating a JavaScript object with the SVG &lt;g&gt; element. The statement dataset[index].name = 'four'; changes a property of the existing object. So when you re-run render D3 is able to pick up that new property. It's still reading the old object, but the object's name property has changed. By contrast, when you execute the statement dataset[index] = { id: oldnode.id, name: 'four' }; you're changing an element in the array by creating a new object, but the SVG &lt;g&gt; element is still associated with the old object. It's true that you're calling ddisp.selectAll('g').data(dataset, function(d) { return d.id; }); again with the updated array, but you haven't changed the id property (and you've told D3 that the id property is what determines the "uniqueness" of a data point). So when D3 comes to the "new" element in the array, it checks the id value, sees that nothing has changed (it's still 2), and, therefore, doesn't update the object associated with that &lt;g&gt; element. If, instead, you responded to the update button with dataset[index] = { id: 4, name: 'four' }; then you would indeed see the node updated because, by changing the id property, you would have signaled to D3 that the array element was new.
type: Answer
has comment: http://stackoverflow.com/comment/43406073
has comment: http://stackoverflow.com/comment/43410768

http://stackoverflow.com/q/27451224
has comment: http://stackoverflow.com/comment/43341138
has comment: http://stackoverflow.com/comment/43341699
has body: A button on my webpage stops working every few days and then starts working again without any intervention/modifying source code. This "Next" button calls a javascript function to iterate forward through an array of text already retrieved via php, but sometimes it stops working. I have not touched this code for more than a month, and during this time I have seen it working most of the time - but not always. Today it's not working. Here is the button declaration: The button calls function submitForm with parameter "Next." function submitform(x) { document.getElementById("alertShow").innerHTML = "" if(x=='Back') { .... } else if(x=='Next') { alert("next Q!"); if(jj+1<numQQ){ runningSum += qnumans_array[jj]; } ++jj; ++j; kk=0; if (jj == limit) { if((viewQ==null)&&(viewA==null)) { window.location="judge.php?counter="+j; } else if(viewQ) { window.location="judge.php?&counter="+j+"&viewQ="+viewQ; } else if(viewA) { window.location="judge.php?&counter="+j+"&viewA="+viewA; } } alert("middle of next q bit1"); if( jj>=numQQ && jj!=limit) { --jj; --j; alert("middle of next q bit if statement"); document.getElementById("alertShow").innerHTML = "end of available questions for this category"; } alert("middle of next q bit2"); alert("jj is"+jj); alert("qid array at jj is"+qid_array[jj]); document.getElementById('qidInput').value = qid_array[jj]; ///*****this is where it stops outputting script alerts. all alerts before this output as they should. *********************************************** alert("middle of next q bit3"); document.getElementById('jjInput').value = j; alert("middle of next q bit4"); document.getElementById("questionShow").innerHTML = quser_array[jj] + ": "+ question_array[jj]; alert("middle of next q bit5"); if(qnumans_array[jj]>0) { document.getElementById("answerShow").innerHTML = auser_array[kk + runningSum] + ": " + answer_array[kk + runningSum]; } else { document.getElementById("answerShow").innerHTML = "No answers posted to this question."; } alert("got to…
tagged with: http://stackoverflow.com/tag/html
has title: HTML/javascript TypeError when using document.getElementById even though ID's are declared
has comment: http://stackoverflow.com/comment/43341141
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43341017
score: 0
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43262061
type: AnswerComment
type: Comment
has text: That's all there is, it's that simple. But in this case it can't be repeated in jsfiddle since it involves two htm files. Just drop these two files on your web server and try and run them, you'll see what I'm talking about. All I can guess is that angular isn't running because the navigation event wasn't being handled by angular and therefore it's not trying to run a scope digest or something.
comment on: http://stackoverflow.com/a/27408301
score: 0

http://stackoverflow.com/q/27317978
type: AnsweredQuestion
downvote count: 0
tagged with: uiviewcontroller
type: Question
tagged with: ios
tagged with: javascript
score: 4
favorite count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27318589
has body: I am new to Swift/iOS and have been working on an app that calls Swift code from JavaScript. There are not as many tutorials online and a lot of them are from when Swift was still in beta. Anyway, I was getting an error on my code and I am unable to compile it and I was wondering if any one had any tips and best practices when it comes to calling swift code from JavaScript. Here is my code import UIKit import WebKit class ViewController: UIViewController, WKScriptMessageHandler { @IBOutlet var containerView : UIView! = nil var webView: WKWebView? override func loadView() { super.loadView() var contentController = WKUserContentController(); var userScript = WKUserScript( source: "redHeader()", injectionTime: WKUserScriptInjectionTime.AtDocumentEnd, forMainFrameOnly: true ) contentController.addUserScript(userScript) contentController.addScriptMessageHandler( self, name: "callbackHandler" ) var config = WKWebViewConfiguration() config.userContentController = contentController self.webView = WKWebView(frame: self.view.frame, configuration: config) self.view = self.webView! } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. var url = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("index", ofType: "html")!) var req = NSURLRequest(URL: url!) self.webView!.loadRequest(req) } func userContentController(userContentController: WKUserContentController!,didReceiveScriptMessage message: WKScriptMessage!) { if(message.name == "callbackHandler") { println("JavaScript is sending a message \(message.body)") } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } The error is on class ViewController: UIViewController, WKScriptMessageHandler { and it says Type 'ViewController' does not conform to protocol 'WKScriptMessageHandler'. Any help would be greatly appreciated.
upvote count: 4
has answer: http://stackoverflow.com/a/27318589
has title: Calling Swift from JavaScript
tagged with: swift

http://stackoverflow.com/q/27395605
downvote count: 0
score: 1
type: Question
tagged with: highcharts
tagged with: javascript
has body: Here's my fiddle: http://jsfiddle.net/highcharts/4rTBY/ chart: { renderTo: 'container', backgroundColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 0 }, stops: [ [0, 'rgb(255, 255, 255)'], [0.5, 'rgb(200, 200, 255)'] ] }, type: 'line' } As we use backgroundColor whole background gets colored. I only want 50% of the background of the chart to get colored from the bottom. Thanks in advance
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has title: Set backgroundColor on half of the highchart area?
accepted answer: http://stackoverflow.com/a/27396719
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27396719

http://stackoverflow.com/q/27411261
has body: Question background: I'm developing a simple table 'Cart'. I'm passing a populated ViewBag object (that contains a List of 'CartItem' objects) from the Controller to its associated Cart View. The code: The HTML table layout in the View: Item Brand Unit Price Quantity The JQuery that populates the table rows from the passed ViewBag list: @foreach (var cartItem in (List<LoginTest.Models.CartItem>)ViewBag.Data) { } The issue: Currently the above JQuery populates the table as shown: Everything populates correctly except as shown the image is not displaying. Inspecting the element in Chrome. Note I have ensured that the image exists in the Images folder If I put the img src outside of the JQuery function the image displays. What am I doing wrong?
score: 0
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: view
answer count: 0
has comment: http://stackoverflow.com/comment/43266884
has comment: http://stackoverflow.com/comment/43266984
type: Question
tagged with: c#
has title: Table cell not displaying Image when populated from JQuery
tagged with: javascript

http://stackoverflow.com/a/27436166
has body: As it looks to me, you are trying to create a JavaScript file through Python. That sounds like a very awkward and inconvenient way to go about exchanging data between two worlds. A common practice to communicate between the front-end (JavaScript) and the back-end (a Python app in your case) is through JSON (which, in turn, is JavaScript). On a very basic level, you let your Python app construct valid JSON and make it available on a specific route for your JavaScript to consume. An example would be: @app.route('/some/route/to/consume') def fetch(): """ Fetch all the fancy stuff from the database. """ db = Database() # Fetch all records, convert them into JSON result = json.dumps(db.get_stuff()) return result This function will fetch all records from the database (with a fictional function db.get_stuff()) and, convert the result to valid JSON and return it. The important bit is the json_dumps() function from the Python json module. It will convert valid Python data structures into valid JSON data structures. Next you should write your actual JavaScript file to consume that JSON and let it do whatever you want it to do. This can be done via an XHR call (AJAX), for example. If the data that will be exposed on your route is not public, do take common security practices in mind and protect the route from unwanted eyes.
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/27432800
upvote count: 1
answers question: http://stackoverflow.com/q/27432800

http://stackoverflow.com/q/27445212
possible better answer: http://stackoverflow.com/a/27445563
has comment: http://stackoverflow.com/comment/43329335
tagged with: http://stackoverflow.com/tag/html
has title: I am trying to make a div slide in on load and my previous solution is no longer working?
tagged with: css
has comment: http://stackoverflow.com/comment/43329419
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43329500
has comment: http://stackoverflow.com/comment/43329255
has comment: http://stackoverflow.com/comment/43329377
type: Question
has answer: http://stackoverflow.com/a/27445563
tagged with: css-transitions
has answer: http://stackoverflow.com/a/27445845
accepted answer: http://stackoverflow.com/a/27445845
answer count: 2
has body: I posted this yesterday, and the code was working but today it is not. I just can't seem to get my javascript to fire off and show the animation of the div? any ideas? I have the js in a seperate file and fire it from the body with a script tag. function slideOnLoad(){ document.getElementById("right-scroll-slide").style.top="10px"; } slideOnLoad(); #right-scroll-slide{ -webkit-transition:all 1s; -ms-transition:all 1s; -moz-transition:all 1s; -o-transition:all 1s; position:absolute; top:-100px; background:red; } aaaa I would have included a jsfiddle, but it doesn't seem to be loading right now.
tagged with: javascript
score: 0

http://stackoverflow.com/comment/43209139
score: 0
type: Comment
type: QuestionComment
has text: The above code works fine in ie9
comment on: http://stackoverflow.com/q/27379842

http://stackoverflow.com/q/27410050
has answer: http://stackoverflow.com/a/27410151
downvote count: 1
tagged with: internet-explorer
has body: I wrote a small jquery code to redirect to google.com after 2 seconds on pressing a button. The code works fine in Firefox, google chrome but not in the Internet Explorer. I believe the location.assign function is not working since it is the one that is supposed to redirect to another url and all other functions like alert are working but not this one. The code is as follows: &lt;script type="text/javascript"&gt; $(document).ready(function(){ $(".prize_select").click(function(){ var timer = setInterval(redirect,2000); function redirect() { location.assign("http://www.google.com"); timer = clearTimeout(timer); } }); }); &lt;/script&gt; I would also say that I have already tried these function: location.assign window.location window.location.href but none of them seems to work in Internet Explorer
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27410151
possible better answer: http://stackoverflow.com/a/27410116
tagged with: javascript
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27410116
has title: location.assign not working in IE
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43264622
upvote count: 2
answer count: 2

http://stackoverflow.com/q/27434788
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27476242
has comment: http://stackoverflow.com/comment/43392294
has comment: http://stackoverflow.com/comment/43386574
has comment: http://stackoverflow.com/comment/43319126
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27439930
type: Question
tagged with: algorithm
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/43402628
upvote count: 1
has answer: http://stackoverflow.com/a/27434922
has body: I have a line segment determined by two points a and b. I also have a square determined by x0 &lt; x &lt; x1 and y0 &lt; y &lt; y1 where x1-x0 = y1-y0. I'm trying to check if any part of the segment intersects the region inside the square. (If the segment just touches the sides that doesn't count as an intersection). My idea was using this picture function(a, b, x0, x1, y0, y1) { if (a or b is inside square) return true; else { switch (which quadrant is a in) { case 1: return (ab intersects top of square); case 2: return (ab intersects left of square); case 3: return (ab intersects bottom of square); case 4: return (ab intersects right of square); } } } I was wondering if there is a better way to approach this problem.
has title: How to check if line segment intersects square
favorite count: 0
tagged with: geometry

http://stackoverflow.com/a/27450595
score: 1
has comment: http://stackoverflow.com/comment/43339939
has comment: http://stackoverflow.com/comment/43339646
downvote count: 0
has body: $(document).on('click','.action',function(){ $.get('suppliers/template/get_options_list.php?action='+action+'&amp;id='+id+'&amp;optvalue='+optvalue+'&amp;pid='+pid+'', update_options); }); function update_options(options){ $('#selectedoptions').html(options); } and if .action if a submit input use $(document).on('submit','your_form_ID_or_Class',function()
type: Answer
answers question: http://stackoverflow.com/q/27450528
upvote count: 1
has comment: http://stackoverflow.com/comment/43339724
has comment: http://stackoverflow.com/comment/43341797

http://stackoverflow.com/a/27327369
answers question: http://stackoverflow.com/q/27326638
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43114747
has body: This part of the error says that data is an unicode string: return data.get(name, None) AttributeError: 'unicode' object has no attribute 'get' data needs to be an object. Instead, it is a string, and strings don't have a get() method, and don't have name attributes as the error trace back says. Try going off of the Django Docs to properly call the AJAX: https://docs.djangoproject.com/en/1.6/topics/class-based-views/generic-editing/#ajax-example
has comment: http://stackoverflow.com/comment/43114204
upvote count: 1
has comment: http://stackoverflow.com/comment/43114231
type: Answer

http://stackoverflow.com/q/27398959
downvote count: 4
has answer: http://stackoverflow.com/a/27399028
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27399067
has answer: http://stackoverflow.com/a/27399123
has comment: http://stackoverflow.com/comment/43243465
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/43243431
has answer: http://stackoverflow.com/a/27399126
score: -2
answer count: 7
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27399028
has answer: http://stackoverflow.com/a/27399058
has body: I have a div which creates dynamic children div Hello World There are many divs which are generated dynamically, I need to remove all the child divs without removing the first div i.e div which says "Hello".
linked to: http://stackoverflow.com/q/5801114
has answer: http://stackoverflow.com/a/27399100
has comment: http://stackoverflow.com/comment/43243407
has answer: http://stackoverflow.com/a/27399075
linked to: http://stackoverflow.com/q/2259393
has comment: http://stackoverflow.com/comment/43243392
accepted answer: http://stackoverflow.com/a/27399123
has title: Remove children of div dynamically
linked to: http://stackoverflow.com/q/4013701

http://stackoverflow.com/a/32577638
has body: You need to include $locationProvider as a dependency in your config function like this: 'use strict'; appv.config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider. when('/', { //controller: 'HomeController', templateUrl: 'views/home.html' }). when('/page/:pgId', { //controller: 'PageController', templateUrl: 'views/page.html' }). when('/article/:pgId/:artId', { //controller: 'ArticleController', templateUrl: 'views/article.html' }). when('/admin/:adCode', { //controller: 'AdminController', templateUrl: 'views/admin.html' }). otherwise({templateUrl: 'views/home.html'}); });
score: 1
answers question: http://stackoverflow.com/q/27457467
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/27325290
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27325545
type: Question
has title: Display div content only once in hour
tagged with: javascript
tagged with: jquery
score: -1
downvote count: 2
answer count: 3
upvote count: 1
possible better answer: http://stackoverflow.com/a/27325365
favorite count: 0
has answer: http://stackoverflow.com/a/27325365
has body: Is possible to show div in header of page to visitor only once in hour? I want to show a bar which shows to a visitor whether we're open or closed. The 'visitor A' should see it at every first page he loads and on the next page not. In 30 minutes it should be shown to him again. I'm running jquery 1.10.2 at my website. Thank you for your ideas
has answer: http://stackoverflow.com/a/27325613
accepted answer: http://stackoverflow.com/a/27325613

http://stackoverflow.com/comment/43241956
comment on: http://stackoverflow.com/a/27397907
type: Comment
has text: It works, but I tried removing any javascript and turns out, it isn't needed [FIDDLE](http://jsfiddle.net/Mns8q/1403/) - just CSS animations...
type: AnswerComment
score: 0

kineticjs
tags question: http://stackoverflow.com/q/27378506
type: Tag
tag name: kineticjs
tags question: http://stackoverflow.com/q/27315296

http://stackoverflow.com/q/27435610
favorite count: 0
has body: I am new to using Javascript objects, and can't explain why this isn't working despite my best efforts. Any help is appreciated. I am posting the whole file, because it is extremely small. Thanks again. &lt;h1 id="mainHeading"&gt; Testing Objects in Javascript &lt;/h1&gt; &lt;/head&gt; &lt;body&gt; &lt;input id="inputBox" type="number"&gt; &lt;div id="response"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; var input = document.getElementById('inputBox'); var mainObj = { keys: [], numCheck: function () { if(input.value &gt;= 0 &amp;&amp; input.value &lt; 100) { response.innerHTML = "Avg"; } }, tracksKey: function (e) { code = e.keyCode; keys[code] = (e.type === "keydown"); checksKey(); }, checksKey: function () { if (keys[13]) { mainObj.numCheck(); } }, } window.addEventListener("keydown", mainObj.tracksKey); window.addEventListener("keyup", mainObj.tracksKey) &lt;/script&gt; &lt;/body&gt;
has title: Trouble with JavaScript objects
accepted answer: http://stackoverflow.com/a/27435761
type: AnsweredQuestion
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/27435761
tagged with: object
has comment: http://stackoverflow.com/comment/43312385
tagged with: javascript
score: -1
answer count: 1
downvote count: 1

http://stackoverflow.com/a/27423386
answers question: http://stackoverflow.com/q/27422171
type: Answer
has body: Check if you have any errors in console. Also, I think your active=month.active must be active="{{month.active}}" function call(tab) { alert(tab); } tab { border: 1px solid red; } Tab 1 Tab 2
score: 0

http://stackoverflow.com/a/27420828
score: 1
has comment: http://stackoverflow.com/comment/43284618
has comment: http://stackoverflow.com/comment/43284485
type: Answer
answers question: http://stackoverflow.com/q/27420611
upvote count: 2
downvote count: 1
has body: Demo html Cursors auto default none context-menu help pointer progress wait cell crosshair text <---- this one vertical-text alias copy move no-drop not-allowed all-scroll col-resize row-resize n-resize s-resize e-resize w-resize ns-resize ew-resize ne-resize nw-resize se-resize sw-resize nesw-resize nwse-resize css .auto { cursor: auto; } .deafult { cursor: default; } .none { cursor: none; } .context-menu { cursor: context-menu; } .help { cursor: help; } .pointer { cursor: pointer; } .progress { cursor: progress; } .wait { cursor: wait; } .cell { cursor: cell; } .crosshair { cursor: crosshair; } .text { cursor: text; } <---- this one .vertical-text { cursor: vertical-text; } .alias { cursor: alias; } .copy { cursor: copy; } .move { cursor: move; } .no-drop { cursor: no-drop; } .not-allowed { cursor: not-allowed; } .all-scroll { cursor: all-scroll; } .col-resize { cursor: col-resize; } .row-resize { cursor: row-resize; } .n-resize { cursor: n-resize; } .e-resize { cursor: e-resize; } .s-resize { cursor: s-resize; } .w-resize { cursor: w-resize; } .ns-resize { cursor: ns-resize; } .ew-resize { cursor: ew-resize; } .ne-resize { cursor: ne-resize; } .nw-resize { cursor: nw-resize; } .se-resize { cursor: se-resize; } .sw-resize { cursor: sw-resize; } .nesw-resize { cursor: nesw-resize; } .nwse-resize { cursor: nwse-resize; } .cursors > div { float: left; box-sizing: border-box; width: 20%; padding: 10px 2px; text-align: center; white-space: nowrap; &:nth-child(even) { background: #eee; } &:hover { opacity: 0.25 } } You can also have the cursor be an image: .custom { cursor: url(images/my-cursor.png), auto; } Some WebKit only cursors: -webkit-zoom-in -webkit-zoom-out -webkit-zoom-grab -webkit-zoom-grabbing source: css tricks

http://stackoverflow.com/comment/43203596
type: QuestionComment
type: Comment
has text: that states how to get a new line in a text area, what i need is to create a jquery function to print the lines with new line characters
comment on: http://stackoverflow.com/q/27376876
score: 0

http://stackoverflow.com/q/27467198
has answer: http://stackoverflow.com/a/27468010
type: UnansweredQuestion
tagged with: node.js
has body: I’m good at jQuery but I’m new to modern js frameworks introduced over the last couple of years. I understand how index.html works in the following example and I can infer that server.js serves the request made from index.html. However, I’m not clear on how server.js gets initialized. http://codeforgeek.com/2014/07/send-e-mail-node-js/#comment-18703 There does not appear to be a src ref from index.html to server.js which appears to indicate that server.js gets initialized in some other way although that's all I'm able to infer. This is a knowledge gap on my end but can you explain how to initialize server.js so that it can be called by index.html?
type: Question
has comment: http://stackoverflow.com/comment/43370066
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43370212
answer count: 1
has title: trying to understand node js server concept

http://stackoverflow.com/comment/43092945
comment on: http://stackoverflow.com/a/27316593
score: 0
type: AnswerComment
type: Comment
has text: Why would you need to trigger a custom event here? Just call method once class is added

http://stackoverflow.com/comment/43208026
score: 0
comment on: http://stackoverflow.com/a/27377906
type: Comment
type: AnswerComment
has text: This should work. I think this is because you put the code at the wrong place. Where did you put that code?

http://stackoverflow.com/comment/43307015
type: Comment
comment on: http://stackoverflow.com/a/27432912
type: AnswerComment
score: 0
has text: Wow, I've been such an air head lately! Sometimes I just need a 2nd set of eyes on the error! thanks man! Enjoy your easy rep :D

http://stackoverflow.com/a/27436537
has body: Quoting from the process's exit event documentation, Emitted when the process is about to exit. There is no way to prevent the exiting of the event loop at this point, and once all exit listeners have finished running the process will exit. Therefore you must only perform synchronous operations in this handler. This is a good hook to perform checks on the module's state (like for unit tests). The callback takes one argument, the code the process is exiting with. Example of listening for exit: process.on('exit', function(code) { // do *NOT* do this setTimeout(function() { console.log('This will not run'); }, 0); console.log('About to exit with code:', code); }); So, don't use promises in the exit event handler, instead make your code synchronous.
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27436513
answers question: http://stackoverflow.com/q/27436513
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43313750

http://stackoverflow.com/q/27335488
has comment: http://stackoverflow.com/comment/43128343
tagged with: css
answer count: 4
accepted answer: http://stackoverflow.com/a/27370762
possible better answer: http://stackoverflow.com/a/27335628
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43127872
has answer: http://stackoverflow.com/a/27335739
has answer: http://stackoverflow.com/a/27370762
has comment: http://stackoverflow.com/comment/43127921
has answer: http://stackoverflow.com/a/27335658
has title: How to trigger different image base on input-box?
has comment: http://stackoverflow.com/comment/43128116
has body: I have 2 images The first one look like this and second one like this GOAL The first image load as default when the user land my my site When user start to type in their username OR password , I want to load the second image instead at the exact position of first image was placed. How do I do that ? Will I need to use JS to get this done ? EDIT I want to show the image a moment the focus is on one of the 2 inputs Even if the user delete all letters in the textbox but as long as he/she is at the input field. I want to trigger the 2nd image. Huge thanks to all of you who involve in this post and your consideration !
tagged with: javascript
has answer: http://stackoverflow.com/a/27335628
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27317261
score: 0
accepted answer: http://stackoverflow.com/a/27319327
has title: AddThis toolbox multiple items
answer count: 1
has body: I am trying to use the addThis toolbox for multiple items on a page. I have been reading that I need to use the addthis:url property to generate the correct URL for the individual items. What I have is the following: &lt;!-- Go to www.addthis.com/dashboard to customize your tools --&gt; &lt;script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-535e7a2916e104ff" async="async"&gt;&lt;/script&gt; &lt;!-- Go to www.addthis.com/dashboard to customize your tools --&gt; &lt;div class="addthis_sharing_toolbox" style="margin-bottom:20px;" addthis:title="THE TITLE" addthis:description="THE DESCRIPTION" addthis:url="&lt;?php echo $this-&gt;item-&gt;link; ?&gt;"&gt;&lt;/div&gt; This doesn't seem to do anything? It only echos out in the div but doesn't actually change the share so that it is specific to the item. Any ideas? thanks
tagged with: php
tagged with: addthis
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43094355
has answer: http://stackoverflow.com/a/27319327
type: Question
has comment: http://stackoverflow.com/comment/43094235
tagged with: javascript

http://stackoverflow.com/q/27400404
has body: Last night I had issue with registration where php was saving null data to my database when ajax was used but with a help of stack overflow the issue was resolved. I was sending data in url and rather than using $_GET i used $_POST, problem solved so this morning I thought lets do the same with login page but this time when I add ajax to it the login button it does nothing, it just clicks and does nothing what I was trying to do was when user login with correct info it goes to home page index.php but when the user try to log in with wrong info then it echo invalid. so I was trying to echo it in index.php rather than taking user to new page. the following is the code i was working on.this one is saved as index.php where user puts there details. <?php if (!isset($_SESSION['uid'])) { echo " Username: Password: "; echo " "; echo " "; echo "&nbsp"; echo " "; echo " "; echo " "; } else { echo " "; echo " You are logged in as ".$_SESSION['username'].""; echo " "; echo " "; echo "&nbsp"; echo " "; echo " "; } ?> this one is saved as ajax.js function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } return xmlhttp; } var HTTP = loadXMLDoc(); function hello2(){ var username = encodeURIComponent(document.getElementById('username').value); var password = encodeURIComponent(document.getElementById('password').value); var url = "login_parse.php?username="+username+"&password="+password; HTTP.onreadystatechange=function() { if (HTTP.readyState==4 && HTTP.status==200) { document.getElementById("ack1").innerHTML=HTTP.responseText; } } HTTP.open("POST", url ,true); HTTP.send(); } and at last this one is saved as login_parse.php <?php session_start(); include_once("connect.php"); if (isset($_POST['username'])) { $username = mysql_real_escape_string( $_GET["username"]); $password = mysql_real_escape_string( md5 ($_GET["passw…
has comment: http://stackoverflow.com/comment/43246570
has comment: http://stackoverflow.com/comment/43246834
has title: AJAX issue : button doesn't responsed anymore
tagged with: mysql
tagged with: php
type: Question
accepted answer: http://stackoverflow.com/a/27401011
score: 2
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/27401011
has comment: http://stackoverflow.com/comment/43246725
has comment: http://stackoverflow.com/comment/43246887
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/comment/43112794
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27326817
has text: It actually is because of strict mode, in strict, `this` is not the global object by default. The spec says *A `this` value of `null` or `undefined` is not converted to the global object in strict mode* !

http://stackoverflow.com/a/39263728
downvote count: 0
has body: Searching for a possible solution to this, and if someone is not specifically using Sentry, I got to this blog post (ironically a Sentry blog post): https://blog.sentry.io/2015/10/29/debuggable-javascript-with-source-maps.html Where there is an interesting idea: "private source maps". It implies generating the source maps in someplace that is not accessible from the internet (such as your company VPN), so only you or your team can access the source maps files. Quoting the "Private Source Maps" section of the post: [...] all of our examples assume that your source maps are publicly available, and served from the same server as your executing JavaScript code. In which case, any developer can use them to obtain your original source code. To prevent this, instead of providing a publicly-accessible sourceMappingURL, you can instead serve your source maps from a server that is only accessible to your development team. For example, a server that is only reachable from your company’s VPN. //# sourceMappingURL: http://company.intranet/app/static/app.min.js.map When a non-team member visits your application with developer tools open, they will attempt to download this source map but get a 404 (or 403) HTTP error, and the source map will not be applied. Seems like a good idea to me!
type: Answer
upvote count: 62
score: 62
answers question: http://stackoverflow.com/q/27345520
has comment: http://stackoverflow.com/comment/96323378

http://stackoverflow.com/a/31974163
score: 0
type: Answer
has body: It can be simply done with the attribute barColors: Check the below example: take data in json var plotdata =[{"x":"A","y1":59,"y2":64,"y3":834,"y4":787},{"x":"B","y1":597,"y2":615,"y3":837,"y4":787}]; morris = Morris.Bar({ element: 'normal-bar', data: plotdata, xkey: 'x', ykeys: ['y1', 'y2', 'y3','y4'], labels: ['Label1', 'Label2', 'Label3','label4'], barColors: ["#3498db", "#26A65B", "#1F3A93", "#6C7A89"], })
answers question: http://stackoverflow.com/q/27441502

http://stackoverflow.com/comment/43105392
comment on: http://stackoverflow.com/q/27322622
score: 0
type: Comment
has text: http://stackoverflow.com/a/22565708/749622
type: QuestionComment

http://stackoverflow.com/q/27394157
has answer: http://stackoverflow.com/a/27394349
tagged with: javascript
score: 0
has title: Angular.copy - require more clarification
tagged with: angularjs
type: UnansweredQuestion
has body: I seen a sample work as like the folloing.. after I see this example i had couple of questions to understand the angular.copy any one help me to understand? here is the full of code with html and js:- Car Parking [Packt] Parking Plate {{car.plate}} Park After I clicking I am passing a car from button, how the car.plate retrived from input box to park(car) function? We can simply push the object to array, then what is the reason to use the $scope.cars.push(angular.copy(car)); what it does for us exactly? why should we delete the object delete $scope.car;? Any one please help me to understand this logic behind the angular please? Here is the working example
has answer: http://stackoverflow.com/a/27394296
type: Question
answer count: 2

http://stackoverflow.com/q/27439198
accepted answer: http://stackoverflow.com/a/27497948
has comment: http://stackoverflow.com/comment/43402571
has comment: http://stackoverflow.com/comment/43455872
answer count: 4
score: 8
has answer: http://stackoverflow.com/a/27477798
tagged with: javascript
has answer: http://stackoverflow.com/a/27588698
has answer: http://stackoverflow.com/a/27551132
type: Question
type: AnsweredQuestion
tagged with: android
possible better answer: http://stackoverflow.com/a/27551132
has comment: http://stackoverflow.com/comment/43402523
tagged with: css
linked to: http://stackoverflow.com/q/19001496
favorite count: 0
has title: How can I address the Samsung Android browser?
has body: I'm working on a responsive website and I have a weird CSS/JS issue with the default touchwiz browser of Android Samsung devices. I've searched on StackOverflow, finding some unhelpful answers like this. I have the physical devices to test on, but since it's not possible to do remote debugging on these browsers it's really time consuming to make changes, deploy them a QA server, test, and retry. Any idea on how can I speed up my testing or targeting that specific browsers? Useragent is not helping in my case... Just to make an example: one of the many problems I'm facing is on this free component, it's not positioning in the middle of the screen, while it's ok on all other android and iOS browsers.
tagged with: samsung-mobile
downvote count: 1
has answer: http://stackoverflow.com/a/27497948
linked to: http://stackoverflow.com/q/2952667
upvote count: 9
linked to: http://stackoverflow.com/q/23786275

http://stackoverflow.com/comment/53336083
comment on: http://stackoverflow.com/a/31277826
has text: The module is available via NPM. You should be able to import that into your ASP project. I've never worked with ASP so I'm not able to go into much more detail than that.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/102379830
has text: document.getElementsByTagName('div')[3].getElementsByTagName('p')[0].setAttribute("style", "margin : 0 !important");
comment on: http://stackoverflow.com/q/27384816
score: 0
type: Comment
type: QuestionComment

php
tags question: http://stackoverflow.com/q/27390872
tags question: http://stackoverflow.com/q/27465996
tags question: http://stackoverflow.com/q/27421541
tags question: http://stackoverflow.com/q/27367731
tags question: http://stackoverflow.com/q/27353430
tags question: http://stackoverflow.com/q/27438070
tags question: http://stackoverflow.com/q/27428078
tags question: http://stackoverflow.com/q/27447588
tags question: http://stackoverflow.com/q/27338562
tags question: http://stackoverflow.com/q/27341308
tags question: http://stackoverflow.com/q/27440234
tags question: http://stackoverflow.com/q/27454718
tags question: http://stackoverflow.com/q/27333646
tags question: http://stackoverflow.com/q/27349618
tags question: http://stackoverflow.com/q/27334240
tags question: http://stackoverflow.com/q/27440475
tags question: http://stackoverflow.com/q/27408899
tags question: http://stackoverflow.com/q/27432793
tags question: http://stackoverflow.com/q/27469496
tags question: http://stackoverflow.com/q/27390249
tags question: http://stackoverflow.com/q/27344245
tags question: http://stackoverflow.com/q/27469091
tags question: http://stackoverflow.com/q/27351568
tags question: http://stackoverflow.com/q/27413929
tags question: http://stackoverflow.com/q/27371243
tags question: http://stackoverflow.com/q/27462494
tags question: http://stackoverflow.com/q/27347175
tags question: http://stackoverflow.com/q/27455240
tags question: http://stackoverflow.com/q/27379903
tags question: http://stackoverflow.com/q/27454238
tags question: http://stackoverflow.com/q/27318857
tags question: http://stackoverflow.com/q/27412949
tags question: http://stackoverflow.com/q/27445864
tags question: http://stackoverflow.com/q/27338985
tags question: http://stackoverflow.com/q/27400402
tags question: http://stackoverflow.com/q/27415477
tags question: http://stackoverflow.com/q/27462984
tags question: http://stackoverflow.com/q/27391306
tags question: http://stackoverflow.com/q/27393960
tags question: http://stackoverflow.com/q/27469387
tags question: http://stackoverflow.com/q/27460382
tags question: http://stackoverflow.com/q/27388397
tags question: http://stackoverflow.com/q/27445671
tags question: http://stackoverflow.com/q/27424687
tags question: http://stackoverflow.com/q/27442753
tags question: http://stackoverflow.com/q/27313861
tags question: http://stackoverflow.com/q/27461635
tags question: http://stackoverflow.com/q/27415431
tags question: http://stackoverflow.com/q/27334690
tags question: http://stackoverflow.com/q/27397297
tags question: http://stackoverflow.com/q/27472039
tags question: http://stackoverflow.com/q/27467463
tags question: http://stackoverflow.com/q/27427108
tags question: http://stackoverflow.com/q/27393340
tags question: http://stackoverflow.com/q/27368634
tags question: http://stackoverflow.com/q/27453830
tags question: http://stackoverflow.com/q/27359128
tags question: http://stackoverflow.com/q/27395071
tags question: http://stackoverflow.com/q/27345977
tags question: http://stackoverflow.com/q/27352928
tags question: http://stackoverflow.com/q/27436859
tags question: http://stackoverflow.com/q/27435454
tags question: http://stackoverflow.com/q/27459641
tags question: http://stackoverflow.com/q/27388326
tags question: http://stackoverflow.com/q/27347331
tags question: http://stackoverflow.com/q/27314416
tags question: http://stackoverflow.com/q/27366964
tags question: http://stackoverflow.com/q/27459583
tags question: http://stackoverflow.com/q/27314946
tags question: http://stackoverflow.com/q/27456294
tags question: http://stackoverflow.com/q/27347255
tags question: http://stackoverflow.com/q/27397880
tags question: http://stackoverflow.com/q/27429479
tags question: http://stackoverflow.com/q/27330815
tags question: http://stackoverflow.com/q/27420059
tags question: http://stackoverflow.com/q/27322474
tags question: http://stackoverflow.com/q/27337566
tags question: http://stackoverflow.com/q/27368957
tags question: http://stackoverflow.com/q/27342638
tags question: http://stackoverflow.com/q/27349882

http://stackoverflow.com/comment/43286089
type: QuestionComment
has text: Yes, much better. I may answer this in 5 minutes or so
score: 0
comment on: http://stackoverflow.com/q/27421534
type: Comment

http://stackoverflow.com/q/27318425
has body: I have a page which contains multiple divs with similar but unique names. I also have a Jquery file which is supposed to simply change the classes of the correct div to show or hide. I have a .click function which waits for any element with an id that starts with replyToComment_ This function will execute if I clicked a class with name replyToComment_1 or replyToComment_spaghetti (although it will only ever be numbers) When the function executes it needs to get that number on the end of the element that was just clicked and store it into a variable, so if replyToComment_1 was clicked the variable needs to contain 1 Hopefully this makes sense. Here's a JSFiddle which will help. http://jsfiddle.net/frayt/s06m8vc3/4/
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27318691
type: Question
accepted answer: http://stackoverflow.com/a/27318509
upvote count: 0
tagged with: javascript
has title: Get name of element which was just clicked (JSFiddle)
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/43096429
possible better answer: http://stackoverflow.com/a/27318506
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27318506
favorite count: 0
has answer: http://stackoverflow.com/a/27318509
downvote count: 1

http://stackoverflow.com/a/27342430
score: 0
answers question: http://stackoverflow.com/q/27342297
has comment: http://stackoverflow.com/comment/43140775
has comment: http://stackoverflow.com/comment/43140946
type: Answer
has comment: http://stackoverflow.com/comment/43140995
has body: You cant push to array like that and then compare the values. You can do it with key/value pairs: $("#blocks .block span").each(function() { blockspansizes[$(this).text().length]=$(this).attr("style"); });//text lengths are all different. $(".newblocks span").each(function() { textlength = (this).text().length; //if textlength matches one length value from array, get its corresponding style from the same object. if(blockspansizes.indexOf(textlength) &gt; -1){ //do something with blockspansizes[textlength] } });

http://stackoverflow.com/q/27397527
accepted answer: http://stackoverflow.com/a/27398568
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/43241358
favorite count: 0
has body: I have a backbone model and collection. In the model, the default attribute values are defined: var Person = Backbone.Model.extend({ defaults: { name: "mark", middle: "-" } }); var People = Backbone.Collection.extend({ model: Person }); var collection = new People(); collection.add({name: "paul", middle: null}); console.log('collection is '); console.log(collection); I want the default value for "middle", which is "-", to be taken if "null" is passed in for the attribute "middle". However, "null" overrides the default instead. How do I do this? The jsfiddle is here
tagged with: backbone.js
type: Question
has title: Use Backbone model default if a attribute value is null
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/27398568
has answer: http://stackoverflow.com/a/27397853
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27397853

http://stackoverflow.com/q/27426692
has answer: http://stackoverflow.com/a/27467756
tagged with: transform
has comment: http://stackoverflow.com/comment/43298803
answer count: 1
tagged with: javascript
score: 0
has body: How to rotate a bar through aroung the starting point? I want to rotate the green rect bar to point to the center of the circle how to do it. The code below is how I draw the rect. downNode = downNode .data(_nodes) .attr("id", function (d, i) { return "nodeDown" + d.dbId; }) .enter() .append("rect") .attr("class", "node").attr("class","downExpressed") .attr("x", function (d) { return Math.sin( Math.PI - (Math.max(0, Math.min(2 * Math.PI, x(d.dx)))+ Math.max(0, Math.min(2* Math.PI, x(d.dx + d.d_dx)))) / 2 ) * Math.max(0, y(d.dy+ d.d_dy)); }) .attr("height", function (d) { var thea = Math.max(0, Math.min(2 * Math.PI, x(d.dx + d.d_dx))) - Math.max(0, Math.min(2 * Math.PI, x(d.dx))); var r = Math.max(0, y(d.dy)); return Math.min(r * thea, Math.floor(_this.maxLevel));}) .attr("y", function (d) { return Math.cos(Math.PI - (Math.max(0, Math.min(2 * Math.PI, x(d.dx)))+ Math.max(0, Math.min(2 * Math.PI, x(d.dx + d.d_dx)))) / 2) * Math.max(0, y(d.dy+ d.d_dy));}) .attr("width", function (d) { return 1/2*Math.floor((d.expression.downs.length) / DownMax * ( Math.max(0, y(d.dy + d.d_dy)) - Math.max(0, y(d.dy)) )); }) First I calculate the angle and r, and then get the x position through rcos(thea) y position rsin(thea); but the result is not pointing to the center, I need to rotate it aroung the starting point of the rect bar. Any suggestion, Thanks.
linked to: http://stackoverflow.com/q/12903547
tagged with: d3.js
type: UnansweredQuestion
has title: D3.js rotate the rect bar points to the center of the circle
type: Question
has comment: http://stackoverflow.com/comment/43337484

http://stackoverflow.com/q/27439061
accepted answer: http://stackoverflow.com/a/27456472
has answer: http://stackoverflow.com/a/27439224
score: 0
has comment: http://stackoverflow.com/comment/43319579
has comment: http://stackoverflow.com/comment/43318184
has comment: http://stackoverflow.com/comment/43319751
has body: How to reload radio button list value? I assignedtext box value as follows, document.getElementById('txtvalue' + id).value = document.getElementById('txtoriginalvalue' + id + '2').innerHTML; I tried same for radio button but i can't able to reload. please help me out. Thanks.
possible better answer: http://stackoverflow.com/a/27439224
has answer: http://stackoverflow.com/a/27456472
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43318090
has comment: http://stackoverflow.com/comment/43318020
type: Question
answer count: 2
has title: Reloading Radio button value
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27415099
has body: I'm trying to figure out how data received from a controller can be used in a different route in Ember.js. I've got a controller like this, which is making an Ajax call and upon success, calls the successCallback function: App.LoginController = Ember.ArrayController.extend({ ... function successCallback(json){ var userData = json; self.transitionToRoute('dashboard'); } ... }); I'm trying to retrieve this userData in LoginController and use it in the dashboard view. App.DashboardRoute = Ember.Route.extend({ model: function(){ return this.controllerFor('login').get('userData'); } }); I've tried consoling out the results of this.controllerFor('login').get('userData'); but nothing returns. But consoling out the data before transitioning in the LoginController shows that the data did get assigned to the variable userData. Any help would be great!
tagged with: ember.js
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27415350
has title: Passing data from controller to route in Ember
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27415350

http://stackoverflow.com/q/27374988
answer count: 1
has comment: http://stackoverflow.com/comment/43200140
favorite count: 0
has comment: http://stackoverflow.com/comment/43200199
has title: jquery change image path on div hover and make its class active?
upvote count: 1
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43200100
score: 1
has answer: http://stackoverflow.com/a/27375097
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a div structure like this :- abc def ghi jkh On pageload I want to assign class active to div1 and change img1 path and when user hovers on div2 its class become active and img2 path changes and div1 active class removes and img1 comes to its old source. I ave tried this :- $("#div1").mouseover(function () { old_src = $("#img1").attr("src"); $("#img1").attr("src", "path"); }).mouseout(function () { $("#img1").attr("src", old_src); }); But in this case I have to do this for every div. I need suggesions for a generic code rather than doing this for every div seperately.
accepted answer: http://stackoverflow.com/a/27375097
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43158721
comment on: http://stackoverflow.com/a/27352339
score: 0
type: Comment
type: AnswerComment
has text: Try calling it a second time…

http://stackoverflow.com/q/27377156
score: 0
tagged with: canvas
has comment: http://stackoverflow.com/comment/43204769
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27378018
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43204622
tagged with: background
type: Question
has body: I am following this tutorial and trying to implement it on my website. I am struggling to remove the 'Black' background to show the full background image with the stars. Here's jsFiddle: jFiddle Here's the screen shot below. Here's the jQuery for your inspection: width = window.innerWidth, height = 300; // Add 2 shooting stars that just cycle. entities.push(new ShootingStar()); entities.push(new ShootingStar()); //animate background function animate() { bgCtx.fillStyle = "black"; bgCtx.fillRect(0, 0, width, height); bgCtx.fillStyle = '#fff'; bgCtx.strokeStyle = "#fff"; var entLen = entities.length; while (entLen--) { entities[entLen].update(); } requestAnimationFrame(animate); } animate(); Any help would be great! thanks :)
accepted answer: http://stackoverflow.com/a/27378018
tagged with: javascript
has title: How to remove canvas background and display full background image

http://stackoverflow.com/q/27397275
has title: Loading html content based on radio values using jquery load
upvote count: 2
type: UnansweredQuestion
has body: Im working on a script using jquery load function and im stuck with a noob issue.. I got 2 html files, testload.html Pastebin file Name of the html file varies based on the input value given in the testload.html, but for demo purpose i have created test.html and i enter "test" in the input field for testing. Demo test.html - Test.html Now the problem is that when the user clicks on a radio button in the testload.html file, only the content of the div based on id should be retrieved from test.html but im getting the contents of all the div. The ids of the div in test.html is the same as value of the individual radio buttons in testload.html Summary user enters a text in input filed in testload.html (demo purpose:test) Selects either test1 radio => displays #1 of test.html test2 radio => displays #2 of test.html test3 radio => displays #3 of test.html Problem: Im getting all the contents in one go instead of the needed content. would love some help here.. Ty UPDATE : Nevermind.. a small mistake on my part. its fixed now. The problem was i missed the concatenation on my load function . and i changed the script lines to.. $('input[type="radio"]').click(function() { var test = $(this).val(); var url = $('#page').val(); url = url +".html #"; $('#getcontent').load(url + test);
type: Question
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27397391
tagged with: jquery
has answer: http://stackoverflow.com/a/27397505
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27417600
has comment: http://stackoverflow.com/comment/43279326
has body: Since you have a form, you need to attach the value to a form element, which can be posted to your server. You need to assign a name, so that you can access the value in your controller and save it in the database: @if (User.IsInRole("RiyadhAdminAssistant")) { @:Riyadh } @if (User.IsInRole("JeddahAdminAssistant")) { @:JEDDAH } @if (User.IsInRole("AlAhsaAdminAssistant")) { @* AlAhsa *@ @:AlAhsa } In your controller, in the action associated with the form, you can access the role parameter (you can name it whatever you want): public ActionResult MyAction(string role) { //store "role" in the database } EDIT: as already pointed out in the comments, you already know the users's role, therefore you don't need to render additional HTML. Instead, just check the role on the server, before saving the data in the database. This answer is a proof of concept and should not be used in specific situations when the data is already known and the browser does not need it.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43278787
accepted answer of: http://stackoverflow.com/q/27417499
upvote count: 2
answers question: http://stackoverflow.com/q/27417499
score: 2

http://stackoverflow.com/comment/43274100
comment on: http://stackoverflow.com/a/27414940
has text: OK, but that statement is equally wrong. I could go and say `document.getElementById("that").onclick.call({id:"else"})`. The value of `this` only depends on the call, and has nothing to do with scopes.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27368467
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/43189472
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27369031
has body: I doing a little site for my web project, but I can't get the code to work. I have 4 "pages" (don't know what to call them) that I want to link to one another. You answer a question and an alert shows up redirecting you to the next page. I get the first link to work but not the other ones. Here's my code: Nej This is what I used for the first link but it does not work when I have multiple of these in place. I tried giving them different tags/names but that didn't work. function confirm_alert(element) { redirect = confirm("confirmation for redirecting?"); if(redirect) { window.location = element.dataset.href } Edit: When I put multiple of these in my buttons did not work anymore(nothing happends when I clicked on them). (English isn't my native language so sorry for all the spelling errors.)
tagged with: javascript
has title: Redirecting pages with confirmation
has comment: http://stackoverflow.com/comment/43188870
has comment: http://stackoverflow.com/comment/43188864
upvote count: 0
has comment: http://stackoverflow.com/comment/43189115

http://stackoverflow.com/comment/139487619
score: 0
type: AnswerComment
type: Comment
has text: I ran into the same problem. I prefer regex management instead, and I changed `if (key.search('on') === 0)` into `if ( !/(mouse|pointer)/g.test( key ) )` so that I can filter which events to be listened
comment on: http://stackoverflow.com/a/27322253

http://stackoverflow.com/comment/43127440
has text: Got it. Again, thanks so much. If I can get that 2nd panel to close completely, I'm good to go. I appreciate your time.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27334910

oriento
type: Tag
tags question: http://stackoverflow.com/q/27412905
tag name: oriento
tags question: http://stackoverflow.com/q/27460658

http://stackoverflow.com/a/27345210
has comment: http://stackoverflow.com/comment/43146398
has comment: http://stackoverflow.com/comment/43146035
score: 1
upvote count: 1
has body: The issue is that the setInterval is set for 12000, but it takes 24000 to get back up to the top, so the setInterval should be at 24000. setInterval(function() { $(".scrollballer").animate({ scrollTop: $(document).height() }, 12000); setTimeout(function() { $('.scrollballer').animate({scrollTop:0}, 12000); },12000); }, 24000); // &lt;-- Don't run again until the full down/up cycle is complete However, there are better ways to do this. First step in improving this is to use a callback for the .animate instead of setTimeout. setInterval(function() { // Use a callback to schedule the "up" animation-------------------------v $(".scrollballer").animate({scrollTop:$(document).height()}, 12000, function() { $('.scrollballer').animate({scrollTop:0}, 12000); }); }, 24000); Next step is to realize that the inner .animate() also can accept a callback, so we really don't need the setInterval(). The callbacks are better because JS timers aren't perfect, and one .animate() could start before the previous is finished. Using callbacks prevents this. // -----------v---create a named function that performs the down/up animations (function down_then_up() { $(".scrollballer").animate({scrollTop:$(document).height()}, 12000, function() { // Use the `down_then_up` function as a callback----v--- to repeat the cycle $('.scrollballer').animate({scrollTop:0}, 12000, down_then_up); }); })(); // &lt;-- invoke the `down_then_up` immediately to get it going. So here I make a function called down_then_up that performs the cycle of scrolling the page. The function is invoked immediately by the () at the very end. Then in the inner .animate() call that brings you back to the top, I pass the down_then_up function as the callback. EDIT Another issue is that when you're scrolling down, you're travelling the full window height, even though it's larger than the actual image container. So if the window height is 800, jQuery calculates based on that number, so it thinks it needs to go a suitable speed to …
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27345145
answers question: http://stackoverflow.com/q/27345145
type: Answer

http://stackoverflow.com/comment/58561126
type: Comment
has text: The only problem with doing it this way , as I have found out, is that you have to add the comment to the top of every file you use. A better solution is to create a new file in the root folder of you app named `.jshintrc` and then add the following code to the file ```{ "esnext": true }```
score: 24
comment on: http://stackoverflow.com/a/35365041
type: AnswerComment

http://stackoverflow.com/a/27402733
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27402677
score: 2
has body: The first &lt;/script&gt; will end the script element in the middle of the string. Your JavaScript will throw an error (because the string isn't terminated) and everything after it will be treated as text in the HTML document (which will get written to the body because you can't have text nodes as child elements of the head element in HTML). You need to avoid having that sequence of characters in your JavaScript. Escape the / document.writeln('&lt;script src="js/messages.js"&gt;&lt;\/script&gt;');
has comment: http://stackoverflow.com/comment/43250818
downvote count: 0

http://stackoverflow.com/comment/43283149
score: 1
comment on: http://stackoverflow.com/a/27420158
type: AnswerComment
has text: Still have: `In div tag calender is displayed.` I guess OP wants calendar to be displyed in DIV in fact
type: Comment

http://stackoverflow.com/comment/43384159
score: 0
has text: Why not inject a script element to your body? Something like this:http://stackoverflow.com/questions/5235321/how-do-i-load-a-javascript-file-dynamically
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27431196

http://stackoverflow.com/q/27469924
has answer: http://stackoverflow.com/a/27976385
type: Question
upvote count: 4
has body: I have two separate GUIs that are part of the same system. One at the top of the screen (navEditor) and one on the side (routeEditor). They need two update each other frequently, and call each others functions. Each has service that holds most of that systems functions. I ran into an issue when I tried to call functions from both A->B and B->A. It, of course, created a circular dependency because I had to include them in each other to gain access. I looked into several solutions including using $rootScope.$broadcast. However, one common suggestion (found here: angular JS - communicate between non-dependend services) suggested a "subscriber/publisher" method that wired the two together. This avoids the circular dependency by using a 3rd service and having the other services attach events and handlers to it. I took this a step further and simply had this parent service return an object with a place holder object for each of my two systems: //BRIDGE SERVICE myApp.service('$trafficSys', function(){ this.sys = { navEditor: {}, //poulated by $routeEditor service routeEditor: {} ////poulated by $navEditor service } }); //ROUTE-EDITOR myApp.service('$routeEditor', ['$trafficSys',function($trafficSys) { var routeSystem = { //entire route editor system goes in here } $trafficSys.sys.routeEditor = routeSystem; }]); //NAV-EDITOR (Same Process as Route Editor) I then simply had my "navEditor" &amp; " routeEditor" services include $trafficSys and then apply all of thier funcitons to either the navEditor or routeEditor objects. What I would like to know is if this is considered an Anti-Pattern, and if I am being more imperative rather than declarative. I am not very experienced with large applications. I'm learning angular so I can push myself to think more about architecture. However, I am finding my lack of foresight is leading me to doubt if i'm doing things the best way. Any advice would be appreciated.
linked to: http://stackoverflow.com/q/15322971
downvote count: 0
tagged with: javascript
score: 4
tagged with: anti-patterns
favorite count: 0
has comment: http://stackoverflow.com/comment/43956774
tagged with: architecture
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27976385
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/43387272
type: AnsweredQuestion
has title: Angular Interdependent Services: Avoiding circular dependncy

http://stackoverflow.com/comment/43110971
has text: If, by "responsive," you really mean to make the size of the graph vary according to browser window size, you could add a `viewBox` attribute to the ` ` element and then use JavaScript or CSS to set the size of the containing ` `. Of course, "responsive" design is much more than simply resizing elements, so perhaps you mean something more involved. In that case, you'll need to spell out the desired behavior.
score: 3
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27325096

http://stackoverflow.com/q/27440317
tagged with: datatables
downvote count: 0
tagged with: jquery
favorite count: 0
type: Question
upvote count: 6
has title: Datatables add multiple child-rows
answer count: 3
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27440958
score: 6
has body: I have a table hooked up to the jQuery datatable. Based on this example I want to add "hidden" child rows to show extra information. I have the following jsfiddle where I have a name/value pair. &lt;tr data-child-name="Name1" data-child-value="Value 1"&gt; &lt;td class="details-control"&gt;&lt;/td&gt; function format ( name, value ) { return '&lt;div&gt;' + name + ': '+ value + '&lt;/div&gt;'; } $(document).ready(function () { var table = $('#example').DataTable({}); // Add event listener for opening and closing details $('#example').on('click', 'td.details-control', function () { var tr = $(this).closest('tr'); var row = table.row(tr); if (row.child.isShown()) { // This row is already open - close it row.child.hide(); tr.removeClass('shown'); } else { // Open this row row.child( format(tr.data('child-name'), tr.data('child-value') )).show(); tr.addClass('shown'); } }); }); My question is how do I add more than one name/value pair? So that I can define various rows like in the datatables.net example. My source is a php-script that generates html like in the jsfiddle example. It's probably an easy task but my jQuery skills are very limited :-) Thank you. UPDATE: The data comes from an ldap query: $ldapResults[$i] echo "&lt;td&gt;" . utf8_encode($ldapResults[$i]['sn'][0]) . "&lt;/td&gt;"
has answer: http://stackoverflow.com/a/27440637
has answer: http://stackoverflow.com/a/27440656

http://stackoverflow.com/a/27358949
has comment: http://stackoverflow.com/comment/43170424
type: Answer
has body: It looks like as soon as the Application_Start method ends, that WebSocketServer is going to get out of scope and eventually garbage collected. You could, set that object as member in the Global class, and dispose it on the Application_End event for example. UPDATE: You are also using the wss schema but not providing any certificate configuration. Please note that IIS and Fleck are two different things, that runs in different ports, and not because you create Fleck into the ASP.NET app means that Fleck is going to infer the SSL/TLS configuration or any configuration at all. Try to set the schema to ws instead and open the page without HTTPS and see if it works.
answers question: http://stackoverflow.com/q/27358592
score: 0

http://stackoverflow.com/q/27465581
has answer: http://stackoverflow.com/a/27509864
has answer: http://stackoverflow.com/a/27466733
accepted answer: http://stackoverflow.com/a/27466733
linked to: http://stackoverflow.com/q/26326958
tagged with: javascript
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/31648244
tagged with: jquery
favorite count: 0
tagged with: angularjs
has body: I'm looking to implement scrolling functionality like the Google Inbox landing page has: Notably, no matter how fast or how many times you scroll the wheel, it will count as "one" and go to the next step. This seems easier said than done since there's no way to cancel "scroll" event. There is a way to cancel DOMMouseScroll &amp; mousewheel events however doing so is tricky: The problem is the way cancelling these events works is like below using return preventFn(ev): var preventFn = function (ev) { ev.returnValue = false; return false; }; Try it here However doing so causes scrollTop() action to break. But without it, the scroll event passes through and messes it up also. I can do better with a rather buggy implementation using a timeout (see fiddle). It works alright but has major bug being everything permanently breaks if the user scrolls WHILE the scrollTop() animation is happening. How can I correct this so it's as awesome as Google did? (and preferably without a timeout. In the Google page, going from 3rd to 4th step ... I cannot even perceive any timeout, it seems to scroll immediately as my mousewheel starts moving. so it seems possible)
score: 2
type: AnsweredQuestion
downvote count: 0
has title: Do action once on multiple scroll events and prevent scrolling
tagged with: scroll
linked to: http://stackoverflow.com/q/25839487
possible better answer: http://stackoverflow.com/a/27509864
type: Question

http://stackoverflow.com/a/27369611
score: 1
has body: Did a similar POC in 2011 and even though there are slot of great libs around now I think the key here is to use websockets. I would not focus on jQuery components but instead make sure that communication between the kinect and the browser is working, what you do with the commands in the browser is secondary. IMO using windows with the kinect will be easier than using OSX and sending data to JS is still not a problem.
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27369178
answers question: http://stackoverflow.com/q/27369178
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43226895
type: AnswerComment
has text: Believe me, I've spend hours on this trying to figure it out. I think it's unfair, as I've read documentations, etc. That I missed the fact about a selector that didn't work the way I thought it would, is human error. I just didn't understand the console error about the undefined style element.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27388456

http://stackoverflow.com/comment/43398756
type: Comment
has text: To say that it's correct 100% of the time would be to optimistic. But in typical, most cases yes, that's correct. If you want 100% working one, then you can type '@Url.Action("ActionName","ControllerName")' inside the razor and send it as a parameter to the function.
comment on: http://stackoverflow.com/a/27446973
type: AnswerComment
score: 0

http://stackoverflow.com/q/27474152
tagged with: javascript
tagged with: background-color
score: 0
has comment: http://stackoverflow.com/comment/43382662
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27474313
accepted answer: http://stackoverflow.com/a/27474313
has body: I am trying to change this div using the sliders embedded in the div. Red Green Blue My function is below. I am new to javascript, but I believe my error is in the function itself.
has comment: http://stackoverflow.com/comment/43382725
type: AnsweredQuestion
tagged with: dynamic
has title: Trying to change div background color with sliders
type: Question
answer count: 1

http://stackoverflow.com/comment/43163548
score: 0
type: Comment
type: QuestionComment
has text: Are you sure this file exists? Remember that when you use a relative path, apache you use the same directory of the script being executed as root directory...
comment on: http://stackoverflow.com/q/27354692

http://stackoverflow.com/comment/43129618
has text: I need to retrieve only the text without input element.
comment on: http://stackoverflow.com/q/27336408
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43362282
comment on: http://stackoverflow.com/a/27462708
type: Comment
score: 1
type: AnswerComment
has text: Sure, but have you included `angular.js` (or `angular.min.js`) as well?

http://stackoverflow.com/a/27319056
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43097796
score: 3
has body: All you're missing is how to enable/disable your button and that is $('.load-table').prop('disabled',false); // or true to disable So just plug this in as required $(".list-group-item").click(function() { $('.list-group-item').removeClass('selected'); $(this).addClass('selected'); $('.load-table').prop('disabled',false); }); $(document).on('click', function (e) { if ($(e.target).closest(".list-group-item, .load-table").length === 0) { $('.list-group-item').removeClass('selected'); $('.load-table').prop('disabled',true); } }); http://jsfiddle.net/has9L9Lh/22/
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27318938
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27318938

http://stackoverflow.com/q/27434861
tagged with: ajax
has body: this is ajax version when inside text file something change then it popup alert it working well . but i also would like to sound alert when popup i tried and search hours but i couldn't found which working together with my ajax script. &lt;audio id="audiotag1" src="Ring04.wav" preload="auto"&gt;&lt;/audio&gt; &lt;script language="javascript"&gt; var previous = ""; setInterval(function() { var ajax = new XMLHttpRequest(); ajax.onreadystatechange = function() { if (ajax.readyState == 4) { if (ajax.responseText != previous) { document.getElementById('audiotag1').play(); sleep(1); alert("file changed!"); previous = ajax.responseText; } } }; ajax.open("POST", "xxx.txt", true); //Use POST to avoid caching ajax.send(); }, 3000); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/43311047
has comment: http://stackoverflow.com/comment/43310696
tagged with: http://stackoverflow.com/tag/html
score: 1
answer count: 0
type: UnansweredQuestion
has title: ajax popup alert working but sound not working
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/27328591
answers question: http://stackoverflow.com/q/27321788
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27321788
score: 1
upvote count: 1
has body: Try: var mycal = $("#calendar)....init... then in your .success: mycal.fullCalendar('refetchEvents');

http://stackoverflow.com/q/27325750
has body: I'm having a strange issue with moment.js. I wrote a function to convert the time from utc to german time format, and everything seemed to work just fine in chrome. But now I tried it with firefox and here I got an invalid date. moment.locale("de"); $('#from').datepicker({ format: "DD. MMMM YYYY" }); $('#from').on('change',function() { var a = moment($('#from').val(), "DD. MMMM YYYY").format("LLLL"); var b = moment(a).add(7,'days'); var localTime = moment.utc(b).toDate(); localTime = moment(localTime).format('DD. MMMM YYYY'); $('#to').val(localTime); }); $('#to').datepicker({ format:'DD.MMMM YYYY' }); $('#sendbtn').on('click',function(){ /... var from = moment(fromfield.value).format(); var to = moment(tofield.value).format(); /... $('#calendar').fullCalendar( 'gotoDate', from ); getEventDate(from,to,persons.value); } }); function getEventDate(start,end,people) { var Calendar = $('#calendar'); Calendar.fullCalendar(); var Event = { title:"Your stay for "+people+" people", allDay: true, start: start, end: end }; filljson(start,end,people); Calendar.fullCalendar( 'renderEvent', Event ); } / ... I've seen this answer but can't get it to work either way. Can someone help me out?
downvote count: 0
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/19839819
score: 5
tagged with: momentjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27326005
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/42472224
upvote count: 5
tagged with: javascript
possible better answer: http://stackoverflow.com/a/42472224
answer count: 2
has answer: http://stackoverflow.com/a/27326005
has title: moment.js gives invalid date in firefox, but not in chrome
tagged with: firefox

http://stackoverflow.com/comment/43284401
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27415943
has text: sorry but i already tried this. this not solution of my problem.

http://stackoverflow.com/q/27455022
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/503093
downvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/43348076
tagged with: if-statement
score: -2
tagged with: hyperlink
has answer: http://stackoverflow.com/a/27455143
has comment: http://stackoverflow.com/comment/43347971
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has title: What is the correct way to use javascript to navigate to another page?
possible better answer: http://stackoverflow.com/a/27455087
accepted answer: http://stackoverflow.com/a/27455143
has answer: http://stackoverflow.com/a/27455087
has body: I'm trying to do what I think is a really simple thing, and I can't find any working solutions online. Basically, I want links in if statements. The pages I want to navigate to are in the same folder as the index-page. Here are the if-statements: if(cartman &gt; kyle &amp;&amp; cartman &gt; stan &amp;&amp; cartman &gt; kenny &amp;&amp; cartman &gt; butters){ window.location = 'cartman.html'; } else if(kyle &gt; cartman &amp;&amp; kyle &gt; stan &amp;&amp; kyle &gt; kenny &amp;&amp; kyle &gt; butters){ window.location = 'kyle.html'; } else if(stan &gt; cartman &amp;&amp; stan &gt; kyle &amp;&amp; stan &gt; kenny &amp;&amp; stan &gt; butters){ window.location = 'stan.html'; } else if(kenny &gt; cartman &amp;&amp; kenny &gt; stan &amp;&amp; kenny &gt; kyle &amp;&amp; kenny &gt; butters){ window.location = 'kenny.html'; } I have found many different codes online that are supposed to do this, but none of them have worked. What is the correct way to use javascript to navigate to another page?
has comment: http://stackoverflow.com/comment/43347957

http://stackoverflow.com/comment/43231768
type: QuestionComment
has text: How abou `var i` instead if just `i`?
comment on: http://stackoverflow.com/q/27392129
score: 2
type: Comment

http://stackoverflow.com/a/27390887
has comment: http://stackoverflow.com/comment/43254825
has body: Look at the if statement below. It detects the current color and switches it: (function(){ var canvas = new fabric.Canvas('c4'); canvas.hoverCursor = 'default'; canvas.on('mouse:down', function(e) { var color = e.target.fill; if(color == '#000') { e.target.setFill('red'); } else { e.target.setFill('#000'); } e.target.lockMovementX = e.target.lockMovementY = true; e.target.lockScalingX = e.target.lockScalingY = true; e.target.lockUniScaling = true; canvas.deactivateAll().renderAll(); }); canvas.add(new fabric.Circle({ radius: 10, fill: '#000', top: 100, left: 200 })); canvas.add(new fabric.Circle({ radius: 10, fill: '#000', top: 100, left: 150 })); canvas.add(new fabric.Circle({ radius: 10, fill: '#000', top: 100, left: 100 })); })();
accepted answer of: http://stackoverflow.com/q/27388821
type: Answer
answers question: http://stackoverflow.com/q/27388821
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/43355880
type: AnswerComment
has text: Change the type to text to see what is echoed by echo $id
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27459240

http://stackoverflow.com/q/27395741
has comment: http://stackoverflow.com/comment/43239507
tagged with: jqgrid
has body: My jqGrid's grid working correctly in Firefox, Opera, IE11. But can't work in IE8. My jgGrid version is 4.5.4. My jQuery version is 1.9.0 My source is as following. Debbuger shows error ( at a row *3492 ). 3491 $t.grid.headers[lvc].width = cw; *3492 $t.grid.headers[lvc].el.style.width=cw+"px"; 3493 if(cle) { $t.grid.cols[lvc].style.width = cw+"px"; } 3494 if($t.p.footerrow) { 3495 $t.grid.footers[lvc].style.width = cw+"px"; 3496 } 3497 } Please teach me the method working well ? Or never work in IE8 ?
type: Question
has comment: http://stackoverflow.com/comment/43273208
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43237971
score: 0
has comment: http://stackoverflow.com/comment/43273051
has comment: http://stackoverflow.com/comment/43238549
answer count: 0
type: UnansweredQuestion
has title: jqGrid with IE8 can't work
has comment: http://stackoverflow.com/comment/43273147

http://stackoverflow.com/a/27450633
type: Answer
upvote count: 1
score: 1
has body: [start] means "replace any one of s, t, a, or r". You'll need to escape the brackets: var result = eventLabel.replace(new RegExp("\\[(start|end)\\]", "gi"), "replaced");
downvote count: 0
answers question: http://stackoverflow.com/q/27450572

http://stackoverflow.com/comment/43195568
has text: If you are thinking the `gameState===2` if statement will ever execute, it won't, since that if statement will execute before any of your callbacks (including `requestAnimationFrame`).
comment on: http://stackoverflow.com/a/27372238
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43238803
score: 0
comment on: http://stackoverflow.com/q/27388435
type: Comment
type: QuestionComment
has text: Is the actual code have the same problem like the unit test?

http://stackoverflow.com/a/27450400
upvote count: 1
type: AcceptedAnswer
has body: var dif = max - min; var a = dif/bucked; for (var i=min; i&lt;=max;i=i+a){ i; }
answers question: http://stackoverflow.com/q/27450216
has comment: http://stackoverflow.com/comment/43339454
type: Answer
accepted answer of: http://stackoverflow.com/q/27450216
downvote count: 0
has comment: http://stackoverflow.com/comment/43339473
score: 1
has comment: http://stackoverflow.com/comment/43339533

http://stackoverflow.com/q/27402167
favorite count: 0
has answer: http://stackoverflow.com/a/27402221
has comment: http://stackoverflow.com/comment/43249105
has body: Hello I'm new to JavaScript and I have a problem with my code that I can't solve :( $(".kupongobjekt").append(text + ","); arrayHolder = $(".kupongobjekt").text; splitted = arrayHolder.split(","); numArray = splitted.sort(sortNumber); newest = numArray.toString(); $(".kupongobjekt").text(newest); That doesn't work at the moment. arrayholder has a div that contains "4,5,3,3,2,8,9," but if I take arrayHolder = "4,5,3,3,2,8,9,"; then it works. But without calling it in it doesn't work. Ok, I know my english is bad but I hope you guys understand what my problem is :)
accepted answer: http://stackoverflow.com/a/27402221
downvote count: 1
type: Question
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/43249021
has title: Need help whit my JavaScript
upvote count: 0
tagged with: arrays
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27379625
has comment: http://stackoverflow.com/comment/43351911
has comment: http://stackoverflow.com/comment/43208840
accepted answer: http://stackoverflow.com/a/27468565
type: Question
has comment: http://stackoverflow.com/comment/43208761
tagged with: javascript
has body: I'm trying to remove the cache when the user go to this url stackoverflow.com/?clear then reload and go to stackoverflow.com with a clean cache, I tried a many methods but I failed. Here is my last attempt, It's not affect the cache at all! Manifest Code { "name": "stackoverflow", "version": "1.0", "background": { "scripts": ["jquery.js","background.js"], "persistent": false }, "page_action" : { "default_icon" : "icon.png", "default_title" : "Remove" }, "permissions" : [ "declarativeContent", "browsingData", "tabs" ], "manifest_version": 2 } background.js chrome.runtime.onInstalled.addListener(function() { // Replace all rules ... chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { // With a new rule ... chrome.declarativeContent.onPageChanged.addRules([ { // That fires when a page's URL contains a 'stackoverflow.com/?clea' ... conditions: [ new chrome.declarativeContent.PageStateMatcher({ pageUrl: { urlContains: 'stackoverflow.com/?clear' }, }) ], // And shows the extension's page action. actions: [ new chrome.declarativeContent.ShowPageAction() ] } ]); }); }); function clearMe(tab) { var ms = (30 * 60) * 1000; // 30 minutes var time = Date.now() - ms; chrome.browsingData.removeCache({"since": time}, function() { chrome.tabs.update({url: 'http://stackoverflow.com'}); }); } //It will be perfect if user do not have to click chrome.pageAction.onClicked.addListener(clearMe) I need better alternative to remove cache without even the user click a button.
has comment: http://stackoverflow.com/comment/43209284
score: 2
has comment: http://stackoverflow.com/comment/43354513
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43208830
has title: Remove cache automatically from chrome when match page url
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43208935
has answer: http://stackoverflow.com/a/27468565
tagged with: google-chrome-extension
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/43214525
tagged with: google-chrome

http://stackoverflow.com/q/27439693
tagged with: google-chrome-extension
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27441333
tagged with: error-handling
upvote count: 1
type: Question
has body: I would like to fix a particular bug of a website with an extension I'm making. (going to explain the site in simple terms) The website has an album and the way it works is that each album has an x amount images and each image has its own page for example: 1.html. On each page is a single image of which i assume are dynamically generated. For some reason sometimes on the last page of an album the img tag looks like this: &lt;img id="image" src="mainsite.com/album1/images/" onerror="this.src='mainsite.com/album1/images/'"&gt; So this results in chrome being stuck in an endless loop logging the following: Resource interpreted as Image but transferred with MIME type text/html: "mainsite.com/album1/images/". This causes my computer and I'm sure anyone else's who use the site to lag real bad as a result of this bug. I wish to fix this issue with an extension so my question is, is it possible to fix this problem with an extension? if so, how? I've tried setting the onerror and src attribute to an empty string and it seems the src of the img is constantly being updated somehow which results in the error still going off. Here's an example of the problem (warning! it may lag your chrome if you stay on page too long)
tagged with: javascript
possible better answer: http://stackoverflow.com/a/31193724
has title: Chrome Extension - Fix img tag onerror infinite loop
has answer: http://stackoverflow.com/a/31193724
answer count: 2
accepted answer: http://stackoverflow.com/a/27441333

http://stackoverflow.com/comment/43185301
type: Comment
score: 0
type: AnswerComment
has text: I'm not sure why you're asking about *code-organization*, since this is quite the small example that is easily solved.
comment on: http://stackoverflow.com/a/27366579

http://stackoverflow.com/comment/43115352
score: 0
type: AnswerComment
has text: this still gives me the error. `Message: Invalid argument supplied for foreach()`
type: Comment
comment on: http://stackoverflow.com/a/27324397

http://stackoverflow.com/q/27367731
type: Question
tagged with: javascript
has body: Basically i am trying to debug this: Ihave a HTML form and a send.php from which i extract data like $locridicare= addslashes($_GET['liv']); $locreturnare=addslashes($_GET['ret']); $codlocridicare=addslashes($_GET['locridicare']); $codlocreturnare=addslashes($_GET['locreturnare']); The codlocridicare should get the VALUE and the locridicare should get the TEXT from the SELECT option called locridicare. Same for codlocreturnare and locreturnare, from the other select. The form i run: and then the in form --- Selectaţi --- Aeroport Otopeni - Bucuresti --- Selectaţi --- Aeroport Otopeni - Bucuresti
has answer: http://stackoverflow.com/a/27367819
answer count: 1
has title: Pass data to send.php - select option text and value
has comment: http://stackoverflow.com/comment/43187464
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43187411
tagged with: php
has comment: http://stackoverflow.com/comment/43187383
score: 0
tagged with: forms

http://stackoverflow.com/comment/43152208
has text: `Boolean(-1) === true` http://es5.github.io/#x9.2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27348753
score: 1

http://stackoverflow.com/q/27437097
has comment: http://stackoverflow.com/comment/43315385
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27437820
has comment: http://stackoverflow.com/comment/43314953
has body: I'm using JS to pull content from a table and create event list items on a page. Im using Date.parse to compare the entry date to todays date, and only show events in the future, based on MM/DD/YY value from var eventDate. &lt;script&gt; today = new Date(); today.setDate(today.getDate() - 1); eventDate = $(this).find("td:nth-child(3)").text().trim(); if (Date.parse(eventDate) &gt; Date.parse(today)) { //Do something... } &lt;/script&gt; I was thrilled to see how simple Date.parse was to use, then realized it only worked in Chrome (not in Firefox or IE). Any other ways to do this cross browser? Any thoughts would be appreciated. Thanks!
type: Question
has answer: http://stackoverflow.com/a/27437820
possible better answer: http://stackoverflow.com/a/27438099
tagged with: javascript
has answer: http://stackoverflow.com/a/27438099
tagged with: date
score: 0
answer count: 2
tagged with: events
tagged with: parsing
linked to: http://stackoverflow.com/q/492994
has title: Need methods other than Date.parse to parse a date string
has comment: http://stackoverflow.com/comment/43314937

http://stackoverflow.com/comment/43185834
has text: Upvoted. This works perfectly, but what about the class part?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27366849
type: Comment

http://stackoverflow.com/a/27442074
has body: On mobile -- but what you want to do is $.on "scroll", if you're not at scrollTop=0 (for the main object being scrolled), apply a new class ($.addClass) to your items that have the background image in them. This new class is simply: .newclass {background-image:none !important} Also check that when you do reach scrollTop 0, you $.removeClass your new class, so the images show back up. If you want to add some pretty to it, in your newclass, use a CSS3 transition for like .25s or so.
score: 0
has comment: http://stackoverflow.com/comment/43323523
type: Answer
answers question: http://stackoverflow.com/q/27441588

recursion
type: Tag
tags question: http://stackoverflow.com/q/27451810
tags question: http://stackoverflow.com/q/27394884
tags question: http://stackoverflow.com/q/27346337
tags question: http://stackoverflow.com/q/27415470
tag name: recursion
tags question: http://stackoverflow.com/q/27472214
tags question: http://stackoverflow.com/q/27344296
tags question: http://stackoverflow.com/q/27432679
tags question: http://stackoverflow.com/q/27329935
tags question: http://stackoverflow.com/q/27318492
tags question: http://stackoverflow.com/q/27464912
tags question: http://stackoverflow.com/q/27471093

http://stackoverflow.com/a/27434813
has body: I am really not sure if your approach is right for the given problem. About activating the window unload event conditionally, move that unload event hookup inside the link click event, that way you hookup the window unload event only when needed. Not always! Update: Something like below. For illustration purpose only. Warning: I feel there is a smell in this approach. $(".link").click(function(){ if(true){//Your condition check goes here. $( window ).unload(function() { alert( "Bye now!" ); }); } else{ window.location.href = "someurl"; } });
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43408606
has comment: http://stackoverflow.com/comment/43337355
score: 0
accepted answer of: http://stackoverflow.com/q/27434670
has comment: http://stackoverflow.com/comment/43343008
has comment: http://stackoverflow.com/comment/43318013
answers question: http://stackoverflow.com/q/27434670

http://stackoverflow.com/comment/43257212
score: 0
type: Comment
has text: One more thing: http://jsfiddle.net/DevPGSV/rp1wocuy/4/ XDDD (Just check if some A to Z letters are in the input, if found, reset)
comment on: http://stackoverflow.com/a/27405351
type: AnswerComment

http://stackoverflow.com/comment/106111852
score: 0
has text: This could work if one can set the gradient to do a hard switch at the 0 value. The idea looks similar to this answer, https://stackoverflow.com/questions/36916867/chart-js-line-different-fill-color-for-negative-point or this solution https://jsfiddle.net/c1w5Laee/
type: Comment
comment on: http://stackoverflow.com/a/54548941
type: AnswerComment

http://stackoverflow.com/q/27432589
has body: Want to change HTML content of a div which has a certain class but problem is there are several others and they get change too. Change this I'm trying function ReplaceContentInContainer(matchClass,content) { var elems = document.getElementsByTagName('*'),i; for (i in elems) { if((" "+elems[i].className+" ").indexOf(" "+matchClass+" ") > -1) { elems[i].innerHTML = content; } } } window.onload = function () { ReplaceContentInContainer("x","Success"} but as you can guess it changes every class"x", so how can I limit this only to the class="x" which is nested in a div with id="y"?
has comment: http://stackoverflow.com/comment/43306480
accepted answer: http://stackoverflow.com/a/27432701
tagged with: replace
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43306567
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43306561
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27432701
has comment: http://stackoverflow.com/comment/43306376
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: Change content of a div which has a non unique class

http://stackoverflow.com/q/27452533
type: Question
has answer: http://stackoverflow.com/a/27487481
answer count: 1
tagged with: koa
tagged with: javascript
tagged with: webstorm
score: 0
has title: Why is Webstorm showing an impossible result?
has body: Can anyone make sense of this apparent contradiction? Please look at the following screen shot. The debugger shows the correct error object but the roll over shows the parameter to be null. The latter appears to be the actual state because no error text gets logged to the log file but the debugger shows what should be there!
type: UnansweredQuestion
tagged with: error-handling
tagged with: node.js

http://stackoverflow.com/comment/43239902
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27396695
score: 1
has text: Can you try reversing the loop i.e. starting from count-1 till 0

http://stackoverflow.com/comment/43232873
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27392688
has text: @Matt I was asking about `console.log($(quantityId), $(quantityId).get())` - the result of the selector seems to be fine....
score: 0

http://stackoverflow.com/q/27425459
type: AnsweredQuestion
tagged with: local-storage
has comment: http://stackoverflow.com/comment/43292980
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43293029
possible better answer: http://stackoverflow.com/a/27425793
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27425793
tagged with: arrays
has title: Update Javascript Array and stringify again
has body: Sooo i have this array var items = ["shovel", "sword", "rope", "gun"]; i stringify it and place in localStorage localStorage.setItem("items", JSON.stringify(items)); Then i call this function that replaces the index value of the passed variable with an empty string. This is so I can check whether or not a value at a specific array index is available. The value is removed but its index remains to be checked later. function removeItem(itm) { var itemArray = JSON.parse(localStorage.getItem("items")); //old array var index = itemArray.indexOf(itm); if (index &gt; -1) { itemArray[index]=""; //edited new array localStorage.setItem("items", JSON.stringify(itemArray)); //does not store } } However the newly edited array will not go back into localStorage
has answer: http://stackoverflow.com/a/27425597
accepted answer: http://stackoverflow.com/a/27425597
has comment: http://stackoverflow.com/comment/43292987

http://stackoverflow.com/comment/43242147
type: Comment
comment on: http://stackoverflow.com/a/27398133
score: 0
type: AnswerComment
has text: @AsheshKumar — "No" seems pretty clear. Because your scanner looks for patterns that *might* be XSS risks, it isn't smart enough to make sure they are.

http://stackoverflow.com/a/27315949
answers question: http://stackoverflow.com/q/27314161
has comment: http://stackoverflow.com/comment/43118777
has body: You need to define the marker shape property. google.maps.MarkerShape object specification This object defines the clickable region of a marker image for browsers other than Internet Explorer. Everything is explained in the documentation here: https://developers.google.com/maps/documentation/javascript/reference#MarkerShape.
score: 0
type: Answer

http://stackoverflow.com/a/27429682
has comment: http://stackoverflow.com/comment/43302557
answers question: http://stackoverflow.com/q/27429579
upvote count: 2
has comment: http://stackoverflow.com/comment/43301291
downvote count: 0
has body: You need to pass the autocomplete to the function like function initialize() {fillinAddress(autocomplete)} function fillinAddress(autocomplete){console.log(autocomplete);}
type: Answer
has comment: http://stackoverflow.com/comment/43300764
score: 2

http://stackoverflow.com/a/27380848
answers question: http://stackoverflow.com/q/27380818
score: 0
has body: Any expression in if statement will be implicitly converted to boolean before evaluated. In the code you posted, it's usually used to check if a parameter is passed, in which case undefined is a falsy value and will be converted to false. AJPerez has given an answer on the falsy values (except for he forgot NaN). function reduce(numerator,denominator){ var gcd = function gcd(a,b){ if (b) { // if two arguments are passed, do something return gcd(b, a%b); } else { // only one argument passed, return it directly return a; } }; gcd = gcd(numerator,denominator); return [numerator/gcd, denominator/gcd]; } However, this approach may be buggy if the argument you're checking is indeed passed by falsy.
type: Answer

odata
tag name: odata
type: Tag
tags question: http://stackoverflow.com/q/27400766

http://stackoverflow.com/a/28130520
score: 0
has body: I suspect leak may be in your code. You use doc in internal callback closure. Try to tell GC doc is not necessary anymore after it is saved. OtherSchema.find().exec(function(err,others) { doc.total = others.data + doc.data; doc.save(function(err) { written++; }); doc = null;//tell GC to free doc });
type: Answer
answers question: http://stackoverflow.com/q/27392679
has comment: http://stackoverflow.com/comment/44685509

http://stackoverflow.com/comment/43232926
has text: I don't know what's wrong with your usage of the framework, but if the function would be called [it would not work](http://stackoverflow.com/q/20279484/1048572) indeed.
comment on: http://stackoverflow.com/q/27392768
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27438612
has comment: http://stackoverflow.com/comment/43333114
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27416638
has comment: http://stackoverflow.com/comment/43341187
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27416638
has comment: http://stackoverflow.com/comment/43333520
has body: Your code is all over the place. This should be easily handled with a simple findOneAndUpdate, optionally with upsert if you want to create the player if they don't exist. var MongoClient = require('mongodb').MongoClient; function insertEntry(sPlayerName, sPlayerID, sPlayerScore, sPlayerHealth) { MongoClient.connect('mongodb://127.0.0.1:27017/mdata', function(err, db) { if(err) { throw err; } var userCollection = db.collection('usercollection'); var player = { playerName: sPlayerName, playerId: sPlayerID, playerScore: sPlayerScore }; var query = { playerName: sPlayerName, playerId: sPlayerID } var sort = {}; var options = { upsert: true; } userCollection.findAndModify(query, sort, player, options, function(err, doc) { if(err) { throw err; } // player updated or inserted }); } }
has comment: http://stackoverflow.com/comment/43347126
has comment: http://stackoverflow.com/comment/43341139

real-time
tags question: http://stackoverflow.com/q/27334150
type: Tag
tag name: real-time

http://stackoverflow.com/q/27344024
possible better answer: http://stackoverflow.com/a/27344482
has comment: http://stackoverflow.com/comment/43143451
has answer: http://stackoverflow.com/a/27344482
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3304638
has title: Is element a descendant of some class?
has comment: http://stackoverflow.com/comment/43168806
answer count: 3
has comment: http://stackoverflow.com/comment/43143483
has comment: http://stackoverflow.com/comment/43143461
has answer: http://stackoverflow.com/a/27344067
score: 0
accepted answer: http://stackoverflow.com/a/27344067
has body: Hi Hi3 How to test with JavaScript if an element is child (or grandchild, or grandgrandchild, etc.) of an element of class blah? (said in another way : if an element is contained in an element of class blah). Note: After some tests, .contains(...) seems not to be the solution.
has comment: http://stackoverflow.com/comment/43143739
has answer: http://stackoverflow.com/a/27356876
tagged with: javascript

http://stackoverflow.com/a/27377378
answers question: http://stackoverflow.com/q/27377306
has comment: http://stackoverflow.com/comment/43205515
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43206017
has body: I don't know your entire code, but, it's something like this: ul#navigation:before { bottom: 100%; left: 50%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-color: rgba(136, 183, 213, 0); border-bottom-color: #cbcbcb; border-width: 12px; margin-left: -12px; } You will only need to position the triangle on the menu ...
has comment: http://stackoverflow.com/comment/43204508

http://stackoverflow.com/a/27454774
type: Answer
has comment: http://stackoverflow.com/comment/43347697
answers question: http://stackoverflow.com/q/27454716
has comment: http://stackoverflow.com/comment/43347719
has comment: http://stackoverflow.com/comment/43347759
upvote count: 1
has body: I'm guessing you want to extract an image from the CSS background-image source and draw it on canvas. This is how its done. var tmp = $("&lt;div&gt;").addClass('backImage'); var src = tmp.css('background-image').match(/[^"][^"]+/g)[1]; var canvas = document.getElementById('canvas') var context = canvas.getContext('2d'); console.log(src); var back = new Image(); back.src = src; back.onload = drawBackground; function drawBackground() { canvas.width = back.width; canvas.height = back.height; context.drawImage(back, 0, 0); } .backImage { background-image: url("http://placehold.it/200/200"); background-repeat: repeat-y; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;canvas id="canvas"&gt;&lt;/canvas&gt;
has comment: http://stackoverflow.com/comment/43347902
has comment: http://stackoverflow.com/comment/43347595
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43347626
has comment: http://stackoverflow.com/comment/43347660
score: 1
has comment: http://stackoverflow.com/comment/43347646
accepted answer of: http://stackoverflow.com/q/27454716
has comment: http://stackoverflow.com/comment/43347632

http://stackoverflow.com/comment/43133306
type: QuestionComment
type: Comment
has text: so one unicode char is in a form value and one is in visible html? the visible html probably escapes the char into an html entity or xml entity. you can turn one into the other before searching. it would be faster to encode the search term so that you need not touch each compared value. you can do that by setting a temp element's innerHTML with the value and then reading the same element's text, and comparing the result text to the row text.
score: 1
comment on: http://stackoverflow.com/q/27338351

http://stackoverflow.com/comment/43272282
has text: Similar to this question (though not enough to be a dupe) ~ http://stackoverflow.com/questions/19439397/how-to-get-a-tooltip-to-appear-in-a-popover
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27414030

http://stackoverflow.com/comment/43334999
type: QuestionComment
has text: I want stuff to happen on every element that has .className based on the mouse coordinates.
comment on: http://stackoverflow.com/q/27448049
score: 0
type: Comment

http://stackoverflow.com/q/27453722
downvote count: 0
tagged with: javascript
tagged with: drop-down-menu
favorite count: 0
tagged with: autofill
tagged with: css
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9313543
has title: Style Autofill or Autocomplete Default Browser Dropdown
linked to: http://stackoverflow.com/q/56026043
tagged with: autocomplete
upvote count: 5
linked to: http://stackoverflow.com/q/11595824
type: Question
score: 5
has answer: http://stackoverflow.com/a/27866872
answer count: 1
has body: Is there some type of css prefix, plugin, javascript, or jquery that allows you to style the default browser autocomplete/autofill dropdown. Not for a search field... but for &lt;input type="email"&gt; I already use input:-webkit-autofill, input:-webkit-autofill:hover, and input:-webkit-autofill:first-line to change the appearence of the yellow background, the font-family, color, etc. (in Chrome) Now I'm trying to override the default look of the dropdown - which is generated by your browser. I'm trying to customize the appearence, text color, :hover color, font, etc. for all Username/Email autofill dropdowns. I do not want to specify a data-list, or have any prefdefined variables... I do not want to turn autocomplete="off" I use dropkick.js to customize all of my &lt;select&gt; dropdowns - and change them into &lt;ul&gt; elements. I am wondering if something like this exists for customizing all the other autofill or autocomplete dropdowns in a similar way. Is this even possible?

http://stackoverflow.com/q/27350545
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27350596
tagged with: css
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43155526
has title: jQuery Accordion alignment within panels
accepted answer: http://stackoverflow.com/a/27350596
tagged with: javascript
has body: I'm having trouble with the placement of the contents within the accordion panels. If you notice, on the 4th panel, the 2nd image is not aligned correctly with the 1st. It's kind of stuck to the bottom of the panel. Essentially, I will be adding 4 images in to each panel along with text below them. I'm just trying to get them to align correctly and I can't seem to figure out hot to do this. I am new to CSS and jQuery so, I'm sure it's something fairly simple that I am missing. I would appreciate any help or assistance you may be able to give me. Thanks for your time. My JSFiddle: http://jsfiddle.net/Del087/CzE3q/988/ #accordion { width:100%; margin:10px auto; border:1px solid black; -webkit-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4); -moz-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4); box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4); } #accordion h2 { clear: both; cursor:pointer; margin:0px 0px; padding:7px 15px; border:1px solid white; background-color:#ff6600; font:bold 22px Petua One; color:#ffffff; text-shadow:0px 1px 0px rgba(0, 0, 0, 0.4); } #accordion .content1 { background-color:#ffffff; padding:10px 15px; color:black; height:150px; width:25%; float:left; } #accordion h2.active { background-color:#000000; } League Scores Pittsburgh Amateur Hockey League Squirt League Standings Pittsburgh Amateur Hockey League Tournament Scores Minnesota Gone Wild" Tournament Standings Minnesota Gone Wild Niagara Sports Tournaments

http://stackoverflow.com/a/27399393
type: Answer
has comment: http://stackoverflow.com/comment/43245627
answers question: http://stackoverflow.com/q/27399208
has comment: http://stackoverflow.com/comment/43244573
has comment: http://stackoverflow.com/comment/43244348
has comment: http://stackoverflow.com/comment/43244778
score: 0
has body: You dont need any each loop in Change function. function change(hrf){ jQuery('.wizard a[data-toggle="tab"].current').removeClass('current'); jQuery('.wizard a[href="#'+hrf+'"]').click(); } Edited Check this code in bootrap $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { e.target // newly activated tab e.relatedTarget // previous active tab }); check : http://getbootstrap.com/javascript/#tabs
has comment: http://stackoverflow.com/comment/43244327

http://stackoverflow.com/q/27381393
type: AnsweredQuestion
has title: Can I get each value based on key from array of objects?
upvote count: 1
has comment: http://stackoverflow.com/comment/43211591
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27381607
tagged with: underscore.js
tagged with: javascript
has answer: http://stackoverflow.com/a/27381451
score: 0
possible better answer: http://stackoverflow.com/a/27381481
has answer: http://stackoverflow.com/a/27381481
favorite count: 0
has answer: http://stackoverflow.com/a/27381607
has answer: http://stackoverflow.com/a/27382197
answer count: 4
has body: I have an array like this: [ { foo: bar, bar: foo, }, { foo: bar, bar: baz, }, { foo: bar, bar: foo, }, ] And I wish to get out an array that looks like this: [foo, baz, foo] Is this possible with pure JS or underscore? I only need to support modern browsers.

google-maps
tags question: http://stackoverflow.com/q/27379655
tag name: google-maps
tags question: http://stackoverflow.com/q/27314704
tags question: http://stackoverflow.com/q/27325315
tags question: http://stackoverflow.com/q/27389740
tags question: http://stackoverflow.com/q/27426210
tags question: http://stackoverflow.com/q/27314161
tags question: http://stackoverflow.com/q/27383556
tags question: http://stackoverflow.com/q/27433511
tags question: http://stackoverflow.com/q/27367859
tags question: http://stackoverflow.com/q/27337799
tags question: http://stackoverflow.com/q/27365920
tags question: http://stackoverflow.com/q/27387535
tags question: http://stackoverflow.com/q/27405028
tags question: http://stackoverflow.com/q/27382006
tags question: http://stackoverflow.com/q/27397962
tags question: http://stackoverflow.com/q/27452755
tags question: http://stackoverflow.com/q/27397606
tags question: http://stackoverflow.com/q/27364532
tags question: http://stackoverflow.com/q/27387865
tags question: http://stackoverflow.com/q/27326703
tags question: http://stackoverflow.com/q/27447331
tags question: http://stackoverflow.com/q/27353435
tags question: http://stackoverflow.com/q/27405268
tags question: http://stackoverflow.com/q/27436806
tags question: http://stackoverflow.com/q/27422425
tags question: http://stackoverflow.com/q/27458097
tags question: http://stackoverflow.com/q/27461555
tags question: http://stackoverflow.com/q/27315722
tags question: http://stackoverflow.com/q/27373600
tags question: http://stackoverflow.com/q/27358065
tags question: http://stackoverflow.com/q/27375173
tags question: http://stackoverflow.com/q/27468033
tags question: http://stackoverflow.com/q/27462371
tags question: http://stackoverflow.com/q/27390535
tags question: http://stackoverflow.com/q/27424830
tags question: http://stackoverflow.com/q/27419509
tags question: http://stackoverflow.com/q/27458649
tags question: http://stackoverflow.com/q/27353044
tags question: http://stackoverflow.com/q/27369410
tags question: http://stackoverflow.com/q/27361233
tags question: http://stackoverflow.com/q/27388445
type: Tag
tags question: http://stackoverflow.com/q/27408252
tags question: http://stackoverflow.com/q/27392333
tags question: http://stackoverflow.com/q/27377731
tags question: http://stackoverflow.com/q/27419463
tags question: http://stackoverflow.com/q/27320846
tags question: http://stackoverflow.com/q/27418311
tags question: http://stackoverflow.com/q/27316804
tags question: http://stackoverflow.com/q/27336909
tags question: http://stackoverflow.com/q/27406234
tags question: http://stackoverflow.com/q/27370290

http://stackoverflow.com/comment/43231599
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27391962
has text: It's a programming question. Updated as such.

http://stackoverflow.com/comment/43305902
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27431718
type: AnswerComment
has text: your code is working. currently testing different scenarios. will report back. :)

http://stackoverflow.com/comment/43359908
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27461728
has text: This is caused by the jQuery unobtrusive ajax plugin. You need to modify it to use `.on()` instead of `.live()`.
type: Comment

http://stackoverflow.com/q/27464625
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
has body: I am trying to use multiple optional parameters with ui-router but it does not seem to work. Below are the tests i did: Single parameter is OK state.url url called state param values /page/:x /page/ $stateParams.x == "" /page/:x /page/2 $stateParams.x == "2" One optional parameter is OK /page/:x? /page/ $stateParams.x == "" /page/:x? /page/2 $stateParams.x == "2" Two parameters are OK (except the ugly double slashes in first case, /page and /page/ turn into /page//. But since the parameters are not optional that's OK) /page/:x/:y /page// $stateParams.x == "" &amp;&amp; $stateParams.y == "" /page/:x/:y /page/2 $stateParams.x == "" &amp;&amp; $stateParams.y == "" /page/:x/:y /page/2/ $stateParams.x == "2" &amp;&amp; $stateParams.y == "" /page/:x/:y /page/2/3 $stateParams.x == "2" &amp;&amp; $stateParams.y == "3" Two optional parameters behaves strange. Second parameters is always undefined and it cannot solve first parameter when I specify the second one. /page/:x?/:y? /page/ $stateParams.x == "" &amp;&amp; $stateParams.y == undefined /page/:x?/:y? /page/2 $stateParams.x == "2" &amp;&amp; $stateParams.y == undefined /page/:x?/:y? /page/2/ $stateParams.x == "" &amp;&amp; $stateParams.y == undefined /page/:x?/:y? /page/2/3 $stateParams.x == "" &amp;&amp; $stateParams.y == undefined
score: 19
type: Question
tagged with: angular-ui-router
tagged with: javascript
has answer: http://stackoverflow.com/a/27493324
accepted answer: http://stackoverflow.com/a/27493324
has title: Multiple optional parameters with angular ui-router
answer count: 1
upvote count: 19

http://stackoverflow.com/a/27360517
has body: What I see from your examples is the difference in the dataType used in the 2 examples. In the C# example you use serviceClient.Headers["Content-type"] = "application/json"; and in the javascript implementation you use contentType: 'application/octet-stream;'. octet-stream should be used for attachments and not JSON objects. The webservice could be validating the request on the content-Type and if the test result is that your request is invalid it can return (and should return) a HTTP 400 - Bad Request. I don't know the webservice where you shoot your requests at and what validations it does but try changing that contenttype in the javascript implementation to contentType: 'application/json;'.
answers question: http://stackoverflow.com/q/27352222
has comment: http://stackoverflow.com/comment/43381634
has comment: http://stackoverflow.com/comment/43196949
score: 0
type: Answer

http://stackoverflow.com/comment/43244595
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27398648
has text: @edduvs Well it depends on the server-side script, but you can write it, so that it starts sending out data while still processing, and the browser will render it as it comes.

http://stackoverflow.com/q/27383435
has body: I'm new to Processing, and I'm attempting to manipulate my rectangle object so the user can drag the mouse to rotate it when the cursor is hovering over its position. However, I'm having trouble positioning a boundary box that both encompasses around my object and rotates correctly along with it. I've been trying a lot of different things attempting to get it to work but to no avail, so any assistance would be greatly appreciated. float bx; float by; int boxSizeX = 150; int boxSizeY = 30; boolean overBox = false; boolean locked = false; float xOffset = 0.0; float yOffset = 0.0; float angle; void setup() { size(800, 600); frameRate(45); bx = width/2.0; by = height/2.0; } void draw() { background(0); pushMatrix(); translate(400, 425); rotate(angle); rect(-25, -15, boxSizeX, boxSizeY); popMatrix(); rect( bx-25, by-15, boxSizeX, boxSizeY); //if (mouseX &gt; bx-boxSizeX &amp;&amp; mouseX &lt; bx+boxSizeX &amp;&amp; mouseY &gt; by-boxSizeY &amp;&amp; mouseY &lt; by+boxSizeY) if( mouseX &gt; bx-25 &amp;&amp; mouseX &lt; bx+25+boxSizeX &amp;&amp; mouseY &gt; by-15 &amp;&amp; mouseY &lt; by+15+boxSizeY) { overBox = true; if(!locked) { stroke(255); fill(153); } } else { stroke(153); fill(153); overBox = false; } } void mousePressed() { if(overBox) { locked = true; fill(255, 255, 255); } else { locked = false; } xOffset = mouseX-bx; yOffset = mouseY-by; } void mouseDragged() { if(locked) { bx = mouseX-xOffset; by = mouseY-yOffset; angle = atan2(mouseY - 400, mouseX - 400); } }
answer count: 1
tagged with: javascript
favorite count: 0
downvote count: 1
has title: Making rotating object draggable
upvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27475252
type: Question
tagged with: processing
score: -1

http://stackoverflow.com/comment/43181310
type: Comment
has text: My bad, I've forgot that this will be in gulp 4, you can see it in [this issue](https://github.com/gulpjs/gulp/issues/96). Will edit my answer
comment on: http://stackoverflow.com/a/27364064
type: AnswerComment
score: 0

http://stackoverflow.com/q/27358738
type: UnansweredQuestion
has body: I am trying to make a stepy-form for my project. What I want to do is I want to submit all my data step by step in stepy-form so I used an AJAX request for this purpose, but When I am trying to save it it's not working. So I used noConflict Method to avoid jQuery conflicts but I still have the same problem. I am using adminEX template And Not getting any error message. So can anyone help me? &lt;script src="ajax/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $.noConflict(); Jquery(document).ready(function(){ $('#stepy_form').click(function(){ $.ajax({ type: 'POST', url: 'ajax/insert_all.php', data: { txtVehicleNo: txtVehicleNo, SltType: SltType, txtPANNumber: txtPANNumber, txtManufacture: txtManufacture, txtModel: txtModel, txtEngineNumber: txtEngineNumber, txtChassisNumber: txtChassisNumber, txtOwnerName: txtOwnerName, txtUnlaidenWt: txtUnlaidenWt, txtGVW: txtGVW // qid: 'form1' }, //alert('hello'); //async: true, //cache: false, success: function(result) { alert('SUCCESS'); //$('#target').html(result); } }); }); }); &lt;/script&gt; And this one is the URL ,insert_all.php $qid = $_POST['qid']; echo $qid;
has title: Ajax not working using jquery url post method
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43169879
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/43169775
has comment: http://stackoverflow.com/comment/43170021
has comment: http://stackoverflow.com/comment/43169785
has comment: http://stackoverflow.com/comment/43169829
score: 0
has comment: http://stackoverflow.com/comment/43169742
tagged with: php
answer count: 1
has comment: http://stackoverflow.com/comment/43169949
has comment: http://stackoverflow.com/comment/43169774
has answer: http://stackoverflow.com/a/27358821

http://stackoverflow.com/comment/43148440
score: 0
comment on: http://stackoverflow.com/q/27336583
type: Comment
type: QuestionComment
has text: So then you propagate the `onClick` to something that’s not the element itself. E.g. the implementation of `ContentAreaHeader` would have ` + ... `.

http://stackoverflow.com/q/27411933
has comment: http://stackoverflow.com/comment/43268363
answer count: 1
tagged with: websocket
favorite count: 0
has comment: http://stackoverflow.com/comment/43271246
upvote count: 2
type: UnansweredQuestion
has title: Scraping data streamed via web-sockets off website using phantomjs or node
has answer: http://stackoverflow.com/a/27412056
tagged with: node.js
tagged with: phantomjs
has body: I want to scrape data off a website. This data is rendered on an HTML Canvas on the website and continually updated. As I understand, one cannot scrape the data off the canvas element since it's more or less a graphic. But the fact remains that this data is being streamed to my browsers so using a headless JavaScript engine such as PhantomJS or NodeJS I ought to be able to get access to the raw data coming off the web socket. I have scraped sites using PhantomJS but I'm unable to find a way to get to this raw data coming via the web socket. I am loading the page using PhantomJS, it get's loaded but obviously the page opens a new connection to connect to the web socket on the origin server and starts receiving a feed. How can my PhantomJS script hook into it? Thanks.
score: 1
tagged with: web-scraping
downvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/27441737
has comment: http://stackoverflow.com/comment/43325119
has comment: http://stackoverflow.com/comment/43325026
score: 0
has comment: http://stackoverflow.com/comment/43324305
type: Answer
has comment: http://stackoverflow.com/comment/43324951
has comment: http://stackoverflow.com/comment/43324158
has body: Try this, no need to plugin, use scrolltop: (function(){ var wsSrollTop = $(window).scrollTop(); var offsetTopLimit = 0; if ($(window).scrollTop() &gt;= offsetTopLimit) { $('#menu2').fadeOut(); }; })() You need to call it also in scrolling the window. Here is the UPDATED fiddle.
answers question: http://stackoverflow.com/q/27441588

http://stackoverflow.com/a/27433095
has comment: http://stackoverflow.com/comment/43307380
answers question: http://stackoverflow.com/q/27433014
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27433014
has comment: http://stackoverflow.com/comment/43307363
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43307551
has body: You'll need to use the literal syntax for regular expression in JavaScript, like so: content = content.replace(/\&lt;(.*?)\&gt;\-&amp;gt;(.+)&amp;lt;\-\&lt;\/(.+)\&gt;/gi, '&lt;$1 style="text-align:center;"&gt;$2&lt;/$3&gt;'); Note that the gi at the end of the regular expression simply enables global searching (that is, replace all occurrences matching the pattern) and case-insensitive matching. They are both technically optional, but you will most likely want the g flag enabled for certain. However, keeping the i flag is up to you (depends on whether or not your content contains &amp;GT;, for example).
type: Answer

http://stackoverflow.com/q/27320492
tagged with: mongodb
answer count: 2
tagged with: mongoose
tagged with: javascript
has title: iterate through mongodb entry javascript node
score: 0
has comment: http://stackoverflow.com/comment/43112670
possible better answer: http://stackoverflow.com/a/27321157
has answer: http://stackoverflow.com/a/27320744
accepted answer: http://stackoverflow.com/a/27320744
has comment: http://stackoverflow.com/comment/43104864
has body: I am trying to iterate through a doc during my update function User.prototype.update = function(user, done){ this.model.findOne({_id:user._id}, function(err, doc){ console.log(doc); for(var i in doc){ if(user[i] != undefined &amp;&amp; user[i] != doc[i]){ console.log('this value', i, user[i], user[i] === doc[i], doc[i]); doc[i] = user[i]; } } console.log(doc[i]); //doc.save(done); }); } however doing this catches all the functions that the model has added to the object such as _save, _done, _events, and many other fields that i dont care to check. I also tried adding a if(user.hasOwnProperty(i)) but that doesnt work. UPDATE: this is working pretty nicely if anyone sees a better way to go about it let me know User.prototype.update = function(user, done){ this.model.findOne({_id:user._id}, function(err, doc){ for(var i in doc._doc){ if(user[i] &amp;&amp; user[i] != doc[i]) doc[i] = user[i] } doc.save(done); }); }
has answer: http://stackoverflow.com/a/27321157
tagged with: node.js
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/43148985
has text: Also why is my circle pushed to the right?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27346755
type: QuestionComment

http://stackoverflow.com/a/27318914
has comment: http://stackoverflow.com/comment/43097778
type: Answer
has body: try the this keyword. Just make sure you use it properly.
has comment: http://stackoverflow.com/comment/43097209
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/27318669
score: 0

http://stackoverflow.com/q/27352565
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43164923
tagged with: slide
upvote count: 1
has body: I'm using AJAX to load pages into a div main_content wrapped in div main. I.e., only the content in the main_content div changes. This is done with a regular javascript function. The site has a static menu bar and about 10-15 pages. What I want to do is when the loadPage() function is called, slide the new page in from the left and the current (soon-to-be OLD) page out to the right, like a continuous scroll. I don't necessarily want to "preload" all the pages behind the scenes. I have searched and searched and cannot find anything that will help me do this exact thing. I'd appreciate any help anyone can give me. I'd really prefer not to use jQuery if it is possible.
type: Question
has comment: http://stackoverflow.com/comment/43188840
downvote count: 0
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/43188885
has title: ajax page load and sliding divs across page
tagged with: http://stackoverflow.com/tag/html
score: 1
tagged with: css

http://stackoverflow.com/comment/43352289
type: QuestionComment
comment on: http://stackoverflow.com/q/27456782
score: 0
has text: How this markup is generated? Why don't you in first place use a LABEL? BTW, `type` attribute isn't valid attribute for DIV element. In jQuery, this would work: `$('table div[type=label]').replaceWith(' ');`
type: Comment

http://stackoverflow.com/q/27440475
tagged with: equivalent
tagged with: php
has answer: http://stackoverflow.com/a/27441134
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27441263
has title: JavaScript equivalent of PHP $array[$i][]
type: Question
has body: I have a problem with the creation of a multidimensional array in JavaScript. The PHP code looks like this: &lt;?php $matches = array(1, 2, 3, 4, 4, 4, 6, 6, 2, 3); foreach($matches as $match) { $levels[$match][] = $match; } print_r($levels); ?&gt; print_r of $levels: levels[1][0] = 1 levels[2][0] = 2 levels[3][0] = 3 levels[4][0] = 4 levels[4][1] = 4 levels[4][2] = 4 levels[6][0] = 6 levels[6][1] = 6 levels[2][1] = 2 levels[3][1] = 3 I have a problem with the creation the same array in JavaScript. &lt;script&gt; var levels = []; $([1, 2, 3, 4, 4, 4, 6, 6, 2, 3]).each(function(key, value) { levels[value][] = value; }); &lt;/script&gt; Can someone help me create the same array in JavaScript?
accepted answer: http://stackoverflow.com/a/27440568
upvote count: 2
answer count: 3
possible better answer: http://stackoverflow.com/a/27441263
has answer: http://stackoverflow.com/a/27440568
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: multidimensional-array

http://stackoverflow.com/q/27421890
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27426358
favorite count: 0
tagged with: kendo-ui
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/27426358
has body: I'm trying to display a pop up window when a user clicks on a button but I cant seem to get this to work. I can fire the event when using a custom command but I need a textbox and button next to each other in the same column. Any ideas why this isn't working? @(Html.Kendo().Grid(Model) .Name("gridPopup") .Columns(columns =&gt; { columns.Bound(p =&gt; p.ProductName).Width(120); columns.Template(@&lt;text&gt;&lt;/text&gt;).Title("").Width(110).ClientTemplate( Html.Kendo().TextBox() .Name("search_textfield") .Value("").ToClientTemplate().ToString() + " " + Html.Kendo().Button() .Name("search_button") .HtmlAttributes(new { type = "button", @class = "k-primary" }) .Events(e =&gt; e.Click("SearchButton") ) .Content("...").ToClientTemplate().ToString() ); }) .Editable(editable =&gt; editable.Mode(GridEditMode.InCell)) .Pageable() .Scrollable() .HtmlAttributes(new { style = "height:320px;" }) .DataSource(dataSource =&gt; dataSource .Ajax() .Batch(true) .PageSize(20) .ServerOperation(false) .Events(events =&gt; events.Error("errorHandler")) .Model(model =&gt; { model.Id(p =&gt; p.ProductID); model.Field(p =&gt; p.ProductID).Editable(true); model.Field(p =&gt; p.CategoryID).DefaultValue(1); }) .Read(read =&gt; read.Action("ForeignKeyColumn_Read", "Home")) .Update(update =&gt; update.Action("ForeignKeyColumn_Update", "Home")) .Create(create =&gt; create.Action("ForeignKeyColumn_Create", "Home")) .Destroy(destroy =&gt; destroy.Action("ForeignKeyColumn_Destroy", "Home")) ) ) &lt;script type="text/javascript"&gt; function errorHandler(e) { if (e.errors) { var message = "Errors:\n"; $.each(e.errors, function (key, value) { if ('errors' in value) { $.each(value.errors, function () { message += this + "\n"; }); } }); alert(message); } } function SearchButton(e) { alert("Search Button Clicked"); } &lt;/script&gt;
type: Question
score: 3
tagged with: kendo-grid
tagged with: javascript
has title: client template button event not firing

http://stackoverflow.com/comment/43334597
has text: also these have the same result too. window.onload = function () { $("#txtPhone").mask("0(999) 999-99-99"); }; document.addEventListener('DOMContentLoaded', function () { $("#txtPhone").mask("0(999) 999-99-99"); });
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27428374
type: AnswerComment

http://stackoverflow.com/q/27346894
type: AnsweredQuestion
has title: Get properties of an object from a function inside this object
accepted answer: http://stackoverflow.com/a/27346932
has body: Assume I have an object and an example of how I would like to get a property height from this object inside a function that is inside the object too: function Chart(element) { return { width: element.clientWidth, height: 400, loadLegend: function (data) { doSomething(this.height) } } }; This code doesn't work, as it's just an illustration to what I need to achieve. Please advise how I can get that property from the function?
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27346932
tagged with: javascript

http://stackoverflow.com/comment/43307856
type: Comment
has text: @crockz That worked! but the one problem I have is it is always displayed in the upper left hand corner of the chart. How do I make it appear next to each circle when I mouse over?
score: 0
comment on: http://stackoverflow.com/q/27411927
type: QuestionComment

http://stackoverflow.com/comment/43356139
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27456749
type: Comment
has text: Yes; it's much easier to run into problems with recursion in this instance. It would be better to use `setInterval`, but only do so the first time the user clicks the button. Otherwise, you could end up with multiple recursions (based on multiple clicks), leading to a bad user experience or even crashes.

functional-programming
tags question: http://stackoverflow.com/q/27460477
tag name: functional-programming
type: Tag
tags question: http://stackoverflow.com/q/27318062

http://stackoverflow.com/comment/43138953
comment on: http://stackoverflow.com/a/27341528
has text: oops i got a typo thanx but still after editing its still not getting
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43255578
comment on: http://stackoverflow.com/a/27360731
score: 0
type: AnswerComment
has text: I think this is with the way your Table is rendered in DOM. It will be good if you can share the code rendering in DOM of your table cell. Can you please try the following Change in the line var titleVal = row.cells[0] --- To ----- var titleVal = row.cells[0].innerhtml
type: Comment

http://stackoverflow.com/comment/43130798
has text: And if all you want to do is create a single chart that has a couple of line charts and a bar chart, plain old D3.js is all you need.
score: 1
comment on: http://stackoverflow.com/q/27337026
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27373353
accepted answer of: http://stackoverflow.com/q/27372912
has body: Use $parent.var_name in ng model , as ng switch creates it seperate scope , and the variable will be restricted to it if its not explicitly defined outside the scope by ng-init or something(in the controller)
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27372912

http://stackoverflow.com/q/27465866
has comment: http://stackoverflow.com/comment/43367816
score: 0
has comment: http://stackoverflow.com/comment/43367927
answer count: 0
has comment: http://stackoverflow.com/comment/43367899
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43367962
has comment: http://stackoverflow.com/comment/43368030
has comment: http://stackoverflow.com/comment/43367835
has comment: http://stackoverflow.com/comment/43367976
has body: I can't access an hidden alert after dynamically appended from another file with jquery load function. I also appended '#addMovie' button dynamically and learned that I can trigger it with 'on' function, but I cant do same thing on '#alertSuccess' because it has no events like 'click' to use with 'on' function, it is hidden and it will be visible automatically. 1) How can I update this DOM without 'events' but using 'on' function ? or 2) Can I trigger and show this element without 'on' function ? or 3) Can I update all DOM's after appended and use them with .click function like other existing elements, so I don't need on('click'...) functions anymore ? // Both '#addMovie' and '#alertSuccess' appended dynamically // into '#searchMovieDiv' element. $('#searchMovieDiv').on('click', '#addMovie', function(e){ // can trigger this with 'on' .... .... $('#alertSuccess').show(); // can't trigger this with 'on' cause // it has no events, will be visible without condition .... .... } // Appended alert Movie added
tagged with: javascript
tagged with: jquery
has title: Use dynamically appended elements with 'on' function without 'events'

http://stackoverflow.com/comment/43304054
type: Comment
type: QuestionComment
has text: Spending a little time learning Javascript will pay off in spades!
comment on: http://stackoverflow.com/q/27431383
score: 0

http://stackoverflow.com/comment/43329978
has text: Please try to understand the doc before posting this kind of questions (http://api.jquery.com/jquery.ajax/)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27445351

http://stackoverflow.com/comment/43145391
comment on: http://stackoverflow.com/q/27345071
score: 0
type: Comment
has text: You may find the javascript `parseFloat` function useful.
type: QuestionComment

http://stackoverflow.com/q/27462453
favorite count: 0
has comment: http://stackoverflow.com/comment/43361196
has comment: http://stackoverflow.com/comment/43361262
has comment: http://stackoverflow.com/comment/43361579
has comment: http://stackoverflow.com/comment/43361212
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27462661
has comment: http://stackoverflow.com/comment/43361226
has comment: http://stackoverflow.com/comment/43361410
has comment: http://stackoverflow.com/comment/43361356
score: -4
has comment: http://stackoverflow.com/comment/43361437
has title: HTML 5 dataset issue
upvote count: 1
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27462661
tagged with: tags
downvote count: 5
has comment: http://stackoverflow.com/comment/43361274
has body: Can anyone tell me why the following line of code throws and error $('#id').dataset.assoc and these two do not? $('#id').data("assoc") $('#id').dataset.file_id Is it something to do with the word assoc?
has comment: http://stackoverflow.com/comment/43361326
has comment: http://stackoverflow.com/comment/43361185
has comment: http://stackoverflow.com/comment/43361513
answer count: 1
tagged with: javascript
tagged with: jquery

graphics
tag name: graphics
tags question: http://stackoverflow.com/q/27353745
type: Tag
tags question: http://stackoverflow.com/q/27376332
tags question: http://stackoverflow.com/q/27428182

http://stackoverflow.com/comment/43381540
type: Comment
comment on: http://stackoverflow.com/q/27473450
type: QuestionComment
score: 2
has text: It might help if you would add some explanation as to *why* you don't want to give the function a name.

http://stackoverflow.com/q/27424325
has comment: http://stackoverflow.com/comment/43290694
has body: in my example i want to simulate jquery.each method as I created JQueryX object that can select with class selector JQueryX(.classname) and adds it to its property selection which is an array now i'm stuck with the line console.log(this, 'i was clicked'); where this returns the window object var x = new JQueryX('.drg'); x.each(function() { console.log(this); this.addEventListener("click", function () { console.log(this, 'i was clicked'); }); }); JQueryX.prototype.each = function (func,paras){ paras = paras || []; for(var i=0; i&lt;this.selection.length; i++) { var that = this.selection[i]; console.log(that); func.apply(that,paras); } }; and the strange thing for me is this returns the object I want if i called it from the line console.log(this);
accepted answer: http://stackoverflow.com/a/27424361
has comment: http://stackoverflow.com/comment/43290727
type: AnsweredQuestion
has title: this returns window object
tagged with: oop
downvote count: 3
score: -1
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27424361
tagged with: jquery
has comment: http://stackoverflow.com/comment/43290577
has comment: http://stackoverflow.com/comment/43290612
has comment: http://stackoverflow.com/comment/43290614
has comment: http://stackoverflow.com/comment/43290657
favorite count: 0
upvote count: 2

http://stackoverflow.com/q/27322622
possible better answer: http://stackoverflow.com/a/34788986
has title: Angular.js paginate filtered data and display total items without duplicating code in view/controller
downvote count: 0
has comment: http://stackoverflow.com/comment/43104753
has comment: http://stackoverflow.com/comment/43114012
tagged with: javascript
linked to: http://stackoverflow.com/q/15316363
has comment: http://stackoverflow.com/comment/43115617
has comment: http://stackoverflow.com/comment/43105671
favorite count: 0
has comment: http://stackoverflow.com/comment/43105843
has comment: http://stackoverflow.com/comment/43105608
has comment: http://stackoverflow.com/comment/45945911
tagged with: angularjs
has answer: http://stackoverflow.com/a/34788986
has comment: http://stackoverflow.com/comment/43105392
upvote count: 1
has comment: http://stackoverflow.com/comment/43105793
has comment: http://stackoverflow.com/comment/45945902
has comment: http://stackoverflow.com/comment/45945891
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45945906
score: 1
linked to: http://stackoverflow.com/q/14302267
has comment: http://stackoverflow.com/comment/43105961
has comment: http://stackoverflow.com/comment/43108083
type: Question
has comment: http://stackoverflow.com/comment/43106160
answer count: 2
has answer: http://stackoverflow.com/a/27323195
accepted answer: http://stackoverflow.com/a/27323195
has body: Let's say I have a filter implemented in a view like this: &lt;input data-ng-model="statementFilter" /&gt; &lt;ul&gt; &lt;li data-ng-repeat="statement in statements | filter: statementFilter"&gt; {{ statement.Name }} &lt;/li&gt; &lt;/ul&gt; This will do a case insensitive partial match for statements with any properties that contain statementFilter. I need to implement this in my controller instead of in my view. I understand you can create custom filters in Angular, but I want my filter to do the generic case insensitive partial matching on any complex object that the built-in Angular filter in the view does. If I create a custom filter, I have to do the actually filtering using javascript which will require another library AFAIK. How can I leverage the generic case insensitive partial matching that comes with Angular's "view" filter in code? Thanks UPDATE Here is a Plunker of what I'm trying to do.

http://stackoverflow.com/q/27429454
accepted answer: http://stackoverflow.com/a/27429610
type: AnsweredQuestion
type: Question
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27430128
has body: What I am trying to do is update the box-ordinal-group property of a specific element to change its order in the page but it doesn't work somehow. My first thought was "is it read only?" but couldn't find anything to support that thought on w3.org. So, any idea? You can see and test my approach below; function get_random_int(min, max){ return Math.floor(Math.random() * (max - min) + min); } var button = $("#btn"); button.on('click', function(){ var rand_order = get_random_int(1,4); var el = $("#blockA"); console.log(rand_order); el.css("-webkit-box-ordinal-group", rand_order); el.css("-mox-box-ordinal-group", rand_order); el.css("box-ordinal-group", rand_order); console.log(el.css("-webkit-box-ordinal-group")); }); #blockContainer > div { border: 1px dashed #f0f } #blockContainer { display: -webkit-box; display: -moz-box; display: box; -webkit-box-orient: vertical; -moz-box-orient: vertical; box-orient: vertical; } #blockA { -webkit-box-ordinal-group: 2; -moz-box-ordinal-group: 2; box-ordinal-group: 2; order: 2 } #blockB { -webkit-box-ordinal-group: 1; -moz-box-ordinal-group: 1; box-ordinal-group: 1; order: 1 } Block A Block B Block C test
has answer: http://stackoverflow.com/a/27430128
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27429610
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Can't change box-ordinal-group CSS property with Javascript

http://stackoverflow.com/q/27404932
has comment: http://stackoverflow.com/comment/43254751
has body: I'm trying to hide and show the contact form (using display:"none" and display:"block") when clicking the button "click me!". I've tried multiple javascript and jquery examples but none of them seem to work for me. It would be nice if the form would slide in and out under the click me button. Can someone help me? Visit this link to see my code http://jsfiddle.net/jm2o73f2/9/ function myFunction() { var x = document.getElementById("hidden"); x.style. } body, img, ul, li, div, input, textarea { margin:0; padding:0; } #footer { width:100%; background:#CCC; clear:both; margin-bottom:-20px; } #footer img { cursor:pointer; } #footer ul { list-style:none; width:250px; padding-top:10px; margin: 0 auto; text-align:center; } #footer #contact { width:400px; margin:auto; display:block; background:white; text-align:left; } #footer #contact textarea { width:250px; resize:none; } #footer #contact input { width:250px; margin: 5px 0; } #footer #contact input[type="submit"] { width:100px; cursor:pointer; } Vragen? Stuur ons gerust een email. Click Me!
downvote count: 0
has comment: http://stackoverflow.com/comment/43254802
favorite count: 0
accepted answer: http://stackoverflow.com/a/27405036
has comment: http://stackoverflow.com/comment/43254690
has comment: http://stackoverflow.com/comment/43254575
type: AnsweredQuestion
has title: Javascript and jQuery hide and show not working
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43254657
has answer: http://stackoverflow.com/a/27405036
possible better answer: http://stackoverflow.com/a/27405093
has comment: http://stackoverflow.com/comment/43255002
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27405118
has answer: http://stackoverflow.com/a/27405093
answer count: 3

http://stackoverflow.com/comment/43142346
has text: why do you enclose GET in tags and quotes?
type: Comment
comment on: http://stackoverflow.com/q/27343434
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43149127
score: 2
has text: @Johan `"` and `'` or even no quotes at all (in this case) are equivalent.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27347132

http://stackoverflow.com/comment/43293454
type: Comment
type: QuestionComment
score: 0
has text: In your REST call what do you pass into `id` if you assume data creation?
comment on: http://stackoverflow.com/q/27425717

http://stackoverflow.com/comment/43159510
score: 0
type: Comment
type: QuestionComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/66380/discussion-between-nikhita-and-wayne-ellery).
comment on: http://stackoverflow.com/q/27352590

http://stackoverflow.com/q/27350231
has comment: http://stackoverflow.com/comment/43155154
has answer: http://stackoverflow.com/a/27350397
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43154973
has answer: http://stackoverflow.com/a/27393911
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43155101
has title: Get text between tags in iFrame
tagged with: iframe
possible better answer: http://stackoverflow.com/a/27350397
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43154990
has body: I'm loading the website inside of an iFrame. I'm trying to get the text between <carrier_name> and </carrier_name> and display that inside of a textbox. This is my HTML This is my javascript $('button[name="otherlistbut"]').click(function() { var phonenum = $('input[name="phonenum"]').val(); $(".frameComp").fadeIn(); window.open("https://api.data24-7.com/v/2.0?user=USERNAME&pass=PASSWORD&api=C&p1=" + "1" + phonenum, "frameComp"); var message = $('textarea[name="message"]').val(); message == $('.frameComp').contents().find("carrier_name").html(); }); This is the source code of the website <?xml version="1.0" ?> OK 13105555555 y <carrier_name>Verizon Wireless</carrier_name> <carrier_id>5</carrier_id> United States
type: Question
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/27393911

http://stackoverflow.com/comment/43428243
type: Comment
has text: I have posted new code.This one is perfect.You can change the values shape and color. :-) the code is available at my website http://vitideas.in/web/newcode/ ,try to upvote my code please.
type: AnswerComment
comment on: http://stackoverflow.com/a/27457416
score: 0

animation
tags question: http://stackoverflow.com/q/27427679
tags question: http://stackoverflow.com/q/27355315
tags question: http://stackoverflow.com/q/27349415
tags question: http://stackoverflow.com/q/27379866
tags question: http://stackoverflow.com/q/27378827
tags question: http://stackoverflow.com/q/27342260
tags question: http://stackoverflow.com/q/27428051
type: Tag
tags question: http://stackoverflow.com/q/27436786
tags question: http://stackoverflow.com/q/27462306
tags question: http://stackoverflow.com/q/27454229
tag name: animation
tags question: http://stackoverflow.com/q/27383979
tags question: http://stackoverflow.com/q/27368653
tags question: http://stackoverflow.com/q/27354606
tags question: http://stackoverflow.com/q/27409204
tags question: http://stackoverflow.com/q/27381596
tags question: http://stackoverflow.com/q/27358913
tags question: http://stackoverflow.com/q/27463090
tags question: http://stackoverflow.com/q/27443708
tags question: http://stackoverflow.com/q/27430772
tags question: http://stackoverflow.com/q/27364678
tags question: http://stackoverflow.com/q/27346755
tags question: http://stackoverflow.com/q/27404314
tags question: http://stackoverflow.com/q/27382991
tags question: http://stackoverflow.com/q/27462442
tags question: http://stackoverflow.com/q/27362787
tags question: http://stackoverflow.com/q/27434803
tags question: http://stackoverflow.com/q/27404535
tags question: http://stackoverflow.com/q/27416149
tags question: http://stackoverflow.com/q/27463085
tags question: http://stackoverflow.com/q/27414145
tags question: http://stackoverflow.com/q/27342877

node.js
tags question: http://stackoverflow.com/q/27322410
tags question: http://stackoverflow.com/q/27391788
tags question: http://stackoverflow.com/q/27447813
tags question: http://stackoverflow.com/q/27454575
tags question: http://stackoverflow.com/q/27369863
tags question: http://stackoverflow.com/q/27392907
tags question: http://stackoverflow.com/q/27347239
tags question: http://stackoverflow.com/q/27462408
tags question: http://stackoverflow.com/q/27381104
tags question: http://stackoverflow.com/q/27436370
tags question: http://stackoverflow.com/q/27389523
tags question: http://stackoverflow.com/q/27369534
tags question: http://stackoverflow.com/q/27441803
tags question: http://stackoverflow.com/q/27423776
tags question: http://stackoverflow.com/q/27424886
tags question: http://stackoverflow.com/q/27336489
tags question: http://stackoverflow.com/q/27412409
tags question: http://stackoverflow.com/q/27344650
tags question: http://stackoverflow.com/q/27404102
tags question: http://stackoverflow.com/q/27433051
tags question: http://stackoverflow.com/q/27471248
tags question: http://stackoverflow.com/q/27441799
tags question: http://stackoverflow.com/q/27427358
tags question: http://stackoverflow.com/q/27315779
tags question: http://stackoverflow.com/q/27381323
tags question: http://stackoverflow.com/q/27349204
tags question: http://stackoverflow.com/q/27450382
tags question: http://stackoverflow.com/q/27387620
tags question: http://stackoverflow.com/q/27315814
tags question: http://stackoverflow.com/q/27465023
tags question: http://stackoverflow.com/q/27383740
tags question: http://stackoverflow.com/q/27371554
tags question: http://stackoverflow.com/q/27392679
tags question: http://stackoverflow.com/q/27438258
tags question: http://stackoverflow.com/q/27449970
tags question: http://stackoverflow.com/q/27377429
tags question: http://stackoverflow.com/q/27425131
tags question: http://stackoverflow.com/q/27425003
tags question: http://stackoverflow.com/q/27468188
tags question: http://stackoverflow.com/q/27432444
tags question: http://stackoverflow.com/q/27398817
tags question: http://stackoverflow.com/q/27451936
tags question: http://stackoverflow.com/q/27460658
tags question: http://stackoverflow.com/q/27447869
tags question: http://stackoverflow.com/q/27469885
tags question: http://stackoverflow.com/q/27415400
tags question: http://stackoverflow.com/q/27343545
tags question: http://stackoverflow.com/q/27468703
tags question: http://stackoverflow.com/q/27435797
tags question: http://stackoverflow.com/q/27347856
tags question: http://stackoverflow.com/q/27436167
tags question: http://stackoverflow.com/q/27426081
tags question: http://stackoverflow.com/q/27435004
tags question: http://stackoverflow.com/q/27473780
tags question: http://stackoverflow.com/q/27472608
tags question: http://stackoverflow.com/q/27369414
tags question: http://stackoverflow.com/q/27352389
tags question: http://stackoverflow.com/q/27363444
tags question: http://stackoverflow.com/q/27329845
tags question: http://stackoverflow.com/q/27364624
tags question: http://stackoverflow.com/q/27387002
tags question: http://stackoverflow.com/q/27432868
tags question: http://stackoverflow.com/q/27465760
tags question: http://stackoverflow.com/q/27445793
tags question: http://stackoverflow.com/q/27459966
tags question: http://stackoverflow.com/q/27366980
tags question: http://stackoverflow.com/q/27447478
tags question: http://stackoverflow.com/q/27349252
tags question: http://stackoverflow.com/q/27375353
tags question: http://stackoverflow.com/q/27341729
tags question: http://stackoverflow.com/q/27465850
tags question: http://stackoverflow.com/q/27368083
tags question: http://stackoverflow.com/q/27451846
tags question: http://stackoverflow.com/q/27441378
tags question: http://stackoverflow.com/q/27388168
tags question: http://stackoverflow.com/q/27473960
tags question: http://stackoverflow.com/q/27330309
tags question: http://stackoverflow.com/q/27374293
tags question: http://stackoverflow.com/q/27332555
tags question: http://stackoverflow.com/q/27339545

http://stackoverflow.com/q/27463220
score: -1
tagged with: forms
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43362686
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27463370
favorite count: 0
has title: Validate form input using JavaScript
has comment: http://stackoverflow.com/comment/43362729
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27463274
has body: I am trying to validate 3 form inputs and based on this I want to display either a success page or a failure page. I must do this using JavaScript. I have this so far: Name: Email: Your Message My JavaScript file: // JavaScript Document //form validation function validateForm() { //name check var name = document.getElementById("name").value; var nameLength = name.length; //get length of string stored in name //email - ref http://www.w3schools.com/js/js_form_validation.asp var email = document.getElementById("usremail").value; var atpos = email.indexOf("@"); //gets position of the @ symbol in the string var dotpos = email.lastIndexOf("."); //gets position of the last dot in the string //message - same method as name validation var message = document.getElementById("comments").value; var messageLength = message.length; if (name.length < 3) { alert("Make sure all fields are filled in correctly"); return false; } else if (atpos < 1 || dotpos<atpos+2 || dotpos+ 2 >= email.length) { alert("Make sure all fields are filled in correctly"); return false; } else if (messageLength < 20) { alert("Make sure all fields are filled in correctly"); return false; } else { return true; } } The problem is when I run the code and submit the form - no matter what I input - nothing happens.
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/comment/43099313
score: 0
comment on: http://stackoverflow.com/a/27320009
type: AnswerComment
type: Comment
has text: The problem is my second promise already returns a value (res2).

http://stackoverflow.com/comment/43205564
type: QuestionComment
comment on: http://stackoverflow.com/q/27374380
score: 0
type: Comment
has text: Maybe the following answer can help you understand about inheritance, prototype, constructor functions and mix ins: http://stackoverflow.com/questions/16063394/prototypical-inheritance-writing-up/16063711#16063711

http://stackoverflow.com/comment/60333167
type: Comment
has text: @Michael I understand your concern, but take note that it's a videostream, not a photostream. There are no phones or webcams that go any higher than 4K just yet.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27444179

http://stackoverflow.com/comment/43232486
has text: It's preferable to either use CSS or requestAnimationFrame when animating HTML objects.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27374521

http://stackoverflow.com/comment/43291874
type: Comment
type: QuestionComment
has text: Yes, you're right. Changed to class but even though it is not working.
comment on: http://stackoverflow.com/q/27424687
score: 0

http://stackoverflow.com/a/27440980
upvote count: 2
has body: You will need to find the value in the DOM and then store in your hidden input field. var outputValue=document.getElementById("id-of-html-tag-where-output-value-is").innerHTML; document.getElementById("id-of-hidden-input-field").value=outputValue; You should do this on form submit.
type: Answer
has comment: http://stackoverflow.com/comment/43324933
has comment: http://stackoverflow.com/comment/43323353
score: 2
has comment: http://stackoverflow.com/comment/43323566
downvote count: 0
answers question: http://stackoverflow.com/q/27440459

http://stackoverflow.com/a/27467712
has comment: http://stackoverflow.com/comment/43374029
accepted answer of: http://stackoverflow.com/q/27467461
type: Answer
answers question: http://stackoverflow.com/q/27467461
downvote count: 1
has comment: http://stackoverflow.com/comment/43373956
score: 1
upvote count: 2
type: AcceptedAnswer
has body: Your PHP include is absolute. It begins with a / and therefore it'll look in the root (the up most path) and tries to traverse down. Change it to a relative one or the correct absolute one and a it'll work
has comment: http://stackoverflow.com/comment/43371105

http://stackoverflow.com/comment/43121313
has text: Not good enough.... 1. requestAnimationFrame worked great on desktop, however android stock Browser does not support it on my JellyBean phone. 2. Will window.onload be called again when only switching back? I think it is called only when the page loads for the first time.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27331300

http://stackoverflow.com/a/27348349
downvote count: 0
answers question: http://stackoverflow.com/q/27348146
has comment: http://stackoverflow.com/comment/43152544
has comment: http://stackoverflow.com/comment/43163727
accepted answer of: http://stackoverflow.com/q/27348146
score: 1
has comment: http://stackoverflow.com/comment/43153092
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43151432
upvote count: 1
has body: markers is an array(which doesn't have a method setMap) You must iterate over this array and call the method setMap for each item(marker).
type: Answer

http://stackoverflow.com/comment/43232881
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27392688
has text: oh ok, I'll try that now.

http://stackoverflow.com/a/27436760
has body: Try with following coding snippet setInterval(function(){ var title = document.title; document.title = (title == "test" ? "none" : "test"); }, 1000); Use document.title = ... You are just editing an attribute which does nothing.
answers question: http://stackoverflow.com/q/27436673
score: 1
accepted answer of: http://stackoverflow.com/q/27436673
has comment: http://stackoverflow.com/comment/43314154
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43314264
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43178738
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27363358
has text: Stop those typeof your_var === 'undefined' checks. Do not use undefined at all, it is confusing. Go with your_var == null which checks for null OR undefined.

http://stackoverflow.com/q/27395926
has body: I am using following get service .. fieldServices.factory('serverField', ['$resource', function($resource){ return { particularField : $resource('http://localhost:8080/Omniview/rest/fields/:fieldId', {}, { get: {method:'GET', isArray:false} }) }; }]); Here is my controller to use the get data : $scope.allFields; serverField.fieldList.get(function(data){ //console.log(data); $scope.allFields=data; }); console.log($scope.allFields); In above case It is giving me undefined as allFields is not set with data but in below case: $scope.allFields; serverField.fieldList.get(function(data){ //console.log(data); $scope.allFields=data; }); setTimeout(function(){ console.log($scope.allFields); },1000) ; It is giving me the correct object .I don't know why .Can someone explain me why it is happening and how do I get rid of it.
type: AnsweredQuestion
tagged with: angular-ui
has title: Get request returning object with time delay
has answer: http://stackoverflow.com/a/27395989
tagged with: angularjs
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27395989
score: 0
possible better answer: http://stackoverflow.com/a/27396200
has answer: http://stackoverflow.com/a/27396200
tagged with: angularjs-directive
tagged with: javascript
tagged with: angularjs-scope

http://stackoverflow.com/comment/43372318
has text: @DaggNabbit: Yeah, the string would need to be properly escaped like JSON.
comment on: http://stackoverflow.com/a/27468506
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43234845
type: QuestionComment
has text: ah yeah, that one http://impactjs.com/forums/impact-engine/bug-in-function-bind
score: 0
comment on: http://stackoverflow.com/q/27393364
type: Comment

http://stackoverflow.com/a/27325429
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27324235
has comment: http://stackoverflow.com/comment/43122443
has body: You can't access elements within &lt;template if="{{..}}"&gt; or &lt;template repeat="{{..}}"&gt; (dynamically created) using the $ accessor. You need to use querySelector(...) and you can the field only when the if expression evaluates to true (the element is actually created/shown)
has comment: http://stackoverflow.com/comment/43123389
has comment: http://stackoverflow.com/comment/43122525
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43123349
accepted answer of: http://stackoverflow.com/q/27324235

http://stackoverflow.com/comment/43203652
has text: `i am trying to put this in a text area...`
type: Comment
comment on: http://stackoverflow.com/q/27376876
type: QuestionComment
score: 0

http://stackoverflow.com/a/27319104
upvote count: 5
answers question: http://stackoverflow.com/q/27319043
has body: I want to print the content of an array in one alert-statement. No need for a loop. Just use .join() to create a string separated by a newline character (or whatever character(s) you want). alert("Here your great content of myArray:\n" + myArray.join("\n")); And FYI, in ECMAScript 6, you'll be able to do this: alert("Here your great content of myArray:\n" + [for (s of myArray) s + "\n"].join("")); This can be handy for more complex situations.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27319043
score: 5

http://stackoverflow.com/a/27418530
has body: That's basic CSS. Nothing to do with the plugin itself. You have to use a fixed position for it... If you want to apply it exactly as in the fullPage.js demo, then: #mymenu{ position: fixed; top: 0; left: 0; height: 40px; z-index: 70; width: 100%; padding: 0; margin: 0; }
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27415395
answers question: http://stackoverflow.com/q/27415395

http://stackoverflow.com/comment/43250200
has text: I know but nothing happens there is no scrollbar ... Chrome
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27402461

http://stackoverflow.com/a/75217324
answers question: http://stackoverflow.com/q/27453617
score: 0
has body: You can check if any element is within a shadowDOM by doing: /** element can be any HTMLELement or Node **/ const root = element &amp;&amp; element.getRootNode(); const isOnShadowDOM = root instanceof ShadowRoot; The first line tell us which is the root parent of any element. For example, a lightDOM element will have the root commonly as #document whiled a shadowed one will have the root as #shadow-root. The second line tell us if this root is a shadowDOM. Here we simply check if the root element is a stance of ShadowRoot, if yes our const will be true, otherwise false.
type: Answer

canvas
tags question: http://stackoverflow.com/q/27415609
tags question: http://stackoverflow.com/q/27431563
tags question: http://stackoverflow.com/q/27459535
tags question: http://stackoverflow.com/q/27401447
tags question: http://stackoverflow.com/q/27331110
tags question: http://stackoverflow.com/q/27353622
tags question: http://stackoverflow.com/q/27432679
tags question: http://stackoverflow.com/q/27424975
tags question: http://stackoverflow.com/q/27364624
tags question: http://stackoverflow.com/q/27418799
tags question: http://stackoverflow.com/q/27406869
tags question: http://stackoverflow.com/q/27470652
tags question: http://stackoverflow.com/q/27406587
tags question: http://stackoverflow.com/q/27458542
tags question: http://stackoverflow.com/q/27337147
tags question: http://stackoverflow.com/q/27343187
tags question: http://stackoverflow.com/q/27428182
tags question: http://stackoverflow.com/q/27360457
tags question: http://stackoverflow.com/q/27429799
tags question: http://stackoverflow.com/q/27426971
tags question: http://stackoverflow.com/q/27423828
tags question: http://stackoverflow.com/q/27380763
tags question: http://stackoverflow.com/q/27392129
tags question: http://stackoverflow.com/q/27431352
tags question: http://stackoverflow.com/q/27377156
tags question: http://stackoverflow.com/q/27356145
tags question: http://stackoverflow.com/q/27458465
tags question: http://stackoverflow.com/q/27429150
tags question: http://stackoverflow.com/q/27403860
tags question: http://stackoverflow.com/q/27342822
tags question: http://stackoverflow.com/q/27321546
tag name: canvas
tags question: http://stackoverflow.com/q/27384272
tags question: http://stackoverflow.com/q/27329426
tags question: http://stackoverflow.com/q/27437508
tags question: http://stackoverflow.com/q/27462949
tags question: http://stackoverflow.com/q/27439047
tags question: http://stackoverflow.com/q/27418145
tags question: http://stackoverflow.com/q/27428051
tags question: http://stackoverflow.com/q/27404531
type: Tag
tags question: http://stackoverflow.com/q/27334551
tags question: http://stackoverflow.com/q/27371031
tags question: http://stackoverflow.com/q/27413661
tags question: http://stackoverflow.com/q/27440414
tags question: http://stackoverflow.com/q/27453729
tags question: http://stackoverflow.com/q/27450248
tags question: http://stackoverflow.com/q/27435434
tags question: http://stackoverflow.com/q/27432952
tags question: http://stackoverflow.com/q/27418672
tags question: http://stackoverflow.com/q/27391532
tags question: http://stackoverflow.com/q/27469241
tags question: http://stackoverflow.com/q/27389529
tags question: http://stackoverflow.com/q/27332603
tags question: http://stackoverflow.com/q/27384013
tags question: http://stackoverflow.com/q/27378179
tags question: http://stackoverflow.com/q/27319245
tags question: http://stackoverflow.com/q/27349650
tags question: http://stackoverflow.com/q/27458358
tags question: http://stackoverflow.com/q/27413078
tags question: http://stackoverflow.com/q/27469085
tags question: http://stackoverflow.com/q/27437133
tags question: http://stackoverflow.com/q/27358228
tags question: http://stackoverflow.com/q/27388453
tags question: http://stackoverflow.com/q/27334856
tags question: http://stackoverflow.com/q/27443708
tags question: http://stackoverflow.com/q/27465723
tags question: http://stackoverflow.com/q/27321215
tags question: http://stackoverflow.com/q/27455740
tags question: http://stackoverflow.com/q/27320095

http://stackoverflow.com/a/27462179
score: 4
has comment: http://stackoverflow.com/comment/43361977
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27461491
has comment: http://stackoverflow.com/comment/43370412
has comment: http://stackoverflow.com/comment/43364730
type: Answer
answers question: http://stackoverflow.com/q/27461491
has body: To make a div content editable in angular, you need to create a contenteditable directive. There is an example for this in the angular documentation here: https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#custom-control-example and a great blog entry from Gabo Esquivel on the topic here: http://gaboesquivel.com/blog/2014/in-place-editing-with-contenteditable-and-angularjs/ As you can see in Gabriel's example, the code for such a directive would be like this (I've added some comments to better understand whats going on): app.directive("contenteditable", function() { return { require: "ngModel", link: function(scope, element, attrs, ngModel) { //read the text typed in the div (syncing model with the view) function read() { ngModel.$setViewValue(element.html()); } //render the data now in your model into your view //$render is invoked when the modelvalue differs from the viewvalue //see documentation: https://docs.angularjs.org/api/ng/type/ngModel.NgModelController# ngModel.$render = function() { element.html(ngModel.$viewValue || ""); }; //do this whenever someone starts typing element.bind("blur keyup change", function() { scope.$apply(read); }); } }; }); Good luck!

http://stackoverflow.com/q/27374380
linked to: http://stackoverflow.com/q/16063394
has answer: http://stackoverflow.com/a/27375085
tagged with: oop
has answer: http://stackoverflow.com/a/27374709
has body: I'm new in programming and I'm learning JavaScript OOP, trying to make a game with tanks. I have some code but it doesn't work properly and I need some help to understand how it works. Please check it and tell me how to solve the problem because I want to add a few more kinds of tanks but before that I need to fix the code. var Tank = (function () { function Tank(name) { this._name = name; } Tank.prototype.getWeight = function () { return this._weight; } Tank.prototype.getName = function () { return this._name; } return Tank; }()); var SmallTank = (function () { this.prototype = Object.create(Tank.prototype); function SmallTank(name) { Tank.apply(this._name); } SmallTank.prototype._weight = 2; return SmallTank; }()); var myTank = new SmallTank("Aleks Tank"); console.log(myTank.getWeight());
has comment: http://stackoverflow.com/comment/43199279
has comment: http://stackoverflow.com/comment/43199604
type: Question
has comment: http://stackoverflow.com/comment/43205564
has comment: http://stackoverflow.com/comment/43199412
tagged with: javascript
has comment: http://stackoverflow.com/comment/43199271
score: 0
has comment: http://stackoverflow.com/comment/43199179
answer count: 2
has comment: http://stackoverflow.com/comment/43199296
has comment: http://stackoverflow.com/comment/43199663
type: UnansweredQuestion
has title: Error for JS OOP beginner training

http://stackoverflow.com/a/27348355
accepted answer of: http://stackoverflow.com/q/27348036
has comment: http://stackoverflow.com/comment/108599570
answers question: http://stackoverflow.com/q/27348036
has comment: http://stackoverflow.com/comment/78015289
downvote count: 1
has comment: http://stackoverflow.com/comment/122015800
has body: Both event.preventDefault() and return false; work if used on form submit. The HTML 5 validation is still present. jQuery("form").submit(function(e){ e.preventDefault(); //or //return false; });
type: AcceptedAnswer
score: 29
upvote count: 30
type: Answer

http://stackoverflow.com/comment/43279334
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27417756
score: 0
has text: The list could be infinite (Altough, this might never happen). I updated my [fiddle](http://jsfiddle.net/zrw9de0f/8/) to the 'real' markup, but I edited out confidential stuff. ;) I need to get 'Test & Test', 'C#' and 'Ruby on Rails' sorted, but couldn't figure out how yet.

http://stackoverflow.com/comment/43141426
has text: you can try `for` loop and inside use my codes with different values
score: 2
comment on: http://stackoverflow.com/a/27342788
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27324054
score: 1
accepted answer of: http://stackoverflow.com/q/27323352
upvote count: 1
type: AcceptedAnswer
has body: I found this resource which answers this question, and also explains why Sigma.JS relies on custom renderers to modify node attributes such as border. On the topic of Sigma custom renderers Hope this helps others out there with similar questions!
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27323352

http://stackoverflow.com/comment/139913743
type: AnswerComment
type: Comment
has text: after trying everything, this worked. thanks a ton!
comment on: http://stackoverflow.com/a/74640112
score: 1

http://stackoverflow.com/comment/43267242
has text: @Niet the Dark Absol, thank you for the recommendation. I will read about it and try to use it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27411197
score: 0

http://stackoverflow.com/comment/68113477
score: 0
comment on: http://stackoverflow.com/q/27468441
type: Comment
type: QuestionComment
has text: Did you manage to display it?

http://stackoverflow.com/a/27344079
accepted answer of: http://stackoverflow.com/q/27344038
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
upvote count: 3
has body: var myapp = angular.module('myApp', []); myapp.controller('HelloWorldCtrl', function($scope){ $scope.helloMessage = "Hello world"; }) {{helloMessage}}
answers question: http://stackoverflow.com/q/27344038

http://stackoverflow.com/a/27428370
has comment: http://stackoverflow.com/comment/43322507
has comment: http://stackoverflow.com/comment/43322956
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27417815
type: Answer
has comment: http://stackoverflow.com/comment/43347165
has body: To be clear, @Luke is saying that some users properly using your site, viewing iframe content, may have problems if they have a security setting, like an anonymity program, blocking their data, like cgi variables. The only real solution is proper authentication and filtering on every page. If a list shows content for a user and loads details into an iframe, the iframe's page must also check that the user has access. At that point, it doesn't matter if they can get at the url. For instance, if you get a list of user images like this. &lt;cfquery name="getImageList"&gt; select imageid,imagefilename_mini from images where userid = &lt;cfqueryparam value="#session.userid#"&gt; &lt;/cfquery&gt; Which loads an iframe to load full sized images, you still need the and subclause &lt;cfquery name="getThisImage"&gt; select imagefilename from images where imageID = ... and userID = ... &lt;/cfquery&gt; That way, even if someone changes the image id in the url, it still only lets them see content bound to the userID. Also, modern browsers make altering the source of a live page all too easy. I don't mean that browsers can alter the server side file, I mean that contents of the DOM as delivered to the browser. It's an incredibly useful tool for developing and debugging, but it does make mischievous/malevolent activity easier. In chrome and firefox, you can inspect an element, change the attributes and the page will change before your eyes. Here, that works for iframe src's, so it still is within the DOM it expects to be in. You should regard client side UI as how you'd like the page to be presented, and the way it works best but use server side safeguarding (proper validation) because it's too easy to get around client-controlled data/elements.
has comment: http://stackoverflow.com/comment/43333687
upvote count: 1

http://stackoverflow.com/comment/43290740
comment on: http://stackoverflow.com/q/27424419
score: 1
type: QuestionComment
type: Comment
has text: How do you get `date` from the string `Datum`? And what about `Dispo`?

http://stackoverflow.com/comment/43273537
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27414704
score: 1
has text: Note carefully what the word "its" refers to.

global
type: Tag
tags question: http://stackoverflow.com/q/27355397
tags question: http://stackoverflow.com/q/27372182
tag name: global

http://stackoverflow.com/comment/43220168
type: QuestionComment
has text: Wouldn't it be input #FirstName since JQuery uses normal CSS rules for selecting element(s)?
comment on: http://stackoverflow.com/q/27385955
score: 0
type: Comment

http://stackoverflow.com/q/27456501
has comment: http://stackoverflow.com/comment/43350452
has comment: http://stackoverflow.com/comment/43350527
type: UnansweredQuestion
has title: Back slash causing problems in javascript
tagged with: escaping
has comment: http://stackoverflow.com/comment/43350516
score: 0
type: Question
tagged with: c#
tagged with: backslash
tagged with: javascript
has answer: http://stackoverflow.com/a/27456748
answer count: 1
has body: I am generating some html in c# and assigning it to a literal in aspx using some data from database. in below code offtitle.Rows[off]["Offeringtitle"].ToString() is bringing a value with a back slash '\' sb.Append(" " ); sb.Append(offtitle.Rows[off]["Offeringtitle"].ToString()); sb.Append(" "); This back slash is causing an error in javascript "Unterminated string constant" while page loading. Please help me in this regards Thanks
tagged with: asp.net

http://stackoverflow.com/q/27370557
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27371459
score: 0
accepted answer: http://stackoverflow.com/a/27371084
tagged with: http://stackoverflow.com/tag/html
has body: Hello I'm trying to get a tip calculator to appear all in alert boxes I'm struggling to get the code to work and to get the alert boxes and show up and to get the right calculations. I want it to show first in an alert box the total cost of bill and then to rate service and based on that ex. poor - 8% fair- 10$ good - 15% and excellent 20%. if anyone could help me with this thanks. link: http://jsfiddle.net/saber2356/wxy9zfn8/ javascript: tip Tip Calculator
possible better answer: http://stackoverflow.com/a/27371459
tagged with: calculator
has title: Alert box Tip Calculator
type: AnsweredQuestion
tagged with: alert
has answer: http://stackoverflow.com/a/27371084
type: Question

http://stackoverflow.com/q/27453701
tagged with: gwtquery
downvote count: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27721281
tagged with: mgwt
type: AnsweredQuestion
score: 1
tagged with: java
has body: To bind events like click with GQuery you can do something like: @UiField Element myButton; ... $(myButton).on("click", new Function() { @Override public void f() { // event is triggered } } What I need is support for touch events like Tap as it was implemented in MGWT. In MGWT you can use a TouchPanel to get a tap event like this: @UiField TouchPanel panel; ... panel.addTapHandler(...); Edit: I need something like the following: @UiField Element myButton; ... $(myButton).on("tap", new Function() { @Override public void f() { // event is triggered } } Is there a way to bind a tap event with GQuery as it is done for the TouchPanel?
has title: How to bind Touch Events with GWTQuery?
upvote count: 1
type: Question
tagged with: gwt
tagged with: javascript
has answer: http://stackoverflow.com/a/27721281

http://stackoverflow.com/q/27451051
answer count: 1
tagged with: applet
has title: Applet access JDialog information
has body: I'm trying to obtain information in a JDialog that is opened by an applet. This applet is not developed by me and I don't have the source code. I can access this applet by JavaScript using the following: var aApp = document.applets[0]; var acApplet = aApp.getAccessibleContext(); I can access all controls inside the main applet, but when the applet trigger a dialog, I can't access the objects inside this dialog. I tried to find Components inside the applet and inside the JFrame that is the parent of this applet.
type: UnansweredQuestion
tagged with: swing
tagged with: java
type: Question
has answer: http://stackoverflow.com/a/27453827
tagged with: javascript
tagged with: awt
score: 0

http://stackoverflow.com/comment/93475541
type: AnswerComment
score: 0
type: Comment
has text: this is the quintessential Javascript behavior
comment on: http://stackoverflow.com/a/27359497

http://stackoverflow.com/comment/43287568
comment on: http://stackoverflow.com/q/27422655
type: Comment
type: QuestionComment
has text: So what is your question?
score: 1

http://stackoverflow.com/comment/43286192
score: 0
type: AnswerComment
has text: try investigate the bootstrap approach there are lots of styles that toggle on :hover to show or hide content and it is pure css
comment on: http://stackoverflow.com/a/27421118
type: Comment

http://stackoverflow.com/q/27472753
has answer: http://stackoverflow.com/a/27472880
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27473029
tagged with: drop-down-menu
has body: this is my first pure JavaScript script as you can probably tell, by the length of it! I'm at a loss to workout how i can get the child links which are in a div with a class called 'menu' to close when i leave that div. I've tried to write an If argument to set it to close when i leave the 'A' and also a 'DIV' and that doesn't seem to work? Any help would be much appreciated and sorry for the overly long code! Please no Jquery for now, thanks! &lt;script&gt; // Variables var getFirstMenu = document.getElementsByTagName('div'); // Use selectors var getMenuClasses = document.getElementsByClassName('menu'); // Hide drop down menus for(var i=0; i &lt; getFirstMenu.length; i++){ getFirstMenu[i].style.visibility = 'hidden'; } // ============================= // Show Menu on mouseover function showDropdown(e){ var el = e.target; if(el.nodeName == 'A'){ for(var i = 0; i &lt; getMenuClasses.length; i++) { if(el == getMenuClasses[0]){ getFirstMenu[0].style.visibility = 'visible'; }else if(el == getMenuClasses[1]) { getFirstMenu[1].style.visibility = 'visible'; }else if(el == getMenuClasses[2]){ getFirstMenu[2].style.visibility = 'visible'; } } } } var getMainMenu = document.getElementById('menu'); getMainMenu.addEventListener('mouseover', function(e){ showDropdown(e); },false); // ============================= // Hide Menu on mouseout function mouseOutMenu(e){ var el = e.target; if(el.nodeName == 'DIV') for(var i = 0; i &lt; getFirstMenu.length; i++){ getFirstMenu[i].style.visibility = 'hidden'; } } getMainMenu.addEventListener('mouseout', function(e){ mouseOutMenu(e); }, false);
has title: javascript menu, How to close when mouse outside of div?
has comment: http://stackoverflow.com/comment/43380124
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/43380236

http://stackoverflow.com/comment/43164358
has text: Hello, I uploaded the game and put the link in the original question. Do let me know what you think...
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27342260
type: QuestionComment

asp.net
tags question: http://stackoverflow.com/q/27378764
tags question: http://stackoverflow.com/q/27441411
tags question: http://stackoverflow.com/q/27465457
tags question: http://stackoverflow.com/q/27349145
tags question: http://stackoverflow.com/q/27421450
tags question: http://stackoverflow.com/q/27338163
tags question: http://stackoverflow.com/q/27374773
tags question: http://stackoverflow.com/q/27456707
tags question: http://stackoverflow.com/q/27426610
tags question: http://stackoverflow.com/q/27329360
tags question: http://stackoverflow.com/q/27329344
tags question: http://stackoverflow.com/q/27444222
tags question: http://stackoverflow.com/q/27422932
tags question: http://stackoverflow.com/q/27377284
tags question: http://stackoverflow.com/q/27446151
tags question: http://stackoverflow.com/q/27446435
tags question: http://stackoverflow.com/q/27351523
tags question: http://stackoverflow.com/q/27394907
tags question: http://stackoverflow.com/q/27428375
tags question: http://stackoverflow.com/q/27384527
tags question: http://stackoverflow.com/q/27461695
tags question: http://stackoverflow.com/q/27355659
tags question: http://stackoverflow.com/q/27407045
tags question: http://stackoverflow.com/q/27372682
tags question: http://stackoverflow.com/q/27408047
tags question: http://stackoverflow.com/q/27415326
tags question: http://stackoverflow.com/q/27329905
tags question: http://stackoverflow.com/q/27425221
tags question: http://stackoverflow.com/q/27428457
tags question: http://stackoverflow.com/q/27409113
tags question: http://stackoverflow.com/q/27442310
tags question: http://stackoverflow.com/q/27454970
tags question: http://stackoverflow.com/q/27403062
tags question: http://stackoverflow.com/q/27362899
tags question: http://stackoverflow.com/q/27408668
tags question: http://stackoverflow.com/q/27395663
tags question: http://stackoverflow.com/q/27417225
tags question: http://stackoverflow.com/q/27400678
tags question: http://stackoverflow.com/q/27401809
tags question: http://stackoverflow.com/q/27315163
tags question: http://stackoverflow.com/q/27396753
tags question: http://stackoverflow.com/q/27368880
tags question: http://stackoverflow.com/q/27408576
tags question: http://stackoverflow.com/q/27386024
tags question: http://stackoverflow.com/q/27385442
tags question: http://stackoverflow.com/q/27415556
tags question: http://stackoverflow.com/q/27371377
tags question: http://stackoverflow.com/q/27420463
tags question: http://stackoverflow.com/q/27406755
tags question: http://stackoverflow.com/q/27379232
tags question: http://stackoverflow.com/q/27405139
tags question: http://stackoverflow.com/q/27314663
tags question: http://stackoverflow.com/q/27423003
tags question: http://stackoverflow.com/q/27410316
tags question: http://stackoverflow.com/q/27373270
tags question: http://stackoverflow.com/q/27335947
tags question: http://stackoverflow.com/q/27470290
tags question: http://stackoverflow.com/q/27360875
tags question: http://stackoverflow.com/q/27465416
tags question: http://stackoverflow.com/q/27362734
tags question: http://stackoverflow.com/q/27386493
tags question: http://stackoverflow.com/q/27442433
tags question: http://stackoverflow.com/q/27331164
tags question: http://stackoverflow.com/q/27346529
tags question: http://stackoverflow.com/q/27442341
tags question: http://stackoverflow.com/q/27378442
tags question: http://stackoverflow.com/q/27369399
tags question: http://stackoverflow.com/q/27468935
type: Tag
tags question: http://stackoverflow.com/q/27467241
tags question: http://stackoverflow.com/q/27456367
tags question: http://stackoverflow.com/q/27365663
tags question: http://stackoverflow.com/q/27418074
tags question: http://stackoverflow.com/q/27362905
tags question: http://stackoverflow.com/q/27330722
tags question: http://stackoverflow.com/q/27372128
tags question: http://stackoverflow.com/q/27362769
tags question: http://stackoverflow.com/q/27426664
tags question: http://stackoverflow.com/q/27426684
tags question: http://stackoverflow.com/q/27316518

http://stackoverflow.com/comment/51046604
type: Comment
has text: cool - glad you could change the type of your post from question (as you said yourself in a comment you deleted ;-) to a solution
comment on: http://stackoverflow.com/a/31512800
score: 0
type: AnswerComment

http://stackoverflow.com/q/27322089
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27322992
answer count: 3
tagged with: language-translation
favorite count: 0
type: UnansweredQuestion
tagged with: localization
tagged with: php
tagged with: laravel
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/45838568
has title: Localization: Php and Javascript
type: Question
has body: I'm thinking of the best way to localize my website. I am using Laravel, which already has a php localization class, but I will also need to translate some javascript strings Ideally, I would use a library or translation file which could be editable through Poedit and could used for both javascript and php, but I can't find a solution for that. Is it even possible without having to create a whole new code library? The solution I thought of until now is far from ideal: Use a php localization class for php strings Use a javascript localization library for javascript Store the language in a cookie which could be read by both ends. The idea of keeping two separate language files (one for php and one for javascript) does not seem like an elegant solution. I saw some javascript libraries for laravel, but they require you to compile your library into a javascript array file every time you update something, which would make it not very dynamic and also redundant, since most php strings won't be used in javascript and vice-versa. Any thoughts on this?
has answer: http://stackoverflow.com/a/27384152

backbone.js
tags question: http://stackoverflow.com/q/27470138
tags question: http://stackoverflow.com/q/27407770
tags question: http://stackoverflow.com/q/27341055
tags question: http://stackoverflow.com/q/27443584
tags question: http://stackoverflow.com/q/27468567
tags question: http://stackoverflow.com/q/27434001
tags question: http://stackoverflow.com/q/27451319
tags question: http://stackoverflow.com/q/27449211
tags question: http://stackoverflow.com/q/27397527
tags question: http://stackoverflow.com/q/27448165
tags question: http://stackoverflow.com/q/27368595
tags question: http://stackoverflow.com/q/27377731
tags question: http://stackoverflow.com/q/27314239
tags question: http://stackoverflow.com/q/27445838
tags question: http://stackoverflow.com/q/27349990
tags question: http://stackoverflow.com/q/27474584
tags question: http://stackoverflow.com/q/27401747
tags question: http://stackoverflow.com/q/27427825
tags question: http://stackoverflow.com/q/27423812
tags question: http://stackoverflow.com/q/27347331
tags question: http://stackoverflow.com/q/27361718
tags question: http://stackoverflow.com/q/27451110
tags question: http://stackoverflow.com/q/27434547
tags question: http://stackoverflow.com/q/27410641
tags question: http://stackoverflow.com/q/27314230
tags question: http://stackoverflow.com/q/27391239
tags question: http://stackoverflow.com/q/27383875
tags question: http://stackoverflow.com/q/27424901
tags question: http://stackoverflow.com/q/27417435
tags question: http://stackoverflow.com/q/27379935
tags question: http://stackoverflow.com/q/27406352
tags question: http://stackoverflow.com/q/27325795
tags question: http://stackoverflow.com/q/27432176
tags question: http://stackoverflow.com/q/27393719
tags question: http://stackoverflow.com/q/27414539
tags question: http://stackoverflow.com/q/27316802
tags question: http://stackoverflow.com/q/27441917
tags question: http://stackoverflow.com/q/27425777
tags question: http://stackoverflow.com/q/27409960
tags question: http://stackoverflow.com/q/27405762
tags question: http://stackoverflow.com/q/27362053
tags question: http://stackoverflow.com/q/27358109
tags question: http://stackoverflow.com/q/27389800
tags question: http://stackoverflow.com/q/27324286
tags question: http://stackoverflow.com/q/27414074
type: Tag
tags question: http://stackoverflow.com/q/27448339
tags question: http://stackoverflow.com/q/27324748
tags question: http://stackoverflow.com/q/27448398
tags question: http://stackoverflow.com/q/27365819
tags question: http://stackoverflow.com/q/27467295
tags question: http://stackoverflow.com/q/27424163
tags question: http://stackoverflow.com/q/27415272
tags question: http://stackoverflow.com/q/27362476
tags question: http://stackoverflow.com/q/27467603
tags question: http://stackoverflow.com/q/27369976
tag name: backbone.js

http://stackoverflow.com/q/27349618
has body: I am trying to add a mask to a toggle menu. The idea being that, when you click on the #toggle button, the menu will slide down and a mask is applied to the content area. The JS and html / php code I have so far is: (function($) { $('#toggle').toggle( function() { $('#popout').animate({ top: 0 }, 'slow', function() { $('#toggle').html('&lt;img src="http://www.example.com/wp-content/themes/your-theme/images/menu.png" alt="close" /&gt;'); }); }, function() { $('#popout').animate({ top: -600 }, 'slow', function() { $('#toggle').html('&lt;img src="http://www.example.com/wp-content/themes/your-theme/images/menu.png" alt="close" /&gt;'); }); } ); })(jQuery); &lt;div id="toggle"&gt;&lt;i class="fa fa-bars"&gt;&lt;/i&gt;&lt;/div&gt; &lt;div id="popout"&gt; &lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'header-menu', 'menu_class' =&gt; 'nav-menu' ) ); ?&gt; &lt;/div&gt; Are there any JS pro's who can help out a learner?
answer count: 0
type: UnansweredQuestion
tagged with: php
downvote count: 0
score: 1
tagged with: wordpress
type: Question
has title: Adding mask to toggle menu
tagged with: javascript
upvote count: 1
has comment: http://stackoverflow.com/comment/43154612
favorite count: 0

http://stackoverflow.com/a/27371342
type: Answer
has body: $("body").click ( function(e){ if ($(e.target).is($(".toggle_menu"))) { $(".div_menu").toggle(); }else{ $(".div_menu").hide(); } } );
answers question: http://stackoverflow.com/q/27371301
score: 0

http://stackoverflow.com/q/27432836
tagged with: css-transitions
has title: Using a CSS Transition to slide a div in on load
accepted answer: http://stackoverflow.com/a/27432912
has body: so I have this div that slides in on load, but for some reason I can't seem to get the action to actually fire off, can someone help me? Thanks! HTML: aaaa CSS: #right-scroll-slide{ -webkit-transition:all 1s; -ms-transition:all 1s; -moz-transition:all 1s; -o-transition:all 1s position:absolute; top:-100px; background:red; } JS: document.getElementById("right-scroll-slide").style.top="70px"; Fiddle: http://jsfiddle.net/qrvp58Ly/1/
tagged with: javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: css
has answer: http://stackoverflow.com/a/27432912
answer count: 1
score: 0

http://stackoverflow.com/q/27382844
type: UnansweredQuestion
type: Question
tagged with: oop
has comment: http://stackoverflow.com/comment/43214984
has comment: http://stackoverflow.com/comment/43214452
has comment: http://stackoverflow.com/comment/43215923
has comment: http://stackoverflow.com/comment/43214347
has title: Reference instance of parent class in prototype extension
has comment: http://stackoverflow.com/comment/43214502
tagged with: javascript
has comment: http://stackoverflow.com/comment/43214777
has comment: http://stackoverflow.com/comment/43214608
score: 0
has comment: http://stackoverflow.com/comment/43215817
has comment: http://stackoverflow.com/comment/43214490
has comment: http://stackoverflow.com/comment/43214459
linked to: http://stackoverflow.com/q/15884096
has body: I have a class that I want to extend with a couple of new methods. In order not to pollute the object's namespace (possible overwrite of existing methods) more than necessary I want to group these methods under one property name. How can I get a reference for the original object's instance inside of the extended container? To clarify: // here's what I have obj = function () { // something happens here this.property = "XYZ" } var x = new obj(); console.log(x.property); // logs "XYZ" // here's how I want to extend it obj.prototype.extension = {property: "ABC"}; obj.prototype.extension.whatstheproperty = function () { // how to get a reference to the obj's instance here? console.log(this.property); // logs "ABC" not "XYZ" for obvious reasons // QUESTION -&gt; how get get "XYZ"? } var z = new obj(); z.extension.whatstheproperty(); My guess is there must be a way to store a reference to the parent instance as a property of extension. An obvious way would be to just set it whenever the parent is instanced: x = new obj(); x.extension.parent = x; Then I could access this.parent inside all methods of extension. But I feel there must be a better way, especially because I don't know when a new obj is instanced. I just want every new obj to have a property extension that has a property referencing the parent instance. How should I approach this?
duplicate of: http://stackoverflow.com/q/15884096
answer count: 0

http://stackoverflow.com/q/27345365
answer count: 2
upvote count: 6
has comment: http://stackoverflow.com/comment/47120535
has body: When I try to swipe left/right my app content also scrolls vertically creating messy UX. Is there a way to prevent it? This is how I handle swipe // angular directive link: function(scope, element, attrs) { $ionicGesture.on('swiperight', function(){console.log("swiped");}, element ); }
has answer: http://stackoverflow.com/a/29391403
tagged with: scroll
tagged with: ionic-framework
has title: How to prevent vertical scroll on swipe left/right
tagged with: swipe
possible better answer: http://stackoverflow.com/a/27430528
tagged with: javascript
has answer: http://stackoverflow.com/a/27430528
score: 6
accepted answer: http://stackoverflow.com/a/29391403
type: AnsweredQuestion
downvote count: 0
favorite count: 0
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/47113736

http://stackoverflow.com/comment/43321953
comment on: http://stackoverflow.com/q/27440961
score: 0
has text: @northkildonan or maybe a js file or xml, if i remember Javascript can access remote file and refresh them (file written by php or others system eh)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27455573
answers question: http://stackoverflow.com/q/27455549
has body: Disable the &lt;submit&gt; button or any other button which on clicked, submits the form, so only first click gets counted and the end user is prevented from clicking it. It is also semantic way of doing as just unbinding any event associated with the button while still allowing to click, will in some way confuse the users. $("#loginForm").validate({ ignore: "", submitHandler: function(form) { $('#submitBtn').prop('disabled', true); // disable so it won't be clicked return false; } });
score: 2
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/a/27340122
has comment: http://stackoverflow.com/comment/43219085
has comment: http://stackoverflow.com/comment/43217444
type: Answer
accepted answer of: http://stackoverflow.com/q/27323526
answers question: http://stackoverflow.com/q/27323526
score: 0
has body: Question 1: Using the jQuery ID Selector and Element Selector, you can chain the tag names in order to select all of the option elements of the first category selector and hide them: $( "#CategoryID1 options" ).hide(); If you applied a class to only those options: Tests Development PMO then you could use the jQuery Class Selector: $( 'first_category' ).hide(); Question 2: Add the disabled property to your input: ... Or using the jQuery prop() method, you can disable DOM elements on document ready: $(document).ready( function() { $("#DynamicCategory").prop( "disabled", true ); }); Remove the disabled property from the input on change of the first, using change(): $( "#CategoryID1" ).change(function() { $("#DynamicCategory").prop( "disabled", false ); });
type: AcceptedAnswer

http://stackoverflow.com/q/27352210
upvote count: 2
has comment: http://stackoverflow.com/comment/43196495
type: UnansweredQuestion
has title: Add a note/message to Google Charts at specific places
score: 2
answer count: 0
has body: I am using Google Charts to display some data related to the performance of a web page (bounce rate, volume, etc). When I make changes to the page (for example changing the color of a button), I keep track of that using small notes (for example: 'week 15 2014: button is now green'). I'd like to display these notes (with a hover-over function to display the text) IN the chart. So vertically they should be at the right location (right week). Horizontally it doesn't matter where they're placed, on top or bottom would be most logical. What would be the best approach to succeed in doing so? JSFiddle of my current chart: http://jsfiddle.net/9qukjbhg/ google.load("visualization", "1", { packages: ["corechart"] }); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Interval', 'Bounce Rate', 'Call to Action Succeed', 'Total Volume'], ['week 36', 0.3283, 0.4328, 67], ['week 37', 0.2857, 0.4167, 84], ['week 38', 0.1562, 0.5417, 96], ['week 39', 0.275, 0.4125, 80], ['week 40', 0.2615, 0.4154, 65], ['week 41', 0.2213, 0.3588, 131], ['week 42', 0.2232, 0.5, 112], ['week 43', 0.3476, 0.3898, 118], ['week 44', 0.3025, 0.4118, 119], ['week 45', 0.294, 0.3897, 136], ['week 46', 0.2043, 0.4286, 49] ]); var formatter = new google.visualization.NumberFormat({ pattern: '#,###%' }); formatter.format(data, 1); formatter.format(data, 2); var options = { vAxes: { 0: { format: '#,###%' }, gridlines: { color: 'transparent' } }, 1: { gridlines: { color: 'transparent' } }, series: { 0: { targetAxisIndex: 0, type: 'bars' }, 1: { targetAxisIndex: 0, type: 'bars' }, 2: { targetAxisIndex: 1 } }, title: 'Page performance per week' }; var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data, options); } What I try to do (something like this, see the note on the right top of the image): Who can point me in the right direction? Many thanks in advance!
type: Question
tagged with: charts
tagged with: google-visualization
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27347860
score: 0
tagged with: sdk
tagged with: firefox-addon
answer count: 1
has title: refresh contenturl in add-on sdk
tagged with: firefox-addon-sdk
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27351080
has body: How can i refresh the Panel with the contenturl when i click in the widget icon? my code is simple here it's: var data = require("sdk/self").data; exports.main = function() { var panel = require("sdk/panel").Panel({ width: 400, height: 560, contentURL: "http://sample.com/index.html", }); panel.on("show", function() { panel.port.emit("show"); }); require("sdk/widget").Widget({ id: "Sample", label: "Sample", contentURL: data.url("icon128.png"), panel:panel }); };
type: Question
tagged with: firefox
tagged with: javascript

http://stackoverflow.com/a/27367836
has body: Other people have pointed out a number of problems with your script, but the reason your script isn't running is because you have this: &lt;input type="text" id="pizza" onchange="pizza_calculate()"&gt;&lt;br&gt; parsed before the script is loaded at the end of your html. pizza_calculate isn't defined. Either move your script to top, or better, don't inline your event handlers and instead use addEventListener instead. function pizza_calculate() { /* body of pizza_calculate */ } var pizzaInput = document.getElementById("pizza"); pizzaInput.addEventListener("change", pizza_calculate, false);
answers question: http://stackoverflow.com/q/27367604
type: Answer
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/q/27411022
favorite count: 0
accepted answer: http://stackoverflow.com/a/27411108
possible better answer: http://stackoverflow.com/a/27416737
type: Question
has answer: http://stackoverflow.com/a/27416737
has title: Dropdown box getting values from mySQL shows blanbk entries
tagged with: php
answer count: 2
downvote count: 3
tagged with: mysql
has answer: http://stackoverflow.com/a/27411108
tagged with: javascript
score: -3
type: AnsweredQuestion
has body: I'm using the template from this mySQL x AJAX tutorial (http://www.9lessons.info/2010/08/dynamic-dependent-select-box-using.html) to create dependent dropdowns. How the code should work: Coach selects what activity group ($activity) he wants to browse from box one. Box two the populates with a list of players($username) who are part of that activity. It does the above, but the entries show up blank as opposed to printing the name - see screenshot attached. Below is the piece &lt;?php if($_POST['activity']) { $activity=$_POST['activity']; $sql=mysql_query("SELECT id AND username FROM player WHERE activity='$activity'"); while($row=mysql_fetch_array($sql)) { $id=$row['id']; $username=$row['username']; $activity=$row['activity']; echo '&lt;option value="'.$username.'"&gt;'.$username.'&lt;/option&gt;'; } } ?&gt; I've messed around with the number of entries in the db, and the blank values change respectively (when changed to 5 people being in group, 5 blank spaces show, etc.) It's really odd because of the fact it appears to be working, just not showing the names. Any ideas? Cheers.
upvote count: 0
tagged with: jquery

http://stackoverflow.com/comment/43149598
comment on: http://stackoverflow.com/a/27346402
has text: I've edited it. @Zobo try if you have success, if not feel free to ask again!
score: 0
type: AnswerComment
type: Comment

camanjs
type: Tag
tags question: http://stackoverflow.com/q/27355628
tag name: camanjs

http://stackoverflow.com/comment/43313366
has text: what is the way to check for the empty object in angular? I tried different things but no luck so far. thanks
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27436307
type: AnswerComment

http://stackoverflow.com/q/27411287
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43267473
type: Question
has answer: http://stackoverflow.com/a/27411812
has comment: http://stackoverflow.com/comment/43267307
tagged with: twitter-bootstrap-3
has title: How to dynamically add row in Bootstrap
has body: I have this piece of code that should do the following: After typing into each input field and pressing the "Add row" button a new row should be added to the end of the table. Pressing the "Delete row" button should remove the last row created. At this point, when I press any of the buttons, it won't do anything. As a mention, when I am verifying Chromes' Console for any JS errors I get this: Uncaught ReferenceError: $ is not defined This is the HTML: # User Password IP Country IP disponibility 1 Add RowDelete Row And this is the JS: $(document).ready(function(){ var i=1; $("#add_row").click(function(){ $('#addr'+i).html(" "+ (i+1) +" "); $('#tab_logic').append(' '); i++; }); $("#delete_row").click(function(){ if(i>1){ $("#addr"+(i-1)).html(''); i--; } }); }); Any ideas on what should I change in my JS ? Thanks
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/43267119
accepted answer: http://stackoverflow.com/a/27411812
possible better answer: http://stackoverflow.com/a/27411525
has comment: http://stackoverflow.com/comment/43266935
has answer: http://stackoverflow.com/a/27411525
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/27442008
has body: I'm trying to run an iframe on two different pages on a website but with different css properties. Due to a limitation of space on my index.php, I'd like to confine text in the iframe to a small width, whereas on another page (samples/index.php), there is no limitation on width and the iframe can be bigger. If I use the same "large" width on both pages and have the iframe narrower on the index.php, the text and will go off the edge and be obscured (I don't want to use scrollbars). In index.php, I have the following declaration: In samples/index.php, the width is narrower data-iframe.html declares the css as follows: This encompasses everything within a div of width 830 pixels bounded by a double lined border, and the text inside confined to an area of 800px. The actual content that is displayed by the iframe comes from an external javascript file - this is immediately below the css statements: Within test-iframe.js we have, for example: document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" Dummy text. More Dummy text (Note the hr to separate the two portions of text) "); document.write(" "); All the images have been resized to be within the large iframe on index.php and the smaller one on samples/index.php Conceivably the text could be very large - above its just a placeholder, but its confined in a smaller area. I'm trying to use the following code to find out what the parent window is - if it contains "samples", then display the complete width of the text etc. if not - use a restricted width. var str = parent.location.href; var nt = str.indexOf("samples"); var a = document.getElementById("blocktext"); var b = document.getElementById("everything"); if (nt>0) // samples found { a.style.width = "800px"; b.style.width = "830px"; b.style.hr = "600px"; } else // samples not found - narrower confines { a.style.width = "50…
answer count: 1
accepted answer: http://stackoverflow.com/a/27444443
has comment: http://stackoverflow.com/comment/43327471
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43327196
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43324039
has comment: http://stackoverflow.com/comment/43325943
score: 0
tagged with: iframe
type: Question
has answer: http://stackoverflow.com/a/27444443
has title: Changing css properties in an iframe based on parent window
tagged with: javascript
has comment: http://stackoverflow.com/comment/43345745

php-5.4
tags question: http://stackoverflow.com/q/27358358
type: Tag
tag name: php-5.4

http://stackoverflow.com/a/27427893
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27427495
downvote count: 0
has body: You actually do not need to use $(document).ready. It's just useless. But it shouldn't break anything. As well as you can access any element on the page from script inserted anywhere in the same document. So problem is somewhere out your question's scope. Try: run $('#test').text() from console. replace $('#test').text() with $('body') or something else in your script. ... Be deductive when you debugging! ;-)

http://stackoverflow.com/comment/43246952
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27399588
has text: The one and only problem in your code was the typo. You misspelled the id of symbol definition while setting xlink:href attribute.
score: 1

http://stackoverflow.com/a/27440068
has comment: http://stackoverflow.com/comment/43319941
has comment: http://stackoverflow.com/comment/43322390
upvote count: 3
downvote count: 3
has comment: http://stackoverflow.com/comment/43320006
has comment: http://stackoverflow.com/comment/43320050
has comment: http://stackoverflow.com/comment/43319857
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27440015
has body: $(function(){ var table = ' 123 '; $('#myVar').html(table); $('#myVar').removeClass().addClass('my-class3'); console.log($('#myVar').html()); }); It depends on myVar, If it a jQuery element then use it like, myVar.html(table); If it is an Id then use it like, $('#myVar').html(table); And If it is a Class then use it like, $('.myVar').html(table); To get more abount jquery-selectors Let it is an Id then your code should look like, $('#myVar').html(table); $('#myVar').removeClass().addClass('my-class3'); console.log($('#myVar').html());
accepted answer of: http://stackoverflow.com/q/27440015
type: Answer
has comment: http://stackoverflow.com/comment/43331915
has comment: http://stackoverflow.com/comment/43320082

http://stackoverflow.com/comment/43161152
has text: Thank you. I haven't considered this way. I need to show tags horizontally in the input field of type ahead. Can you advise please how I can achieve this by using your method?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27321557
type: Comment

http://stackoverflow.com/comment/43135910
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27339737
has text: in this situations if you use **Console** (F12) you would not end up asking this Q on SO! :) use it!

http://stackoverflow.com/q/27365010
tagged with: unit-testing
has answer: http://stackoverflow.com/a/27365113
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
has body: Main module being injected with everything; require('./dashboard'); module.exports = angular.module('college', ['college.dashboard']) .config(function ($stateProvider) { $stateProvider .state('college.list', { url: '/college', templateUrl: '/dashboard/dashboard.html', controller: 'DashboardCtrl', authenticate: true }); }) .factory('ProjectFactory', require('./services/college.service')); College Index, which makes the dashboard controller available; module.exports = angular.module('college.dashboard', []) .controller('DashboardCtrl', require('./dashboard.controller.js')); The college controller exposes the following method; module.exports = function($scope, $rootScope, $state) { $scope.openCollege = function(id) { $rootScope.currentCollege = id; $state.go('college.main', {currentCollege: id}); }; }; The following error is thrown when the unit test calls scope.openCollege (2); Error: Error: Could not resolve 'college.main' from state '' Creating state; beforeEach(inject(function ($rootScope, $state, $location, $controller) { scope = $rootScope.$new(); location = $location; rootScope = $rootScope; $rootScope.currentCollege = {};// Empty by default state = $state; $controller('DashboardCtrl', { $scope: scope, $state: state, $location: location }); })); Some of the spec test code; expect(state.current.name).to.equal(''); scope.openCollege(2); I need to figure out how to handle/mock $state.go during the Karma unit testing so that state knows about college.main. Any help is appreciated. J
has comment: http://stackoverflow.com/comment/43182739
favorite count: 0
possible better answer: http://stackoverflow.com/a/27365113
accepted answer: http://stackoverflow.com/a/27375958
has title: Mocking $state change in AngularJS controller
has comment: http://stackoverflow.com/comment/43183023
tagged with: angularjs
score: 2
has answer: http://stackoverflow.com/a/27375958
type: AnsweredQuestion
tagged with: karma-runner
downvote count: 0

http://stackoverflow.com/comment/43326885
score: 0
type: Comment
has text: @Anima-t3d Yes I did. After pasting the thing into Opera Dragonfly's console the "Commit" button would always light up, as if there were changes to the code, but the code was only ever committed if I refreshed the page or used the back/forward buttons. Clicking the commit button didn't do anything either.
comment on: http://stackoverflow.com/a/27336742
type: AnswerComment

http://stackoverflow.com/a/27378059
has body: You can use an object to store your arrays in, then access that object using the string value of the dropdown. Something like this: var options = { arr1: ['A', 'B', 'C'], arr2: ['1', '2', '3'], arr3: ['X', 'Y', 'Z'] } var array = options[$('#ddl').val()]; // options[document.getElementById('ddl').value] Example fiddle
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27377969
type: Answer
accepted answer of: http://stackoverflow.com/q/27377969
score: 4
upvote count: 4

http://stackoverflow.com/a/27459706
has body: try: HTML: &lt;div id="newTask"&gt; &lt;input type="hidden" id="taskID" 1="" name="taskID" value="39"&gt; &lt;input type="text" id="taskName1" name="taskName1" value="12"&gt; &lt;span class="remove" data-myid="39"&gt;&lt;/span&gt; &lt;/div&gt; JS: $(".remove").click(function(){ var currentID = $(this).data('myid'); var parenID = $(this).parent().attr('id'); $.ajax({ url: 'scripts/removeTask.php', type: 'post', data: 'id='+currentID, success: function(data, status) { if(data == "OK") { $("#"+parenID).remove(); } else{ $('#TaskResult').html(data); } }, error: function(xhr, desc, err) { console.log(xhr); console.log("Details: " + desc + "\nError:" + err); } }); // end ajax call })
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43356343
has comment: http://stackoverflow.com/comment/43358865
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27459641
has comment: http://stackoverflow.com/comment/43356284
has comment: http://stackoverflow.com/comment/43356164
accepted answer of: http://stackoverflow.com/q/27459641
type: Answer
has comment: http://stackoverflow.com/comment/43356138

http://stackoverflow.com/a/27413908
has comment: http://stackoverflow.com/comment/43272056
accepted answer of: http://stackoverflow.com/q/27413788
has body: Here's a link to a fiddle. http://jsfiddle.net/uo15brz1/7/ I changed your markup a little, adding id attributes to your divs. The jquery, gets the name attribute from the link that's clicked, adds a # to the front, hides the visible div, then toggles the respective div. I also added e.preventDefault to stop the browser from navigating due to the hash change. As an aside, javascript don't require the $ prefix. $(document).ready(function () { $(".click_me").on('click', function (e) { e.preventDefault(); var name = $(this).attr('name'); var target = $("#" + name); if(target.is(':visible')){ return false; //ignore the click if div is visible } target.insertBefore('.hide_div:eq(0)'); //put this item above other .hide_div elments, makes the animation prettier imo $('.hide_div').slideUp(); //hide all divs on link click target.slideDown(); // show the clicked one }); });
has comment: http://stackoverflow.com/comment/43272212
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27413788
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43272206
has comment: http://stackoverflow.com/comment/43272026

http://stackoverflow.com/q/27416503
upvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/43276847
tagged with: javascript
has comment: http://stackoverflow.com/comment/43276973
has comment: http://stackoverflow.com/comment/43276719
has body: I am trying to redirect on a specific url when user select an option here is the code i am using Maquilero textil tipo and the script $('#maqui').on('change', function (e) { var optionSelected = $("option:selected", this); var valueSelected = this.value; top.location.href="/ver/"+valueSelected; }); I want to redirect to /ver/valueSelected
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27416670
downvote count: 0
has comment: http://stackoverflow.com/comment/43276952
tagged with: jquery
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/27416670
has title: jquery select change event when get selected option

http://stackoverflow.com/comment/43157941
has text: Use console.log to display some intermediate values, such as the values passed to the chooseEntry and createWriter callbacks. This will no doubt tell you what's wrong. If you want more help, post a small, complete app here, including the manifest.json file.
comment on: http://stackoverflow.com/q/27350235
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27353967
has comment: http://stackoverflow.com/comment/43161161
has comment: http://stackoverflow.com/comment/43161139
has answer: http://stackoverflow.com/a/27354474
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/43161199
has comment: http://stackoverflow.com/comment/43161611
tagged with: javascript
has comment: http://stackoverflow.com/comment/43161603
score: 0
has comment: http://stackoverflow.com/comment/43161582
tagged with: validation
answer count: 1
has body: I'm doing some input validation using angular, but when the function is called each of the elements come back as undefined. I've included the important code below, please let me know if this is not enough. I appreciate any help that I can get. JS angular.module('app.directives', []) .directive('mrnCheck', [function () { return { require: 'ngModel', link: function (scope, elem, attrs, ctrl) { //console.log(firstMRN.val()); var firstMRN = '#' + attrs.mrnCheck; elem.add('test'); //console.log(firstMRN.val()); //console.log(firstMRN); elem.add(firstMRN).on('keyup', function () { scope.$apply(function () { ctrl.$setValidity('mrnmatch', elem.val() === $(firstMRN).val()); }); }); } } }]); HTML <div class = "row" ng-show="<?php echo $_SESSION["associate"]; ?>"> MRN MRN MRN values must match! Error at link (httpsomeLink/imageinbox/IIExpress/app/app.js:237:9) at nodeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6704:13) at compositeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6098:13) at compositeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6101:13) at nodeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6698:24) at compositeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6098:13) at nodeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6698:24) at compositeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6098:13) at compositeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6101:13) at nodeLinkFn (httpsomeLink/imageinbox/IIExpress/app/assets/angular/angular.js:6698:24) Please note, line 237 is the line that begins with elem.add. Also, somelink represents a real link, as I could not post the real one.
tagged with: angularjs
type: UnansweredQuestion
has title: TypeError: undefined is not a function Input Validation AngularJS

http://stackoverflow.com/q/27411562
has comment: http://stackoverflow.com/comment/43268425
has comment: http://stackoverflow.com/comment/43292061
has comment: http://stackoverflow.com/comment/43267682
has title: IE executes inline scripts before external in dynamic iframe content
answer count: 0
upvote count: 3
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/43292686
type: Question
score: 3
has body: within a website I'm writing the content of a dynamically added iframe with JavaScript. After adding the content to the iframe the JavaScript in the iframe will be executed. Unfortunately there are differences in IE. IE (8-11) will execute inline JavaScript first, before executing external scripts even if they are before the internal scripts. This is very strange since the normal process is, that JavaScript will be loaded synchronously step by step. Example: My webpage: TEST test1.js will just log a example status to see what kind of log will be executed firstly: console.log("EXTERNAL"); In Firefox the console will be: "EXTERNAL" test1.js:1 "Inline" test.html:1 "EXTERNAL" test1.js:1 "Inline" test.html:1 In IE the console will be: EXTERNAL Inline Inline EXTERNAL As you can see the inline content will be executed before the external even if the external was added to the iframe before! Can somebody tell me why and how to avoid it? Notice: You can ignore the first two console logs since the parser will log the JavaScript even if it is inside a string (in my example it is inside the string).
tagged with: internet-explorer
tagged with: internet-explorer-8
tagged with: javascript
linked to: http://stackoverflow.com/q/690251
has comment: http://stackoverflow.com/comment/43292017
downvote count: 0
has comment: http://stackoverflow.com/comment/43279169
tagged with: asynchronous
favorite count: 0
has comment: http://stackoverflow.com/comment/43331261

http://stackoverflow.com/comment/43233270
has text: grade:a is just an example. I could have two students with same grade a
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27392914
score: 0

http://stackoverflow.com/q/27321392
score: 12
answer count: 2
upvote count: 12
downvote count: 0
tagged with: javascript
favorite count: 0
has body: Node allows you to spawn child processes and send data between them. You could use it do execute some blocking code for example. Documentation says "These child Nodes are still whole new instances of V8. Assume at least 30ms startup and 10mb memory for each new Node. That is, you cannot create many thousands of them." I was wondering if is it efficient, should I worry about some limitations? Here's example code: //index.js var childProcess1 = childProcess.fork('./child1.js'); childProcess1.send(largeArray); childProcess1.once('message', function(formattedData) { console.log(formattedData); return false; }); //child1.js process.on('message', function(data) { data = format(data); //do smth with data, then send it back to index.js try{ process.send(data); return false; } catch(err){ console.log(err); return false; } });
has answer: http://stackoverflow.com/a/27327402
accepted answer: http://stackoverflow.com/a/27327402
tagged with: node.js
possible better answer: http://stackoverflow.com/a/27322570
has answer: http://stackoverflow.com/a/27322570
type: AnsweredQuestion
has title: Is it expensive/efficient to send data between processes in Node?
type: Question

http://stackoverflow.com/a/27365944
has body: It should be: function examplefunction() { document.getElemtentById("paragraphtobechanged").innerHTML = "When I put more \"\" it fails in other words it will not write this part." } You need to escape the double quotation marks. Or you can do: function examplefunction() { document.getElemtentById("paragraphtobechanged").innerHTML = 'When I put more "" it fails in other words it will not write this part.' }
type: Answer
accepted answer of: http://stackoverflow.com/q/27365900
score: 2
answers question: http://stackoverflow.com/q/27365900
upvote count: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27394396
has body: Maybe you should set height to dropdown-menu class , otherwise 'overflow:auto' won't work
answers question: http://stackoverflow.com/q/27393070
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27393070
type: AcceptedAnswer

http://stackoverflow.com/q/27390942
tagged with: http://stackoverflow.com/tag/html
tagged with: plugins
has title: move jquery into js file cause reference error and type error
type: Question
has comment: http://stackoverflow.com/comment/43229769
tagged with: javascript
has answer: http://stackoverflow.com/a/27391024
has comment: http://stackoverflow.com/comment/43229794
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/27391012
has body: So, in my html file, I have a script for flashing message like this &lt;script&gt; $(document).ready( function() { flashThisMessage("me"); }); //I want to move this code below to js file, so I dont have to copy this part //to every html file that need to use, so I can just include the js file (function($) { $.fn.flash_message = function(options) { options = $.extend({ text: 'Done', time: 5000, how: 'before', class_name: '' }, options); return $(this).each(function() { if( $(this).parent().find('.flash_message').get(0) ) return; var message = $('&lt;span /&gt;', { 'class': 'flash_message ' + options.class_name, text: options.text }).hide().fadeIn('fast'); $(this)[options.how](message); message.delay(options.time).fadeOut('normal', function() { $(this).remove(); }); }); }; })(jQuery); &lt;/script&gt; and my js file look like this function flashThisMessage( theMessage ) { $('#status-message-area').flash_message({ text: theMessage, how: 'append' }); } How can I move this the flash_message script into js file, I tried to just copy it, it will give an error "ReferenceError: jQuery is not defined" and "TypeError: $(...).flash_message is not a function" ?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43229784
has comment: http://stackoverflow.com/comment/43229831

http://stackoverflow.com/comment/43196933
comment on: http://stackoverflow.com/a/27372917
score: 0
type: AnswerComment
has text: It is a javascript code, so you need it inside tag
type: Comment

pug
tags question: http://stackoverflow.com/q/27343757
tags question: http://stackoverflow.com/q/27381217
tags question: http://stackoverflow.com/q/27454776
tags question: http://stackoverflow.com/q/27372323
tag name: pug
type: Tag
tags question: http://stackoverflow.com/q/27347810
tags question: http://stackoverflow.com/q/27415272
tags question: http://stackoverflow.com/q/27369976
tags question: http://stackoverflow.com/q/27407358
tags question: http://stackoverflow.com/q/27353722

http://stackoverflow.com/comment/43218294
comment on: http://stackoverflow.com/a/27384452
score: 0
type: AnswerComment
type: Comment
has text: @FossArduino have a look at https://egghead.io/articles/new-to-angularjs-start-learning-here too

http://stackoverflow.com/q/27350813
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43163982
tagged with: path
has comment: http://stackoverflow.com/comment/43158438
has body: I've been working on a project using fake data and sketches I've found online to create a line graph. However, I can't display paths with a JSON file containing numerical data. This is not the final data but I'm using the field "Id" as numerical value. I should be able to see a diagonal line, but nothing shows on the graph. &lt;body&gt; &lt;script&gt; var margin = {top: 20, right: 30, bottom: 30, left: 50}, width = 900 - margin.left - margin.right, height = 500 - margin.top - margin.bottom, a = 3.779528*5, f = width/height, ticksX = 1+ (width/a), ticksY = 1+ (height/a*f) c = 1 + (width/a*10); var x = d3.scale.linear() .domain([194, 2229]) .range([0, width]); var y = d3.scale.linear() .domain([194, 2229]) .range([height, 0]); var xAxis = d3.svg.axis() .scale(x) .tickSize(-height) .tickPadding(10) .tickSubdivide(true) .ticks(ticksX) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .tickPadding(10) .tickSize(-width) .tickSubdivide(true) .ticks(ticksY) .orient("left"); var zoom = d3.behavior.zoom() .x(x) //.y(y) .scaleExtent([1, 10]) .on("zoom", zoomed); var svg = d3.select("body").append("svg") .call(zoom) .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); d3.json("pacientes.json", function(error, data) { data.forEach(function(d) { d.Id = +d.Id; d.Edad = +d.Edad; console.log(d.Id); }); x.domain(d3.extent(data, function(d) { return d.Id; })); y.domain(d3.extent(data, function(d) { return d.Id; })); svg.append("clipPath") .attr("id", "clip") .append("rect") .attr("width", width) .attr("height", height); var line = d3.svg.line() .interpolate("linear") .x(function(d) { return x(d.Id); }) .y(function(d) { return y(d.Edad); }); svg.selectAll('svg-path') .data(data) .enter() .append("path") .attr("x", function(d) { return x(d.Id); }) .attr("y", function(d) { return x(d.Id); }) .style("stroke-width", 10) .attr("class", "line") .attr("…
has title: Path not showing d3 (binding issue?)
type: Question
tagged with: javascript
score: 0
tagged with: binding
has comment: http://stackoverflow.com/comment/43162739

http://stackoverflow.com/q/27373304
score: -1
has body: I use Geo Plugin for get user state/ County and store it in cookie. So website's data will display data from that state/ County. But issue is what if User Change State/ County then site will reload and again that included config file will call and set cookie to current state/ County from that Geo Plugin. Here is my cookie code // get user location require_once(LIBRARY_DIR.'/geoplugin.class.php'); $geoplugin = new geoPlugin(); $geoplugin-&gt;locate(); setcookie("county", $geoplugin-&gt;region); Now user change county from dropdown list then again it set to current county. what I do for prevent again to select default/ Current county from Geo Plugin ?
answer count: 1
favorite count: 0
duplicate of: http://stackoverflow.com/q/9415282
type: UnansweredQuestion
tagged with: php
has title: PHP : Change Cookie Value
tagged with: cookies
tagged with: geolocation
linked to: http://stackoverflow.com/q/9415282
downvote count: 1
has answer: http://stackoverflow.com/a/27373532
type: Question
upvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43349139
type: QuestionComment
has text: @T J - alert working ,i have no errors but getting some Warnings.
type: Comment
comment on: http://stackoverflow.com/q/27441411
score: 0

http://stackoverflow.com/q/27409373
has title: Getting [$injector:modulerr] on a very simple page; can't figure out why
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27409560
type: Question
tagged with: javascript
score: 0
has body: I'm very much a noob to Angular. And I'm getting an error that I just can't figure out (even after much Googling and fiddling around). Here's my code (and here it is on CodePen): Ergo The code above produces this error: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.5/$injector/modulerr?p0=ergo&p1=Error%3A%20…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A17%3A339) (<a href="http://errors.angularjs.org/1.3.5/$injector/modulerr?p0=ergo&p1=Error%3A%20%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.5%2F%24injector%2Fnomod%3Fp0%3Dergo%0A%20%20%20%20at%20Error%20(native)%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A6%3A416%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A21%3A334%0A%20%20%20%20at%20a%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A20%3A483)%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A21%3A218%0A%20%20%20%20at%20http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A35%3A146%0A%20%20%20%20at%20r%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A7%3A302)%0A%20%20%20%20at%20g%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A34%3A428)%0A%20%20%20%20at%20Lb%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A38%3A146)%0A%20%20%20%20at%20d%20(http%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A17%3A339" rel="nofollow">Here's a link to the full URL from that error message.) A few places on the web say that this can happen if the ngRoute module fails to load - it was formerly part of the Angular core, but was split out into its own module in 1.2. Now, I'm not using ngRoute anywhere in this very simple page, so …
answer count: 1
has comment: http://stackoverflow.com/comment/43263136
has answer: http://stackoverflow.com/a/27409560
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43263066

http://stackoverflow.com/comment/43184605
type: Comment
comment on: http://stackoverflow.com/a/27363895
has text: @DavidMarch I don't understand that comment, I don't use it in my answer.
score: 0
type: AnswerComment

physics
tags question: http://stackoverflow.com/q/27466436
tag name: physics
type: Tag

http://stackoverflow.com/comment/43226332
has text: what is `medication`? An Object or an Array?
type: Comment
comment on: http://stackoverflow.com/q/27389187
score: 0
type: QuestionComment

promise
tags question: http://stackoverflow.com/q/27413715
tags question: http://stackoverflow.com/q/27468188
tags question: http://stackoverflow.com/q/27322723
tags question: http://stackoverflow.com/q/27445793
tags question: http://stackoverflow.com/q/27377688
tags question: http://stackoverflow.com/q/27388151
tags question: http://stackoverflow.com/q/27440281
tag name: promise
tags question: http://stackoverflow.com/q/27432759
tags question: http://stackoverflow.com/q/27436513
tags question: http://stackoverflow.com/q/27340910
tags question: http://stackoverflow.com/q/27318238
type: Tag
tags question: http://stackoverflow.com/q/27322916
tags question: http://stackoverflow.com/q/27429508
tags question: http://stackoverflow.com/q/27344138
tags question: http://stackoverflow.com/q/27320139
tags question: http://stackoverflow.com/q/27409837
tags question: http://stackoverflow.com/q/27319781
tags question: http://stackoverflow.com/q/27419712
tags question: http://stackoverflow.com/q/27450782
tags question: http://stackoverflow.com/q/27445513
tags question: http://stackoverflow.com/q/27343489
tags question: http://stackoverflow.com/q/27317744
tags question: http://stackoverflow.com/q/27389742

http://stackoverflow.com/a/27384308
upvote count: 1
answers question: http://stackoverflow.com/q/27384155
downvote count: 0
type: Answer
score: 1
has body: Shims or require config does not load any scripts. Scripts are loaded when you require it.

http://stackoverflow.com/comment/43289083
has text: try using htmlspecialchars($test)
comment on: http://stackoverflow.com/q/27423476
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27362845
accepted answer: http://stackoverflow.com/a/27363203
has comment: http://stackoverflow.com/comment/43178272
has body: I have a website, which has some functions that are related to tablet view and some that are related to phone view - mostly menu configuration. To overcome the need to refresh the website every time the device is changing it's orientation, i used the resize function to load the relevant functions each time the user resizes his window (aka orientation). function res(){ var reswidth = $(window).width(); //REMOVING SOME MENU STYLES $('.logo').removeClass('logoTop'); $('.menuList').removeClass('ulTop'); $('.menuList').removeClass('openMenu'); $('.menuList').removeClass('openMenu0'); $('.logo').unbind(); $('.menu-item').unbind(); $('.menuList').unbind(); $('.icon-menu').unbind(); $('.menuListItem').unbind(); $('.menu').unbind(); $('.info').unbind(); //DETECTING WHICH DEVICE IS IT. if (reswidth &gt; 1000) { slideshow(); tablet(); if (reswidth &gt; 1600) { audio(); } } else { phone(); $('.menu').localScroll(); } } $(window).ready(res).resize(res); The problem with this method is that actually the mobile browsers are resizing all the time! every time the user scrolls (in any direction) the browser is changing it's size (menu bars, tab bars and address bar) which leads to removing and recalling the phone() function over and over again. I'm looking for a way to enable the resize function ONLY if the user has passed a specific amount of pixels/resizes numbers.. so changing 100px won't count as a resize. Is that possible with jQuery? live example can be seen at boazkerengil.com/zoubisou
has title: Using resize function from minimum number of resizes
has answer: http://stackoverflow.com/a/27363203
has comment: http://stackoverflow.com/comment/43177965
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43178013
type: Question
score: 0
tagged with: mobile
answer count: 1
tagged with: javascript
tagged with: resize
tagged with: jquery

http://stackoverflow.com/comment/43201547
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27375635
has text: you can trim on MYSQL end `SELECT TRIM(BOTH '%' FROM 'query');`

http://stackoverflow.com/comment/43258151
score: 0
comment on: http://stackoverflow.com/q/27405344
type: Comment
type: QuestionComment
has text: Nice. So you already done the `"send the data to the client"` part in the server. Now, you have to debug your client side. Do you see anything in the browser console? If you put just a `console.log('test')` inside the callback in the ajax request, can you see it logged?

http://stackoverflow.com/q/27330601
tagged with: datepicker
tagged with: php
tagged with: wordpress
has title: Restrict Date/Time Picker
has body: I'm using the contact form 7 datepicker plugin which works great but i'm looking to limit the values on it: https://wordpress.org/plugins/contact-form-7-datepicker/. I want for users to be able to use the date picker on my contact form 7 booking forms but i want them to only be able to select a day that is no earlier than 1 day and 1 hour in advance. So if i try to select todays date and todays time, an alert will popup saying that its too early. It has to be 25 hours at the earliest. How would i even begin this with the below plugin code: time.php file ... <?php class ContactForm7Datepicker_Time { static $inline_js = array(); public static function register() { // Register shortcodes add_action('wpcf7_init', array(__CLASS__, 'add_shortcodes')); // Validations add_filter('wpcf7_validate_time', array(__CLASS__, 'validation_filter'), 10, 2); add_filter('wpcf7_validate_time*', array(__CLASS__, 'validation_filter'), 10, 2); // Tag generator add_action('load-contact_page_wpcf7-new', array(__CLASS__, 'tag_generator')); add_action('load-toplevel_page_wpcf7', array(__CLASS__, 'tag_generator')); // Messages add_filter('wpcf7_messages', array(__CLASS__, 'messages')); // Print inline javascript add_action('wp_print_footer_scripts', array(__CLASS__, 'print_inline_js'), 99999); } public static function shortcode_handler($tag) { $tag = new WPCF7_Shortcode($tag); if (empty($tag->name)) return ''; $validation_error = wpcf7_get_validation_error($tag->name); $class = wpcf7_form_controls_class($tag->type, 'wpcf7-date'); if ($validation_error) $class .= ' wpcf7-not-valid'; $atts = array(); $atts['size'] = $tag->get_size_option('40'); $atts['maxlength'] = $tag->get_maxlength_option(); $atts['class'] = $tag->get_class_option($class); $atts['id'] = $tag->get_option('id', 'id', true); $atts['tabindex'] = $tag->get_option('tabindex', 'int', true); $atts['type'] = 'text'; if ($tag->has_option('readonly')) $atts['readonly'] = 'readonly'; if ($tag->is_required()) $atts['aria-required'] = 'true…
type: Question
has answer: http://stackoverflow.com/a/27335147
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion

wordpress
tags question: http://stackoverflow.com/q/27349618
tags question: http://stackoverflow.com/q/27462178
tags question: http://stackoverflow.com/q/27462984
tags question: http://stackoverflow.com/q/27351068
tags question: http://stackoverflow.com/q/27445671
tags question: http://stackoverflow.com/q/27365512
tags question: http://stackoverflow.com/q/27442753
tags question: http://stackoverflow.com/q/27411752
tags question: http://stackoverflow.com/q/27372964
tags question: http://stackoverflow.com/q/27370103
tags question: http://stackoverflow.com/q/27379102
tags question: http://stackoverflow.com/q/27435454
tags question: http://stackoverflow.com/q/27320907
tags question: http://stackoverflow.com/q/27454679
tags question: http://stackoverflow.com/q/27420426
tags question: http://stackoverflow.com/q/27395679
tags question: http://stackoverflow.com/q/27380904
tags question: http://stackoverflow.com/q/27424856
tags question: http://stackoverflow.com/q/27450209
tags question: http://stackoverflow.com/q/27365322
tags question: http://stackoverflow.com/q/27334886
tags question: http://stackoverflow.com/q/27462210
tags question: http://stackoverflow.com/q/27465724
tags question: http://stackoverflow.com/q/27472096
tags question: http://stackoverflow.com/q/27327884
tags question: http://stackoverflow.com/q/27394365
tags question: http://stackoverflow.com/q/27427292
tags question: http://stackoverflow.com/q/27375928
tags question: http://stackoverflow.com/q/27385289
tags question: http://stackoverflow.com/q/27370728
tags question: http://stackoverflow.com/q/27387865
tags question: http://stackoverflow.com/q/27436284
tag name: wordpress
tags question: http://stackoverflow.com/q/27424705
tags question: http://stackoverflow.com/q/27319508
tags question: http://stackoverflow.com/q/27440695
tags question: http://stackoverflow.com/q/27433444
tags question: http://stackoverflow.com/q/27343555
tags question: http://stackoverflow.com/q/27330601
tags question: http://stackoverflow.com/q/27450120
tags question: http://stackoverflow.com/q/27386034
tags question: http://stackoverflow.com/q/27405925
tags question: http://stackoverflow.com/q/27392314
tags question: http://stackoverflow.com/q/27335088
tags question: http://stackoverflow.com/q/27354750
type: Tag
tags question: http://stackoverflow.com/q/27444148
tags question: http://stackoverflow.com/q/27390912
tags question: http://stackoverflow.com/q/27338562

http://stackoverflow.com/comment/43293235
score: 0
comment on: http://stackoverflow.com/q/27424843
type: Comment
type: QuestionComment
has text: Actually I just notice that you simply changed the id for a class in the jquery, so now all the comments open and close at the same time. This is why I needed to catch the first comment after the post.

http://stackoverflow.com/q/27313885
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43088519
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have the following code On pageinit popup getting opened but it is closing again. What do I have to do to make it stay? $(document).delegate("#pageone", "pageinit", function () { alert("hi"); $("#popupdiv").trigger("click"); //openvipPopup is the id of the anchor for popup }); using Solution Location Cancel Done Set URL Solution Location
has comment: http://stackoverflow.com/comment/43088452
type: Question
has title: how to open popup on page init in jquery mobile
linked to: http://stackoverflow.com/q/16441013
duplicate of: http://stackoverflow.com/q/16441013

http://stackoverflow.com/q/27332279
has comment: http://stackoverflow.com/comment/43123035
type: Question
tagged with: javascript
score: 0
tagged with: jquery
has title: Different types of transitions on the same slider in bxslider
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43122516
has body: I am using bxslider for a very simple slider and would like to have different types of transition between slides. For instance the first slide will move in horizontal direction while the next in vertical. Is there any way I can accomplish this? I have tried the following but it doesn't work: $('.bxslider').bxSlider({ auto: true, pause: 70, speed: 700, pager: false, controls: false, mode: 'vertical', onSlideNext: function($slideElement, oldIndex, newIndex){ if (newIndex == 2) this.mode = 'horizontal'; if (newIndex == 4) this.mode = 'vertical'; } });
answer count: 0
tagged with: bxslider
has comment: http://stackoverflow.com/comment/43123253

http://stackoverflow.com/comment/43370066
type: QuestionComment
comment on: http://stackoverflow.com/q/27467198
has text: you start node server by typing in `node server.js`
score: 0
type: Comment

http://stackoverflow.com/q/27457469
linked to: http://stackoverflow.com/q/13281244
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43352538
has comment: http://stackoverflow.com/comment/43352558
tagged with: css
has answer: http://stackoverflow.com/a/27457552
has answer: http://stackoverflow.com/a/27458623
has comment: http://stackoverflow.com/comment/43352147
tagged with: scroll
type: Question
has comment: http://stackoverflow.com/comment/43352133
answer count: 2
downvote count: 0
tagged with: javascript
score: 4
has body: What I am trying to achieve is that when the user scrolls the page using the mouse-wheel (as there is no scrollbar), the page slides down with an animation to the next section of the page and while the animation is being played, mouse-wheel won’t work (to tidy things up, which is a good act). The behavior I want can be seen in http://google.com/inbox or http://www.luxaqua-design.com/. The thing I liked in Google’s inbox website is that it has the same effects with touch screen devices and their scrolling mechanisms. I only need some pointers about the events that happen in this kind of scrolling and how I can manage them (specially, I am looking to achieve the same functionality with touch devices).
has title: How to recreate page scroll behavior in Google’s inbox page?
upvote count: 4
has comment: http://stackoverflow.com/comment/43352497

http://stackoverflow.com/q/27363351
type: Question
has answer: http://stackoverflow.com/a/27363552
has comment: http://stackoverflow.com/comment/43178893
has body: &lt;html&gt; &lt;body&gt; var el = document.getElementById("tab"); var tab = Table(el, data); tab.showData(); tab.takeData(); var PieChart=drawPieChart(canvas); &lt;/body&gt; &lt;/html&gt; &lt;script&gt; function Table(el, data) { ... ... return{ showData: function(){ ... ... } takeData: function(){ var myData=new Array(); for (var i = 0; i &lt; val2; i++) { myData[i] = document.getElementById('polja' + i).value; } } ... ... }; } function drawPieChart(canvas){ ... ... return{ getmyData( ); ... ... }; } &lt;/script&gt; how can i get myData in function "drawPieChart" except making myData global variable? thx i was thinking in html make somthing like this PieChart.getMyData(Table.takeData); or something like that
has title: javascript get array from another function
has comment: http://stackoverflow.com/comment/43178691
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27364253
has comment: http://stackoverflow.com/comment/43178619
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27364811

http://stackoverflow.com/a/27357422
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27357313
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/43167262
upvote count: 1
has comment: http://stackoverflow.com/comment/43168236
has comment: http://stackoverflow.com/comment/43167400
has comment: http://stackoverflow.com/comment/43170427
accepted answer of: http://stackoverflow.com/q/27357313
has body: You check the keyCode on a click, that won't work. Also, the preventDefault() should be used on the event: e.preventDefault(). Use this instead for global enter key: $(document).ready(function() { $(window).keydown(function(event){ if(event.keyCode == 13) { event.preventDefault(); return false; } }); });

http://stackoverflow.com/q/27351466
has comment: http://stackoverflow.com/comment/43157510
tagged with: javascript
has comment: http://stackoverflow.com/comment/43157544
score: -1
has comment: http://stackoverflow.com/comment/43158918
has comment: http://stackoverflow.com/comment/43157662
has body: I am trying to build a video application in cordova for Android Platform in that i had completed to display video from youtube embed url .And it is working fine for some video but some video facing issue as given below in screen shots. For playing youtube video in in-line i used all the basic configuration like 1>For AndroidManifest.xml android:hardwareAccelerated="true" 2>For config.xml <preference name="AllowInlineMediaPlayback" value="true"/> <access origin="*" subdomains="true" /> <access origin="http://*.youtube.com" /> And the iframe for playing in-line video is given below
has comment: http://stackoverflow.com/comment/43158020
has comment: http://stackoverflow.com/comment/43157483
has comment: http://stackoverflow.com/comment/43157562
has comment: http://stackoverflow.com/comment/59956560
has comment: http://stackoverflow.com/comment/43158979
answer count: 1
has comment: http://stackoverflow.com/comment/43158556
favorite count: 0
tagged with: cordova
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43157858
tagged with: android
has answer: http://stackoverflow.com/a/27354269
has comment: http://stackoverflow.com/comment/43157754
has comment: http://stackoverflow.com/comment/43157785
has comment: http://stackoverflow.com/comment/43157699
has comment: http://stackoverflow.com/comment/43157911
tagged with: video
has comment: http://stackoverflow.com/comment/43157727
tagged with: iframe
downvote count: 3
has comment: http://stackoverflow.com/comment/43157829
has comment: http://stackoverflow.com/comment/43158810
has comment: http://stackoverflow.com/comment/43157621
has title: Videos of Youtube Not Working On Cordova Android App
type: Question
has comment: http://stackoverflow.com/comment/43157631
has comment: http://stackoverflow.com/comment/43157784

http://stackoverflow.com/q/27336616
answer count: 2
tagged with: jquery
has body: In my page I am trying to hold old value and when something gets wrong I need to get it back. ex: var $oldVal; $(document).delegate('.edit','click',function(){ $oldVal = $(this).closest('tr').find('input'); }); $(document).delegate('.save','click',function(){ $.get('servlet',function(result){ if (result.result == "true"){ $newVal = $(this).closest('tr').find('input'); }else if ( result.result == "false" ) { $newVal = $oldVal; // } }); }); When I try to get new val in $.each like this; $.each($newVal,function(k,v){ value = $(v).val(); /// PROBLEM ( 1 ) }); It will never get the old value. It always gets the new one. I am trying to make an input box that will be same after user input is right but if it is wrong then it needs to get older value.
type: UnansweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27336688
has answer: http://stackoverflow.com/a/27336684
score: 0
has title: Jquery gets new value from dom

http://stackoverflow.com/q/27347339
upvote count: 1
type: AnsweredQuestion
has body: I'm trying to generate a table with a simple 'for' loop, and all rows and cells generate just fine, but they appear empty in Firefox. If you try to log cells' innerText on any stage, the content is there, it seems that it's that breaks everything. Here's code sample: http://jsfiddle.net/7s8e4w3p/ html This Is Table Header in JsFiddle css th, td { border: 1px solid black; } js for(var i=0; i<=5; i++){ var tr = document.createElement('tr'); for(var j=0; j<=5; j++){ var td = document.createElement('td'); td.innerText = "test"; tr.appendChild(td); } document.getElementById('table').appendChild(tr); } Works perfectly well in Chrome, IE, Opera, mobile Safari and even Android browser. What am I missing?
accepted answer: http://stackoverflow.com/a/27347361
has comment: http://stackoverflow.com/comment/43162816
score: 1
has comment: http://stackoverflow.com/comment/43149556
has answer: http://stackoverflow.com/a/27347460
tagged with: dom
has title: Generated table is empty in firefox 33
type: Question
answer count: 2
tagged with: firefox
downvote count: 0
possible better answer: http://stackoverflow.com/a/27347460
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/1359469
has answer: http://stackoverflow.com/a/27347361
tagged with: http://stackoverflow.com/tag/html
duplicate of: http://stackoverflow.com/q/1359469
tagged with: css

http://stackoverflow.com/comment/43215039
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27383099
has text: How is a noscript tag a pop up ad?
type: Comment

http://stackoverflow.com/q/27458768
has title: Reference to global object to save data to db
favorite count: 0
linked to: http://stackoverflow.com/q/23667086
tagged with: node.js
has comment: http://stackoverflow.com/comment/43354577
answer count: 0
type: UnansweredQuestion
score: 1
has body: I am running on win 7 and have installed nodeJS as a path variable. I have installed a nodeJs module(server): I am getting my json elements like that: json: { channel: 'ticker.160', trade: { timestamp: 1418473296, datetime: '2014-12-13 07:21:36 EST', marketid: '160', topsell: { price: '0.00007723', quantity: '1.48685240' }, topbuy: { price: '0.00007714', quantity: '38.89032927' } } } Price: 0.00007714 Quantity: 38.89032927 Timestamp: 1418473296 The part of my script which prints and saves the data: var data; channel.bind("message", function(data) { console.log(data); this.data = data; console.log("Price: ", data.trade.topbuy.price, "Quantity:", data.trade.topbuy.quantity, "Timestamp:", data.trade.timestamp); }); console.log(data); /** * save data to db */ var trade = {exchange : 'crispy.com', market_id : 'ticker.160', typeOfTransaction : 'buy', price : data.trade.topbuy.price, quantity : data.trade.topbuy.quantity, created_at : data.trade.timestamp, updated_at : data.trade.timestamp }; var query = connection.query('INSERT INTO trades SET ?', trade, function(err, result) { }); console.log(query.sql); I want to reference to the global variable data, because I want to use the json object later to save it into a mysql db. When running the code I get later in my mysql part an error that the global object is not found: $ node server.js undefined c:\xampp\htdocs\project\psher\node_modules\server.js:52 price : data.trade.topbuy.price, ^ TypeError: Cannot read property 'trade' of undefined at Object.&lt;anonymous&gt; (c:\xampp\htdocs\project\psher\node_mo dules\server.js:52:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3 Any recommendations what I am doing wrong? I appreciate your answer!
has comment: http://stackoverflow.com/comment/43354689
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43372137
has comment: http://stackoverflow.com/comment/43354807
tagged with: javascript
has comment: http://stackoverflow.com/comment/43354637
downvote count: 0

http://stackoverflow.com/a/71047678
has comment: http://stackoverflow.com/comment/131783740
has body: I find very simple and intuitive solution to be: const d = new Date(Math.floor(Date.now() / 86400000) * 86400000); // 86400000 = 24 * 60 * 60 * 1000 Also if you wish to round to other values, for example to whole hours, you can easily expand the mentioned solution to: const d = new Date(Math.floor(Date.now() / 3600000) * 3600000); // 3600000 = 60 * 60 * 1000
answers question: http://stackoverflow.com/q/27323791
score: 0
has comment: http://stackoverflow.com/comment/133491536
type: Answer

http://stackoverflow.com/comment/43215374
type: QuestionComment
comment on: http://stackoverflow.com/q/27382686
has text: OK, so my understanding is wrong. Both will trigger a digest? There must have been some extenuating circumstances in the actual code.
score: 0
type: Comment

http://stackoverflow.com/comment/43313647
score: 0
type: AnswerComment
type: Comment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/66700/discussion-between-user3878988-and-idan-adar).
comment on: http://stackoverflow.com/a/27416081

http://stackoverflow.com/q/27445240
has comment: http://stackoverflow.com/comment/43329305
tagged with: javascript
has comment: http://stackoverflow.com/comment/43329351
accepted answer: http://stackoverflow.com/a/27445274
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27445274
has body: I have a question just out of curiosity, I have an HTML select inside of a form that looks like this: New York, US Stamford, US London, UK Sydney, AU when I submit the form, whichever option I have selected sends it's value to the server to my action method, even though I have not set a "value" attribute for each option. This is fine for me, I'm glad its working without it, but don't the option elements theoretically need a "value" attribute?
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43329366
type: Question
has title: html select element sends value to server without value attribute
score: 3

http://stackoverflow.com/q/27437077
has comment: http://stackoverflow.com/comment/43315273
answer count: 0
tagged with: nvd3.js
tagged with: d3.js
upvote count: 1
has title: angular nvd3 piechart not rendering data from backend
type: Question
score: 1
tagged with: javascript
has body: I am using angular d3 directive to render a pie chart from backend data. Pie chart works for static data: $http({ method : 'GET', url : piechart_url, headers:{ 'Content-Type' :'application/json' }}) .success(function(resp,status,headers,config) { //try hard coded here $scope.exampleData = [ { key: "One", y: 5 }, { key: "Two", y: 2 }, { key: "Seven", y: 9 } ]; }) But it does not work with the data from a backend API. * It only renders first key in the pie chart. * $http({ method : 'GET', url : piechart_url, headers:{ 'Content-Type' :'application/json' }}) .success(function(resp,status,headers,config) { $scope.exampleData = resp.items; }) The resp.items contains [{"key":"ONE","y":10000},{"key":"TWO","y":10}] I have tried adding/removing quotes.
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/43163386
score: 0
comment on: http://stackoverflow.com/q/27355205
type: QuestionComment
type: Comment
has text: possible duplicate of [JavaScript Form Validation](http://stackoverflow.com/questions/15088538/javascript-form-validation)

http://stackoverflow.com/q/27329296
favorite count: 0
has body: I'm interested in using WebPack for my SPA (I haven't used it before), which will have several pages, each with their own bundle of JS, CSS and HTML. Firstly, is there a way to remove stylesheets that aren't being used using webpack? From a look at the documentation, it seems that there isn't. For example, say I have a #wrapper div that needs to have a width: auto for most pages, but a width: 100% for a certain page that needs to be full screen. If my modules just require() their stylesheets, then they will all keep being added to the HTML, and the last one to be loaded will have control over the width, whereas I want just the current page's stylesheet to be loaded. Is there any way to remove stylesheets using webpack? Or is there a better solution to this problem? In addition, does webpack have a callback for stylesheets? If I need to run some code only when the css has loaded (I mean the onload callback has fired, not just when the tag is added to the html), is there a proper way of doing it?
tagged with: css
has title: Adding and removing stylesheets with webpack
answer count: 0
downvote count: 0
type: UnansweredQuestion
type: Question
score: 1
upvote count: 1
tagged with: webpack
tagged with: javascript

http://stackoverflow.com/comment/43105172
type: QuestionComment
comment on: http://stackoverflow.com/q/27322973
score: 5
has text: The reason that this is happening is that angular triggers digest cycles when data is change withing its own scope, However if the data is changed externally then angular does not see/know about a change and thus can not evaluate changes. Please read about [`$scope`](https://docs.angularjs.org/guide/scope) for a better understanding.
type: Comment

http://stackoverflow.com/comment/43188631
has text: You have to use JavaScript for this. CSS doesn't handle logic, only presentation, and remembering which images were clicked falls squarely under logic.
score: 1
comment on: http://stackoverflow.com/q/27368371
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/44207904
score: 0
has text: Thanks, I think this is as close as I can get... it's not perfect but it will have to do for now
type: Comment
comment on: http://stackoverflow.com/a/27398577
type: AnswerComment

http://stackoverflow.com/comment/43129044
type: AnswerComment
has text: I don't think that will quite work- I'm not trying to change the HTML. I'm trying to update the link_to path. the link_to url is flash_card_path(old: @card). I need it to be that same path, but I need to update @card to be a different value. The attr() selector doesn't change the rails generated bath, does it?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27335524

http://stackoverflow.com/comment/43106721
type: AnswerComment
type: Comment
has text: If someone could modify the JS file that contains the data, they could probably also modify the JS file that contains the actual application logic. By that logic, I should not write a website at all, because everything could be hijacked.
score: 0
comment on: http://stackoverflow.com/a/27322162

http://stackoverflow.com/a/27452075
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27451846
score: 1
accepted answer of: http://stackoverflow.com/q/27451846
type: AcceptedAnswer
has body: Your module should look like this: var Schema = mongoose.Schema; var InfoSchema = new Schema ({ name: String, email: String, }); module.exports = mongoose.model('Info', InfoSchema); That way you're exporting the model, not the schema. Then you can use it like so: var Info = require('../config/mongo/mySchema'); app.post('/person', function(req, res) { var Data = { name: req.body.name, email: req.body.email }; var info = new Info(Data); info.save(function (error, data){ if (error) { console.log(error); } else { console.log('done'); } }); });
downvote count: 0

http://stackoverflow.com/comment/43296949
comment on: http://stackoverflow.com/q/27427495
score: 0
has text: OK, guess it's not that then. You definitely don't have another element with the ID 'test'? The fragment you've posted certainly looks like it should work.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47577388
has text: If you run this snippet inside Safari and look at the console (referring to console.log in the answer), you will see that the same error the OP stated is shown. I am also searching for this answer.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27378217
score: 2

http://stackoverflow.com/a/27422097
has body: As an usual approach, many developers separate frontend errors and backend errors : as frontend errors there are missing input text, or double click on submit button. This kind of errors are usually managed in the beforeSend: function, 'cause it would be a waste of time to send AJAX requests with missing data. You can stop the request with a simple return false statement as discussed here. A lot of people also use the JQuery validation plugin that works really well. as backend errors there are values that are not validated by your server-side language (PHP or others), or more technical issues like internal server error or timeout. In this case, you can use the error: function as well explained by @Forien, separating errorStatus values to give users a more readable feedback. Hope this helps
answers question: http://stackoverflow.com/q/27421541
type: Answer
score: 0

http://stackoverflow.com/a/27363724
answers question: http://stackoverflow.com/q/27363583
type: Answer
has body: I would use an array as the response. PHP : $total = ($_POST['price'] * $_POST['ammount']) * (1 - $system-&gt;fee()); define('ARRAYSPLIITER', '::'); echo $fee . ARRAYSPLIITER . 'Second String'; jQuery Ajax : $.ajax({ type: 'GET', url: '/system/calculate.php', data: 'ammount=' + $('ammount').val() , success: function(msg) { array = msg.split("::"); $('#modal-body').html(array[0]); $('#element2').html(array[1]); } })
score: 0

http://stackoverflow.com/q/27316889
has comment: http://stackoverflow.com/comment/43094311
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43093901
has body: I have created a HTML table and on each row there is a link to another page. The href attribute is not used for this redirect. Rather an onclick event. This works perfect when a left-click is used. However it does not work if "right-click -> new tab" is used. The current page just loads. Is there any simple way of making it work with a right-click? Or do I have to remove the href (...which will remove the right click menu option). &lt;a onclick="CommCenter.Core.View.openRuleUrl('/Rule/Index/7256')" href="#"&gt;
has comment: http://stackoverflow.com/comment/43094001
tagged with: javascript
has answer: http://stackoverflow.com/a/27316952
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has title: "Open in New Tab" not opening correct page
favorite count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/27368653
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: menu
has title: Div Margin-top Not Changing?
answer count: 0
type: UnansweredQuestion
tagged with: animation
has body: I have a menu-like div that I'd like to slide down. I'd also like the margin-top of the div underneath the menu div (the content div) to go down, so that the content div gets closer to the edge of the margin div as the margin div expands. This is my script: &lt;script type="text/javascript"&gt; var charter = document.getElementById("charter"); var main = document.getElementById("main"); var height = charter.style.height | 100; var mMargin = main.style.marginTop | 80; charter.onmouseover = down; charter.onmouseout = up; function down() { if (height &lt; 200) { height += 10; mMargin -= 10; charter.style.height = height + "px"; margin.style.marginTop = mMargin + "px"; setTimeout (down, 20); } } function up() { if (height &gt; 100) { height -= 10; charter.style.height = height + "px"; setTimeout (up, 20); } } &lt;/script&gt; The page loads, and nothing happens when I mouse over the div. I checked the error log, and the first error is: Uncaught TypeError: Cannot read property 'style' of null. That's followed by a bunch of Failed to load resource: net::ERR_FAILED, and then at the end there's a Widget configuration is not found. Perhaps it's in the way I'm defining mMargin? I might be supposed to use something different than marginTop, but I don't know what it is.
has comment: http://stackoverflow.com/comment/43189192
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43189477

http://stackoverflow.com/a/27423698
type: AcceptedAnswer
has body: just added display function with iDkey as 'id' $('#username').editable({ //to keep track of selected values in multi select type: 'select2', url: '/post', autotext : 'always', source : getSource(), value : [1,2], emptytext: 'None', display: function(value, sourceData) { //display checklist as comma-separated values var html = [], checked = $.fn.editableutils.itemsByValue(value, getSource(), 'id'); // it was needed to send 'id' as idKey otherwise it was fetching with value if(checked.length) { $.each(checked, function(i, v) { html.push($.fn.editableutils.escape(v.text)); }); $(this).html(html.join(', ')); } else { $(this).empty(); } }, select2: { multiple : true, initSelection : getInitSel(true), query :getQuery } }); here is working code http://jsfiddle.net/wQysh/351/ Every time we 'setValue' to editable or on close event editable's 'display' function is called. in display function existing values is checked by this function $.fn.editableutils.itemsByValue where the third parameter accepts the idKey. If we do not provide third parameter while calling this function, it by default takes 'value' as idKey. and 'value' as idKey should not be used when we are using to load array data. ref : http://ivaynberg.github.io/select2/#data_array.
type: Answer
answers question: http://stackoverflow.com/q/27423115
accepted answer of: http://stackoverflow.com/q/27423115
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/27430710
score: 0
type: Answer
has body: Thanks to @Vitaliy Zurian. I have used the following code, by using counter in the for loop router.route('/user/:_id/host/:_id/joineeList').get(function (req, res) { var finalList = []; Host.findOne({ _id: req.params._id }, function (err, host) { if (err) { res.send(err); } else { var count = host.joinees.length; var limits = []; for (var i = 0; i &lt; count; i++) { limits.push(i); } async.eachSeries(limits, function (i, callback) { console.log(host.joinees[i].userid); var ID = host.joinees[i].userid; var CODE = host.joinees[i].status_code; User.findOne({ _id: host.joinees[i].userid }, function (err1, user) { if (err1) { console.log(err1); } else { finalList.push({ "userId": ID, "name": user.name, "profilepic": user.profilepic, "status": CODE }); callback(); } }); }, function() { console.log(finalList); }); } }); });
answers question: http://stackoverflow.com/q/27426147

http://stackoverflow.com/q/27377093
tagged with: codeigniter
tagged with: forms
has answer: http://stackoverflow.com/a/27377932
type: Question
upvote count: 0
downvote count: 5
tagged with: javascript
tagged with: jquery
has title: What is the external URL for this tag
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/27377421
tagged with: php
accepted answer: http://stackoverflow.com/a/27377421
type: AnsweredQuestion
score: -5
possible better answer: http://stackoverflow.com/a/27377460
has body: I'm using a form that has 3 parts, login, forgot password and registration. The initial view is the login form, but can be changed to the forgot password or registration form, which replaces the initial view by using JS. I'm looking to post back to the page if validation isn't met. This seems to be working fine, and the field repopulates itself. However I can't get the right form to load when posted back. For example, if the user is filling out the forgot password form, and fills in an invalid email address, the message at the top of the form will be correct, however the form that will appear is the default login form. Once the user clicks on the forgot password button, JS kicks it over to the forgot password form, and has the users invalid email address re-populated. Each form has a unique "form_type" hidden variable to differentiate between the three, so I can use this to check then load the right one. Ideally I would like to keep this as 1 page and use JS to swap between the three if possible. I don't know how to get it to load the right form once posted back. It's using the below code to change between the forms. How do I link to the right form when posting back. &lt;a href="javascript:;" id="forget-password"&gt; &lt;a href="javascript:;" id="register-btn"&gt; I'm not good with JS at all, and I think this is the issue. The front end and JS is all created by a third party, it's "Metronic" theme. Let me know if I need to include any JS. If it makes a difference, although the logic should be the same, I'm using codeigniter too. EDIT All the functionality to swap between the forms is there, I just need it to POST back to the right form. This is what I have so far, if you click on the forgot password and enter an email address that is longer than 5 characters, you'll see what I mean. I obviously didn't ask this very well... Once the user submits, and the form is posted back with errors, I need right form to pop up, rather than the default for the page. The tags above…
has answer: http://stackoverflow.com/a/27377460

http://stackoverflow.com/q/27327707
type: Question
accepted answer: http://stackoverflow.com/a/27336742
has title: Possible to get line numbers or stack traces in Screeps?
has comment: http://stackoverflow.com/comment/43140970
tagged with: javascript
upvote count: 2
has answer: http://stackoverflow.com/a/27336742
has comment: http://stackoverflow.com/comment/43140949
answer count: 1
favorite count: 0
tagged with: screeps
has comment: http://stackoverflow.com/comment/43125685
has comment: http://stackoverflow.com/comment/43118016
has comment: http://stackoverflow.com/comment/43322648
score: 2
type: AnsweredQuestion
downvote count: 0
has body: In Screeps, is it possible to not just see the error in the console output, but also the module, line, and perhaps stack trace? UPDATE: this is what the errors I get look like. I don't see a line number or stack trace, or perhaps a button to enable these? https://www.dropbox.com/s/9znxz5xe0j42616/Screen%20Shot%202014-12-06%20at%2012.21.18%20PM.png?dl=0
has comment: http://stackoverflow.com/comment/43118731
linked to: http://stackoverflow.com/q/27177456

http://stackoverflow.com/comment/43144521
comment on: http://stackoverflow.com/a/27343333
has text: @PoOoZaQ What we mean is that there is a *more* ugly way to do it, because this answer doesn't take into account every character that should be disallowed... For instance, `¶¿§‼` is a valid hashtag. But taking it into account would be a pain since you would have to add more characters to the blacklist: For instance this regex: `^#?[^\s!@#$%^&*()=+./,\[{\]};:'"?><\u2000-\u206F]+$` would make my previous `¶¿§‼` example not match. Without constructs like `\p{P}` in JS you'd have to add all the Unicode ranges to blacklist to the character class.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27350874
has body: Here is a fiddle http://jsfiddle.net/rLdtse86/13/ You use Pseudo elements on hover action a:hover::before { content:"{"; } a:hover::after { content:"}"; }
downvote count: 0
answers question: http://stackoverflow.com/q/27350814
upvote count: 2
has comment: http://stackoverflow.com/comment/43156015
has comment: http://stackoverflow.com/comment/43156006
has comment: http://stackoverflow.com/comment/43157398
has comment: http://stackoverflow.com/comment/43156009
type: Answer
score: 2

http://stackoverflow.com/a/27473759
has comment: http://stackoverflow.com/comment/43382016
has comment: http://stackoverflow.com/comment/43382446
type: Answer
has body: The issue is that you're submitting the form, which reloads the current page. That's why you see the values for only a moment. To fix it, use a &lt;button type="button"&gt; instead of an &lt;input type="submit"&gt;.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27473706
has comment: http://stackoverflow.com/comment/43382124
upvote count: 1
has comment: http://stackoverflow.com/comment/43381978

http://stackoverflow.com/comment/43304055
comment on: http://stackoverflow.com/a/27429098
type: AnswerComment
type: Comment
has text: ` Tags `
score: 0

http://stackoverflow.com/q/27423533
has title: How to simulate click on a display:none on hover image (how to listen for any mouse click in a browser)
has comment: http://stackoverflow.com/comment/43289170
possible better answer: http://stackoverflow.com/a/27423827
has comment: http://stackoverflow.com/comment/43289784
has answer: http://stackoverflow.com/a/27423827
has body: On a website (find it by the link) I have links with images in footer (screenshot) I have found a great glitch effect in a footer icons which I want to use. It chages images randomly if code looks like that: and simple style .footer img:hover { display:none; } But in that scenario click while hovering on of the image footers gives no result. I've tried to use javascript: var a_href $("footer a").on("mousemove", function() { a_href = $(this).attr('href'); console.log(a_href); }); $(document).click(function(){ console.log("!!!!!!!!!!!"); console.log(a_href); window.open(a_href,'_blank'); }); Idea was to save the last hovered link and then emulate the click on it by clicking any other element. But that method works only if I click anywhere ELSE than a space over the glitchy icons. Same with $('body').click, $('.footer').click. I've tried to overlay footer with other div on which i'd be putting .click but then display:none on hover doesn't work. Here is a jsfiddle - http://jsfiddle.net/yssdjr17/1/ What should I do? Thank you. UPD If we use something instead of a display:none we loose the cool glitch effect that way. We loved how randomly elements collapsed and that user might click on one of the elements, but never sure on which one. Some sort of a minigame for him. Is there a way to listen for a mouseclick, in browser, no matter on what element?
accepted answer: http://stackoverflow.com/a/27423655
tagged with: css
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43289195
answer count: 2
has comment: http://stackoverflow.com/comment/43289091
tagged with: javascript
has answer: http://stackoverflow.com/a/27423655
score: 0
has comment: http://stackoverflow.com/comment/43289239
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27333937
accepted answer: http://stackoverflow.com/a/27334009
tagged with: http://stackoverflow.com/tag/html
has title: Removing the browse button when submitting an image
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 2
has body: I want to remove the browse button from the picture, It is more professional looking if i only keep the image of the profile picture, so that when the user clicks on the image, it opens the select file window... I managed to do that using the following code: &lt;label&gt;&lt;img src="images/profile-picture.png"&gt;&lt;input type="file" name="pic" id="pic" accept="image/*"&gt;&lt;/label&gt; Any idea how can i remove the annoying button and the text next to it ?
type: Question
has answer: http://stackoverflow.com/a/27334009
tagged with: javascript
has comment: http://stackoverflow.com/comment/43125036
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/43171039
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27322141
has text: i am not using mvc annotation driven as of now for all the beans i have bean and in controller bean as a property attribute i am refering that bean as well in controller i have respective setter method if its problem with the conf then i same project instead of ajax call through form submit file is getting saved but i my case i need to send this file using ajax call instead of form submit. so i boubt problem with parameter that controller expect and what ajax is sending may be

http://stackoverflow.com/comment/43100283
type: QuestionComment
comment on: http://stackoverflow.com/q/27318532
type: Comment
score: 1
has text: OK, so you need to 1) write code that renders a form, using data from the DB, 2) Write front-end code (JavaScript) that makes the correct elements draggable 3) process the form, and remove selected rows from the DB. Get coding, I'd say

http://stackoverflow.com/a/27320744
answers question: http://stackoverflow.com/q/27320492
has body: In you case, query returns MongooseDocument, that's why you get properties like _doc, save and so on, you should use lean - if you use this function you get plain js object not MongooseDocument.. this.model.findOne({_id:user._id}).lean().exec(function(err, doc){ // .. }); Or use toObject this.model.findOne({_id:user._id}, function(err, doc){ for (var i in doc.toObject()) { console.log(i); } });
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27320492

http://stackoverflow.com/comment/43229606
type: Comment
type: QuestionComment
score: 1
has text: If you have an async function, you should make it return a promise. If you don't, you don't need to do anything.
comment on: http://stackoverflow.com/q/27390870

http://stackoverflow.com/comment/43250107
has text: You need to click the red element first and then the green element. Like you can see in the JSFiddle. And it's an IE11 thing. In Chrome it works fine.
comment on: http://stackoverflow.com/q/27402461
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27461331
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27458530
upvote count: 1
has body: please use this syntax to validate your form $("#f").validate({ rules: { field01: { required: true }, field02:{ required: true, }, field03: { required: true }, field04: { required: true, }, field05: { required: true } }, submitHandler: function(form) { form.submit(); } }); here is f is your form id and field0* will be the name of your input fields that you want to be required.
accepted answer of: http://stackoverflow.com/q/27458530
has comment: http://stackoverflow.com/comment/43358996
score: 1

http://stackoverflow.com/comment/43223432
has text: @apsillers ok... here's the FULL version of my code. I am running a WEB Audio API visualizer in the mix, and have the mute code as you have suggested. what am I doing wrong? http://jsfiddle.net/yt94feor/7/
score: 0
comment on: http://stackoverflow.com/q/27387009
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43205513
comment on: http://stackoverflow.com/a/27377906
type: Comment
has text: thank u so much. its working now but i dont want to allow alphabets in phone number field. i pasted the same code for phone number filed. its not working for phone number. var phone = document.mainform.phoneno; if(/^[0-9]+$/.test(phone.value)) { return true; } else { alert('phone'); phone.focus(); return false; }
score: 0
type: AnswerComment

http://stackoverflow.com/a/27431541
score: -1
downvote count: 1
has body: In your code, the $(this) refers to the image element...specify submitting the form specifically: $('img').on("click", function () { $(form).submit(); });
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/27431519

http://stackoverflow.com/a/27453636
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: You can do this with event listeners and the indexOf or match methods (among other possibilities). Here's an example using jQuery: HTML &lt;input type="text" id="theInput"/&gt; &lt;div id="images"&gt;&lt;/div&gt; JavaScript $('#theInput') .on('change keyup', function() { clearImages('#images'); if ($(this).val().match(/smile/i)) { addImage('#images', 'https://s.yimg.com/lq/i/mesg/emoticons7/1.gif'); } if ($(this).val().match(/cool/i)) { addImage('#images', 'https://s.yimg.com/lq/i/mesg/emoticons7/16.gif'); } }); function addImage(selector, url) { $(selector).append('&lt;img src="' + url + '"/&gt;'); } function clearImages(selector) { $(selector).html(''); } This will add an image if the user enters text containing "smile" or "cool". DEMO Edit: And here's a plain-JavaScript version: function addImage(selector, url) { document .getElementById(selector) .innerHTML += '&lt;img src="' + url + '"/&gt;'; } function clearImages(selector) { document .getElementById(selector) .innerHTML = ''; } function doImages() { clearImages('images'); if (this.value.match(/smile/i)) { addImage('images', 'https://s.yimg.com/lq/i/mesg/emoticons7/1.gif'); } if (this.value.match(/cool/i)) { addImage('images', 'https://s.yimg.com/lq/i/mesg/emoticons7/16.gif'); } } var theInput = document.getElementById("theInput"); theInput.onchange = doImages; theInput.onkeyup = doImages; DEMO
answers question: http://stackoverflow.com/q/27453534

jquery-ui
tags question: http://stackoverflow.com/q/27466871
tags question: http://stackoverflow.com/q/27352540
tags question: http://stackoverflow.com/q/27354625
tags question: http://stackoverflow.com/q/27368004
tags question: http://stackoverflow.com/q/27341248
tags question: http://stackoverflow.com/q/27360009
tags question: http://stackoverflow.com/q/27457587
tags question: http://stackoverflow.com/q/27380836
tags question: http://stackoverflow.com/q/27427043
tags question: http://stackoverflow.com/q/27342428
tags question: http://stackoverflow.com/q/27426428
tags question: http://stackoverflow.com/q/27321788
tags question: http://stackoverflow.com/q/27410988
tags question: http://stackoverflow.com/q/27417225
tags question: http://stackoverflow.com/q/27367458
tags question: http://stackoverflow.com/q/27385346
tags question: http://stackoverflow.com/q/27396753
tags question: http://stackoverflow.com/q/27377507
tags question: http://stackoverflow.com/q/27389224
tags question: http://stackoverflow.com/q/27470961
tags question: http://stackoverflow.com/q/27472838
tags question: http://stackoverflow.com/q/27399208
tags question: http://stackoverflow.com/q/27457302
tags question: http://stackoverflow.com/q/27337166
tags question: http://stackoverflow.com/q/27372161
tags question: http://stackoverflow.com/q/27410945
tags question: http://stackoverflow.com/q/27406216
tags question: http://stackoverflow.com/q/27446037
tags question: http://stackoverflow.com/q/27460560
tags question: http://stackoverflow.com/q/27408013
tags question: http://stackoverflow.com/q/27452226
tags question: http://stackoverflow.com/q/27445907
tags question: http://stackoverflow.com/q/27341511
tags question: http://stackoverflow.com/q/27350538
tags question: http://stackoverflow.com/q/27441040
tags question: http://stackoverflow.com/q/27431867
type: Tag
tags question: http://stackoverflow.com/q/27457795
tag name: jquery-ui
tags question: http://stackoverflow.com/q/27359993
tags question: http://stackoverflow.com/q/27435418
tags question: http://stackoverflow.com/q/27441411
tags question: http://stackoverflow.com/q/27314416
tags question: http://stackoverflow.com/q/27444238

http://stackoverflow.com/comment/43381119
comment on: http://stackoverflow.com/a/27452046
score: 0
has text: Thanks Jeremy! For anyone curious the full working code is contained in this commit: https://github.com/DeBraid/bitcoin-prices/commit/2a9337a8fbeaa8c2d586f60195a32b297ab4f3e5
type: Comment
type: AnswerComment

http://stackoverflow.com/a/27341411
answers question: http://stackoverflow.com/q/27341374
score: 0
has body: You can use String.prototype.indexOf to check for apostrophe's presence: var str = "That's awesome"; if(str.indexOf("'") !== -1) { alert("no apostrophe's allowed"); } Doing it on form submission is a separate issue.
type: Answer

http://stackoverflow.com/comment/43214833
type: QuestionComment
type: Comment
has text: Thanks @StephenMuecke. I was missing parts of the code and thats why it didnt make any sense. Thanks for all of your help.
comment on: http://stackoverflow.com/q/27322181
score: 0

http://stackoverflow.com/comment/43143812
comment on: http://stackoverflow.com/a/27343737
type: AnswerComment
score: 0
type: Comment
has text: Thank you, I was just working the wrong way. I've got it now thanks! I included FontAwesome into css using @font-face and used :before to specify an icon to that slicknav_open and slicknav_collapsed class.

http://stackoverflow.com/a/27392346
has comment: http://stackoverflow.com/comment/43264115
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43234795
has comment: http://stackoverflow.com/comment/43254726
upvote count: 2
has comment: http://stackoverflow.com/comment/43254518
answers question: http://stackoverflow.com/q/27389639
has body: I'll bet the problem is the word "debug" in the name "breeze.debug.js". As I recall, ASP.NET bundling excludes any file with that word in its name from production bundles. Here's a StackOverflow thread on this topic. I wish I remembered the exact incantation. I don't use bundling anymore myself but I got it to work a while back. You may have to do a little digging and messing around to get this just right. It does work.
accepted answer of: http://stackoverflow.com/q/27389639
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27411000
favorite count: 0
has answer: http://stackoverflow.com/a/27528871
accepted answer: http://stackoverflow.com/a/27528871
has comment: http://stackoverflow.com/comment/43266420
has comment: http://stackoverflow.com/comment/43266897
type: AnsweredQuestion
has title: Gulp doesn't write result to file
tagged with: less
type: Question
tagged with: javascript
score: -1
has body: I have a gulpfile.js that looks like this: var gulp = require('gulp'), concat = require('gulp-concat'), less = require('gulp-less'), minifyCSS = require('gulp-minify-css'), uglify = require('gulp-uglify'), autoprefixer = require('gulp-autoprefixer'); gulp.task('less', function () { gulp.src(['less/*.less']) .pipe(less()) .pipe(concat('everything.css')) .pipe(autoprefixer()) .pipe(minifyCSS()) .pipe(gulp.dest('asset/')); }); gulp.task('js', function () { gulp.src(['javascript/*.js']) .pipe(concat('everything.js')) .pipe(uglify()) .pipe(gulp.dest('asset/')); }); gulp.task('watch', function() { gulp.watch('javascript/*.js', ['js']); gulp.watch('less/*.less', ['less']); }); As I was developing, the less task stopped working out of the blue. The console doesn't throw any errors, everything looks just like it should but the everything.css file does not get updated. I even removed the file and it doesn't get created again. I'm compeltely clueless to what's going on, even rebooted my computer as a sanity check but it didn't help. EDIT: So apparently it's the less pipe. But why did it start to fail suddenly?
downvote count: 2
upvote count: 1
answer count: 1
tagged with: gulp

google-chrome
tags question: http://stackoverflow.com/q/27379625
tags question: http://stackoverflow.com/q/27399159
tags question: http://stackoverflow.com/q/27456563
tags question: http://stackoverflow.com/q/27383224
tags question: http://stackoverflow.com/q/27324608
tags question: http://stackoverflow.com/q/27426884
tags question: http://stackoverflow.com/q/27442664
tags question: http://stackoverflow.com/q/27356273
tags question: http://stackoverflow.com/q/27315087
tags question: http://stackoverflow.com/q/27335950
tags question: http://stackoverflow.com/q/27429700
tags question: http://stackoverflow.com/q/27447679
tags question: http://stackoverflow.com/q/27414495
tags question: http://stackoverflow.com/q/27358696
tags question: http://stackoverflow.com/q/27415959
tags question: http://stackoverflow.com/q/27423530
tags question: http://stackoverflow.com/q/27332951
tags question: http://stackoverflow.com/q/27408523
tags question: http://stackoverflow.com/q/27428000
tags question: http://stackoverflow.com/q/27454211
tags question: http://stackoverflow.com/q/27316885
tags question: http://stackoverflow.com/q/27373198
tags question: http://stackoverflow.com/q/27413517
tags question: http://stackoverflow.com/q/27380763
tags question: http://stackoverflow.com/q/27320848
tags question: http://stackoverflow.com/q/27393886
tags question: http://stackoverflow.com/q/27350235
tags question: http://stackoverflow.com/q/27456706
tags question: http://stackoverflow.com/q/27347947
tags question: http://stackoverflow.com/q/27466817
tags question: http://stackoverflow.com/q/27407424
tags question: http://stackoverflow.com/q/27325750
tags question: http://stackoverflow.com/q/27341057
tags question: http://stackoverflow.com/q/27353840
tags question: http://stackoverflow.com/q/27461487
tags question: http://stackoverflow.com/q/27419942
tags question: http://stackoverflow.com/q/27434887
tags question: http://stackoverflow.com/q/27335214
tags question: http://stackoverflow.com/q/27453421
tags question: http://stackoverflow.com/q/27468355
tags question: http://stackoverflow.com/q/27407575
type: Tag
tags question: http://stackoverflow.com/q/27405698
tags question: http://stackoverflow.com/q/27342732
tags question: http://stackoverflow.com/q/27473081
tag name: google-chrome
tags question: http://stackoverflow.com/q/27315302
tags question: http://stackoverflow.com/q/27405126
tags question: http://stackoverflow.com/q/27388096
tags question: http://stackoverflow.com/q/27365746
tags question: http://stackoverflow.com/q/27377459
tags question: http://stackoverflow.com/q/27367448
tags question: http://stackoverflow.com/q/27405918
tags question: http://stackoverflow.com/q/27448926
tags question: http://stackoverflow.com/q/27412572
tags question: http://stackoverflow.com/q/27414709
tags question: http://stackoverflow.com/q/27408644
tags question: http://stackoverflow.com/q/27397805
tags question: http://stackoverflow.com/q/27362420
tags question: http://stackoverflow.com/q/27383610
tags question: http://stackoverflow.com/q/27342517
tags question: http://stackoverflow.com/q/27376661
tags question: http://stackoverflow.com/q/27362556
tags question: http://stackoverflow.com/q/27419470
tags question: http://stackoverflow.com/q/27355566
tags question: http://stackoverflow.com/q/27340523
tags question: http://stackoverflow.com/q/27371484
tags question: http://stackoverflow.com/q/27343099

http://stackoverflow.com/q/27427679
has title: Don't know how to use .toggle()
has body: I have a logo, with the letter T and H and the letters animatie about 400px away from each other when clicked on the menu. When they have animated the navigation comes forward with an: eas-in, BUT when I click on the hamburger-menu again, I want the navigation to close with the same animation. I have tried different .toggle() functions, but I don't know how to make it work. This is how it looks right now, I just cant figure out how to toggle the menu. Is there anyone that knows how to do this, or is there anyone that has any advice? much appreciated! (this is the working code for the animation and the fade-in navigation) $( "#myMenu" ).click(function() { $( ".letterT" ).animate({ marginLeft: "-200px", borderWidth: "10px" }, 1000 ); }); $( "#myMenu" ).click(function() { $( ".letterH" ).animate({ marginLeft: "400px", position: "absolute", borderWidth: "10px" }, 1000 ); }); $( "#myMenu" ).click(function() { $( "nav" ).fadeIn( 2000) }); The code above works once. with 1 click, now I tried to use the .toggle() but when I do so it immediately hides my menu with an animation.. And I can't find the menubutton anymore. (This is the not working code that I tried to use for the toggle) $(function(){ $('#myMenu').toggle(function(){ $( ".letterT" ).animate({ marginLeft: "-200px", }, 1000 ); $( ".letterH" ).animate({ marginLeft: "400px", position: "absolute", }, 1000 ); //the code above should start the animation, //and below it should animate back when I click on the menu }, function(){ $( ".letterT" ).animate({ marginLeft: "200px", }, 1000 ); $( ".letterH" ).animate({ marginLeft: "-400px", position: "absolute", }, 1000 ); }); });
answer count: 1
tagged with: button
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/4911577
accepted answer: http://stackoverflow.com/a/27432448
tagged with: animation
type: AnsweredQuestion
score: 0
tagged with: toggle
type: Question
has answer: http://stackoverflow.com/a/27432448

http://stackoverflow.com/comment/43432714
comment on: http://stackoverflow.com/a/27470983
type: AnswerComment
has text: I have returned to that format and also checked the new output is valid with a JSON validator (JSONLint). It matches your spec, and also doesn't work. I tried also changing the variable name I use for data from 'data' to 'myData' to ensure variable masking wasn't happening. Using the 'ajax loaded' data on the .lineChart() gives me "TypeError: data.map is not a function state.disabled = [-->]data.map(function(d) { return !!d.disabled }); and using it on a .lineWithFocusChart() gives me "TypeError: data.filter is not a function if (!data || !data.length || !data.filter(function(d) { return d..."
score: 0
type: Comment

http://stackoverflow.com/q/27413155
has title: add custom links to series / data sections in pie chart (highcharts.js)
has answer: http://stackoverflow.com/a/27416922
has body: I am simply trying to allow each data section or series of a pie chart via highcharts to be clickable, eg. Shop section should link to #shop_section I've found demos where a global link was set to every data section in a chart. But I simply would like a unique #link to be accessible via clicking one of my three data sections / series. series: [{ innerSize: '30%', data: [ ['Shop', 10], ['Buy', 10], ['Own', 10], ] }] }); This didn't work: (attempt) data: [ {name: 'Shop', 10, url: 'http://my_site1.com'}, {name: 'Buy', 10, url: 'http://my_site2.com'}, {name: 'Own', 10, url: 'http://my_site3.com'} ]
type: Question
tagged with: charts
answer count: 2
possible better answer: http://stackoverflow.com/a/27446376
tagged with: highcharts
has answer: http://stackoverflow.com/a/27446376
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27416922
type: AnsweredQuestion

http://stackoverflow.com/q/27451978
has title: Return Title Case respecting capital letters in middle of word?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43342608
has comment: http://stackoverflow.com/comment/43342815
accepted answer: http://stackoverflow.com/a/27452060
type: Question
has comment: http://stackoverflow.com/comment/43342567
has body: Not sure if this is a duplicate (not sure how I'd word a search to find it for sure because my google-fu is weak today) I have some javascript code to convert the first letter of every word to uppercase. I need to alter it so that it respects oddball capitalization that you might see in last names (e.g.: McGuire, MacGonnacle, O'Brien). Essentially, the idea is to force the first letter of each word to be capitalized but not convert all the other letters to lowercase if entered in uppercase. Here's the code snippet : function properCase(str) { str = str.toLowerCase(); return str.replace(/(\b)([a-z\WA-Z\W])/g, function (firstLetter) { return firstLetter.toUpperCase(); }); } It's probably because it's the end of the day on a weekend but what modifications do I need to make?
has answer: http://stackoverflow.com/a/27452060
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/77813127
has body: It looks like your bookmarklet is in violation of the site you are testing this on CSP. If I run the bookmarklet on google.com it says this in the console "Content-Security-Policy: The page’s settings observed the loading of a resource at inline (“script-src”)."
answers question: http://stackoverflow.com/q/27447679
score: 0
type: Answer

http://stackoverflow.com/a/27462310
has body: you could do like this. &lt;input type="checkbox" name="slection" ng-click="addEntryToSelection(entry)" value="{{entry.defaultName}}" ng-model="toggleInfo.checked" ng-change="toggleChange"&gt; in controller. function toggle(){ console.log('check!'); } var change = ($scope.toggleChange==true ? toggle() : /*false*/); //persist the check value where you could assign to services; if ($scope.toggleChange==true){ $scope.toggleInfo = { checked: true }; } else { $scope.toggleInfo = { checked: false }; }
answers question: http://stackoverflow.com/q/27462154
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/43149218
has text: One last question...when I do inspect element and click on the jumbotroon element I see rectangle in the middle of the screen but it's clear (same background color )There is a way maybe to change this color explicit?or maybe I miss some reference?
type: AnswerComment
comment on: http://stackoverflow.com/a/27343829
score: 0
type: Comment

http://stackoverflow.com/comment/43219361
score: 0
type: Comment
has text: I downvote because you removed hello from Base's prototype. Don't be a smartass and show him the real way of inheriting in js
type: AnswerComment
comment on: http://stackoverflow.com/a/27385487

http://stackoverflow.com/q/27430362
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43311678
score: 0
tagged with: datatables
has comment: http://stackoverflow.com/comment/43311637
has body: I am issues having refeshing my knockout.js DataTabls. So I have a data table that loads correctly on page load (ie attached:function method) , I have multiple buttons that (Display All, Allowed, Not Allowed) that displays the table based on the conditions. Now, when I click on the these buttons the table gets reloaded once again, ie if I have 5 records existing I will see 10 (5+5) after I click on the button. This only happens once (ie it stays at 10 and does not reach 15,20...) Here is my view model Original method : $.ajax({ type: "GET", url: "/api/listusers/GetContractorList", dataType: "json", contentType: "application/json; charset=utf-8", headers: appsecurity.getSecurityHeaders(), success: function (result) { if (result != null) { var mappedContractorList = $.map(result, function (item) { return new GKContractorObj(item); }); viewmodel.ContractorList(mappedContractorList); tableObj= $('#tblContractorsList').DataTable() } }, failure: function (error) { logger.logError('Failed to contractor list', 'Error', null, true); } }); Ajax call when DisplayAll button is clicked $.ajax({ type: "GET", url: "/api/listusers/GetContractorList", dataType: "json", contentType: "application/json; charset=utf-8", headers: appsecurity.getSecurityHeaders(), success: function (result) { if (result != null) { var mappedContractorList = $.map(result, function (item) { return new GKContractorObj(item); }); viewmodel.ContractorList(mappedContractorList); tableObj = $('#tblContractorsList').DataTable(); } }, failure: function (error) { logger.logError('Failed to contractor list', 'Error', null, true); } }); The view : Contractor Details Details I dont think there is any issue with the controller call. Its just that i'm not sure how to refresh / reload the table. Any help/ suggestions ?
has title: Knockout data table appending values (not reloading)
has answer: http://stackoverflow.com/a/27847235
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43311696
accepted answer: http://stackoverflow.com/a/27847235
tagged with: knockout.js
type: Question
answer count: 1

http://stackoverflow.com/q/27406253
score: -1
has comment: http://stackoverflow.com/comment/43263480
answer count: 2
downvote count: 1
has body: I have a list of form controls grounder under a DIV tag. I would like to fire an event in javascript if there is data change in any of the form control. I dont want to perform the onchange check on each form control by suppluying its name because there are so many.. The .each option does the iteration ... but I couldnt find the event that would trcak the change done to any of these HTML form controls using the parent DIV tag.
linked to: http://stackoverflow.com/q/5831065
duplicate of: http://stackoverflow.com/q/5831065
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/27406534
has answer: http://stackoverflow.com/a/27406531
type: Question
has title: Track data change in HTML form controls under a DIV tag using jquery
favorite count: 0

http://stackoverflow.com/comment/43335920
has text: You have two inputs with the same id
comment on: http://stackoverflow.com/q/27447924
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/43395495
type: Comment
type: QuestionComment
has text: In chrome I get all events. jQuery send a key in the event which is called `ctrlKey` where you can check if ctrl is pressed... i dodnt check which is cmd but you can easily find it out by console complete event
comment on: http://stackoverflow.com/q/27380018
score: 0

http://stackoverflow.com/a/27356154
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/27356049
upvote count: 1
answers question: http://stackoverflow.com/q/27356049
type: AcceptedAnswer
downvote count: 0
has body: Please replace with and replace $.each(data, function (key, value) { var html = " "; $("#HomeImgSliders").append(html); }); with $.each(data, function (key, value) { var html = " "; $("#HomeImgSliders").append(html); });

http://stackoverflow.com/q/27322564
has comment: http://stackoverflow.com/comment/43104372
has comment: http://stackoverflow.com/comment/43104430
has answer: http://stackoverflow.com/a/27322667
has body: I'm studying JavaScript and have no programming background at all. In this example I think I understand that foo is an undeclared (global) variable that doesn't exist when bar is calculated, so bar = (undefined + 1) or NaN. var bar = foo + 1, foo = 1; Let's say this is toward the end of a long bunch of code. What if foo had been defined previously and foo = 1 is intended to re-set the value of foo? Does it make sense to test for it? I think I'm opening up a scope can of worms.... ("Scope? You can't haaaandle the scope!") I thank you all in advance for your patience with my learning curve! Any answers you could phrase in analogy or metaphor would help my get this under my belt....
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27322635
score: -1
type: Question
answer count: 2
tagged with: javascript
tagged with: variables
favorite count: 0
has title: does it make sense to test whether undeclared variable was defined earlier in code?
has comment: http://stackoverflow.com/comment/43104337

http://stackoverflow.com/comment/43258486
has text: Typo: "#burger.extend" not "burder".
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27405379
score: 0

http://stackoverflow.com/comment/43105670
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27323214
has text: Hi. Can you tell me why the output on console for `obj.name` is "undefined", either with `fn.apply(fn, [])` or with `fn()`?

http://stackoverflow.com/q/27446960
favorite count: 0
has answer: http://stackoverflow.com/a/28730230
has title: Immutable.js relationships
score: 27
type: Question
linked to: http://stackoverflow.com/q/21826514
tagged with: immutable.js
has answer: http://stackoverflow.com/a/28801355
has answer: http://stackoverflow.com/a/27473984
has answer: http://stackoverflow.com/a/32595514
has answer: http://stackoverflow.com/a/27464373
answer count: 5
upvote count: 27
tagged with: reactjs
accepted answer: http://stackoverflow.com/a/27473984
downvote count: 0
tagged with: javascript
has body: Imagine a situation that John have two childrens Alice and Bob, and Bob have a cat Orion. var Immutable = require('immutable'); var parent = Immutable.Map({name: 'John'}); var childrens = Immutable.List([ Immutable.Map({name: 'Alice', parent: parent}), Immutable.Map({name: 'Bob', parent: parent}) ]); var cat = Immutable.Map({name: 'Orion', owner: childrens.get(1)}); After few years John wants to rename to Jane. var renamedParent = parent.set('name', 'Jane'); ...and let childrens know about it. childrens = childrens.map(function(children) { children.set('parent', renamedParent); }); Then I have to update cat because Bob changed. cat = cat.set('owner', childrens.get(1)); Is it possible to automatically update all related objects when one object change? I looked at Cursors, but I'm not sure if they are a solution. If it possible, can you give me an example?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28730230

http://stackoverflow.com/comment/43329500
type: QuestionComment
has text: @WayneC Oops, I posted this yesterday and got that error, I copied the code from my previously question, I have the semi-colon in my current code.
comment on: http://stackoverflow.com/q/27445212
score: 0
type: Comment

http://stackoverflow.com/comment/43296173
score: 0
has text: If you want to minify your Javascript you shouldn't rely on a plugin. Most likely when the plugin is consolidating the JS it is not taking into account which code needs to be loaded first and a function is being called before it's defined.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27427292

http://stackoverflow.com/a/27401089
answers question: http://stackoverflow.com/q/27400800
has body: try this var text = $("textarea").val(); var res = $(text).map(function() { return $(this).attr("href"); }); console.log(res); FIDDLE
accepted answer of: http://stackoverflow.com/q/27400800
type: AcceptedAnswer
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43248255
type: Answer
score: 2

http://stackoverflow.com/q/27433511
has answer: http://stackoverflow.com/a/28117505
score: 1
has comment: http://stackoverflow.com/comment/43591939
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/43366915
downvote count: 0
tagged with: javascript
upvote count: 1
tagged with: android
answer count: 1
has body: Cant find an solutions how to do this with uiGmapGoogleMapApi.Since google object is not imported, cant use regular solutions. My markers update via: $scope.change_type = function(val) { var markers = []; $scope.eventMarkers = markers var events = Events.venues(val.type) for (var i = 0; i &lt; events.length; i++) { event = events[i] markers.push(createMarker(i,event)) } $timeout(function(){$scope.eventMarkers = markers}, 100) My temp work around was to create timeout long enough for it to update before pushing new, but this is not a real solution and doesnt work too well on an actual device. Pushing empty array of markers also didnt work. Seems like I have to use .setMap(null) but cant find any documentation on how and where.
favorite count: 0
has title: AngularJS - Google Map Markers Removal
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/27352485
tagged with: http://stackoverflow.com/tag/json
answer count: 2
has comment: http://stackoverflow.com/comment/43160393
has body: I am a newbie to Bottle and sort of to Python as well and I am trying create an app whenever I click a button, an AJAX is fired and POST a json to server and store it using SQLite. However, at current stage, I am trying to figure out how do I successfully received the data in the server. On the client side, I have the following send_data function written in JavaScript. function send_data(feedback) { $.ajax({ url: "/feedback", type: "POST", data: JSON.stringify(feedback), contentType: "application/json", success: function() { alert("Feedback successfully stored in the server!"); }, error: function() { alert("Feedback failed to store back in the server!"); }, } The passed in parameter feedback looks something like {"id1": 1, "id2": 2}. On the server side, I have a feedback.py file and the code is from bottle import request, route, run @route('/feedback', method='POST') def feedback(): comments = request.json print comments run(host='localhost', port=8080) Right now, I just want to check if I have received the data successful. But everytime, when I click that botton, I receive the following error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/feedback. This can be fixed by moving the resource to the same domain or enabling CORS. OPTIONS http://localhost:8080/feedback [HTTP/1.0 405 Method Not Allowed 2ms] I am not sure if it's because I am not using the element &lt;form&gt;. That botton is technically just an image. Every time I click that image, send_data() function is fired. Anyone can help? I really appreciate it. Thank you!
downvote count: 1
has comment: http://stackoverflow.com/comment/43158744
has title: POST json data to Bottle
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43159021
has answer: http://stackoverflow.com/a/51410728
has answer: http://stackoverflow.com/a/62271252
score: 1
favorite count: 0
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/43158789
tagged with: python
tagged with: bottle
has comment: http://stackoverflow.com/comment/43158921
upvote count: 2

http://stackoverflow.com/comment/43307350
type: Comment
score: 0
has text: That's a strange result, I would have thought you had an empty array with a length of 10 ?
type: QuestionComment
comment on: http://stackoverflow.com/q/27433075

http://stackoverflow.com/a/27464189
upvote count: 2
has body: may be this would explain it more to you var obj = { get foo(){ console.log('getter'); return this._foo;}, set foo(v){ console.log('setter'); this._foo = v; } } while getting a value from the object passing a parameter wont mean anything. while setting a value passing a parameter would mean and represent the value that needs to be set. Chrome console. AFter initializing the object obj.foo = "UI" setter "UI" obj.foo getter "UI"
answers question: http://stackoverflow.com/q/27464148
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43364617

http://stackoverflow.com/a/27463293
has comment: http://stackoverflow.com/comment/138149337
downvote count: 0
score: 10
has body: You can use async as a control flow for your calls to get them in only one task, also avoiding you to get a "pyramid effect". So something like this should be good for your use-case: var async = require('async'); gulp.task('yeah', function (cb) { async.series([ function (next) { gulp.src('...') .pipe(gulp.dest('...') .on('end', next); }, function (next) { gulp.src('...') .pipe(gulp.dest('...') .on('end', next); }, function (next) { gulp.src('...') .pipe(gulp.dest('...') .on('end', next); } ], cb); }); That will also allow you to have some error handling and target better where a problem occured.
has comment: http://stackoverflow.com/comment/66451722
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27459899
upvote count: 10
type: Answer
answers question: http://stackoverflow.com/q/27459899

http://stackoverflow.com/comment/43207867
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27379157
type: AnswerComment
has text: Sorry, I forgot to mention that I cannot control the name of the originally called method. `.remove()` is always called by another script. I need to trigger exactly this method. Than you anyway! :)

http://stackoverflow.com/a/27376996
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/43205491
type: Answer
has comment: http://stackoverflow.com/comment/43206871
has comment: http://stackoverflow.com/comment/43203743
has comment: http://stackoverflow.com/comment/43206718
downvote count: 1
has body: $('#t').change(function(){ $('#f').val("100"); });
answers question: http://stackoverflow.com/q/27376918

http://stackoverflow.com/comment/43372244
has text: @idanshmu You haven't told us *anything* about your problem, or why this is a corner case, or what other kinds of cases you might encounter. If you actually tell us what your problem is, instead of wasting everybody's time, you might get the "elegant way" you're after. Nobody is going to give you an elegant solution for a problem you're refusing to tell us.
type: AnswerComment
comment on: http://stackoverflow.com/a/27468446
type: Comment
score: 3

http://stackoverflow.com/q/27350733
tagged with: angularjs
tagged with: php
has title: AngularJs Data fetch from Laravel
has body: Hello i use laravel and angular js im fetching 1 user data from database but i cant show my user data in user profile page id = $rootScope.user.id $http.get('api/users/'+id).success(function(data){ $scope.user = data; }) i can see the data in chrome developer tools like that : data: [{id: "308", email: example, first_name: "example", last_name: "example", website: null,…}] status: 1 but when i want to show data in ng-model like that ng-model="user.first_name" i cant see the data on view when do this : ng-model="user" return is [object Object] waiting for help guys , where is my problem ?
tagged with: laravel
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27350764
accepted answer: http://stackoverflow.com/a/27350764
type: Question
upvote count: 2
tagged with: javascript
favorite count: 0
answer count: 1

http://stackoverflow.com/comment/43315124
has text: You can not set file input values that is a security precaution. Why don't you just schedule a task, that way the boss does not even need to click a button. That is normally how automation works.
comment on: http://stackoverflow.com/q/27437125
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43252945
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27403347
has text: [This here](http://www.w3schools.com/tags/att_input_required.asp) is a page on w3schools.com on how to use the `required` tag. It is one of the new HTML 5 attributes. Be aware that it will behave differently in different browsers.

http://stackoverflow.com/comment/43352200
has text: I see your point. I cant give an authoritative answer for that but I think it makes sense if re-ordering algorithm works that way. "Move elements from bottom to top to accomplish the given ordering." But probably more complex than that.
comment on: http://stackoverflow.com/a/27457366
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43404778
comment on: http://stackoverflow.com/q/27452950
has text: Yeah, looks like the `#gdwboutique.panier .cart .cart_item { overflow:hidden;} ` should fix it. Its not a MooTools issue but a CSS one since the height of parent is `0px` after animation but the children are still taking space. I think it could be [something like this](http://css-tricks.com/snippets/css/clear-fix/). Anyway it works with that CSS fix: http://jsfiddle.net/9yeqs5vq/2/
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27375743
score: 0
answers question: http://stackoverflow.com/q/27374937
type: Answer
has comment: http://stackoverflow.com/comment/43201686
has body: You can use angular as is using the files. You can install it using "npm" or "bower" as well. https://github.com/angular/bower-angular Grunt may be necessary if you want run any tasks to your app, any automation stuff like minification etc. Grunt is basically task runner.

appfog
tags question: http://stackoverflow.com/q/27451936
tag name: appfog
type: Tag

http://stackoverflow.com/a/27411357
has body: Extending my comment with the answer. You can leave multiple css files, I don't think it will do any harm. As for JS files, at first you should create a wrapper file wrapper.js $(function() { if (!$().chosen) { //we do this only if chosen is not present var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'url to yor chosen library'; $("body").append(script); } }); And then in your view you will reference this wrapper.js file instead of your chosen library path.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27410367

http://stackoverflow.com/comment/43281332
type: Comment
type: QuestionComment
has text: Below is the detail of exception Uncaught Error: [$injector:modulerr] Failed to instantiate module helloKinveyApp due to: Error: [$injector:nomod] Module 'helloKinveyApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
score: 0
comment on: http://stackoverflow.com/q/27418925

http://stackoverflow.com/comment/55181764
has text: this was extremely helpful tonight. i had a helper that was using a default value for the initial case. in this initial case i wasn't bothering to read from the reactive variable (since it wasn't needed). because i didn't read from the variable, meteor assumed the function was NOT reactive. but when i read from the reactive variable in the initial case, all is well. thanks for this answer.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27413245

http://stackoverflow.com/comment/43381593
comment on: http://stackoverflow.com/q/27473450
score: 0
type: QuestionComment
has text: Actually its my task to do. that I need to do recursion in anonymous function. and I cant use any function name. but I can pass the function name as parameter to another function.
type: Comment

http://stackoverflow.com/a/27462089
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27455549
type: AcceptedAnswer
downvote count: 0
has body: Not sure why you have the .validate() method inside a function like that. The .validate() method is supposed to be called once and only used for initializing the plugin. You should use a type="submit" button so that you can properly integrate with the plugin and enable/disable it much easier than trying to manually capture/deactivate/activate an anchor element. (Use CSS on the button element to make it look exactly like your anchor element.) Then use .prop('disabled', 'disabled') within the submitHandler to disable the button as soon as the properly validated form is submitted. As you can see by the demo, most of your code was not needed as the plugin takes care of nearly everything automatically. $(document).ready(function() { $("#loginForm").validate({ // <- initialize plugin on form ignore: [], // <- proper way to set ignore to nothing submitHandler: function(form) { $('#submitBtn').prop('disabled', 'disabled'); alert('submitted'); // <- for demo return false; } }); }); Login
type: Answer
answers question: http://stackoverflow.com/q/27455549
score: 1

http://stackoverflow.com/comment/43360071
comment on: http://stackoverflow.com/a/27439311
has text: Well it's one of the drawbacks of this method. Mobile devices became to handle higher and higher resolutions despite of screen size.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27344067
has body: Loop through parents, check each one. function isContainedByClass(src,cls) { while(src &amp;&amp; src.tagName) { if( src.classList.contains(cls)) return true; // apply old-browser compatibility as needed src = src.parentNode; } return false; }
has comment: http://stackoverflow.com/comment/43144433
upvote count: 2
has comment: http://stackoverflow.com/comment/43160604
type: Answer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27344024
score: 1
answers question: http://stackoverflow.com/q/27344024
has comment: http://stackoverflow.com/comment/43143621
has comment: http://stackoverflow.com/comment/43156133
has comment: http://stackoverflow.com/comment/43144412
has comment: http://stackoverflow.com/comment/43145317
has comment: http://stackoverflow.com/comment/43143874
has comment: http://stackoverflow.com/comment/43143801
has comment: http://stackoverflow.com/comment/43151907
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43143697

http://stackoverflow.com/q/27346327
has comment: http://stackoverflow.com/comment/43149382
favorite count: 0
has body: I've got an update button working that loads new .csv data into a D3.s stacked bar chart. My problem is that on update it seems to be using both data sets instead of just the new one. I think this is related to some confusion I have about update and selectAll, but I haven't been able to figure out how to replace instead of append. Here's my current code: UPDATE: I changed the functionUpdateData() code to what I have currently because I realized it had some junk in there. New code has working transitions for x and y axis labels, but still the same problem described above with the actual bars.
type: Question
has title: D3.js with update button adds new data to old instead of replacing old data
has comment: http://stackoverflow.com/comment/43182247
upvote count: 2
tagged with: d3.js
answer count: 1
has answer: http://stackoverflow.com/a/27348880
has comment: http://stackoverflow.com/comment/43180412
linked to: http://stackoverflow.com/q/18186011
has comment: http://stackoverflow.com/comment/43182352
score: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43179816
type: UnansweredQuestion

http://stackoverflow.com/q/27429148
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43301399
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/43300929
has comment: http://stackoverflow.com/comment/43299732
has comment: http://stackoverflow.com/comment/43301124
tagged with: php
has title: Calling a POST variable in PHP-function
has comment: http://stackoverflow.com/comment/43299689
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27429222
type: Question
has comment: http://stackoverflow.com/comment/43299777
has comment: http://stackoverflow.com/comment/43299809
has comment: http://stackoverflow.com/comment/43301042
has body: I have a PHP-file with multiple php functions in it. I am sending a Javascript Variable with an AJAX-call, POST method to that PHP-file.` Now the variable IS accessible in my PHP-file but not in that specific function where I want it... $("#dropdown").change(function () { var value = $("#dropdown").val(); console.log(value); $.ajax({ type: "POST", dataType: 'text', url: "PhpFunctions.php", data: {id:$("#dropdown").val()}, success: function (data) { console.log(data); $("div.geselecteerdVliegtuig").fadeIn("slow", function () { console.log("Vliegtuigdetail faded in"); }); /* $("div.vliegtuigenEnabled2").hide(); console.log("vliegtuigEnabled ID's hidden"); */ }, error: function (err) { alert('error: ' + err); } }); //END AJAX CALL` //I CAN ACCESS DATABASE AND ID IS ACCESSIBLE HERE //Connect to server $connect = mysql_connect("localhost", "root", "root") or die(mysql_error()); //Connect to database $select_db = mysql_select_db("Luchthaven") or die("Could not find database"); $id = $_POST['id']; echo $id; //WORKS //NEED TO ACCESS IS HERE function GeselecteerdVliegtuig() { makeConnection(); //Query the database $id = $_POST['id']; //$query = "SELECT * FROM vliegtuig WHERE vliegtuig_ID = 'PEG431';"; //echo "SELECT * FROM vliegtuig WHERE vliegtuig_ID = 'PEG431'; "; $query = "SELECT * FROM vliegtuig WHERE vliegtuig_ID = '" . $id . "';"; echo "SELECT * FROM vliegtuig WHERE vliegtuig_ID = '" . $id . "'; "; $fetch = mysql_query($query) or die("could not fetch data"); while ($row = mysql_fetch_assoc($fetch)) { echo " "; echo " " . $row['vliegtuig_ID'] . " "; echo " " . $row['maatschappij'] . " "; echo " " . $row['lengte'] . " "; echo " " . $row['breedte'] . " "; echo " " . $row['kilometerstand'] . " "; echo " " . $row['bouwjaar'] . " "; echo " " . $row['bereik'] . " "; echo " " . $row['aantalMotoren'] . " "; echo " "; } // END WHILE mysql_close(); //Make sure to close out the database connection echo "Connection closed "; }
has answer: http://stackoverflow.com/a/27430375
tagged with: post

http://stackoverflow.com/q/27361268
upvote count: 4
has comment: http://stackoverflow.com/comment/43197640
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: client-side
favorite count: 0
has body: Is it possible to merge multiple PDFs into one through just the client alone? http://mrrio.github.io/jsPDF/# looked like an answer but it doesn't seem to have the feature of merging two already made pdfs. Is something like this possible?
type: Question
has title: How to merge multiple PDFs on the client side
tagged with: http://stackoverflow.com/tag/pdf
score: 4
has comment: http://stackoverflow.com/comment/43214447
has comment: http://stackoverflow.com/comment/43180497
has comment: http://stackoverflow.com/comment/43211736

http://stackoverflow.com/comment/43281525
score: 0
type: Comment
has text: I shared my code. i want to add a class for each user and then display the data. How to add class for each user and thn append data?
comment on: http://stackoverflow.com/a/27418966
type: AnswerComment

http://stackoverflow.com/comment/43298955
has text: @A.Wolff the 1 is created by a counter in php in wordpress, I suppose I could just append it to the class instead of having it be a seperate class"
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27428383

http://stackoverflow.com/q/27459333
has comment: http://stackoverflow.com/comment/43358643
has answer: http://stackoverflow.com/a/27459489
has title: Is there a minimal version of "npm install grunt"?
tagged with: javascript
score: -1
tagged with: gruntjs
answer count: 3
has body: When I run npm install grunt I get, in my opinion, a heavily polluted project folder. In the folder node_modules there are libs like rimraf, coffescript and others I really don't want to use. Are these required for grunt itself to be able to run or are they only there for my convenience? I would like some kind of "npm install grunt --minimal" to only install an absolute minimum of what's needed to be able to use grunt. I don't really like my project folder full of stuff that's not really my own code. I've googled the terms i can come up with, like "minimal grunt install", but only found the basic install tutorials.
upvote count: 1
possible better answer: http://stackoverflow.com/a/27459846
favorite count: 0
has comment: http://stackoverflow.com/comment/43358894
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27459489
has comment: http://stackoverflow.com/comment/58281219
downvote count: 2
has answer: http://stackoverflow.com/a/69196752
has comment: http://stackoverflow.com/comment/43358955
has answer: http://stackoverflow.com/a/27459846
type: Question

http://stackoverflow.com/q/27397848
has answer: http://stackoverflow.com/a/27397948
has answer: http://stackoverflow.com/a/27397907
tagged with: css
answer count: 4
type: AnsweredQuestion
has title: Issue toggling a div with jQuery
type: Question
has answer: http://stackoverflow.com/a/27397968
accepted answer: http://stackoverflow.com/a/27397968
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27397907
has body: I have got a hidden area that shows when a red sidebar is clicked. I want it to hide when I click the red sidebar again. I have put a blue bar inside the hidden area that hides the collapsible area when clicked. I want the red bar to do both things, hide and show the collapsible area. HTML: CSS #left-collapser { width: 20px; height: 100%; float: right; background-color: lightblue; } #right-collapser { width: 20px; height: 100%; float: left; background-color: red; border-top-right-radius: 20px; border-bottom-right-radius: 20px; } .aux { border: 1px solid red; background-color: yellow; } .aux2 { border: 1px solid blue; background-color: lightgreen; } body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; .frame { position: absolute; width: 200%; height: 100%; top: 0; bottom: 0; left: 0; .menu { height:100%; /* background-color: #3D6AA2; */ &.collapse { float:left; height: 100% !important; width: auto; } &.collapse.height { position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; } &.collapse.width { position: relative; width: 0; overflow: hidden; -webkit-transition: width 0.35s ease; -moz-transition: width 0.35s ease; -o-transition: width 0.35s ease; transition: width 0.35s ease; } &.collapse.in.width { width: auto; } &.collapse.in.height { height: auto; } .collapse-inner { position: relative; width: 250px; height: 100%; } } .view { width: 50%; height: 100%; overflow: hidden; } } } Javascript $("#left-collapser").click(function (e) { $('#menu').collapse('hide'); }); $("#right-collapser").click(function (e) { $('#menu').collapse('show'); }); Here is the Fiddle •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• EDIT•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• It turns out …
tagged with: jquery
has comment: http://stackoverflow.com/comment/43241650
score: 0
has comment: http://stackoverflow.com/comment/43241682
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27398018

http://stackoverflow.com/comment/43303170
comment on: http://stackoverflow.com/q/27430974
score: 0
has text: Is there any reason you're mixing up `jQuery` and `Vanilla Javascript`? I suggest that you choose one and stick to it.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43120971
type: QuestionComment
has text: `str.length >=5 && str.length <=20`
comment on: http://stackoverflow.com/q/27331275
score: 0
type: Comment

http://stackoverflow.com/comment/43890528
type: AnswerComment
has text: I just wanted to say that I ended up scrapping everything I had and learned a bit about AJAX. I used this code when I rewrote everything and it works, thanks.
comment on: http://stackoverflow.com/a/27390690
score: 0
type: Comment

http://stackoverflow.com/a/27420206
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27420194
answers question: http://stackoverflow.com/q/27420194
has body: You can make use of document.querySelector which returns element based on CSS selectors. You'll want to use document.querySelectorAll if you want it to return more than one element. console.log(document.querySelector('[open=yes]')); Returns the first element within the document (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors
type: AcceptedAnswer

http://stackoverflow.com/comment/43113252
has text: should use var log = console.log.bind(console);
comment on: http://stackoverflow.com/q/27326817
score: 0
type: Comment
type: QuestionComment

regex
tags question: http://stackoverflow.com/q/27412680
tags question: http://stackoverflow.com/q/27454931
tags question: http://stackoverflow.com/q/27342945
tags question: http://stackoverflow.com/q/27360987
tags question: http://stackoverflow.com/q/27343716
tags question: http://stackoverflow.com/q/27463258
tags question: http://stackoverflow.com/q/27353139
tags question: http://stackoverflow.com/q/27350139
tags question: http://stackoverflow.com/q/27335617
tags question: http://stackoverflow.com/q/27392087
tags question: http://stackoverflow.com/q/27429496
tags question: http://stackoverflow.com/q/27435700
tag name: regex
tags question: http://stackoverflow.com/q/27395872
tags question: http://stackoverflow.com/q/27457359
tags question: http://stackoverflow.com/q/27346986
tags question: http://stackoverflow.com/q/27422095
tags question: http://stackoverflow.com/q/27460882
tags question: http://stackoverflow.com/q/27380962
tags question: http://stackoverflow.com/q/27450574
tags question: http://stackoverflow.com/q/27384198
tags question: http://stackoverflow.com/q/27374283
tags question: http://stackoverflow.com/q/27332392
tags question: http://stackoverflow.com/q/27446961
tags question: http://stackoverflow.com/q/27405242
tags question: http://stackoverflow.com/q/27411279
tags question: http://stackoverflow.com/q/27354277
tags question: http://stackoverflow.com/q/27396281
tags question: http://stackoverflow.com/q/27434437
tags question: http://stackoverflow.com/q/27424968
tags question: http://stackoverflow.com/q/27455872
tags question: http://stackoverflow.com/q/27379279
tags question: http://stackoverflow.com/q/27465054
tags question: http://stackoverflow.com/q/27315788
tags question: http://stackoverflow.com/q/27384253
tags question: http://stackoverflow.com/q/27370772
tags question: http://stackoverflow.com/q/27348595
tags question: http://stackoverflow.com/q/27363331
tags question: http://stackoverflow.com/q/27415462
tags question: http://stackoverflow.com/q/27357120
tags question: http://stackoverflow.com/q/27474027
tags question: http://stackoverflow.com/q/27419833
tags question: http://stackoverflow.com/q/27355068
tags question: http://stackoverflow.com/q/27461828
tags question: http://stackoverflow.com/q/27420364
tags question: http://stackoverflow.com/q/27388094
tags question: http://stackoverflow.com/q/27428720
tags question: http://stackoverflow.com/q/27449006
tags question: http://stackoverflow.com/q/27383425
tags question: http://stackoverflow.com/q/27446091
tags question: http://stackoverflow.com/q/27431762
tags question: http://stackoverflow.com/q/27460899
tags question: http://stackoverflow.com/q/27325450
tags question: http://stackoverflow.com/q/27356619
tags question: http://stackoverflow.com/q/27381744
tags question: http://stackoverflow.com/q/27394861
tags question: http://stackoverflow.com/q/27433176
tags question: http://stackoverflow.com/q/27453622
tags question: http://stackoverflow.com/q/27424180
tags question: http://stackoverflow.com/q/27402598
tags question: http://stackoverflow.com/q/27445440
tags question: http://stackoverflow.com/q/27452280
tags question: http://stackoverflow.com/q/27414259
tags question: http://stackoverflow.com/q/27472010
tags question: http://stackoverflow.com/q/27433014
tags question: http://stackoverflow.com/q/27321679
tags question: http://stackoverflow.com/q/27461812
tags question: http://stackoverflow.com/q/27334122
tags question: http://stackoverflow.com/q/27471734
tags question: http://stackoverflow.com/q/27389329
tags question: http://stackoverflow.com/q/27443044
tags question: http://stackoverflow.com/q/27316615
tags question: http://stackoverflow.com/q/27430241
tags question: http://stackoverflow.com/q/27405139
tags question: http://stackoverflow.com/q/27461337
tags question: http://stackoverflow.com/q/27337971
tags question: http://stackoverflow.com/q/27385942
tags question: http://stackoverflow.com/q/27322733
tags question: http://stackoverflow.com/q/27315874
tags question: http://stackoverflow.com/q/27328957

css
tags question: http://stackoverflow.com/q/27441588
tags question: http://stackoverflow.com/q/27348361
tags question: http://stackoverflow.com/q/27342595
tags question: http://stackoverflow.com/q/27366617
tags question: http://stackoverflow.com/q/27335774
tags question: http://stackoverflow.com/q/27443860
tags question: http://stackoverflow.com/q/27353166
tags question: http://stackoverflow.com/q/27391992
tags question: http://stackoverflow.com/q/27408047
tags question: http://stackoverflow.com/q/27396504
tags question: http://stackoverflow.com/q/27432729
tags question: http://stackoverflow.com/q/27453974
tags question: http://stackoverflow.com/q/27350843
tags question: http://stackoverflow.com/q/27464847
tags question: http://stackoverflow.com/q/27332580
tags question: http://stackoverflow.com/q/27450106
tags question: http://stackoverflow.com/q/27468414
tags question: http://stackoverflow.com/q/27410631
tags question: http://stackoverflow.com/q/27468871
tags question: http://stackoverflow.com/q/27422162
tags question: http://stackoverflow.com/q/27426341
tags question: http://stackoverflow.com/q/27430394
tags question: http://stackoverflow.com/q/27333745
tags question: http://stackoverflow.com/q/27330007
tags question: http://stackoverflow.com/q/27431220
tags question: http://stackoverflow.com/q/27420060
tags question: http://stackoverflow.com/q/27451936
tags question: http://stackoverflow.com/q/27366441
tags question: http://stackoverflow.com/q/27431368
tags question: http://stackoverflow.com/q/27357033
tags question: http://stackoverflow.com/q/27425011
tags question: http://stackoverflow.com/q/27390374
tags question: http://stackoverflow.com/q/27325096
tags question: http://stackoverflow.com/q/27358232
tags question: http://stackoverflow.com/q/27435623
tags question: http://stackoverflow.com/q/27409537
tags question: http://stackoverflow.com/q/27368655
tags question: http://stackoverflow.com/q/27323482
tags question: http://stackoverflow.com/q/27406415
tags question: http://stackoverflow.com/q/27394860
tags question: http://stackoverflow.com/q/27462851
tags question: http://stackoverflow.com/q/27327016
tags question: http://stackoverflow.com/q/27427978
tags question: http://stackoverflow.com/q/27320728
tags question: http://stackoverflow.com/q/27474340
tags question: http://stackoverflow.com/q/27361686
tags question: http://stackoverflow.com/q/27454211
tags question: http://stackoverflow.com/q/27426419
tags question: http://stackoverflow.com/q/27319605
tags question: http://stackoverflow.com/q/27437577
tags question: http://stackoverflow.com/q/27391370
tags question: http://stackoverflow.com/q/27333336
tags question: http://stackoverflow.com/q/27453132
tags question: http://stackoverflow.com/q/27391384
tags question: http://stackoverflow.com/q/27337441
tags question: http://stackoverflow.com/q/27387181
tags question: http://stackoverflow.com/q/27368358
tags question: http://stackoverflow.com/q/27457469
tags question: http://stackoverflow.com/q/27356244
tags question: http://stackoverflow.com/q/27366522
tags question: http://stackoverflow.com/q/27464947
tags question: http://stackoverflow.com/q/27381735
tags question: http://stackoverflow.com/q/27393794
tags question: http://stackoverflow.com/q/27465644
tags question: http://stackoverflow.com/q/27384422
tags question: http://stackoverflow.com/q/27376472
tags question: http://stackoverflow.com/q/27411239
tags question: http://stackoverflow.com/q/27397036
tags question: http://stackoverflow.com/q/27347506
tags question: http://stackoverflow.com/q/27412283
tags question: http://stackoverflow.com/q/27364607
tags question: http://stackoverflow.com/q/27341881
tags question: http://stackoverflow.com/q/27322170
tags question: http://stackoverflow.com/q/27444378
tags question: http://stackoverflow.com/q/27320848
tags question: http://stackoverflow.com/q/27431850
tags question: http://stackoverflow.com/q/27370283
tags question: http://stackoverflow.com/q/27370995
tags question: http://stackoverflow.com/q/27319499
tags question: http://stackoverflow.com/q/27444227

http://stackoverflow.com/a/27426911
has comment: http://stackoverflow.com/comment/43300760
score: 0
has body: try simplifying your code to set cookies this way: DEMO function setCookie(key, val){ document.cookie = key+'='+val; } setCookie('foo', 123); setCookie('bar', 123); setCookie('baz', 123); document.body.innerHTML = document.cookie; // for demo purposes edit II you could always check if the cookie exists before assigning it function setCookie(key, val){ if (cookieExists(key)) return; document.cookie = key+'='+val; } function cookieExists(key) { return !!~document.cookie.split(';').map(function(a) { return a.split('=')[0].trim(); }).indexOf(key); } function setCookies(cookies) { var keys = Object.keys(cookies); for (var i = 0, len = keys.length; i &lt; len; i++){ var key = keys[i], val = cookies[key]; if (cookieExists(key)) break; setCookie(key, val); } } var cookies = { 'foo': Date.now(), 'bar': 123, 'baz': 123 } setCookies(cookies); document.body.innerHTML = document.cookie;
answers question: http://stackoverflow.com/q/27425674
has comment: http://stackoverflow.com/comment/43302497
has comment: http://stackoverflow.com/comment/43314654
type: Answer

http://stackoverflow.com/comment/43185409
type: Comment
comment on: http://stackoverflow.com/a/27365885
has text: When I throw an alert in there to see what the value of sqlInserts[x] is, it shows me the text I expect to see... it just doesn't seem to want to run the insert statement. It says it goes in fine, but it doesn't.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27405925
has title: Tabs on website broken by Wordpress 4.0.1 update?
has body: I'm having the same problem as mentioned in this question: WordPress 4.0.1 Tab Title displays wrong I thought I'd make my own question because I have a little more information than the asker of that question provided. Here's the PHP for the tabs: $output = ' '; for ( $i = 0; $i < count( $matches[0] ); $i++) { if ( $history == 'true' ) { $href = '#' . rawurlencode( str_replace( array( ' ', '.' ), array( '-', '' ), trim( $matches[3][$i]['title'] ) ) ); } else { $href = '#'; } $output .= ' ' . $matches[3][$i]['title'] . ' '; } $output .= ' '; which outputs this HTML as displayed on this page http://souffle.mothemes.com/shortcodes/accordions/ : ”Lorem” ”Ipsum” ”Dolor” The reverse quotes shouldn't be there, and for titles longer than one word, only the first word displays. I can't for the life of me figure out where the problem comes from. The options seem to be: the PHP listed above the backend dialogue that requests the information for the PHP the Javascript file that connects the two (?? my Javascript is very, very, very limited.) And I have no idea why the Wordpress 4.0.1 update would have broken this (I took a look at the changelog but I don't know enough to really know what I'm looking for). Any help here would be appreciated since I am entirely lost on my own. Thanks!
tagged with: javascript
has comment: http://stackoverflow.com/comment/43258992
tagged with: http://stackoverflow.com/tag/html
tagged with: php
answer count: 0
type: UnansweredQuestion
tagged with: wordpress
linked to: http://stackoverflow.com/q/27337758
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43256703

http://stackoverflow.com/comment/43175344
score: 0
type: Comment
has text: @apsillers makes a good point, which is why you should **always use [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode)** in your JavaScript, which will force the interpreter to make duplicate `var` statements an error (as it should be)! It's easy, just place `"use strict;"` at the top of your functions/modules.
comment on: http://stackoverflow.com/a/27360166
type: AnswerComment

http://stackoverflow.com/q/27470967
has body: i currently tried out freewall.js for layouting my content.I added a menu with captions that filter what content will be displayed e.g."everything" "photo" "print" and so on. But i noticed when launching my page it stacks the content boxes on top of each other with a little offset. it looks a little buggy when refreshing it, it rearranges the stack so it looks like a cardbox. BUT if you press "everything" all the content boxes will go in their proper place. so here is my question how do i change the js in that sense that it immediatly loads the "everything" page on pageload? i add the link of the example that i took the inspiration from ( that page has the exact same problem) http://kristynjanae.com/ regards JS: $(function() { var wall = new freewall("#freewall"); var images = wall.container.find('.brick'); var length = images.length; images.css({visibility: 'hidden'}); images.find('img').on("load error", function() { -- length; if (!length) { setTimeout(function() { images.css({visibility: 'visible'}); wall.fitWidth(); }, 505); } }); wall.reset({ selector: '.brick', animate: true, cellW: 320, cellH: 'auto', onResize: function() { wall.fitWidth(); } }); wall.filter(":not(.k1, .k2, .k3, .k4, .k5, .k6)"); $(".filter-label").click(function() { $(".filter-label").removeClass("active"); var filter = $(this).addClass('active').data('filter'); if (filter) { wall.filter(filter); wall.reset({ selector: '.brick', animate: true, cellW: 320, cellH: 'auto', onResize: function() { wall.fitWidth(); } }); } else { wall.unFilter(); } }); wall.fitWidth(); }); CSS: body { background: white; margin: 0 auto; position: relative; font-family: open sans, sans-serif; /*font-family: 'open sans', sans-serif;*/ font-size: 15px; } nav ul{ list-style: none; overflow: hidden; padding: 0px; margin: 0px; padding-left: 15px; font-size: 15px; text-align: center; -webkit-transition: max-height 0.4s; -ms-transition: max-height 0.4s; -moz-transition: max-height 0.4s; -o-transition: max-height 0.4s; tran…
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43377889
has comment: http://stackoverflow.com/comment/43376822
has title: Freewall.js default on pageload
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27476842
type: Question
score: 0
has comment: http://stackoverflow.com/comment/43376976
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43377263

http://stackoverflow.com/a/27321965
type: Answer
downvote count: 6
has comment: http://stackoverflow.com/comment/84610899
has comment: http://stackoverflow.com/comment/73977226
answers question: http://stackoverflow.com/q/27321672
upvote count: 5
score: -1
has comment: http://stackoverflow.com/comment/74022447
has body: You should probably pick the events you want to listen to, put them into an array and iterate over each: ['click','mouseover'].forEach(function(ev) { el.addEventListener(ev, function() { console.log('event:', ev) }) })
has comment: http://stackoverflow.com/comment/83081511

http://stackoverflow.com/a/27469825
has comment: http://stackoverflow.com/comment/43374574
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43374549
upvote count: 5
type: Answer
has body: You can use attr() with a function as the second argument: $('li').attr('number', function(_index) { return _index; }); Demo: http://jsfiddle.net/techfoobar/8tpab84s/4/ Thanks to user: NicoSantangelo - You can simply use the first argument of the callback function instead of $(this).index()
downvote count: 0
answers question: http://stackoverflow.com/q/27469814
accepted answer of: http://stackoverflow.com/q/27469814
score: 5

http://stackoverflow.com/a/28693011
has body: This is happen to me too, the error appear when I navigate to another view "page" after the recaptcha verification. I found a not elegante solution but it's work, I simply remove the iframe container generated by the captcha api on route change YourAPPconfig.run(function ($rootScope) { $rootScope.$on('$routeChangeSuccess', function () { // fix recaptcha bug $('.pls-container').remove(); }); });
has comment: http://stackoverflow.com/comment/47344917
type: Answer
answers question: http://stackoverflow.com/q/27402217
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/43303188
type: QuestionComment
score: 0
has text: What you are doing already comes with CSS for free. For some examples, see http://easings.net
type: Comment
comment on: http://stackoverflow.com/q/27430772

http://stackoverflow.com/comment/43217420
has text: Then you'll need to show the JS that is doing the POST. It is that that is responsible for processing the json response.
comment on: http://stackoverflow.com/q/27382871
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/37924977
has body: You'll get a lot of answers here about micro-optimisation but delete really does sometimes have supreme problems where it becomes incredibly slow in certain scenarios that people must be aware of in JS. These are to my knowledge edge cases and may or may not apply to you. I recommend to profile and benchmark in different browsers to detect these anomalies. I honestly don't know the reasons as I tend to workaround it this but I would guess combinations of quirks in the GC (it is might be getting invoked too often), brutal rehashing, optimisations for other cases and weird object structure/bad time complexity. The cases usually involve moderate to large numbers of keys, for example: Delete from objects with many keys: (function() { var o={},s,i,c=console; s=new Date();for(i=0;i&lt;1000000;i+=10)o[i]=i;c.log('Set: '+(new Date()-s)); s=new Date();for(i=0;i&lt;50000;i+=10)delete(o[i]);c.log('Delete: '+(new Date()-s));})(); Chrome: Set: 21 Delete: 2084 Firefox: Set: 74 Delete: 2 I have encountered a few variations of this and they are not always easy to reproduce. A signature is that it usually seems to degrade exponentially. In one case in Firefox delete inside a for in loop would degrade to around 3-6 operations a second where as deleting when iterating Object.keys would be fine. I personally tend to think that these cases can be considered bugs. You get massive asymptotic and disproportionate performance degradation that you can work around in ways that shouldn't change the time or space complexity or that might even normally make performance moderately worse. This means that when considered as a declarative language JS gets the implementation/optimisations wrong. Map does not have the same problem with delete so far that I have seen. Reasons: To be sure, you would have to look into the source code or run some profiling. delete in various scenarios can change speed arbitrarily based on how engines are written and this can change from version to version. JavaScript obje…
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/27397034
downvote count: 0
score: 8

http://stackoverflow.com/q/27334581
has title: Animate divs when others disappear
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27335140
tagged with: css-transitions
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/27335140
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43127052
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a layout of divs that all 'clear', like in a list. I use jQuery's built in fadeOut function to make them disappear after a certain amount of time. That all works great. The divs disappear one at a time starting from the top. jQuery uses to fading opacity and finally display:none to 'fadeOut' the div. When the top div finally fades out (to display:none) the divs underneath it all move up, but they jump up. I was wondering if there is a way to make this a smooth (slide) transition? TIA

http://stackoverflow.com/comment/43352330
type: AnswerComment
comment on: http://stackoverflow.com/a/27457304
score: 0
type: Comment
has text: I see. So would it be safe to stick to 0x10001?

http://stackoverflow.com/comment/43291041
type: Comment
has text: are you sure you're not reinventing position:fixed ?
score: 2
comment on: http://stackoverflow.com/q/27424572
type: QuestionComment

http://stackoverflow.com/comment/43423184
has text: I voted to reopen because there are plenty of answers on how this can better be architected that are not primarily opinion-based. Folks here seem to react to the work "best" and automatically assume all possible answers must be opinion-based. StackOverflows own wording says that primarily opinion-based questions are: `answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise`. There are many possible answers to this question that are simply useful alternative ways to structure the code that solves the issue at hand.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27462945
score: 0

http://stackoverflow.com/a/27321138
upvote count: 1
has comment: http://stackoverflow.com/comment/43102515
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27321072
has body: If you just want the user to visit page.php before using api.php, the session is the way to go.
type: Answer
has comment: http://stackoverflow.com/comment/43102564
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27321072
has comment: http://stackoverflow.com/comment/43101934

http://stackoverflow.com/comment/43125420
has text: What is the use-case for using the `$watch` here? Are there outside elements changing the names of model instances?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27331572
type: AnswerComment

http://stackoverflow.com/q/27317954
has title: Knockout mapping Json Array to Observable Array get error
tagged with: http://stackoverflow.com/tag/json
tagged with: knockout.js
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43095478
has body: I´ve an problem to map my json array to an observable array. I´ve got an error "Cannot read property 'fromJSON' of undefined" This are my linked knockout scripts: knockout-3.2.0.js knockout.mapping-latest.js knockout.mapping-latest.debug.js My Json array looks like this: [ {"$id":"1","GR":10}, {"$id":"2","GR":20}, {"$id":"3","GR":30}, {"$id":"4","GR":40}, {"$id":"5","GR":50}, {"$id":"6","GR":60}, {"$id":"7","GR":70}, {"$id":"8","GR":80} ] And This is my vieModel: function FormViewModel() { var self = this; self.CpGrp = ko.observable([]); self.GR = ko.observableArray(); $(document).ready(function (){ .... done: function (e, data) { $(".progress").removeClass("progress-striped active"); // we're done debugger; var test $.getJSON("/api/Points", function (dataa) { dataType: 'json' test = ko.toJSON(dataa); ko.mapping.fromJSON(test, {}, self) } )}, ko.applyBindings(new FormViewModel()); Where is the Bug?
score: 0
has answer: http://stackoverflow.com/a/27328114
accepted answer: http://stackoverflow.com/a/27328114
answer count: 1
has comment: http://stackoverflow.com/comment/43095594
has comment: http://stackoverflow.com/comment/43096787
linked to: http://stackoverflow.com/q/15444242
has comment: http://stackoverflow.com/comment/43096688
type: AnsweredQuestion

http://stackoverflow.com/q/27449780
score: 2
tagged with: phantomjs
tagged with: casperjs
answer count: 0
downvote count: 0
duplicate of: http://stackoverflow.com/q/11551861
has title: How does require function work in CasperJS and PhantomJS?
type: Question
has body: I am a newbie in JavaScript. I have been reading PhantomJS and CasperJS API. All the time I see the following line of code in CasperJS var casper = require('casper').create(); in PhantomJS var webPage = require('webpage').create(); We can replace the above lines with in CasperJS var casper = new require('casper').Casper() in PhantomJS var WebPage = require('webpage'); var webPage = new WebPage(); Based on what I know, CasperJS is testing utility sit on top of PhantomJS environment. I'm guessing that the require function has the same underlying implementation for both CasperJS and PhantomJS. I have been search around for the API reference to the require function, but I couldn't find any. Would be nice if someone can guide me to the right path. What does the require function do? (is it similar to the functionality of using keyword in C# .net) Where does PhantomJS reference the "require" function from? (is it using its own implementation or is it referencing another javascript framework?)
tagged with: javascript
upvote count: 2
tagged with: require
linked to: http://stackoverflow.com/q/11551861
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43352628
has comment: http://stackoverflow.com/comment/43413650

http://stackoverflow.com/comment/43352643
type: QuestionComment
comment on: http://stackoverflow.com/q/27436167
score: 0
has text: @Mike I'm using Meteor version MongoDB. It's not regular MongoDB. I'm just curious is this an issue for meteor mongo. It should work with regular MongoDB.
type: Comment

http://stackoverflow.com/q/27356077
favorite count: 0
has comment: http://stackoverflow.com/comment/43164998
possible better answer: http://stackoverflow.com/a/27356164
has answer: http://stackoverflow.com/a/27356164
type: AnsweredQuestion
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/27356185
has title: Cant get value of input
score: -2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43165095
has answer: http://stackoverflow.com/a/27356122
accepted answer: http://stackoverflow.com/a/27356122
downvote count: 2
tagged with: element
has body: I try to get input value of my form. I already try many solutions but still no results. Here is form input: &lt;input class="form-control" id="account_ya_price_list_url shop_key_input" name="account[ya_price_list_url]" type="text" style="/* margin-right: 20px; */"&gt; Js: console.log($('#shop_key_input').html()); console.log($('#shop_key_input').val()); console.log($('#shop_key_input').value); var div = document.getElementById('shop_key_input'); var div2 = document.getElementsByName('account[ya_price_list_url]').first; console.log(div2.innerHTML ); console.log(div.innerHTML ); console.log(div2.value ); console.log(div.value ); All of this or undefined or null. What I am doing wrong?
answer count: 3
tagged with: jquery-selectors
tagged with: getelementbyid
linked to: http://stackoverflow.com/q/70579

roxy-fileman
tag name: roxy-fileman
tags question: http://stackoverflow.com/q/27371965
type: Tag

http://stackoverflow.com/comment/43308691
type: AnswerComment
comment on: http://stackoverflow.com/a/27433280
has text: The iframe is not in the `DOM` yet when you run the code
type: Comment
score: 0

http://stackoverflow.com/q/27385955
has comment: http://stackoverflow.com/comment/43220279
downvote count: 2
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43220196
has comment: http://stackoverflow.com/comment/43220168
favorite count: 0
has comment: http://stackoverflow.com/comment/43220254
has answer: http://stackoverflow.com/a/27386199
has title: jQuery select elements deep in the structure are not found
upvote count: 0
has answer: http://stackoverflow.com/a/27386212
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43220141
type: Question
has body: I am trying to select elements in jQuery like this: $("input[id*='FirstName']") , but it's not working, it's not bringing the values I want from the page. The input is located nested deeply inside the DOM, like the child #30 from the root, and I think jQuery is not able to find it. Anyone faced an issue like this before?? Update: http://pastebin.com/es0Z1P1a
score: -2

http://stackoverflow.com/q/27355206
type: Question
score: 0
has body: I'm trying to run code when some press my icon in my chrome extension. When i used to run the code with code: "code..." it changed the title but didn't run the jquery code. I read that you need to execute it from a file so i added a file. Now both of them doesn't work, before the title was changed (when i used code) and now (when i use the file) it doesn't work. I added alerts to see what code run, none of them work, not even the first I got the following app: manifest.json: { "name": "Pandora Likes", "version": "0.0.1", "manifest_version": 2, "background": { "scripts": ["background.js"] }, "browser_action": { "default_icon": { "19": "icons/19x19.png" }, "default_title": "Pandora Likes" }, "permissions": ["tabs","http://*/","https://*/"] } background.js: function onClick() { chrome.tabs.query({},function(array_of_Tabs) { for(var i=0;i&lt;array_of_Tabs.length; i++){ if(array_of_Tabs[i].url.indexOf('pandora.com')&gt; -1) { //chrome.tabs.update(array_of_Tabs[i].id, { selected: true }); chrome.tabs.executeScript(array_of_Tabs[i].id,{file: "like.js"}); } } }); } chrome.browserAction.onClicked.addListener(onClick); like.js: alert("before"); document.title='gaga'; alert('after'); console.log("before); $('.thumbDownButton').click(); console.log("after); Thank you for your help
answer count: 1
tagged with: jquery
tagged with: google-chrome-extension
has title: Chrome extrension - chrome.tabs.executeScript doesnt run with file
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27355773
linked to: http://stackoverflow.com/q/9515704
tagged with: javascript

http://stackoverflow.com/comment/43346560
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27435376
has text: The request is being made but now my data is always null. I submitted a new question for this problem and have tried many things to fix the issue but still nothing works
score: 0

http://stackoverflow.com/comment/43214806
type: Comment
type: QuestionComment
has text: I'd venture to guess that by using that free site that you're not allowed to interfere with the ads.
score: 3
comment on: http://stackoverflow.com/q/27383099

http://stackoverflow.com/q/27423812
answer count: 1
has title: r.js is not creating the build file
has body: I created a sample program using backbone.js and require.js. I am trying to optimize using this program r.js. but it is not working in Ubuntu 14. It is working fine in Windows. Sample program: index.html Testing Testing init.js require.config({ paths: { jquery: 'libs/jquery', underscore: 'libs/underscore', backbone: 'libs/backbone' } }); require(['underscore', 'backbone', 'app'], function(_, Backbone, app) { console.log(app); app.start(); }); app.js define(['underscore', 'backbone'], function(_, Backbone) { 'use strict'; return { start: function() { console.log('APP'); } }; }); I want to optimize this using r.js I installed r.js using npm install -g requirejs build.js ({ baseUrl : "js", name: "init", out: "build/init-built.js" }) Command to run the optimization: r.js -o build.js Nothing happens after executing this command. Please help me to solve this problem?
favorite count: 0
tagged with: backbone.js
tagged with: requirejs
has comment: http://stackoverflow.com/comment/43289897
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27440334
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27440334

http://stackoverflow.com/q/27336904
has comment: http://stackoverflow.com/comment/43130605
has comment: http://stackoverflow.com/comment/43130539
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43130571
possible better answer: http://stackoverflow.com/a/27336996
has answer: http://stackoverflow.com/a/27337164
has answer: http://stackoverflow.com/a/27336996
linked to: http://stackoverflow.com/q/19849189
type: Question
has comment: http://stackoverflow.com/comment/43130887
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43130582
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43130515
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27337164
has comment: http://stackoverflow.com/comment/43130556
has comment: http://stackoverflow.com/comment/43130546
has body: I want to create different "div" in the body when the user enter the number of div in the textbox For example, with the markup for my textbox: &lt;input type="text" id="numberDiv" maxlength="1"&gt; I am using the following JS: &lt;script&gt; $(document).ready( function () { $('#numberDiv').keyup( function () { var s = $("#numberDiv").val(); var nbrDiv = parseInt(s); for(var i = 0; i &lt;= nbrDiv; i++) { var iDiv = document.createElement('div'); iDiv.id = 'div'; document.getElementsByTagName('body')[0].appendChild(iDiv); iDiv.innerHTML = "I'm a div"; } }) }); &lt;/script&gt; My problem is when I put for example "1" in the textbox it creates 1 div but when I press an other key (for example: enter, alt, ...) it creates another div even if my input has the maxlength="1". How can I disable the pressing on another key when my first number is in the textbox.
has answer: http://stackoverflow.com/a/27337000
has title: TextBox create div javascript

http://stackoverflow.com/comment/103043855
type: AnswerComment
score: 2
comment on: http://stackoverflow.com/a/27407217
has text: Nice explanation, but in no way helps people with this issue on how to resolve it. Could you reference some documentation and perhaps construct a solution?
type: Comment

http://stackoverflow.com/q/27419727
upvote count: 1
has title: Validating respective textarea in a questionnaire based on the option selected using ajax php mysql
type: Question
has comment: http://stackoverflow.com/comment/43285391
has comment: http://stackoverflow.com/comment/43282897
has comment: http://stackoverflow.com/comment/43285908
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/43285506
has comment: http://stackoverflow.com/comment/43285486
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43285814
has body: First of all, Thanks in advance, I am designing an questionnaire which has 3-5 radio buttons and one comment box for each and every questions. Some of the options are mandatory, so that the user must fill some comments or else he cannot fill other questions. Both the names of radio button and textarea are the question_id and the value of radio button is the checked value. The names are stored as array so to insert in the db while submitting the form. The input fields are &lt;input type='radio' name='ans_val[&lt;?php echo $qid; ?&gt;]' value='&lt;?php echo $gans; ?&gt;' /&gt; &lt;textarea rows='3' name='cmnt[&lt;?php echo $qid; ?&gt;]' id="req"&gt;&lt;/textarea&gt; I used ajax to find whether the selected option is mandatory or not, because the options are stored in the database. I was able to view the passed value while selecting an option and the result of the query which executed to check the mandatory option. The ajax code I used is $(document).ready(function () { $('input:radio').click(function(){ var ans_id = $(this).attr('value'); var q_id = $(this).attr('name'); var dataString = 'id='+ans_id; $.ajax({ type: "POST", data: dataString, url: "ans_chq.php", success: function(data){ $('body').append(dataString); // $('textarea').html(dataString); } }); }); }); In ans_chq.php, when the user selects a mandatory option '$mandatory' will become '1' else '0'. I would like to know, how to return the variable $mandatory from the other page to the current page and how to validate respective textarea based on the options selected... Please help me with this...
has answer: http://stackoverflow.com/a/27421751
tagged with: mysqli
has comment: http://stackoverflow.com/comment/43285238
has comment: http://stackoverflow.com/comment/43285618
tagged with: php
accepted answer: http://stackoverflow.com/a/27421751
type: AnsweredQuestion

http://stackoverflow.com/q/27392333
score: 0
has comment: http://stackoverflow.com/comment/43232120
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43261022
has title: Google Maps API OVER_QUERY_LIMIT 10 Destinations
type: AnsweredQuestion
has body: I've been researching this all day and still haven't come across a solution that works. I'm using the Google Maps Distance Matrix Service with 1 origin and 14 destinations. I modified the sample code from Google (https://developers.google.com/maps/documentation/javascript/examples/distance-matrix) and just added more destinations to test it out. With anything over 10 destinations, the OVER_QUERY_LIMIT error occurs and mis-places a marker. From the usage limits I found (100 elements per 10 seconds), I shouldn't be hitting the limit at all. I have also tried inserting my API Key in this line, to no avail: src="https://maps.googleapis.com/maps/api/js?v=3.exp" Any help would be appreciated! Thanks. Code changes to the sample code from Google: var destinationA = new google.maps.LatLng(45.465422,9.185924); var destinationB = new google.maps.LatLng(41.385064,2.173403); var destinationC = new google.maps.LatLng(40.416775,-3.70379); var destinationD = new google.maps.LatLng(51.507351,-0.127758); var destinationE = new google.maps.LatLng(48.856614,2.352222); var destinationF = new google.maps.LatLng(41.902784,12.496366); var destinationG = new google.maps.LatLng(50.85034,4.35171); var destinationH = new google.maps.LatLng(46.198392,6.142296); var destinationI = new google.maps.LatLng(47.36865,8.539183); var destinationJ = new google.maps.LatLng(53.408371,-2.991573); var destinationK = new google.maps.LatLng(37.389092,-5.984459); var destinationL = new google.maps.LatLng(53.349805,-6.26031); var destinationM = new google.maps.LatLng(55.864237,-4.251806); var destinationN = new google.maps.LatLng(51.92442,4.477733); function calculateDistances() { var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: [origin], destinations: [destinationA, destinationB,destinationC, destinationD,destinationE, destinationF,destinationG, destinationH,destinationI, destinationJ,destinationK, destinationL, destinationM, destinationN], travelMode: google.maps.Tr…
has answer: http://stackoverflow.com/a/27408555
has comment: http://stackoverflow.com/comment/43260972
upvote count: 1
downvote count: 1
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/43233687
tagged with: javascript
has comment: http://stackoverflow.com/comment/43261337
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/27408555

http://stackoverflow.com/q/27421504
answer count: 1
type: UnansweredQuestion
has title: textbox having value via javascript, but asp:requiredfieldvalidator fires even the textbox has the value
has answer: http://stackoverflow.com/a/27424045
downvote count: 1
score: -1
has body: i have a textbox in asp.net with required field validator, which is filled using the javascript function(). But the case is that when the validation fires on the textbox it gives error message if it is empty thats okey, but when i fill textbox via javascript it still shows the error message of validation
type: Question
tagged with: asp-classic
upvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/43300773
type: Comment
has text: You were right! I changed the commas by semicolons and the error was gone! Now I need to reorganize the formula to my sheet.
comment on: http://stackoverflow.com/a/27427823
type: AnswerComment
score: 0

http://stackoverflow.com/a/27389646
has body: You can do it dynamically at any depth, given a path as an array, and using a reducer: var searchByPath = function(path, xs) { return path.reduce(function(acc, k) { return acc &amp;&amp; acc[k] },xs) } For example: var xs = [ [1,2,3,4], [5,6,7,8] ] // xs[1][2] searchByPath([1,2], xs) //=&gt; 7 // xs[3][100] searchByPath([3,100], xs) //=&gt; undefined
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27389521

http://stackoverflow.com/comment/43166679
score: 0
type: Comment
has text: I guess it is. Thanks, then. I have posted an updated on the question with what I am originally using.
type: AnswerComment
comment on: http://stackoverflow.com/a/27323876

http://stackoverflow.com/q/27459705
type: UnansweredQuestion
tagged with: web-services
type: Question
score: 1
has body: can anyone help me with javascript button who make PUT operation. action : function() { var selectedRecords = this.view.viewGrid.getSelectedRecords(); var lengthAr = selectedRecords.length; for (var i=0; i &lt; lengthAr ; i++){ alert(selectedRecords[i].id); } }, i want to update one column for all selectedRecords[all]. For this i must make PUT query like this: http://wiki.openbravo.com/wiki/JSON_REST_Web_Services : {data: {"_identifier":"United States","_entityName":"Country","$ref":"Country\/100","id":"100","client": {"_identifier":"System","_entityName":"ADClient","$ref":"ADClient\/0","id":"0","active":true},"organization": {"_identifier":"*","_entityName":"Organization","$ref":"Organization ... truncated for clarity ... (USA)","_entityName":"ADLanguage","$ref":"ADLanguage\/192","id":"192","active":true},"currency":{"_identifier": "USD","_entityName":"Currency","$ref":"Currency\/100","id":"100","active":true},"iBANLength":null,"iBANCode":null}} but i'm new with javascript and i don't know how to do this. I can't undenstand this code: What is _identifier? should not it be ID from selectedRecords[i].id? How i can write the query in javascript?
upvote count: 1
tagged with: javascript
tagged with: rest
tagged with: openbravo
has title: Javascript REST Web Services PUT query
favorite count: 0
answer count: 0
downvote count: 0

http://stackoverflow.com/q/27368358
answer count: 1
has answer: http://stackoverflow.com/a/27368894
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/43188777
type: Question
has title: Stretching an img by setting it's height/width at runtime using CSS produces odd gradient
tagged with: javascript
tagged with: jquery
has body: Can anyone suggest what might be causing the gradient on the right hand side of the popup in this image: http://s29.postimg.org/gvr8liupj/lv_problem.jpg The left, top and bottom edges of the 'popup' (an absolutely positioned div) are stretched in exactly the same way - I simply set the width/height at run-time using jQuery... I've checked everything and am stumped. Has anyone experienced anything similar?
score: 0

http://stackoverflow.com/comment/43304229
has text: I have a custom library. but mostly using jQuery
type: AnswerComment
comment on: http://stackoverflow.com/a/27430272
score: 0
type: Comment

http://stackoverflow.com/q/27419470
type: Question
tagged with: safari
has answer: http://stackoverflow.com/a/27419903
has comment: http://stackoverflow.com/comment/43282447
has body: I am creating Invoice sample in HTML. and after printing the same invoice. The invoice print is fine when Printing with FireFox But when trying to print with Chrome and Safari the Invoice footer getting lost its CSS setting. I need a footer on last page at Bottom if more than one page in print. HTML : http://pastebin.com/A4q5HJN3 Header Service Description Hrs/Qty Rate/Price Sub Total Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your article here - $200.00 $200.00 Article Title of your …
has comment: http://stackoverflow.com/comment/43281996
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Invoice Footer CSS getting lost in print while printng with Chrome and Safari
tagged with: css
type: UnansweredQuestion
tagged with: google-chrome

http://stackoverflow.com/comment/58007950
score: 1
comment on: http://stackoverflow.com/a/31731050
has text: Variables inside functions can not be changed by rewire. This is constrained by JavaScript and can't be circumvented by rewire.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27321800
has answer: http://stackoverflow.com/a/27322162
type: AnsweredQuestion
has body: I'm building a website that will have a JS multi-dimensional array in a .js file in the scripts folder on the server. In the array will be video embed codes (Vimeo iframes) and additional strings for composers, players and piece names. There will about 1000 videos in the array. var videos = [ ['embed code', 'composer name', 'player name', 'piece name'], ['embed code', 'composer name', 'player name', 'piece name']...]; There will be a search text box for users to do specific searches by composer, player, etc. A jQuery script will iterate through each inner array to find matches to the user's query and present them on the page. It will look basically like this: function getArray(video) { if (campyear === video[j]) { var pos = video.indexOf(video[j]); $('#searcharea').append(' ' + video[(pos - pos)] + ' Composer: ' + video[(pos -pos) + 1] + ' Player: ' + video[(pos - pos) + 2] + ' Piece: ' + video[(pos - pos) + 3] + ' '); } else noResultCount++; if (campyear === video[j] && count % 2 === 0) $('#searcharea').append(' '); if (campyear === video[j]) count++; if (i === videos.lenght && j === 4) $('#searcharea').append(' '); if (noResultCount === videos.length * 5) $('#searcharea').html(" No results found for " + yearvalue + " " + buttonvalue + ". Not all camps have videos for every year. "); $('#searcharea').fadeIn(500); } // End of getArray() ... ... ... for (i = 0; i < videos.length; i++) { for (j = 0; j < 5; j++) { getArray(videos[i]); } } I know there are security issues with the traditional SQL databases and PHP that need to be considered, but in this case should I be concerned about any threats to the data or website? My thought was the script can only read the data and print it so there wasn't much someone could do, but I'm not sure. The data isn't sensitive. Thanks for your time.
has comment: http://stackoverflow.com/comment/43103111
type: Question
accepted answer: http://stackoverflow.com/a/27322162
has comment: http://stackoverflow.com/comment/43102869
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43102886
score: 0
has title: Security issues with reading a JS array?
has comment: http://stackoverflow.com/comment/43102877
answer count: 1

http://stackoverflow.com/comment/43284071
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27420581
has text: Have you seen [this bug?](https://code.google.com/p/chromium/issues/detail?id=312928)

http://stackoverflow.com/q/27400615
has body: I use the following code that change the following object (myDoc) to JQuery, my question how should I change it after to Java script object(not Jquery) ? I know that I can store it before but I want to avoid that. this._mDoc = $( myDoc );
downvote count: 1
has answer: http://stackoverflow.com/a/27400665
has comment: http://stackoverflow.com/comment/43246472
type: Question
type: AnsweredQuestion
tagged with: javascript
score: -1
answer count: 2
upvote count: 0
tagged with: jquery
has title: Return the original object after obj change to Jquery
possible better answer: http://stackoverflow.com/a/27400665
favorite count: 0
has answer: http://stackoverflow.com/a/27400642
accepted answer: http://stackoverflow.com/a/27400642
has comment: http://stackoverflow.com/comment/43246311

http://stackoverflow.com/a/27400088
has comment: http://stackoverflow.com/comment/43245310
score: 0
answers question: http://stackoverflow.com/q/27399948
type: Answer
has body: http://jsfiddle.net/washington_guedes/rtonjcym/14/ $("button").on("click", function(){ if( $(this).val() === "0") $(this).html("Click here to disable").val("1"); else $(this).html("Click here to enable").val("0"); }); $("#action").on("click", function(){ if( $("button").val() === "0") return; // function implementation $(this).css({"background-color": "#" + Math.floor(Math.random() * 10) + Math.floor(Math.random() * 10) + Math.floor(Math.random() * 10)}); }); I stored in button's value: zero or one... and used this code in the functions: .. function .. (){ if( $("button").val() === "0") return; ... } ..

http://stackoverflow.com/comment/43369407
type: QuestionComment
has text: dataType : json is been used, does this data type help in client storage or do I need to change it to local ? But if i change the data type to local, then lot of code has to be changed in this scenario.. Any other alternative for this ?
score: 0
comment on: http://stackoverflow.com/q/27458359
type: Comment

http://stackoverflow.com/a/27375712
accepted answer of: http://stackoverflow.com/q/27375635
answers question: http://stackoverflow.com/q/27375635
upvote count: 8
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43201332
has body: The components of a query string are the key names and values. ?key=value&amp;key=value Don't encode the = characters. They aren't part of the component, they divide the components up. var url = 'http://www.example.com/resource?' + encodeURIComponent("resource.name~") + "=" + encodeURIComponent("%" + query + "%");
type: Answer
score: 8
downvote count: 0

http://stackoverflow.com/comment/43231492
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27391951
has text: post the code that you've tried running.

http://stackoverflow.com/a/27464265
type: Answer
has body: You need setters/getters, when you need implement some non-standart logic for property. For example, next object accumulate all assignments: var obj = { _a:0, get a(){ return this._a;}, set a(value){this._a+=value;} } obj.a = 5; obj.a = 7; obj.a 12 Also this useful, when you want to write some proxy object, for example getter resolves data from remote server, and setter post your data to it. If you need simple property, just use {a:0} instead of {_a:0,get a(){return this._a;},set a(v){this._a=v;}} Other snippet, with js 'privates': function Obj(key) { var private = 0; var authorized = false; return { set token(v) {authorized = (v===key);}, set data(v) {if(authorized) private = v;} get data() {return authorized?private:undefined;} } } obj = new Obj('pass'); obj.data = 5; // no effect obj.token = 'pass'; obj.data = 'Data'; //Now works! ///...
score: 0
answers question: http://stackoverflow.com/q/27464148
has comment: http://stackoverflow.com/comment/43365700

http://stackoverflow.com/comment/43323074
type: Comment
has text: dont know if the original code was working, but this code is working for me on Firefox 34 on MacOS.
comment on: http://stackoverflow.com/q/27441439
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43352496
score: 0
type: Comment
has text: Thanks! I now have a further issue... this works great, but I want to stop further clicks/submits from running my script again. I've done this code, but this just shows the popup and still runs the ajax again... how do I make it so the ajax can only run once per form?
comment on: http://stackoverflow.com/a/27457286
type: AnswerComment

http://stackoverflow.com/comment/43227819
type: Comment
score: 0
has text: Okay so just to get this right: If I catch the error .on('error'... how do i match it to the specific emit I made... to be more precise: what happens if I emit 5 messages and 1 doesnt get delivered, how am I aware of this 1?
comment on: http://stackoverflow.com/a/27364138
type: AnswerComment

http://stackoverflow.com/a/60291220
score: 6
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27375252
upvote count: 6
has body: As of early 2020, it seems that KaTeX 0.11.1 supports inline maths without using the "hack" in the answer by Vincent. The single dollar delimiters $ ... $ do not work but the escaped brackets \( ... \) instead do, as in the following minimal code and snippet: Katex 0.11.1 Lorem ipsum $e^{i\pi}+1=0$ dolor sit amet, \(e^{i\pi}+1=0\) consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum $e^{i\pi}+1=0$ dolor sit amet, \(e^{i\pi}+1=0\) consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. After some tests, I couldn't make dollar delimiters $ ... $ work but the brackets \( ... \) here working by default are an update respect to version 0.7.1 of KaTeX (anyway still available).
has comment: http://stackoverflow.com/comment/116616820

http://stackoverflow.com/a/48564816
upvote count: 5
has body: You can check this utility to check the available resolutions of your devices: https://webrtchacks.github.io/WebRTC-Camera-Resolution/ It is useful for troubleshooting purposes. Hope you find it interesting!
downvote count: 0
answers question: http://stackoverflow.com/q/27420581
type: Answer
score: 5

http://stackoverflow.com/q/27385184
answer count: 3
possible better answer: http://stackoverflow.com/a/27387425
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27387425
has title: React Component and CSSTransitionGroup
favorite count: 0
accepted answer: http://stackoverflow.com/a/27387145
tagged with: css
upvote count: 13
score: 13
has body: early days with Facebook ReactJS. Simple CSS fade-in transition. It works as expected with ReactJS v0.5.1. It doesn't with v11.1, v12.0, v12.1. Here's the CSS and JSX: CSS .example-enter { opacity: 0.01; transition: opacity .5s ease-in; } .example-enter.example-enter-active { opacity: 1; } .example-leave { opacity: 1; transition: opacity .5s ease-in; } .example-leave.example-leave-active { opacity: 0.01; } JSX for ReactJS v12.1 /**@jsx React.DOM*/ var ReactTransitionGroup = React.addons.CSSTransitionGroup; var HelloWorld = React.createClass({ render: function() { return ( Hello world ); } }); React.render(<HelloWorld />, document.body); Here's the list of Codepens: v0.5.1 http://codepen.io/lanceschi/pen/ByjGPW v0.11.1 http://codepen.io/lanceschi/pen/LEGXgP v0.12.0 http://codepen.io/lanceschi/pen/ByjGOR v0.12.1 http://codepen.io/lanceschi/pen/YPwROy Any help appreciated. Cheers, Luca
has answer: http://stackoverflow.com/a/53716575
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27387145
type: Question
tagged with: reactjs

http://stackoverflow.com/a/27379308
has comment: http://stackoverflow.com/comment/43208061
type: Answer
has body: You can to use a jquery plugin to get/set cookie data directly with javascript. https://github.com/carhartl/jquery-cookie#readme
answers question: http://stackoverflow.com/q/27379060
score: 0

http://stackoverflow.com/comment/43171215
score: 0
has text: How would I go about doing this?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27359433

http://stackoverflow.com/a/27449814
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43655156
has body: There's no such thing as an =+ operator, there is an += operator, however. += Addition assignment. Also, I'm pretty sure the typeof val is undefined since it's value is never defined in the argument passing of the method. A variable which's type is undefined can certainly not contain a value which's a number (it's NaN) and thus the error message makes sense.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27449718

constraints
type: Tag
tags question: http://stackoverflow.com/q/27468355
tag name: constraints

http://stackoverflow.com/a/27329998
has body: You are performing an assignment, not a comparison: $scope.tocadoColour = 'red' should be $scope.tocadoColour === 'red'
score: 0
accepted answer of: http://stackoverflow.com/q/27329966
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27329966
type: Answer

jquery-file-upload
tags question: http://stackoverflow.com/q/27405291
type: Tag
tag name: jquery-file-upload

http://stackoverflow.com/comment/43168480
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27358026
has text: http://www.whateverorigin.org/

http://stackoverflow.com/comment/43188945
comment on: http://stackoverflow.com/q/27368503
score: 0
type: QuestionComment
type: Comment
has text: The third var is useless. You only need to declare a variable once, as you've already done with the second var.

http://stackoverflow.com/a/27341097
score: 2
has body: Let me try to answer it with examples: function modify(obj) { // modifying the object itself // though the object was passed as reference // it behaves as pass by value obj = {c:3}; } var a = {b:2} modify(a); console.log(a) // Object {b: 2} function increment(obj) { // modifying the value of an attribute // working on the same reference obj.b = obj.b + 1; } var a = {b:2} increment(a); console.log(a) // Object {b: 3} function augument(obj) { // augument an attribute // working on the same reference obj.c = 3; } var a = {b:2} augument(a); console.log(a) // Object {b: 2, c: 3} Please refer the JSFiddle for working demo.
answers question: http://stackoverflow.com/q/27340990
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/27317589
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43095227
has comment: http://stackoverflow.com/comment/43095402
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27318095
has title: creating a JS object: use literal notation or set variables?
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/43094925
favorite count: 0
has comment: http://stackoverflow.com/comment/43112290
has comment: http://stackoverflow.com/comment/43094773
type: Question
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/43094825
score: -1
has answer: http://stackoverflow.com/a/27318095
has body: Which is faster and/or more performant, or does it really not matter and is up to preference? Option 1: using object literal notation: var Company = { colors : ['#000000', '#ffffff'], answers : ['A','B','C','D'], }; Option 2: not sure what this is called but I've seen it especially with classes and prototypes var Company = {}; Company.colors = ['#000000', '#ffffff']; Company.answers = ['A','B','C','D'];
tagged with: oop

http://stackoverflow.com/q/27327299
accepted answer: http://stackoverflow.com/a/27327948
tagged with: angularjs
has title: ng-class not responding to change in model in Angular?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43125931
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27327948
tagged with: javascript
linked to: http://stackoverflow.com/q/12008580
answer count: 1
downvote count: 0
favorite count: 0
has body: Having searched extensively, got some help from A ternary in templates and getting partially functional results, I'm 99% sure I'm doing it 99% right, but...obviously not completely, so I'm here. The basic HTML structure: some stuff in here The stuff in the controller that sits above it: $scope.activeDay = null; $scope.fn1 = function() { $scope.activeDay = '0-0'; }; // this works, and sets the first one active $scope.fn2 = function(data) { $scope.activeDay = data.week + '-' + data.day; }; // this sets the first one not active, but none of the others go active I'm trying to set one of the nested list items to be active, based on its indexes in the nested arrays by using the $parent.$index and $index as a string, joined by '-'. What's throwing me off is that console.logging $scope.activeDay, data.week + '-' + data.day, and both == and === comparisons come out exactly as I would expect, (the same strings, true, true) and it works on initial load when I set activeDay to '0-0', so I'm clearly missing something in my binding or...? After finding this: https://egghead.io/lessons/angularjs-the-dot - I tried setting it up as an object so I couldn't get into some weird isolate scope nonsense: $scope.tiles = { activeDay: null }; and then setting that property from my functions, to no avail. Why does setting it initially work, while changing it later does not? Is this improper binding of classes or...? I also tried it with class="day-tile {{activeDay == $parent.$index + '-' + $index ? 'active' : ''}}" and that works initially, but breaks afterwards... Your help is much appreciated! UPDATE: After moving ng-class="{'active': (activeDay == $parent.$index + '-' + $index) }" onto the div inside the ng-repeated .day-tile li, it works fine. Any ideas why this might be?
has comment: http://stackoverflow.com/comment/43114239

http://stackoverflow.com/comment/43152202
has text: What are these `param1`/`param2` doing there?
comment on: http://stackoverflow.com/a/27348772
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/a/27319614
has comment: http://stackoverflow.com/comment/43098905
upvote count: 2
has comment: http://stackoverflow.com/comment/43098956
has comment: http://stackoverflow.com/comment/43123235
answers question: http://stackoverflow.com/q/27319461
type: AcceptedAnswer
downvote count: 0
has body: A bit of creative filtering and finding. $(function(){ $('tr td').filter(function(){ return $(this).text().toLowerCase().indexOf('name')>-1; }) // first find only the td's containing the text you want .parent() // step up to the tr .find('a') // find the `a` - only because you've duplicated id's. This could be any selector .hide(); // hide it }); blabla Name: Messi button blabla blabla upload id: 123456 button blabla blabla upload id: 654321 button blabla Be careful: id's should be unique.
type: Answer
accepted answer of: http://stackoverflow.com/q/27319461
score: 2

http://stackoverflow.com/comment/43382948
comment on: http://stackoverflow.com/q/27456735
score: 0
has text: are you sending any parameters to `requestAttention()` ?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43180682
comment on: http://stackoverflow.com/q/27364420
type: Comment
type: QuestionComment
has text: check that your CSS does not have the property `backdrop` set to `false` - Also, are you Boostrap 2.x syntax with Boostrap 3.x libraries?
score: 0

http://stackoverflow.com/comment/43304625
type: QuestionComment
score: 0
has text: Take a look at `event.stopPropogation`, `preventDefault` and `bubbling`.
comment on: http://stackoverflow.com/q/27431702
type: Comment

http://stackoverflow.com/comment/43158290
comment on: http://stackoverflow.com/a/27352143
type: AnswerComment
score: 0
has text: that's not a map, and more to the point, it's silly, you can just ask if(yourMap[keyToLocate]!=null); no looping needed.
type: Comment

http://stackoverflow.com/a/27351231
score: 4
accepted answer of: http://stackoverflow.com/q/27351205
answers question: http://stackoverflow.com/q/27351205
type: Answer
has comment: http://stackoverflow.com/comment/43156775
has body: before the script in which you'll need it, you should be able to include something like this. then access it by variable name.
has comment: http://stackoverflow.com/comment/43156720
has comment: http://stackoverflow.com/comment/43156661
has comment: http://stackoverflow.com/comment/43156787
upvote count: 4
has comment: http://stackoverflow.com/comment/43156833
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27433051
score: 2
type: Question
has answer: http://stackoverflow.com/a/27433420
has comment: http://stackoverflow.com/comment/43307242
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: Angular.js: how to update one item of an array?
answer count: 3
has body: Background: app built in Angular (with routing), Node, Express, MongoDB/Mongoose. In one controller I have an array of stuff $scope.array=[]; whose items are fetched through an $http request. I have a routine which modifies one item of the array: $http.get('/api/update?id='+itemId, .. Upon success of the get request, I have to update the specific item of $scope.array which has been modified. I know a possible way is to re-fetch the complete array, but seems inefficient. Can anyone suggest a way to update/substitute only the item which has been modified?
has answer: http://stackoverflow.com/a/27433601
linked to: http://stackoverflow.com/q/1744310
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27433303
tagged with: node.js

http://stackoverflow.com/a/27454637
answers question: http://stackoverflow.com/q/27440494
has comment: http://stackoverflow.com/comment/43396227
accepted answer of: http://stackoverflow.com/q/27440494
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43399840
type: Answer
has body: Do you mean that you get an error 10-15 minutes after you have created the initial cursor? If so, MongoDB closes the cursor on the server side after 10 minutes of inactivity to avoid memory leaks.
upvote count: 1

http://stackoverflow.com/a/27391494
has body: Use blur instead of change event.
answers question: http://stackoverflow.com/q/27391461
type: Answer
has comment: http://stackoverflow.com/comment/43232639
has comment: http://stackoverflow.com/comment/43230955
has comment: http://stackoverflow.com/comment/43230860
score: 0

http://stackoverflow.com/a/27414123
has comment: http://stackoverflow.com/comment/43294012
upvote count: 2
has comment: http://stackoverflow.com/comment/43280354
has body: I was using a webcam (with the navigator.getUserMedia function). The webcam resolution was significantly higher and so, even when the sizes of the video element and canvas were the same, the image being captured was much larger than could fit. The solution was to add a constrain property to make the media stream also 125px x 125px
type: Answer
answers question: http://stackoverflow.com/q/27413768
score: 2
accepted answer of: http://stackoverflow.com/q/27413768
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27363431
has body: For anyone wanting to do this, here is how I did it: In the eventClick method check to see if the checkbox inside the event is checked, if so, set your non-standard event property (selected) to 1 or true. In the eventDrop method check to see which events have the selected property set to 1 or true and update those events' start and end dates/times. Don't forget to use $('calendar').fullCalendar('updateEvent', event); to update the event after changing properties inside eventDrop Lastly in eventRender which I used to place the checkboxes inside the event elements, make sure that is the events's selected property is 1 or true, the respective checkbox is checked. That should do it.
answers question: http://stackoverflow.com/q/27359154
score: 0
type: Answer

http://stackoverflow.com/q/27422352
tagged with: variables
favorite count: 0
has body: I have a problem. Was working on this for a long time, but really stuck. Searching in stackoverflow for similar problems did not really help me - as people have a little different issues and I could not implement the answers to my code. I have a dynamically changing &lt;input&gt; elements, where their ids and values are created by PHP. So, total number &lt;input&gt; elements there can be 1 or even 10+. HTML: &lt;input id='photonumb1' type='text' value='001'/&gt; &lt;input id='photonumb2' type='text' value='002'/&gt; &lt;input id='photonumb3' type='text' value='003'/&gt; ... There is also one &lt;input id="totalphotos" /&gt; tag which has a value of how many &lt;input&gt; elements there are created. I want JavaScript to take the number of &lt;input&gt; elements there are (probably taking a value from "totalnumbers") and take the values of all "photonumb*" (using for() loop I suppose?). Each value of each element is to be assigned as new variable, like: var photoname1 = 001; var photoname2 = 002; var photoname3 = 003; ... Total variable number depends on how many &lt;input&gt; elements there are created. I was trying to do the suggestions, like: totalphotos = document.getElementById('totalphotos').value; for (i = 1; i &lt;= totalphotos.length; i++) { window[photoname + i] = document.getElementById('photonumb' + i).value; } But this did not help me, it just does not create a new variable, if I do console.log(photoname1); for example. Anyone has a suggesstion for me? Thank you in advance! ----- EDIT--- Hey @Quentin, why marked as duplicate? Maybe the idea of the question might be similar, but I am asking it completely other way, so even the answer that I am looking for is different. Moreover, I have seen that question before, I could not completely understand how it works. Thus for other beginners like me, this question might be way more useful. Thanks.
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/5187530
has comment: http://stackoverflow.com/comment/43287468
tagged with: dynamic
has comment: http://stackoverflow.com/comment/43286948
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27422584
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27422472
accepted answer: http://stackoverflow.com/a/27422584
possible better answer: http://stackoverflow.com/a/27422472
type: Question
has title: Dynamic javascript variable name using for loop
score: 0
answer count: 2
duplicate of: http://stackoverflow.com/q/5187530
tagged with: for-loop
tagged with: javascript

http://stackoverflow.com/comment/43203756
type: Comment
comment on: http://stackoverflow.com/a/27377056
has text: Can u check 1 more time,i make the code shorter just now.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43225173
type: Comment
type: QuestionComment
has text: I'd go with a Honeypot implementation. Example here: http://stackoverflow.com/questions/16861325/honeypot-implementation
score: 1
comment on: http://stackoverflow.com/q/27388587

http://stackoverflow.com/a/27395132
score: 2
answers question: http://stackoverflow.com/q/27395033
downvote count: 0
has body: Although you already are having a count rowNum, you could just use that in your function to check the count. Alternatively you could use something like this : var count = $('p[id^=rowNum]').length; if(count &gt;= 10) { // meaning there are atleast 10 dynamic elements created }
upvote count: 2
type: Answer

http://stackoverflow.com/q/27425528
has comment: http://stackoverflow.com/comment/43293692
has comment: http://stackoverflow.com/comment/43293134
has body: Ok guys, heres the deal. I have two div's in my page for the purpose of a scrollable table. That all works fine(I'd post the code but the page is WAY to complicated with all the DB data we bring in. And I don't wanna breach any privacy rules here at my company.) Anyway. I have the two div's containing exactly the same data and I have z-index'd the scrollable div on top of the other one. The hidden div only exists to show the table header. I have to write out the data in both div's so the table header's cells are the correct width because the width fluxuates. Anyway, now that the explination is over, heres the problem. When using CTRL+F to find items in the table. When it finds a single item, it says it found two because it's finding the value in the div thats hidden. Is there anyway in HTML,CSS,JAVASCRIPT to not include the contents of the hidden div in the find function? Sorry for such a long explination. This is my first question here, just wanted to be thorough. Thanks guys for any help you can give. CODE:This writes out the divs and tables response.write "&lt;div id='container'&gt;" response.write "&lt;TABLE BORDER=1 style='border: solid; ' WIDTH='100%'&gt;" call writeHeader call writeData response.write "&lt;/table&gt;&lt;div id='divToShow'&gt;&lt;TABLE BORDER=1 style='background-color: white;border: solid;' WIDTH='100%'&gt;" objrst.Close objRst.Open Sql call writeData call writeHeader response.write "&lt;/div&gt;&lt;/table&gt;&lt;/div&gt;" CSS: &lt;style&gt; #container { width: 100%; height: 650px; position: relative; overflow: hidden; } #divToShow { width: calc(100% + 5px); height: 650px; position: absolute; top: 46; left: 0; overflow-x: scroll; overflow-y: scroll; } #divToShow { z-index: 10; }
accepted answer: http://stackoverflow.com/a/27427984
has comment: http://stackoverflow.com/comment/43294136
has comment: http://stackoverflow.com/comment/43293280
has comment: http://stackoverflow.com/comment/43293810
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43294729
has title: Hiding DIV elements from browsers built-in find function
has comment: http://stackoverflow.com/comment/43295104
has comment: http://stackoverflow.com/comment/43293144
has comment: http://stackoverflow.com/comment/43293047
type: Question
has comment: http://stackoverflow.com/comment/43292990
tagged with: javascript
has answer: http://stackoverflow.com/a/27427984
has comment: http://stackoverflow.com/comment/43293626
score: 0
has comment: http://stackoverflow.com/comment/43293374
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43294248
has comment: http://stackoverflow.com/comment/43295428
has comment: http://stackoverflow.com/comment/43293179
has comment: http://stackoverflow.com/comment/43294497
has comment: http://stackoverflow.com/comment/43294237

http://stackoverflow.com/comment/43334312
has text: @Skullomania do you need the lazy loading or do you only want some kind of left to right animation?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27446875

http://stackoverflow.com/comment/43230913
comment on: http://stackoverflow.com/a/27391632
type: Comment
score: 1
type: AnswerComment
has text: another alternative might just be split (also dont use `str` as the string variable name :P it makes bad habits ... +1 all the same)

http://stackoverflow.com/q/27403020
tagged with: javascript
has comment: http://stackoverflow.com/comment/43250987
has answer: http://stackoverflow.com/a/27403200
has comment: http://stackoverflow.com/comment/43250687
accepted answer: http://stackoverflow.com/a/27403200
answer count: 1
downvote count: 0
has body: I have a sticky div which stays on top if I scroll past it. But it resize to the full screen size and I want it to keep the same size. Here is CSS-code for the wrapper and the sticky class: .wrapper{ margin: 0 auto; width: 100%; height: 180px; background-color:#fff; border-top: 0; -webkit-box-shadow: 0 8px 6px -6px #B8B8B8; -moz-box-shadow: 0 8px 6px -6px #B8B8B8; box-shadow: 0 8px 6px -6px #B8B8B8; } .sticky { width: 100%; position: fixed; left: 0; top: 0; z-index: 100; border-top: 0; padding-left: 15px; padding-right: 15px; -webkit-box-shadow: 0 8px 6px -6px #B8B8B8; -moz-box-shadow: 0 8px 6px -6px #B8B8B8; box-shadow: 0 8px 6px -6px #B8B8B8; } And here is the JS code: var global = {}; $(document).ready(function(){ var element = $(".wrapper"); offset = element.offset(); global.top = offset.top; global.height = element.outerHeight(); }); $(window).scroll(function () { var scroll_top = $(document).scrollTop(); if (scroll_top &gt; global.top ) { $('.wrapper').addClass('sticky'); $("body").css({ "padding-top": global.height }); } else { $('.wrapper').removeClass('sticky'); $("body").css({ "padding-top": 0 }); } }); I created also a fiddle: http://jsfiddle.net/44ep8dz4/1/
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43251149
has comment: http://stackoverflow.com/comment/43250888
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Do not resize width of a sticky div
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/43294157
type: QuestionComment
comment on: http://stackoverflow.com/q/27426177
score: 0
has text: Try looking into Jquery.Post? http://api.jquery.com/jquery.post/ Put it into a form and asynchronously post the form.
type: Comment

http://stackoverflow.com/comment/51439525
comment on: http://stackoverflow.com/a/27317324
type: Comment
has text: @compguy24 Mostly in the module's documentation or by looking at the `angular.module` line in the source code
type: AnswerComment
score: 0

http://stackoverflow.com/q/27429560
linked to: http://stackoverflow.com/q/12961607
downvote count: 0
has comment: http://stackoverflow.com/comment/43320686
answer count: 1
has body: I have a large MVC4 app in VS2012 with controller functions that return simple dynamic objects (as JSON) back to jQuery $.post functions. It appears the compiler is combining objects with the same property definitions (but different letter cases) into the same object. This is causing issues when trying to read back the properties in javascript. Dim js As New System.Web.Script.Serialization.JavaScriptSerializer() 'should return {"TEST":true} and does MessageBox.Show(js.Serialize(New With {.TEST = True})) ' should return {"test":true} but returns {"TEST":true} if the above code exists. MessageBox.Show(js.Serialize(New With {.test = True})) The project is large with multiple developers, so it's not always practical to scan the code for instances of this issue. Is there a way to prevent this optimization?
favorite count: 0
has title: Prevent compiler streamlining two dynamic objects into one
tagged with: vb.net
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28778317
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/43328711
has comment: http://stackoverflow.com/comment/43301518
has comment: http://stackoverflow.com/comment/43338698
has comment: http://stackoverflow.com/comment/43300452
tagged with: javascript
tagged with: compiler-optimization
has comment: http://stackoverflow.com/comment/43329643
accepted answer: http://stackoverflow.com/a/28778317
score: 3

http://stackoverflow.com/a/27334529
type: Answer
has comment: http://stackoverflow.com/comment/43127071
has comment: http://stackoverflow.com/comment/43127367
upvote count: 1
has body: TL;DR Use can use setInterval or Websockets to accomplish this. Below I explain how. First of all, we need to understand what is behind this Publish/Subscribe pattern. Since you want to build a real-time application, you may create a function that asks to your server if some data was added since last time it was checked. USING WindowTimers.setInterval() Here is the simplest way to accomplish this in my point of view, assuming that's your first time and you never worked with websockets before. For instance, in your client-side project you create a function within a setInterval setInterval( checkNewData, time). Your method checkNewData() will make an ajax requisition to your server, asking if some data was added recently: function checkNewData() { // ajax call // On response, if found some new comment, you will inject it in the DOM } Then, in your server-side method, get the timestamp of its call and verify in your database if there are some data. Something like this: // Method written in PHP public function ajax_checkNewData() { $time = time(); // Asks to your model controller if has something new for us. // SELECT comment FROM comments WHERE timestamp &gt; $time // Then return its response } You will use the response that came from your controller method ajax_checkNewData() to write on your comments-container. USING WEBSOCKETS (beautiful way) Now, there are another way to do this, using WebSockets. HTML5 WebSocket represents the first major upgrade in the history of web communications. Before WebSocket, all communication between web clients and servers relied only on HTTP. Now, dynamic data can flow freely over WebSocket connections that are persistent (always on), full duplex (simultaneously bi-directional) and blazingly fast. Amongst different libraries and frameworks, you can use socket.io. I believe this will solve your real-time application problem pretty good, but I am not sure how much of your project you will need to change to suit this solution. Check it ou…
answers question: http://stackoverflow.com/q/27334150
downvote count: 0
score: 1

http://stackoverflow.com/comment/43112870
type: Comment
type: QuestionComment
score: 6
comment on: http://stackoverflow.com/q/27326937
has text: Have you tried a if(!moment1.isBefore(moment2)) ?

http://stackoverflow.com/a/27337337
has comment: http://stackoverflow.com/comment/43131291
type: AcceptedAnswer
downvote count: 0
has body: scr is not src. Use a validator to make sure you haven't misspelt attribute names.
type: Answer
accepted answer of: http://stackoverflow.com/q/27337284
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/27337284

http://stackoverflow.com/q/27404223
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43253283
has answer: http://stackoverflow.com/a/27405470
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43254779
linked to: http://stackoverflow.com/q/3941307
has body: When setting up a div with a class, attaching a click event to that class using jQuery, it prevents any child href from working. For example: HTML some text here and a link JS $('body').on('click', '.someClass', function(e) { alert("clicked"); }); jsfiddle for this: http://jsfiddle.net/w6ero5j5/2/ it will always alert the message, even when clicking on the link. how can I make the link works?
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43253354
score: 0
tagged with: jquery-events
duplicate of: http://stackoverflow.com/q/3941307
has title: jQuery parent element event 'click' blocks a href links

http://stackoverflow.com/a/27380882
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/27380584
has body: i correct your code, just put: $(document).ready(function () { $('.sub-menu li').hide(); $(".ca-menu li").click(function () { $(this).find(".sub-menu").slideDown(); $(this).siblings("li").find(".sub-menu").slideUp(); }); }); Or, put the slideUp in the slideDown callback: var l; $('.sub-menu li').hide(); $(".ca-menu li").click(function () { l = $(this).siblings("li").find(".sub-menu"); $(this).find(".sub-menu").slideDown(function(){ l.slideUp(); }); }); Here the examples: jsfiddle or jsfiddle with callback.
type: Answer
accepted answer of: http://stackoverflow.com/q/27380584

http://stackoverflow.com/comment/43377427
type: QuestionComment
has text: Post the code you are currently using to get the sum (and only that).
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27471325

http://stackoverflow.com/comment/43198736
type: QuestionComment
type: Comment
has text: Maybe this is the json that you are looking for - https://favbet.com/bets/starting_soon/. No need screen scrapping. :)
comment on: http://stackoverflow.com/q/27342546
score: 1

http://stackoverflow.com/comment/63669337
has text: This procedure doesn’t work for German dates. The long form is `DD.MM.YYYY` but the short form still requires the trailing dot (`DD.MM.`) —which gets stripped by the second `replace(…)`.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29641375
type: AnswerComment

http://stackoverflow.com/comment/43260979
comment on: http://stackoverflow.com/a/27407884
score: 0
type: Comment
has text: i have added a JavaScript for keydown check this if it works!
type: AnswerComment

http://stackoverflow.com/comment/43271587
has text: FYI: JavaScript allows for `try-finally` blocks (without `catch`).
comment on: http://stackoverflow.com/q/27413715
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43354287
has text: Yes i tried.. it does not work.. http://s5.postimg.org/y7dv14faf/screenshot_104.png
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27458530
type: Comment

http://stackoverflow.com/a/27380902
downvote count: 0
score: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27380765
has body: The function only updates when all three values are included. Presumably your &gt;0 checks are to handle the case where there are blank inputs because they will parse as NaN and anything + NaN == NaN. So probably you best approach is to substitute 0 when your parseInt returns NaN. This can be easily done like this: val1 = parseInt(id("fenster").value) || 0; Now if parseInt gives NaN, which is falsy, you will assign 0 instead. Also note, you should specify the radix for parseInt: val1 = parseInt(id("fenster").value, 10) || 0; Because leading zeros will cause it to think it's octal. Also, it would probably be easier to assign a class to your inputs and then get them all at once and loop through them.
accepted answer of: http://stackoverflow.com/q/27380765
upvote count: 1
type: Answer

http://stackoverflow.com/comment/43289560
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27423246
has text: It doesn't work for me :( function popup(){ var mypopup = window.open('http://33bits.es/foro/masiconos.php', 'popup', 'width=400','height=300','status=no', 'scrollbars=yes', 'toolbars=no', 'menubar=no', 'location=no'); mypopup.focus; $popDocument = $(mypopup.document); $popDocument.ready(function() { //Más Iconos $popDocument.find('img').click(function (evt) { var clase = $(this).attr('class'); insertar_popup(clase); }); Still like before.

http://stackoverflow.com/comment/43372560
score: 0
comment on: http://stackoverflow.com/q/27467040
has text: Strpos possibly? Then break/return error if it's found?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27371484
tagged with: firebase
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/26390027
tagged with: google-chrome
type: Question
has body: I am integrating my project with facebook auth login, and I want to support Chrome on IOS. I noticed that I have to handle both authWithOAuthPopup and authWithRedirect (firebase user-auth) in this case. However Chrome IOS did not support Popup auth currently. I simplify my code and shows the case how it won't work in Chrome on IOS var rootRef = new Firebase('https://docs-sandbox.firebaseio.com/web/uauth'); rootRef.onAuth( function(authData){ alert('getAuth'); alert(authData); console.log(authData); }); $('#login').on('click', function(e){ rootRef.authWithOAuthPopup("facebook", function(err, authData){ if(err &amp;&amp; err.code === 'TRANSPORT_UNAVAILABLE'){ rootRef.authWithOAuthRedirect("facebook", function(err, authData){ if(authData){ alert('redirect'); alert(authData); } }) } }) }); Link here http://jsfiddle.net/blackbing/zjunuzec/5/ for more detail. It works on Safari IOS. If login success, it will alert [object], but it shows null in Chrome on IOS. any idea?
has title: I cannot get authData by using authWithOAuthRedirect with Chrome on IOS
has answer: http://stackoverflow.com/a/27420282
accepted answer: http://stackoverflow.com/a/27420282
tagged with: ios
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/27446509
score: 1
has comment: http://stackoverflow.com/comment/43392952
accepted answer of: http://stackoverflow.com/q/27441040
has comment: http://stackoverflow.com/comment/43394293
has comment: http://stackoverflow.com/comment/43393077
answers question: http://stackoverflow.com/q/27441040
has body: I believe you're binding the stop (or any other) event while initializing as follows: $("#draggable").draggable({ stop: function(ev,ui){ } }); In that case, trigger won't work. Bind the event separately, for example: $("#draggable").on("dragstop",function(ev,ui){ }); Then trigger will work. $("#draggable").draggable(); $("#draggable").on("dragstop", function(ev, ui) { alert("draggable stop"); }); $("button").click(function(){ $("#draggable").trigger("dragstop"); }); #draggable { width: 50px; height: 50px; background: dodgerblue; } click
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/q/27371881
has title: prevent back not working after refresh
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/27309561
type: AnsweredQuestion
tagged with: dom
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27372279
accepted answer: http://stackoverflow.com/a/27372279
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43195804
has body: I got prevent back coding from here prevent back in browser and warning, strict way needed it didn't work after a user make refresh, todd, help me regarding this bug. The code for reference as follows: Stay put, or else welcome to purgatory

frequency-distribution
tag name: frequency-distribution
type: Tag
tags question: http://stackoverflow.com/q/27450216

http://stackoverflow.com/q/27322849
type: UnansweredQuestion
has body: I'm using the D3 plug-in to make a Sankey diagram, and would like to add labels above each column of nodes. Something like this: Is there a function in the sankey object that can return the location of the nodes? var sankey = d3.sankey() .nodeWidth(15) .nodePadding(10) .size([width, height]); I'm following the pattern here: http://bost.ocks.org/mike/sankey/
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43106713
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43106590
has title: Get node position in D3 sankey diagram
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43106389
tagged with: sankey-diagram
tagged with: d3.js

http://stackoverflow.com/comment/43216517
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27372764
has text: Does breeze understood how to handle Moment objects? Shouldn't the OrderDate predicates be using moment's toDate function? http://momentjs.com/docs/#/displaying/as-javascript-date/ For example: `var gteMay1 = new breeze.Predicate("OrderDate", ">=", moment("2013-05-01").toDate());`

http://stackoverflow.com/q/27447058
accepted answer: http://stackoverflow.com/a/27464490
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I want to create a html table header with colspan and i'm lost; i have this json: var metadata = [{ "colIndex": 0, "colType": "String", "colName": "PM" }, { "colIndex": 1, "colType": "String", "colName": "PROD" }, { "colIndex": 2, "colType": "Numeric", "colName": "NR/M1" }, { "colIndex": 3, "colType": "Numeric", "colName": "NR/M2" }, { "colIndex": 4, "colType": "Numeric", "colName": "NR/M3" }, { "colIndex": 5, "colType": "Numeric", "colName": "NR/M4" }, { "colIndex": 6, "colType": "Numeric", "colName": "NR/M5" }, { "colIndex": 7, "colType": "Numeric", "colName": "NR ART/M6" }, { "colIndex": 8, "colType": "Numeric", "colName": "NR ART/M1" }, { "colIndex": 9, "colType": "Numeric", "colName": "NR ART/M2" }, { "colIndex": 10, "colType": "Numeric", "colName": "NR ART/M3" }, { "colIndex": 11, "colType": "Numeric", "colName": "NR ART/MX" }]; The table header will be, mostly, based on spliting "colType": "Numeric" +------+-------+-----+--------+-----+-----+-----+-----+------+----+----+----+ | | | NR | NR ART | + PAM | PROD +-----+--------+-----+-----+-----+-----+------+----+----+----+ | | M1 | M2 | M3 | M4 | M5 | M6 | M1 | M2 | M3 | MX | +------+-------+-----+--------+-----+-----+-----+-----+------+----+----+----+ First i tried to split colName where colType is numeric var arr = [], a; $.each(metadata, function (i, v) { arr.push(v.colName.split("/")); a = v.colName.split("/").length; }); next, i get unique parents (?), but what can i do with this? i think i must travers this array in hierarchie (parent - children and then to construct the html header). The array is dynamic. Any advice? Please and thank you.
answer count: 4
has answer: http://stackoverflow.com/a/27448741
possible better answer: http://stackoverflow.com/a/27447341
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27447341
has answer: http://stackoverflow.com/a/27464490
upvote count: 1
type: Question
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27448786
has title: Javascript Create complex table header from json

http://stackoverflow.com/q/27455872
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27455916
tagged with: brackets
accepted answer: http://stackoverflow.com/a/27455916
answer count: 1
has body: function replaceSuperscript(s) { var ix = '⁰¹²³⁴⁵⁶⁷⁸⁹ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʱʳˢᵗᵘᵛʷˣʸᶻ', re = '0123456789abcdefghijklmnopqrstuvwxyz' for (var i = 0; i &lt; ix.length; i++) s = s.replace(new RegExp('\\[' + re[i] + '\\]', 'g'), ix[i]) return s } document.write(replaceSuperscript('A[1], A[t], A[0]')) I tried various amount of back slashes, why this is not working, how to get it working? Expected output: A¹, Aᵗ, A⁰
has comment: http://stackoverflow.com/comment/43349588
tagged with: regex
has title: Can't replace brackets
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43349375
type: Question

http://stackoverflow.com/comment/43104632
score: 0
type: Comment
has text: Nice work Tasos! However, if a timer is already running and you add a second one. Clicking the second one resets the first instead of letting it run concurrently...
comment on: http://stackoverflow.com/a/27322541
type: AnswerComment

http://stackoverflow.com/comment/43223915
score: 0
has text: @elclanrs for me this convention sucks as private property/method could be overwritten.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27386540

http://stackoverflow.com/q/27417175
has body: I am using bower to install dependencies and various libraries in my project. But I am getting a fatal error. The URL's git:// portion seems to be replaced by insteadof I am using Mac OS X and Terminal for commands. Is there any solution for this? pdc1-4s6zyr1:~ administrator$ bower install **git://github.com/jquery/jquery.git** bower not-cached git://github.com/jquery/jquery.git#* bower resolve git://github.com/jquery/jquery.git#* bower ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/jquery/jquery.git", exit code of #128 Additional error details: fatal: '.insteadofgithub.com/jquery/jquery.git' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Thanks, Ankit Tanna
tagged with: terminal
possible better answer: http://stackoverflow.com/a/27419224
tagged with: bower
tagged with: git
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/43278325
has answer: http://stackoverflow.com/a/27419224
answer count: 2
has title: Bower install Libraries Issues
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27417555
accepted answer: http://stackoverflow.com/a/27417555
favorite count: 0
tagged with: command-line

http://stackoverflow.com/q/27354013
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27354720
type: Question
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/27354163
has answer: http://stackoverflow.com/a/27354162
tagged with: javascript
has body: I am trying to customize this working http://jsfiddle.net/markcoleman/JNqqU/ ,in current working fiddle directly object is assigned . where i am trying to change it to $scope.obj.items . passing object to directive is not working . do i need to write some $watch fo r the variable ??? i am getting dynamic value that's why i am trying to pass Object value with this . Code :: Show Pop over javascript Directive part :: scope: { items: '=', title: '@' } Any suggestion , I am trying Below Fiddle http://jsfiddle.net/JNqqU/652/
score: 0
has comment: http://stackoverflow.com/comment/43161414
tagged with: jquery
tagged with: angularjs
has title: passing object value to directive instead of any other data variable
has comment: http://stackoverflow.com/comment/43161388
answer count: 4
has answer: http://stackoverflow.com/a/27354352

http://stackoverflow.com/comment/43315464
type: QuestionComment
has text: @T.J.Crowder When I selected in the autocomplete list, whatever I choose, it works. When I set the value by function as in this case, it does not work. When I console.log(autocomplete), it is the whole object that is considered as undefined.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27429579

http://stackoverflow.com/comment/43243475
type: Comment
comment on: http://stackoverflow.com/a/27398150
has text: Is it the tone of my answer or its format you're complaining about?If it's the former, I'm not critising anyone; if it's the latter, I've seen a lot of answer like this all over SO.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27408789
has comment: http://stackoverflow.com/comment/43262369
has comment: http://stackoverflow.com/comment/43262233
score: 0
has comment: http://stackoverflow.com/comment/43262651
has comment: http://stackoverflow.com/comment/43262067
has comment: http://stackoverflow.com/comment/43262353
has comment: http://stackoverflow.com/comment/43262191
has comment: http://stackoverflow.com/comment/43262024
has comment: http://stackoverflow.com/comment/43262816
has comment: http://stackoverflow.com/comment/43262046
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43262671
has comment: http://stackoverflow.com/comment/43262879
has comment: http://stackoverflow.com/comment/43262121
has comment: http://stackoverflow.com/comment/43262255
answer count: 0
has comment: http://stackoverflow.com/comment/43262004
has comment: http://stackoverflow.com/comment/43281897
tagged with: authentication
has title: Include the username in the redirect URL path after authenticating the user in Node.js using PassportJS
has body: I'm using PassportJS to create a login/sign-up program. Then to enter I try to include the username of the user in the path of the redirect. To be more precise, when the user does a login with username and password I want to redirect him/her to the page localhost:3000/library?'username'. How can I do it? var config = require('./config'); var express = require('express'); var path = require('path'); var logger = require('morgan'); var bodyParser = require('body-parser'); var dustjs = require('adaro'); var app = express(); var multer = require('multer'); var passport = require('passport'); LocalStrategy = require('passport-local').Strategy; var mongoose = require('mongoose'); require('./models'); require('express-session'); // Connect to MongoDB here var mongoose = require('mongoose'); mongoose.connect(config.mongoUrl + config.mongoDbName); //passport // --------------- USER PART --------------------\\ var User = mongoose.model('User'); passport.use(new LocalStrategy({ usernameField:'userName', passwordField:'password' }, function(username, password, done) { User.findOne({userName: username}, function (err, user) { if (err) { return done(err); } // Return an error as in Node if (!user) { return done(null, false, { message: 'Incorrect username.' }); // If user does not exist return the error and the message } user.isValidPassword(password, function(err,isMatch){ if (isMatch==true){ return done(null, true); // Authentication is good, the password is valid }else{ return done(null, false, {message:"Incorrect password! "}) } }); }); } )); passport.serializeUser(function(users, done) { done(null, 0); // Invoke passport with user._id authenticated }); passport.deserializeUser(function(id, done) { User.findById(id, function(err, user) { // Deserializza e cerca attraverso l'id done(err, user); }); }); // --------------- EDN USER PART --------------------\\ /*--- Configure the multer. used to upload the track from our pc on the server ---*/ app.use(multer({ dest: './public/trac…
has comment: http://stackoverflow.com/comment/43262215
type: Question
tagged with: javascript
tagged with: passport.js

http://stackoverflow.com/comment/43412556
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27390269
type: Comment
has text: Waiting on approval :) ty

http://stackoverflow.com/q/27393649
type: UnansweredQuestion
upvote count: 1
tagged with: python
has title: jQuery autocomplete with python Flask
type: Question
tagged with: autocomplete
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27407890
tagged with: jquery
tagged with: flask
answer count: 1
score: 1
has body: Many similar questions as mine were asked before and I tried all the solutions, only to find it didn't help. I am having a text box for which autocomplete needs to be incorporated with values fetched from db based on the input given. I am using javascript in the client side and using python in the server side. I am using flask framework for this activity. html: &lt;input type="text" id="auto"/&gt; javascript: &lt;script type = "text/javascript"&gt; $(document).ready(function(){ $("#auto").autocomplete({ source: "{{url_for('autocomplete')}}", minLength: 1 }); }); &lt;/script&gt; python: @app.route('/autocomplete', methods=['GET']) def autocomplete(): value = request.args.get('term') sql = "select name from data_table where name like '%"+value+"%'" conn = sqlite3.connect(DATABASE) data_list = [] cursor = conn.execute(sql) for row in cursor: data_list.append(row[0]) conn.close() return jsonify(json_list=data_list) For every key entered in the textbox, the python method is getting called. The problem is how I return the results to javascript. Everytime I enter a key I get 500 Internal server error. In autocomplete snippet, if source: "{{url_for('autocomplete')}}".json_list it throws error too. But the autocomplete works fine if values are given as array in the javascript side and when no python activity is involved. Any help is appreciated. Thanks in advance.
favorite count: 0
has comment: http://stackoverflow.com/comment/43242758

http://stackoverflow.com/q/27446091
type: AnsweredQuestion
has title: Search Json Array
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/48235238
has body: I got a json array like below: [ {"value":"uk-icon-adjust","title":"Adjust","url":"#", "text":""}, {"value":"uk-icon-adn","title":"Adn","url":"#", "text":""}, {"value":"uk-icon-align-center","title":"Align center","url":"#", "text":""}, {"value":"uk-icon-align-justify","title":"Align justify","url":"#", "text":""}, {"value":"uk-icon-align-left","title":"Align left","url":"#", "text":""} ] I want to search this json array for specific titles. But the problem is, that I want to search with a Regex. e.g: sb searchs for "ad" -> the function should return the first two json strings (Adjust and Adn). I have no idea, now to setup a javascript function which can achieve this. Some ideas?
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27446201
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/27446305
answer count: 3
has answer: http://stackoverflow.com/a/27446175
tagged with: regex
possible better answer: http://stackoverflow.com/a/27446175
accepted answer: http://stackoverflow.com/a/27446201
linked to: http://stackoverflow.com/q/15764844

http://stackoverflow.com/a/27343297
answers question: http://stackoverflow.com/q/27343133
has body: You should use either setTimeout or clear the interval and try to run it again. setInterval registers an interval with a specific id and timespan. That's the one, the first with the 2 seconds time span. I would prefer to use setTimeout to get over the issue. Here is a plunk, you can see the code and the results. Plunk here function makeSymbol(sym) { var test = function (){ if(dropSpeed &gt; 1500){dropSpeed = dropSpeed - 350;} if(spawnSpeed &gt; 50){spawnSpeed = spawnSpeed - 231;} if(spawnSpeed &lt;= 4) spawnSpeed = 2000; $("#speed").text((new Date())); setTimeout(test, spawnSpeed); } setTimeout(test,spawnSpeed); }
score: 0
type: Answer

http://stackoverflow.com/a/27429712
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27429663
upvote count: 1
has body: Float is not an endless container. Consider this example: console.log(0.1 + 0.2 == 0.3) // Prints... FALSE! Or, another case: console.log(99999999999999999999999999999999999) // Prints 1e+35 ...while 1e+35 is just 1 with 35 zeroes. Original number (9999...) is so large and precise that JS starts cutting lower digits to store at least something - the source is too big to save in float. This actually happens because of internal float conversions made by JavaScript engine and the philosophy of float type is that higher digits are more important that lower. Your case is somewhat similar. This is because floating point type accuracy depends on its value length. So, If your value is too big or too small, you will lose precision for lower digits. Thus you should never trust float and never compare it with other values using '==' of '===' - it may be anything.

http://stackoverflow.com/comment/43273429
has text: Thanks for catching that, I must have accidentally removed it at some point. However, I added it back in.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27414671

http://stackoverflow.com/comment/43296944
comment on: http://stackoverflow.com/q/27425990
has text: i have now edited the post so you can see the spill(); function at the bottum
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27439904
has comment: http://stackoverflow.com/comment/43320719
has comment: http://stackoverflow.com/comment/43323167
type: Question
score: 0
tagged with: javascript
tagged with: jquery
has title: AngularJs URL changes with different parameters but view remains same. It only changes on refresh. How to render page on each parameter change?
tagged with: ajax
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43323701
has body: Inside the controller I do a AJAX call and render data. Basically I have different inbox types which I want to render through passing parameter from URL to my API through a http post call inside the Controller. In the navigation as: Similarly I pass other parameters to the url on different inbox types. When I click on Recent URL : /list/&amp;type=recent and content is rendered When I click on Starred URL : /list/&amp;type=starred but content is not rendered. I have to manually refresh the page to view the new content. Here is my controller : app.controller('SmsListCtrl', ['$scope', '$stateParams','$http', function($scope, $stateParams, $http, transformRequestAsFormPost) { $scope.method = $stateParams.inboxType; console.log("Inbox Type : "+ $stateParams.inboxType ); $http.post('tpl/processors/process-list.php', {method : $scope.method}) .then(function(response) { console.log(response.data); $scope.smses = response.data; console.log($scope.smses); } }, function(x) { $scope.authError = 'Server Error'; }); console.log("Inbox Type after HTTP Call : "+ $stateParams.inboxType ); }); }]); My navigation : &lt;a ui-sref="app.mail.list({inboxType: '&amp;type=recent'})"&gt; &lt;a ui-sref="app.mail.list({inboxType: '&amp;type=reminders'})"&gt; &lt;a ui-sref="app.mail.list({inboxType: '&amp;type=favourites'})"&gt; I m stuck here. Please help as I am new to Angular JS.
answer count: 0
type: UnansweredQuestion
tagged with: http
has comment: http://stackoverflow.com/comment/43319695

http://stackoverflow.com/comment/43126822
type: Comment
has text: Im getting the error: `TypeError: got is undefined`, and the echo from the file: `[{"got":"1235.00","needed":"4350"}]`
comment on: http://stackoverflow.com/a/27333921
score: 0
type: AnswerComment

http://stackoverflow.com/q/27401771
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27402313
tagged with: audio
type: AnsweredQuestion
tagged with: internet-explorer-10
type: Question
accepted answer: http://stackoverflow.com/a/27402313
answer count: 1
tagged with: javascript
has body: I have AngualrJS app with a factory which responsible of playing audio in some events. I have 3 different audio that created in that factory. My issue is in IE10, that only one audio(message-sent) which I call from other controller is playing the 3 and the other 2 is playing( calling from the same factory) only in debugger when I run step by step and after the first time playing then it's work as expected without debugger. in Chrome and firefox it's works great. var sounds = { messageSent: new Audio('/assets/audios/message-sent.mp3'), privateMessageRecived: new Audio('/assets/audios/private_message.mp3'), notificationRecieved: new Audio('/assets/audios/notification-recived.mp3') }; Then it's play the audio : sounds[soundName].play(); The mime-type is audio/mpeg. function start() { pusherEvents.onAll(function(channelName, eventName, data) { if (!isEmbedInactive() || isMuted()) { return; } switch (eventName) { case 'message': if (!isMe(data.sender_id)) { SpotsManager.getSpot({ id: data.spot_id }) .then(function(spot) { if (spot.type === 'intimate') { sounds.privateMessageRecived.play(); } }); } break; case 'user_mentioned': if (!isMe(data.mentioner.id)) { sounds.notificationRecieved.play(); } break; case 'message_liked': var isMine = isMe(data.sender_id); if (isMine) { sounds.notificationRecieved.play(); } break; case 'invitation_accepted': if (!isMe(data.invitee.id)) { sounds.notificationRecieved.play(); } break; case 'intimate_user_invited': sounds.notificationRecieved.play(); break; } }); }
has title: Audio object is not playing in IE10

http://stackoverflow.com/q/27450636
has title: AngularJS : Factory undefined inside Controller Method
accepted answer: http://stackoverflow.com/a/27450805
type: AnsweredQuestion
tagged with: angularjs-controller
upvote count: 1
has comment: http://stackoverflow.com/comment/43339853
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43339893
has answer: http://stackoverflow.com/a/27450805
has comment: http://stackoverflow.com/comment/43340022
has body: When I call a factory method within the controller it's fine- but when I call a factory method within a controller method it's undefined. Here's my factory: app.factory('config', ['$http', '$interval', function($http, $interval, $scope) { return { lines: function() { return $http({ url: appPath+'/config.php?data=lines', method: 'JSON' }) }, updateLines: function() { $http.post(appPath+'/write.php?handler=update line', $scope.lines). success(function(data, status, headers, config) { return true; }).error(function(data, status, headers, config) { return false; }); } } }]); My Controller: app.controller('lineController', function($scope, $interval, $http, config) { // this works fine config.lines().success(function(data) { $scope.lines=data; }); this.addToLine = function(line, customer) { }; this.unassign = function(customer, line) { var index = line.indexOf(customer); line.splice(index, 1); // Cannot read property 'lines' of undefined config.updateLines(); }; }); Inside the controller scope my factory config is defined, however when referencing config in a method the factory is undefined. AngularJs is new to me, so if this is bad practice then I'd appreciate being pointed in the right direction. Thanks
answer count: 1
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43339933
tagged with: angularjs
tagged with: angularjs-factory

http://stackoverflow.com/a/27736392
has body: Finally found an answer: jQuery has already done all the dirty work in their parseHTML() method. And I just happen to be using jQuery anyway, so good for me! :) I checked what the magic was behind the scenes, and it's really pretty gruesome. First, they inspect the HTML (with regexs...) to see what parent tag they need to use, and then they have a workaround for IE8, which apparently it DOES preserve comment nodes - but only if they come after a text node. All comments before the first text node are lost. And some tags are affected this way too, which I had no idea about. And then there's half a dozen other workarounds for IE &amp; Webkit problems that I've never even heard of. So, I'm just going to leave it to them to do the right thing, because trying to reproduce that stuff would be madness.
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/27324709
accepted answer of: http://stackoverflow.com/q/27324709
type: Answer

http://stackoverflow.com/q/27349650
score: 1
has comment: http://stackoverflow.com/comment/43154078
answer count: 2
has title: Collision Detection with javascript on the html canvas element without using jquery
tagged with: canvas
has body: I have something I can not wrap my head around, I have been trying for a couple of hours. I am making a simple game. I have most of the code done, but I cannot make collision detection work, now matter how hard I try JS function collision() { //Tank1 if (bulcords2.x &lt; tankcords.x + 31 &amp;&amp; bulcords2.x + 5 &gt; tankcords.x &amp;&amp; bulcords2.y &lt; tankcords.y + 31 &amp;&amp; 1 + bulcords2.y &gt; tankcords.y) { } }
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27353586
favorite count: 0
possible better answer: http://stackoverflow.com/a/27353639
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27353639
has comment: http://stackoverflow.com/comment/43154037
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27353586
type: AnsweredQuestion

http://stackoverflow.com/a/27339420
has comment: http://stackoverflow.com/comment/43135584
upvote count: 1
has comment: http://stackoverflow.com/comment/43135684
answers question: http://stackoverflow.com/q/27339412
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43136416
has body: Nothing in jquery called $(document.body) You will get an error in that.. just use $(document) or $(document).ready(function(){ // your code here after document is ready }); or use $(document).on('click','.change-zip',function(){ $('#zip-change-tooltip').parent().parent().css('height','200px'); });
has comment: http://stackoverflow.com/comment/43135474
has comment: http://stackoverflow.com/comment/43135670

http://stackoverflow.com/a/27353821
has comment: http://stackoverflow.com/comment/43162986
has comment: http://stackoverflow.com/comment/43162838
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43162508
downvote count: 0
has body: First things first. When you do persons= {}; you are creating a global property called persons and assigning an empty object to it. You might want a local variable here. So, change it to var persons = {}; And then, when you create a new key in the object, by default, the value will be undefined. In your case you need to store an array. So, you have to initialize it like this persons['Matt'] = []; and then you can use the Array.prototype.indexOf function to find out if the item being added is already there in the array or not (it returns -1 if the item is not found in the array), like this if (persons['Matt'].indexOf("A") === -1) { persons['Matt'].push("A"); } if (persons['Matt'].indexOf("B") === -1) { persons['Matt'].push("B"); } You can create a function to do this function insertIfNotThere(array, item) { if (array.indexOf(item) === -1) { array.push(item); } } var persons = {}; persons['Matt'] = []; insertIfNotThere(persons['Matt'], 'A'); insertIfNotThere(persons['Matt'], 'B'); // This will be ignored, as `A` is already there in the array insertIfNotThere(persons['Matt'], 'A');
answers question: http://stackoverflow.com/q/27353723
type: Answer
accepted answer of: http://stackoverflow.com/q/27353723
upvote count: 3
has comment: http://stackoverflow.com/comment/43160974
score: 3

http://stackoverflow.com/q/27457302
has answer: http://stackoverflow.com/a/27457924
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27457924
has title: Finding the index of an element in a list after JQuery UI drag and drop
tagged with: http://stackoverflow.com/tag/html
tagged with: jquery-ui-draggable
favorite count: 0
has answer: http://stackoverflow.com/a/27458507
upvote count: 2
linked to: http://stackoverflow.com/q/26616454
type: AnsweredQuestion
score: 2
tagged with: jquery-ui
has body: I have a list of elements, each element has an id which equals to its order in this list. Now I am changing the order of these elements by dragging them around. I have got the following two questions: How can I achieve the effect that when an element is dragging around, it will push up or down the elements which are above or below it? I want to dynamically change the ids of these elements to their order in the list. For example, assume there are four elements, when the first element is dragged to the bottom, it id will change to 3, and the ids of the elements above it will change accordingly. (Notice that the elements are not necessarily of equal height.) Here is a snippet of my code, you may access http://jsfiddle.net/shapeare/bL8jz3rp/4/ to see more detailed code: dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text
type: Question
accepted answer: http://stackoverflow.com/a/27458507
answer count: 2
downvote count: 0

http://stackoverflow.com/a/27411385
answers question: http://stackoverflow.com/q/27411081
score: 0
type: Answer
has body: If you need to do this check very often you could also create an index for faster lookup e.g.: var index = Object.keys(whiteFgrs).reduce(function(idx, name){idx[whiteFgrs[name]]=name;return idx;},{}); index['&amp;#9817']; // === 'Peasant'

http://stackoverflow.com/a/27349833
has comment: http://stackoverflow.com/comment/43154469
score: 5
upvote count: 5
has body: Try ... Working Demo $("body").on('submit', '.submit-form', function(e) { alert("test"); e.preventDefault(); }); Basically, dynamically created content does not handle prior attached events well. Since the object did not exist when you attempted to run the submit, there was nothing to attach to. What I did here was attach an on event onto the body that searches for .submit-form, irregardless of when it was created.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27349825
type: Answer
answers question: http://stackoverflow.com/q/27349825

http://stackoverflow.com/comment/43103300
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27320083
has text: I've added a fiddle to the question @JoshKG. Maybe that will help communicate the problem correctly

http://stackoverflow.com/comment/43207762
type: Comment
comment on: http://stackoverflow.com/a/27379041
type: AnswerComment
score: 0
has text: Thanks but I tried this also and no luck. Any ideas?

http://stackoverflow.com/comment/43249893
comment on: http://stackoverflow.com/q/27402291
score: 0
type: Comment
type: QuestionComment
has text: It would help if you showed what your input array looked like.

http://stackoverflow.com/a/54548941
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27439658
has body: I did a similar thing using gradientStroke command, then applying this to the backgroundColor: var ctx = document.getElementById("YearsExperience").getContext("2d"); var gradientStroke = ctx.createLinearGradient(0, 1200, 0, 0); gradientStroke.addColorStop(0, "#80b6f4"); gradientStroke.addColorStop(0.2, "#94d973"); gradientStroke.addColorStop(0.4, "#80b6f4"); gradientStroke.addColorStop(1, "#94d973"); var YearsExperience = new Chart(ctx, { type: 'bar', data: { labels: ArrLabel[idx], datasets: [{ label: 'Years of experience', data: ArrData[idx], backgroundColor: gradientStroke }] }, options: { scales: { xAxes: [{gridLines: {display:false}}], yAxes: [{ ticks: { beginAtZero:true } }] }, events: ['none'],animation: { easing: "easeInOutBack" } } }); An example of the output can be seen here: http://neophytte.mine.nu/portfolio/skills.html
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27439658
upvote count: 1
has comment: http://stackoverflow.com/comment/106111852
type: Answer

http://stackoverflow.com/comment/43214565
has text: @schillingt: I do not think so (should be POST be done using ajax?) - is there a link somewhere in docs on how I should be doing this?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27382871
score: 0

http://stackoverflow.com/comment/43336546
comment on: http://stackoverflow.com/q/27448784
type: Comment
type: QuestionComment
score: 2
has text: I didn't think it a duplicate of "What does 'use strict' do" because I know what it does. I was asking specifically about its 'syntax'.

http://stackoverflow.com/comment/43151808
score: 2
comment on: http://stackoverflow.com/q/27348595
has text: Few words... well you need to know exactly how many before a script starts matching. 2, 3? What about the *exact order* or *at random*? Any script to share (the best one so-far)?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27376775
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43616264
tagged with: angularjs
has body: I know this might sound a little crazy but here goes. We have built an entire application in Ionic + angular. We have a big problem though, the performance of the page transitions and scroll is very poor. Obviously we will be optimizing but some of our transitions I don't think are going to work regardless of the efforts we make. Last night in an effort to solve this problem I found Famo.us and liked what I saw. The problem is that we are on a tight deadline and we cannot afford to port the whole application to Famo.us and our developers have only just overcome the learning curve of Ionic and angular. Is it possible to just use some parts of Famo.us but keep our Ionic core app. Essentially I would like to build the layout, left/right horizontal scroll, up/down vertical scroll, menu, popups etc.. with Famo.us and leave the content using the Ionic framework? Any help would be much appreciate, also if we can be pointed in the right directions a new library which is a marriage of both could be incredible, shallower learning curve and all the benefits of Ionics, build tools and easy use with Famo.us' excellent power and rendering!
tagged with: famo.us
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30469955
has title: Using Famo.us and Ionic
has comment: http://stackoverflow.com/comment/43225857
has comment: http://stackoverflow.com/comment/43227394
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43225877
has comment: http://stackoverflow.com/comment/43208117
score: 1
has comment: http://stackoverflow.com/comment/43211371
has comment: http://stackoverflow.com/comment/43203345
tagged with: ionic-framework
answer count: 1
has comment: http://stackoverflow.com/comment/43217500

http://stackoverflow.com/q/27363544
downvote count: 1
type: Question
has title: Uncaught TypeError: Cannot set property 'action' of undefined
tagged with: javascript
has body: I could not able to submit the form through javascript function. I have a requirement when user clicks on a link, i need to submit a form. Below is the error seen on browser console: Uncaught TypeError: Cannot set property 'action' of undefined Please suggest how can i submit the form to invoke the spring controller method. Below is the javascript function: function submitDataOnClick(){ document.myForm.action = contextPath + "/dataProcess.htm"; document.myForm.submit(); } //all form elements.. Spring controller: @RequestMapping(value = "/dataProcess", method = RequestMethod.GET) public ModelAndView dataProcess(HttpServletRequest request, HttpServletResponse response, BindingResult beException) throws IOException { //logic... ModelAndView mav = new ModelAndView(); mav.setViewName("home"); return mav; }
score: 2
has comment: http://stackoverflow.com/comment/43179261
answer count: 1
tagged with: jsp
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27363682
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43178959
has comment: http://stackoverflow.com/comment/43179400
tagged with: spring-mvc
upvote count: 3
has comment: http://stackoverflow.com/comment/43179058

http://stackoverflow.com/q/27382766
tagged with: ui-select
has answer: http://stackoverflow.com/a/41973925
type: AnsweredQuestion
tagged with: angularjs-select2
favorite count: 0
tagged with: angularjs
type: Question
possible better answer: http://stackoverflow.com/a/27932193
score: 5
has answer: http://stackoverflow.com/a/27932193
has answer: http://stackoverflow.com/a/52510864
answer count: 7
has answer: http://stackoverflow.com/a/27942402
has title: Angular ui-select placeholder not working
linked to: http://stackoverflow.com/q/29428264
upvote count: 5
has answer: http://stackoverflow.com/a/36766567
tagged with: select
has answer: http://stackoverflow.com/a/34229420
has answer: http://stackoverflow.com/a/45850314
downvote count: 0
has body: We have been using ui-select (https://github.com/angular-ui/ui-select) to theme dropdowns like select2. This functionality has largely been working apart from one aspect: default placeholders. The code largely follows the ui-select demos (3rd example on this page: http://plnkr.co/edit/a3KlK8dKH3wwiiksDSn2?p=preview). As far as I'm concerned the default text should be that of the 'placeholder' attribute. Instead, it appears blank until you choose an option. We have been using a hack whereby we set the value of the ui-select-match, in the Angular controller to counter this issue, but this is far from perfect and clearly not how it should be used. {{$select.selected.title}} Has anyone ecountered this problem before, or have any idea as to what we are doing wrong?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27942402

http://stackoverflow.com/q/27454347
tagged with: ruby-on-rails
tagged with: multi-select
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/30431175
favorite count: 0
has title: Selectize.js with Rails and remote data loading – returning comma separated string instead of array
has body: Using selectize.js the standard multi select returns an array of strings: ["1","2","3"] this works perfectly with the following code: $('.selectize').selectize(); I want to use remote data loading due to having a large amount of data but when setting selectize up that way I get back ["1,2,3"] rather than the desired ["1","2","3"]. Here is the code: var formatName = function(item) { return $.trim((item.first_name || '') + ' ' + (item.last_name || '')); }; $('.selectize-contacts').selectize({ delimiter: ',', valueField: 'id', labelField: 'name', searchField: ['first_name', 'last_name', 'email'], sortField: [ {field: 'first_name', direction: 'asc'}, {field: 'last_name', direction: 'asc'} ], options: [], create: false, render: { item: function(item, escape) { var name = formatName(item); debugger; return '&lt;div&gt;' + (name ? '&lt;span class="name"&gt;' + escape(name) + '&lt;/span&gt;' : '') + '&lt;/div&gt;'; }, option: function(item, escape) { var name = formatName(item); return '&lt;div&gt;' + escape(name) + '&lt;/div&gt;'; } }, load: function(query, callback) { if (!query.length) return callback(); $.ajax({ url: $(".selectize-contacts").data("search") + '?q=' + query, type: 'GET', error: function() { callback(); }, success: function(data) { callback(data); } }); }, }); Any advice on why these values are different would be much appreciated.
score: 2
downvote count: 0
type: UnansweredQuestion
tagged with: selectize.js

http://stackoverflow.com/comment/43322908
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27441588
has text: have you tried @media tag for this problem?

http://stackoverflow.com/comment/43204292
type: Comment
comment on: http://stackoverflow.com/a/27377140
has text: sorry still not working. now it accepts even alphanumeric and no limit abc.1c.1d.1.1.1.1.c is showing true
score: 0
type: AnswerComment

http://stackoverflow.com/q/27370072
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43191919
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Detecting nested list id
has answer: http://stackoverflow.com/a/27370210
favorite count: 0
type: UnansweredQuestion
has body: When adding a new element via jquery, how do I define each element with a specific name or id in a nested list, depending on what currently exists? Example: Question 1 Answer 1 Answer 2 Add Answer When I click "Add Answer" I'd like to add a new Answer, but know that it is "ans3". Further, there will be multiple top-level and nested lists, so it will need to know which question it's associated with. EX) Question 1 Answer 1 Answer 2 Question 2 Answer 1 Answer 2 Thank you!

http://stackoverflow.com/q/27465239
tagged with: javascript
tagged with: jquery
has body: I would like to output a bootstrap label for one value of a field in a JQuery dataTable. This fields possible values can be '0' or '1' and depending on the result I want to decide which bootstrap label I want to output in the dataTable. Unfortunately I don't know how I can do this if statement for this case. My JQuery: $(document).ready(function() { $('#accountOverview').dataTable( { "ajax": { "url": "/database/accounts.php", "data": {"action": "selectAccounts"}, "dataSrc": "" }, "columns": [ { "data": "email" }, { "data": "platform" }, { "data": "coins" }, { "data": "profitDay" }, { "data": "playerName" }, { "data": "tradepileCards" }, { "data": "tradepileValue" }, { "data": "enabled" } ], "autoWidth": false }); }); I need to use something like this for the result of the "enabled" field: if(enabled==1) Online else Offline HTML Table: E-Mail Platform Coins Profit last 24h Playername Tradepile Cards Tradepile Value Status The label needs to be in the field "status" = the last each row.
score: 2
tagged with: datatables
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43419211
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27494904
accepted answer: http://stackoverflow.com/a/27494904
type: Question
has title: Edit jQuery Datatable fields
has comment: http://stackoverflow.com/comment/43420415

http://stackoverflow.com/comment/43252676
score: 1
type: Comment
comment on: http://stackoverflow.com/q/27403962
type: QuestionComment
has text: As max rows in the spreadsheet is more than 6K and this needs to be inserted into multiple spreadsheets so appending rows one by one is out of question as there is time out and the job goes unfinished.

http://stackoverflow.com/comment/55985047
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27391346
type: AnswerComment
has text: Let me know if my answered work for you. If so please mark it as accepted. It's good to keep the unanswered queue clear.

http://stackoverflow.com/a/27318509
has body: You can split and take the second element. var parentCommentId = this.id.split('_')[1]; DEMO
downvote count: 0
answers question: http://stackoverflow.com/q/27318425
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27318425
type: Answer
type: AcceptedAnswer
score: 2

http://stackoverflow.com/comment/43126413
type: QuestionComment
type: Comment
score: 2
has text: *"how to output results from another file while staying on the same page"* - Use Ajax.
comment on: http://stackoverflow.com/q/27334690

http://stackoverflow.com/comment/43179961
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27363936
score: 3
has text: @RaphaelRafatpanah `[].map` would likely be easier to implement than any filter angular has. `var displayNames = $scope.customers.map(function (d) {return d[data]["DisplayName"];});`

http://stackoverflow.com/q/27449886
has comment: http://stackoverflow.com/comment/43342178
has comment: http://stackoverflow.com/comment/43338929
favorite count: 0
has comment: http://stackoverflow.com/comment/43338617
has answer: http://stackoverflow.com/a/27449939
score: -4
accepted answer: http://stackoverflow.com/a/27449939
has comment: http://stackoverflow.com/comment/43338517
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43340406
tagged with: date
has comment: http://stackoverflow.com/comment/43338487
type: Question
answer count: 2
downvote count: 4
upvote count: 0
possible better answer: http://stackoverflow.com/a/27449934
tagged with: javascript
has title: Make first word second with jQuery? And Remove 3rd?
tagged with: jquery
has body: I have the following code: December Friday the 12th I need to change it to: Friday, December 12th This is generated dynamically, though the format will be consistent. I can not edit the markup. How can I move this words with jQuery?
has answer: http://stackoverflow.com/a/27449934
has comment: http://stackoverflow.com/comment/43338985
has comment: http://stackoverflow.com/comment/43338552

xmldocument
tags question: http://stackoverflow.com/q/27402431
type: Tag
tag name: xmldocument

http://stackoverflow.com/comment/43337863
type: QuestionComment
comment on: http://stackoverflow.com/q/27449543
has text: To get some responses, please reduce your code to ONLY the parts relevant to your question. Please refrain from putting your entire project on the post. Take a look at these guidelines: http://stackoverflow.com/help/mcve
score: 1
type: Comment

http://stackoverflow.com/comment/43287124
has text: Awesome thank you very much! I was also looking for a smooth transition but some other user already suggested that :-)
type: Comment
comment on: http://stackoverflow.com/a/27421923
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43269643
type: QuestionComment
has text: changing datetimepicker to datepicker broke it, it was working fine just autofills current time of my browser. There is a js file called datetime.js and has jquery inside and that is referring to datetime picker, my bootstrap-datepicker.js isn't being used, i believe the coder is using a jquery one
score: 0
comment on: http://stackoverflow.com/q/27412207
type: Comment

http://stackoverflow.com/a/27419796
type: Answer
has comment: http://stackoverflow.com/comment/43284968
score: 2
has comment: http://stackoverflow.com/comment/43284556
has body: You can just resolve the deferred immediately, but still return its promise: if (shouldShortcut) { deferred.resolve(); return deferred.promise; }
answers question: http://stackoverflow.com/q/27419712
downvote count: 0
has comment: http://stackoverflow.com/comment/43284631
upvote count: 2
has comment: http://stackoverflow.com/comment/43283596

http://stackoverflow.com/q/27371389
tagged with: encryption
type: AnsweredQuestion
downvote count: 0
has body: I get an exception while trying to decrypt a cryptojs encrypted message. My decryption javascript code is given below. I am kind of stuck with no clue of what is happening. I did some debugging and could see that Base64 within the cipher-core library was undefined... function decrypt(){ var salt = CryptoJS.enc.Hex.parse("3A79D3242F9D0DCE0C811DCCE7F830C5"); var iv = CryptoJS.enc.Hex.parse("9BCBD77036744C7F26DF591AE6A772C6"); var encryptedBase64 = "eKCnyuKiH3lvknsNZq9hARCr6xtDLU/De7sPc3RPSRFAh7WCurBKmDZx/Ol0mbROBtAJBCT0+U927iygd4GspQ=="; var key = CryptoJS.PBKDF2("passwordA", salt, { keySize: 128/32, iterations: 100 }); console.log('key '+key); var encryptedStr = encryptedBase64; //CryptoJS.enc.Base64.parse(encryptedBase64); console.log('encryptedStr : '+ encryptedStr ); var decrypted = CryptoJS.AES.decrypt(encryptedStr, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }); console.log('decrypted : '+ decrypted); var decryptedText = decrypted.toString(CryptoJS.enc.Utf8); console.log('decrypted text : '+ decryptedText); } I get the following exception TypeError: Cannot read property 'parse' of undefined at Object.m.OpenSSL.parse(http: //domain.com/PEMSWeb/offlinePageDemo/offlineInspectionApp/CryptoJSv3.1.2/components/cipher-core-min.js:12:101) at Object.f.SerializableCipher.k.extend._parse(http: //domain.com/PEMSWeb/offlinePageDemo/offlineInspectionApp/CryptoJSv3.1.2/components/cipher-core-min.js:13:220) at Object.f.SerializableCipher.k.extend.decrypt(http: //domain.com/PEMSWeb/offlinePageDemo/offlineInspectionApp/CryptoJSv3.1.2/components/cipher-core-min.js:13:99) at Object.decrypt(http: //domain.com/PEMSWeb/offlinePageDemo/offlineInspectionApp/CryptoJSv3.1.2/components/cipher-core-min.js:8:308) I have no idea what is going wrong ...something is going incorrect within cryptojs Updated I have the following libraries in my page in the same sequence 1) CryptoJSv3.1.2/components/core-min.js 2) CryptoJSv3.1.2/components/cipher-core-min.js 3) CryptoJSv3.1.…
type: Question
has comment: http://stackoverflow.com/comment/43226660
has answer: http://stackoverflow.com/a/27390015
has comment: http://stackoverflow.com/comment/43226258
accepted answer: http://stackoverflow.com/a/27390015
has title: Exception thrown by cryptojs while decrypting an encrypted message
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/43216285
upvote count: 4
tagged with: cryptojs

http://stackoverflow.com/comment/43174600
comment on: http://stackoverflow.com/q/27361243
has text: The main reason to prefer the first solution over the second one is maintainability: If you have multiple functions writing/appending to the same global variable, you're just calling for trouble with inconsistencies.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27421450
tagged with: websocket
has title: HttpContext.Current.Session is null inside the aync Task while try to Make a WebSocket Request
tagged with: asp.net
favorite count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
tagged with: c#
tagged with: generic-handler
tagged with: javascript
has answer: http://stackoverflow.com/a/27425235
linked to: http://stackoverflow.com/q/8109526
upvote count: 1
has body: I'm Creating a WebSocket Request From The Client To the Server Using Generic Handler HttpContext.Current.Session is null inside the Task Method My Server Code is &lt;%@ WebHandler Language="C#" Class="SyncDataHandler" %&gt; using System; using System.Web; using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; using System.Web.Script.Serialization; using System.Text; using System.Web.SessionState; public class SyncDataHandler : IHttpHandler, IRequiresSessionState { public void ProcessRequest(HttpContext context) { if (context.IsWebSocketRequest) { context.AcceptWebSocketRequest(SyncDataTask); } } public static string getLastComment() { return new JavaScriptSerializer().Serialize(DH_Details.GetLastComment()); } public async Task SyncDataTask(WebSocketContext context) { WebSocket socket = context.WebSocket; var x = HttpContext.Current.Session; // x is null why ??? while (true) { System.Threading.Thread.Sleep(1000); ArraySegment&lt;byte&gt; buffer = new ArraySegment&lt;byte&gt;(new byte[1024]); // If the socket is still open, echo the message back to the client if (socket.State == WebSocketState.Open) { string SyncedObject = getLastComment(); buffer = new ArraySegment&lt;byte&gt;(Encoding.UTF8.GetBytes(SyncedObject)); // Asynchronously send a message to the client await socket.SendAsync(buffer, WebSocketMessageType.Text, true, CancellationToken.None); } else { break; } } } public bool IsReusable { get { return false; } } } My Web Config &lt;?xml version="1.0"?&gt; &lt;!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.5"&gt; &lt;assemblies&gt; &lt;add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt; &lt;add assembly="Microsoft.TeamFoundation.WorkItemTracking.Client, Version=12.0.0.0, Culture=neutral, PublicKeyTok…
answer count: 1

http://stackoverflow.com/comment/43178171
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27362592
has text: `console.log($scope.customers[0]._data);` returns 'undefined.' You can view the console.log yourself at persianturtle.com/app. I've reset it so it logs `$scope.customers`.
type: Comment

http://stackoverflow.com/a/27429418
has comment: http://stackoverflow.com/comment/43301303
answers question: http://stackoverflow.com/q/27429180
score: 0
has body: EDIT: It was pointed out to me that the font-size: 0; method has some on Safari and Android. I was pointed to this article http://css-tricks.com/fighting-the-space-between-inline-block-elements/ You can also make them blocks and float them left. Here's my fiddle example. http://jsfiddle.net/ivanjsfiddle00/a4nu8arz/6/ html css div div { background: #000; height: 100px; width: 100px; display: block; float: left; } #second { clear: left; } ORIGINAL POST: Why use javascsript to remove the white space? As I understand it when you make elements display as inline-blocks the parent element leaves room for text. Basically, what I've read is that images are displayed this way and so inline-blocks default to leaving room for caption text. Set the parent element's font-size to zero. Here's my fiddle example. http://jsfiddle.net/ivanjsfiddle00/a4nu8arz/2/ html css div div { background: #000; height: 100px; width: 100px; display: inline-block; } #first { font-size: 0; }
type: Answer
has comment: http://stackoverflow.com/comment/43300453

http://stackoverflow.com/comment/52475992
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27483763
score: 0
has text: Thanks @jtromans I've fixed the typo. Stoked it was useful to you.

http://stackoverflow.com/comment/43217461
type: AnswerComment
score: 0
has text: You shouldnt need jquery, in fact it's quite confusing using the two frameworks side by side - a lot of what do using jquery is already available in Angular. The data from the inputs is stored in an object named in ng-model - I'll elaborate in my answer
type: Comment
comment on: http://stackoverflow.com/a/27384356

http://stackoverflow.com/a/27361378
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27361179
has comment: http://stackoverflow.com/comment/43175468
answers question: http://stackoverflow.com/q/27361179
has body: This is an educated guess based on the limited information presented. The line $("#div1").load("hello.txt #p1"); Break it apart: load is making an Ajax call to fetch "hello.txt". When the document is loaded, jQuery parses the document and looks for an element with an id of "p1". (that is what the #p1" is) That content is loaded into the element with the id of div1 My guess is that you do not have an element with the id of "p1" in your text file. So either give an element an id of p1 This is the new text to show. or drop the p1 so it is .load("hello.txt");
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27326636
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27328143
tagged with: normals
score: 4
tagged with: opengl
upvote count: 4
has answer: http://stackoverflow.com/a/27326938
downvote count: 0
tagged with: javascript
tagged with: vectormath
has body: I'm trying to calculate the surface normal of a 2D polygon. I am using Newell's method from the OpenGL wiki to calculate the surface normal. https://www.opengl.org/wiki/Calculating_a_Surface_Normal From my understanding the normal should be in the y direction but it always returns [0, 0, 0]. The y value gets changed to -1 on the second iteration and back to zero on the fourth iteration. p = [[0, 0, 0] [1, 0, 0] [0, 0, 1] [1, 0, 1]] function calcNormal(p) { var normal = [0, 0, 0]; for(var i = 0; i &lt; p.length; i++) { var j = (i + 1) % (p.length); normal[0] += (p[i][1] - p[j][1]) * (p[i][2] + p[j][2]); normal[1] += (p[i][2] - p[j][2]) * (p[i][0] + p[j][0]); normal[2] += (p[i][0] - p[j][0]) * (p[i][1] + p[j][1]); } return normal; }
has title: Calculate normal vector of a polygon - Newells Method
has answer: http://stackoverflow.com/a/27328143
possible better answer: http://stackoverflow.com/a/27326938
type: AnsweredQuestion
favorite count: 0

http://stackoverflow.com/a/27470631
score: 0
answers question: http://stackoverflow.com/q/27429174
type: Answer
has comment: http://stackoverflow.com/comment/43376266
has body: In the controller you can do something like this: import Ember from "ember"; import pagedArray from 'ember-cli-pagination/computed/paged-array'; export default Ember.ArrayController.extend({ sortProperties: ['date'], sortAscending: false, page: 1, perPage: 5, pagedContent: pagedArray("arrangedContent", {pageBinding: "page", perPageBinding: "perPage"}), queryParams: ["page", "perPage"], totalPagesBinding: "pagedContent.totalPages" });
has comment: http://stackoverflow.com/comment/43376300
has comment: http://stackoverflow.com/comment/43378614
has comment: http://stackoverflow.com/comment/51035376

http://stackoverflow.com/comment/43198327
comment on: http://stackoverflow.com/a/27373688
type: AnswerComment
has text: yeap but not for only the first but for every selected one. i need this : http://jsfiddle.net/u9dvmytn/4/ ( without the join() it works properly ! )
score: 0
type: Comment

http://stackoverflow.com/a/51351786
has body: Check your all these file: var users = require('./routes/users'); var Users = require('./models/user'); var Items = require('./models/item'); Save properly, In my case, one file was missed and throwing the same error
upvote count: 1
answers question: http://stackoverflow.com/q/27465850
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/27389374
linked to: http://stackoverflow.com/q/27397099
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/43226702
favorite count: 0
has answer: http://stackoverflow.com/a/27396113
accepted answer: http://stackoverflow.com/a/27396113
possible better answer: http://stackoverflow.com/a/27389568
type: AnsweredQuestion
score: 2
downvote count: 0
has title: Call a function of a library, outside the library
has comment: http://stackoverflow.com/comment/43227190
has comment: http://stackoverflow.com/comment/43226697
type: Question
has answer: http://stackoverflow.com/a/27389463
has comment: http://stackoverflow.com/comment/43227355
has body: I have a library that runs in a (function() { ... }) (); scheme ... // mylibrary.js (function() { function myfunc() { alert('hello'); }; if (...) return; // do something }) (); ... that I use in a HTML page : Bonjour How to call the function myfunc() outside the library ? Should I change the (function() { ... }) (); scheme ? (that I used to be able to do some return inside the library) What is the most common practice?
tagged with: javascript
has answer: http://stackoverflow.com/a/27389568

http://stackoverflow.com/q/27464752
tagged with: asynchronous
favorite count: 0
type: Question
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/27464908
has title: Is this irregular behavior caused by Javascript running asynchronously?
linked to: http://stackoverflow.com/q/8747421
has body: Snake.prototype.move = function() { var head = this.head(); var newCoord = new Coord(head.pos); console.log(head, newCoord); console.log(head.pos, newCoord.pos); this.segments.push(newCoord); head.plus(this.dir); if (this.growingCount &gt; 0) { this.growingCount -= 1; } else { this.segments.pop(); } }; Coord() Constructor and plus function: var Coord = SnakeGame.Coord = function(pos) { this.pos = pos; }; Coord.prototype.plus = function(dir) { if (dir === "U") { this.pos[0] -= 1; } else if (dir === "D") { this.pos[0] += 1; } else if (dir === "R") { this.pos[1] += 1; } else if (dir === "L") { this.pos[1] -= 1; } }; head() returns the first segment in the segments property on the Snake instance. The problem I'm seeing is that it seems like the two console.log's are showing different results. The first line shows the Coord objects with a pos value of [3, 2] (which shouldn't be the case since head hasn't been updated yet). The next console line, outputs [3, 3] and [3, 3] (which should be the case). What's going on? I feel like the error is staring at me in the face and I can't see it. Clarification: Basically the head and newCoord when they're first instantiated, to have the same positions (unchanged). After the head.plus(this.dir); line, head should be one position further than newCoord. One execution of the method should have head.pos be [3, 2] and newCoord to have [3, 3]. Next execution, head.pos should be [3, 1], another newCoord should be [3, 2]. Does this make sense?
linked to: http://stackoverflow.com/q/23392111
has comment: http://stackoverflow.com/comment/43365946
has comment: http://stackoverflow.com/comment/43365852
tagged with: javascript
has answer: http://stackoverflow.com/a/27464908
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43366012
score: 1

http://stackoverflow.com/q/27396690
has title: Groovy spring boot project with javascript
has body: I am following this guide's structure. I have added a script.js file (currently placed in the templates directory). This script.js is referenced from one of my html files, however when i start my application the script.js is not being found successfully. From what i'm seeing i think you need to @Grab it somehow? Not sure. How can i make it that my script.js file is discoverable? Edit: Here is a quicker view of my structure src My.java templates greeting.html script.js app.groovy greeting.html contains &lt;script src="script.js" /&gt; however it is not being loaded
has answer: http://stackoverflow.com/a/27398575
tagged with: spring
type: AnsweredQuestion
tagged with: spring-boot
tagged with: java
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/27398575
answer count: 1
tagged with: javascript
tagged with: groovy

http://stackoverflow.com/q/27366954
answer count: 1
has comment: http://stackoverflow.com/comment/43186188
has comment: http://stackoverflow.com/comment/43186106
favorite count: 0
type: UnansweredQuestion
has body: I have links such as: &lt;?php echo anchor("$controller_name/cleanup", '&lt;i class="fa fa-undo hidden-lg fa fa-2x tip-bottom" data-original-title="'.lang('items_cleanup_old_items').'"&gt;&lt;/i&gt;&lt;span class="visible-lg"&gt;'.lang("items_cleanup_old_items").'&lt;/span&gt;', array('id'=&gt;'cleanup', 'class'=&gt;'btn btn-warning','title'=&gt;lang("items_cleanup_old_items"))); ?&gt; I have javascript in $(document).ready() that binds to the anchor and overrides the click to be an ajax call function and does event.preventDefault();to prevent the link from being navigated to. The problem I am running into is if the page is not loaded all the way yet and they click the link; they go to the ajax page (which is a bunch of json). The solution I was thinking of is changing the anchor to javascript:void(0) and adding a property data-cleanup-url with the actual link. Would this be a proper solution?
linked to: http://stackoverflow.com/q/9585752
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43185970
type: Question
has comment: http://stackoverflow.com/comment/43186012
has answer: http://stackoverflow.com/a/27367082
downvote count: 0
has title: Disable link clicking until page is loaded
tagged with: javascript
tagged with: jquery
tagged with: ajax

http://stackoverflow.com/comment/43202062
comment on: http://stackoverflow.com/a/27376075
score: 0
type: AnswerComment
has text: wordpress uses like this. I have read from http://www.creativedev.in/2013/01/solutionuncaught-referenceerror-is-not-defined-in-wordpress/
type: Comment

http://stackoverflow.com/comment/43370282
comment on: http://stackoverflow.com/a/27417905
score: 0
type: AnswerComment
type: Comment
has text: i'm glad that was helpful. you bound `imageflip` into `ul#iGallery` on document ready and images on instagram will load after document ready event, i just moved it within `didLoadInstagram()` method so plugin will bind after all images load complete.

http://stackoverflow.com/a/27381231
type: Answer
has body: Please try the following instead; $(document).on('click', '.radioGroup', function() { alert('Radio Clicked'); }); You can try 'change' instead of click. I believe the reason it simply does not work with your project is because you are simply rendering the buttons dynamically so the dom element does not occur at first. So there are 2 possible solutions, something that will listen to the dom elements at all times or you can include the in the rendering block. Also, if your script is in the top of your _Layout.html then move it to bottom as that could help too.
has comment: http://stackoverflow.com/comment/43294897
answers question: http://stackoverflow.com/q/27363134
score: 0
has comment: http://stackoverflow.com/comment/43212074
has comment: http://stackoverflow.com/comment/43251548

http://stackoverflow.com/a/27384240
answers question: http://stackoverflow.com/q/27383995
type: Answer
has body: You could use websockets on the client side to achieve this, http://www.html5rocks.com/en/tutorials/websockets/basics/ Websockets are not supported in older versions of IE, http://caniuse.com/#feat=websockets
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27383995
score: 0

http://stackoverflow.com/comment/43130161
comment on: http://stackoverflow.com/q/27336704
has text: Content appears unscrollable for me even before opening the appBar.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27314963
has body: You much better off having a simple object with the keys as the date and the value as the count. I've added a simple pad function that prefixes a zero where the number is a single digit as per your output requirements. function pad(n) { return n.toString().length == 1 ? '0' + n : n; } function getCount(arr) { var obj = {}; for (var i = 0, l = arr.length; i &lt; l; i++) { var thisDate = arr[i]; var day = pad(thisDate.getDate()); var month = pad(thisDate.getMonth() + 1); var year = thisDate.getFullYear(); var key = [year, day, month].join('-'); obj[key] = obj[key] || 0; obj[key]++; } return obj; } getCount(arr); // Object { 2014-04-12: 1, 2014-05-12: 3 } DEMO
answers question: http://stackoverflow.com/q/27314530
score: 0
type: Answer

http://stackoverflow.com/a/48647844
has comment: http://stackoverflow.com/comment/85277083
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/85276651
has comment: http://stackoverflow.com/comment/85276990
answers question: http://stackoverflow.com/q/27433075
upvote count: 5
has body: Based on Faris Zacina answer, a one line approach. var zeros = Array.apply(null, Array(10)).map(function(){return 0})
downvote count: 0

http://stackoverflow.com/a/27428759
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43298913
answers question: http://stackoverflow.com/q/27428465
score: 1
has body: On client side you should use object.forEach() function e capital letter or jQuery function $.each(object) result.forEach(function(index, value){ alert(index + " "+ value); }); If you have not set response header Content-type: application/json then you will need to parse response content as JSON object use JSON.parse() function .done(function( result ) { JSON.parse(result).forEach(function(index, value){ alert(index + " "+ value); }); }) On Server side return mean function that return and assign value into any variable, AJAX response need output buffer so echo content on server side and terminate script after output buffer foreach($result as $row) { $checkpoints[$row['ID']] = $row['Name']; } //return json_encode($checkpoints); header('Content-type: application/json'); echo json_encode($checkpoints); exit(); header('Content-type: application/json'); means response content type as json object
downvote count: 0
has comment: http://stackoverflow.com/comment/43299003

http://stackoverflow.com/a/27379272
answers question: http://stackoverflow.com/q/27379232
has comment: http://stackoverflow.com/comment/43207916
has comment: http://stackoverflow.com/comment/43208065
has comment: http://stackoverflow.com/comment/43207932
has comment: http://stackoverflow.com/comment/43207984
score: 0
has comment: http://stackoverflow.com/comment/43207880
has comment: http://stackoverflow.com/comment/43208012
type: Answer
has comment: http://stackoverflow.com/comment/43207901
has body: Your JavaScript is looking for $('#ParticipantNumber'), which is the element with the ID ParticipantNumber. Your code defines the editor with: @Html.EditorFor(model =&gt; model.ParticipantNumber, new { @class = "ParticipantNumber", disabled = "disabled" }) The intention here is to assign the input with the class ParticipantNumber, which would have meant you could address it with `$('.ParticipantNumber') instead. However, the parameter you're using is additionalViewData; the EditorFor HTML editor does not have a property to reflect HTML properties back into the renderer. Your two options are: Write a custom template Change the way you're referencing the input Option 1 is possibly a bit over-the-top for your needs; with option 2, the following will solve your problem, by simply referencing the input within your &lt;div id='ParticipantNumber'&gt;: @Html.EditorFor(model =&gt; model.ParticipantNumber) $('#ParticipantNumber input').keyup(function () { var s = $(this).val(); console.log(s) }

http://stackoverflow.com/comment/43253955
type: Comment
comment on: http://stackoverflow.com/a/27404058
type: AnswerComment
score: 0
has text: Thanks, this is exactly what I needed. The post that you've mentioned is super relevant.

http://stackoverflow.com/comment/43288527
has text: Do you get error in console because of `active=month.active` must be `active="{{month.active}}"`?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27422171
type: Comment

onfocus
tag name: onfocus
tags question: http://stackoverflow.com/q/27321859
type: Tag

http://stackoverflow.com/q/27403303
answer count: 3
tagged with: mvvm
has answer: http://stackoverflow.com/a/27405920
downvote count: 0
type: UnansweredQuestion
has title: Kendo Ui combobox - set default value
score: 2
tagged with: kendo-combobox
has answer: http://stackoverflow.com/a/27419154
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27405908
tagged with: javascript
has body: I successfully filled my combobox. But now I'm trying to set default value for combobox. For example let's say third value from source. This is my input and datasource: &lt;script&gt; viewModel.dataSourceType = new kendo.data.DataSource({ transport: { read: { url: "/api/Type/Get", dataType: "json" } }, schema: { id: "Id", data: "Data", model: { id: "Id", fields: {} } } }); &lt;input id="type" data-role="combobox" data-value-primitive="true" data-auto-bind="true" data-text-field="Name" data-value-field="Id" data-bind="value: model.Id, source: dataSourceType"&gt; It's probably really easy but I'm strugling with that. Thank you.
favorite count: 0
tagged with: kendo-ui

http://stackoverflow.com/comment/43335031
type: QuestionComment
has text: @rotaercz: That's fine, you can do that in the handler, but if you want to receive `mousemove` events when the cursor isn't over any of them, you have to capture it on something the cursor *is* over. `document` is your best option, most likely.
comment on: http://stackoverflow.com/q/27448049
type: Comment
score: 1

http://stackoverflow.com/comment/43168628
type: Comment
has text: Why don't you just put another element in the HTML before `.bg`, then you can do whatever you want with it?
score: 0
comment on: http://stackoverflow.com/q/27358143
type: QuestionComment

http://stackoverflow.com/a/27471124
score: 2
accepted answer of: http://stackoverflow.com/q/27470954
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has body: The string you are passing to Date's constructor is not valid function convertToJSONDate(strDate){ var splitted = strDate.split("."); var dt = new Date(splitted[2],splitted[0],splitted[1]); var newDate = new Date(Date.UTC(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds())); return '/Date(' + newDate.getTime() + ')/'; } convertToJSONDate("12.1.2014"); Another simplified version could be: function convertToJSONDate(strDate){ var splitted = strDate.split("."); //var dt = new Date(splitted[2],splitted[0],splitted[1]); var newDate = new Date(Date.UTC(splitted[2], splitted[0], splitted[1])); return '/Date(' + newDate.getTime() + ')/'; } convertToJSONDate("12.1.2014");
answers question: http://stackoverflow.com/q/27470954

points
tag name: points
type: Tag
tags question: http://stackoverflow.com/q/27348965

gulp
tags question: http://stackoverflow.com/q/27429796
tags question: http://stackoverflow.com/q/27435463
tags question: http://stackoverflow.com/q/27380647
tags question: http://stackoverflow.com/q/27383740
tags question: http://stackoverflow.com/q/27459899
tags question: http://stackoverflow.com/q/27425131
tags question: http://stackoverflow.com/q/27364924
type: Tag
tag name: gulp
tags question: http://stackoverflow.com/q/27358371
tags question: http://stackoverflow.com/q/27462408
tags question: http://stackoverflow.com/q/27442861
tags question: http://stackoverflow.com/q/27325207
tags question: http://stackoverflow.com/q/27411000
tags question: http://stackoverflow.com/q/27412475
tags question: http://stackoverflow.com/q/27331941
tags question: http://stackoverflow.com/q/27363593
tags question: http://stackoverflow.com/q/27374627
tags question: http://stackoverflow.com/q/27444864
tags question: http://stackoverflow.com/q/27366098

http://stackoverflow.com/a/27412792
has comment: http://stackoverflow.com/comment/43277489
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27412680
upvote count: 2
answers question: http://stackoverflow.com/q/27412680
has comment: http://stackoverflow.com/comment/43271527
has body: The problem is your replacement string. You don't need to escape any characters. The second argument of the replace method takes a string, not another regular expression. '\/\/player/\.\vimeo\.\com\/video/$1' You can just do this: '//player.vimeo.com/video/$1' I am not sure why you are using a keyup event on your input as well as your url element, however. I changed your function a bit and it works for me. EDIT Since you want to only use one field, you'll need to use onchange to format the url once the user is done editing. I've changed the function to reflect this change. Notice, you don't even need jQuery anymore. var vimeo = function(elem) { var str2 = elem.value; elem.value = str2.replace(/(?:http:\/\/)?(?:www\.)?(?:vimeo\.com)\/(.+)/g, '//player.vimeo.com/video/$1'); }; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"&gt;&lt;/script&gt; &lt;input onchange="vimeo(this);"&gt;
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27392543
has body: Actually you can use any library like jQuery or Angular with $http for making an XHR requests. It's more convenient and give us flexibility. If you don't want to, you can use Promises, it's on EcmaScript 6 CMIIW, you can use the shim from whenjs. It's for avoiding callbacks spaghetti in the future. But if you want to use plain Javascript code, your alert must be inside HR.onreadystatechange=function() { if(HR.readyState==4 &amp;&amp; HR.status==200) { alert("A"+HR.responseText); } } Because it's asynchronous.
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27392252
score: 1

http://stackoverflow.com/a/67428044
upvote count: 1
score: -1
answers question: http://stackoverflow.com/q/27376522
has comment: http://stackoverflow.com/comment/119185146
type: Answer
has body: I ran into the same problem while i was making a real-time whiteboard application using Socket.io, express server and p5.js library. i was trying to send the p5 vector using socket to the server whick caused the error. Here is my code txtPos = createVector(mouseX / width, mouseY / height); let data = { pos: txtPos, txt: "", h: colorSlider.value(), b: brighSlider.value(), size: sizeSlider.value(), }; texts.push(data); socket.emit("newText", data); ^ The above code throws an error as the data object i wanted to send was including the txtPos(p5 vector) which includes the p5 object, which includes the p5 vector, which again includes the p5 object and it goes on forever...like a recursive object(circular object). to fix this my new code was pretty simple. I replaced pos:txtPos, with pos:{ x:txtPos.x, y:txtPos.y, } and guess what now i am able to send this data successfully. :D
downvote count: 2

http://stackoverflow.com/comment/43287444
type: Comment
has text: Yeah, I did that using id, and that makes all textarea mandatory. Also I am using this code inside the success : funtion(data){}. Could that be the reason?
comment on: http://stackoverflow.com/a/27421751
type: AnswerComment
score: 0

http://stackoverflow.com/q/27437752
answer count: 1
tagged with: adsense
tagged with: http://stackoverflow.com/tag/html
has title: How to make GoogleAdSense (Custom Search Ads) to be responsive (bootstrap)?
type: AnsweredQuestion
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27451383
type: Question
has body: We have google ads implemented in our website. Recently we changed the entire website to responsive design. So I was looking at options from google and found out that google has an api for responsive design. I looked at ways to implement it. What I found from documentation and verious examples posted over internet was to get responsive ads using this I completely understand how the above code works and I tested it and its absolutely fine - but my problem is we were using custom ads from google where we were passing the search string, etc to query the google ads. We use custom ads with query since our website is very big. Our script goes like this - //Our existing code with custom search query to get relevant ads Now I dont know how to make this responsive - I could not find any documentation. Please help me with this !!
tagged with: responsive-design
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27451383

http://stackoverflow.com/a/51221292
upvote count: 8
answers question: http://stackoverflow.com/q/27441803
score: 8
has comment: http://stackoverflow.com/comment/128109711
type: Answer
downvote count: 0
has body: When you start using ECMAScript 6 this error thrown by your IDE. There are two options available: if you have only one file and want to use the es6 then simply add below line at the top of the file. /*jshint esversion: 6 */ Or if you have number of js file or you are using any framework(like nodejs express)you can create a new file named .jshintrc in your root directory and add code below in the file: { "esversion": 6 } If you want to use the es6 version onward for each project you can configure your IDE.

http://stackoverflow.com/comment/43221411
has text: Define "not working". Do you have the console up to see if it's throwing errors? Here's the working fiddle I made: http://jsfiddle.net/xknegdnL/1/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27386415

http://stackoverflow.com/q/27324996
has answer: http://stackoverflow.com/a/27325377
score: 8
has body: How can i add simple link (a href) in html5 desktop notification on body section? I try onclick function, but it work's only few seconds. If i try press later the notification just disappear and nothing do. So the best way would be with link. I try that write, but then just print me as text. var notification = new Notification('title', { icon: '...', body: 'aaa' });
has answer: http://stackoverflow.com/a/32052013
favorite count: 0
linked to: http://stackoverflow.com/q/25209805
upvote count: 8
possible better answer: http://stackoverflow.com/a/32052013
has title: How can i add simple link in html5 desktop notification
linked to: http://stackoverflow.com/q/20456377
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27325377
type: Question
answer count: 2
tagged with: javascript
tagged with: notifications
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/comment/43156916
comment on: http://stackoverflow.com/q/27349252
has text: An abrupt disconnect may take a short while for the server to notice the lack of keep-alives. Are you waiting long enough?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/30925481
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27328293
has body: Separate the javascript commands in the onClick with a semicolon.
downvote count: 0

http://stackoverflow.com/q/27373600
has comment: http://stackoverflow.com/comment/43198445
type: Question
tagged with: google-maps
has body: i have an index page that has 2 drop down. second dropdown depends on the first one, after selecting a value from the second list, a search is performed through the database table acc to the value selected and then the matching result is displayed. what i want is that the result that is getting dispalyed(in this case the latitude and longitude corresponding the result) should be shown on google map code that i have so far Code on the main page that contains the dropdown and will display the map &lt;div class="showsearch" id="gmap_canvas"&gt; //place where the ,ap should get displayed &lt;/div&gt; Code that performs the search to display result and should also work for map &lt;?php include("connection.php"); if(isset($_POST['fname'])) { $fname = mysqli_real_escape_string($con, $_POST['fname']); $sql1 = 'SELECT * FROM features_for_office WHERE fname LIKE "%'.$fname.'%"'; $result = mysqli_query($con, $sql1); if (mysqli_num_rows($result) &gt; 0) { while($row = mysqli_fetch_assoc($result)) { $latitude= $row["latitude"]; $longitude= $row["longitude"]; } ?&gt; &lt;!-- JavaScript to show google map --&gt; &lt;div class="showsearch" id="gmap_canvas"&gt;&lt;/div&gt; &lt;script&gt; function init_map(lat,lang) { var myOptions = { zoom: 14, center: new google.maps.LatLng(lat, lang), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions); marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(&lt;?php echo $latitude; ?&gt;, &lt;?php echo $longitude; ?&gt;) }); /*infowindow = new google.maps.InfoWindow({ content: "&lt;?php echo $formatted_address; ?&gt;" });*/ google.maps.event.addListener(marker, "click", function () { infowindow.open(map, marker); }); infowindow.open(map, marker); } function loadCoordinates(){ var latitude; var longitude; $('.showsearch').blur(function() { $.ajax({ type: "GET", dataType: "json", url: "get_search_data.php", data: "name="+$(this).val(), success: function(json){…
tagged with: javascript
tagged with: google-maps-api-3
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43198909
has comment: http://stackoverflow.com/comment/43199160
type: UnansweredQuestion
has title: fetch data from database and plot it on google map
has answer: http://stackoverflow.com/a/27374648
tagged with: php

http://stackoverflow.com/comment/43373311
comment on: http://stackoverflow.com/a/27468966
type: AnswerComment
has text: This dint work, is it necessary to use your nav tags? since am using a twitter bootstrap sample
type: Comment
score: 0

arrays
tags question: http://stackoverflow.com/q/27343883
tags question: http://stackoverflow.com/q/27419528
tags question: http://stackoverflow.com/q/27425459
tags question: http://stackoverflow.com/q/27360672
tags question: http://stackoverflow.com/q/27456597
tags question: http://stackoverflow.com/q/27447494
tags question: http://stackoverflow.com/q/27339132
tags question: http://stackoverflow.com/q/27462261
tags question: http://stackoverflow.com/q/27432776
type: Tag
tags question: http://stackoverflow.com/q/27353430
tags question: http://stackoverflow.com/q/27426147
tags question: http://stackoverflow.com/q/27327122
tags question: http://stackoverflow.com/q/27467092
tags question: http://stackoverflow.com/q/27443391
tags question: http://stackoverflow.com/q/27440234
tags question: http://stackoverflow.com/q/27428383
tags question: http://stackoverflow.com/q/27394240
tags question: http://stackoverflow.com/q/27331370
tags question: http://stackoverflow.com/q/27345600
tags question: http://stackoverflow.com/q/27460477
tags question: http://stackoverflow.com/q/27389521
tags question: http://stackoverflow.com/q/27440475
tags question: http://stackoverflow.com/q/27408899
tags question: http://stackoverflow.com/q/27427981
tags question: http://stackoverflow.com/q/27456947
tags question: http://stackoverflow.com/q/27321179
tags question: http://stackoverflow.com/q/27424419
tags question: http://stackoverflow.com/q/27444241
tags question: http://stackoverflow.com/q/27440682
tags question: http://stackoverflow.com/q/27375550
tags question: http://stackoverflow.com/q/27318787
tags question: http://stackoverflow.com/q/27442816
tags question: http://stackoverflow.com/q/27345449
tags question: http://stackoverflow.com/q/27453855
tags question: http://stackoverflow.com/q/27347531
tags question: http://stackoverflow.com/q/27356144
tags question: http://stackoverflow.com/q/27333920
tags question: http://stackoverflow.com/q/27326897
tags question: http://stackoverflow.com/q/27344193
tags question: http://stackoverflow.com/q/27450196
tags question: http://stackoverflow.com/q/27343499
tags question: http://stackoverflow.com/q/27358087
tags question: http://stackoverflow.com/q/27454557
tags question: http://stackoverflow.com/q/27415671
tags question: http://stackoverflow.com/q/27321652
tags question: http://stackoverflow.com/q/27323363
tags question: http://stackoverflow.com/q/27440746
tags question: http://stackoverflow.com/q/27450216
tags question: http://stackoverflow.com/q/27346579
tags question: http://stackoverflow.com/q/27383611
tags question: http://stackoverflow.com/q/27420341
tags question: http://stackoverflow.com/q/27369863
tags question: http://stackoverflow.com/q/27359057
tags question: http://stackoverflow.com/q/27415040
tags question: http://stackoverflow.com/q/27467208
tags question: http://stackoverflow.com/q/27376166
tags question: http://stackoverflow.com/q/27401427
tags question: http://stackoverflow.com/q/27414169
tags question: http://stackoverflow.com/q/27468069
tags question: http://stackoverflow.com/q/27347779
tags question: http://stackoverflow.com/q/27334951
tags question: http://stackoverflow.com/q/27360901
tags question: http://stackoverflow.com/q/27465374
tags question: http://stackoverflow.com/q/27329562
tags question: http://stackoverflow.com/q/27389740
tags question: http://stackoverflow.com/q/27370348
tags question: http://stackoverflow.com/q/27348669
tags question: http://stackoverflow.com/q/27461112
tags question: http://stackoverflow.com/q/27416760
tags question: http://stackoverflow.com/q/27443170
tags question: http://stackoverflow.com/q/27393601
tags question: http://stackoverflow.com/q/27356824
tags question: http://stackoverflow.com/q/27355555
tags question: http://stackoverflow.com/q/27402291
tags question: http://stackoverflow.com/q/27459102
tags question: http://stackoverflow.com/q/27342297
tags question: http://stackoverflow.com/q/27397034
tags question: http://stackoverflow.com/q/27357190
tags question: http://stackoverflow.com/q/27384076

http://stackoverflow.com/q/27391442
type: Question
has body: I am writing an APIService class to help me with having a standardized way for AJAX requests for my web application. The httpRequest function expression is working correctly. When I make a second call to ApiService.call, it works correctly because the endpoints have been set. BTW - I am defining this as a static class so that it can be referenced without being instantiated. I am having a problem with the call method in ApiService. Specifically, when I call ApiService.setEndpoints, ApiService.endpoints.store_get (the default endpoint created when I run the setEndpoint method) has not been set when I make the httpRequest. I know that you should pass a callback if data needs to be set, however, I do not know how best to do this in this circumstance. var ApiService = { endpoints: { }, ENUMERATE_ENDPOINT:'/apis/abc/0.1/json/Resource/Enumerate/init', init:function() { }, setEndpoints:function() { try { new httpRequest(ApiService.ENUMERATE_ENDPOINT,'','GET',ApiService.constructEndpoint,true); } catch(e) { console.log('Error making AJAX call to set API endpoints'); console.log('Error message: ' + e.message) } }, constructEndpoint:function(data) { var json = JSON.parse(data); if (json.hasOwnProperty('success') &amp;&amp; (json.success == 'TRUE' )) { // Sets the api endpoints for (endpoint in json.payload.api_endpoints) { ApiService.endpoints[endpoint] = json.payload.api_domains.api_root_url.slice(json.payload.api_domains.api_root_url.indexOf('apis')) + json.payload.api_endpoints[endpoint]; } } }, call:function(params, callback, endpoint_string) { endpoint_string = endpoint_string || undefined; try { if (typeof endpoint_string !== "undefined") { new httpRequest(endpoint_string, params, 'POST', callback, true); } else { ApiService.setEndpoints(); new httpRequest(ApiService.endpoints.store_get, params, 'POST', callback, true); } } catch(e) { console.log('Error making AJAX call to API endpoints'); console.log('Error message: ' + e.message); } } } var httpRequest = function(url,p…
has title: How can I make my javascript function wait for the results of an AJAX call?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43231227
score: 0
tagged with: callback
tagged with: ajax
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/43232339

http://stackoverflow.com/comment/43330202
type: Comment
comment on: http://stackoverflow.com/q/27445559
type: QuestionComment
score: 0
has text: I put it in the end of the post.

http://stackoverflow.com/q/27315193
has answer: http://stackoverflow.com/a/27317625
has title: Cannot read property 'replace' of undefined
has comment: http://stackoverflow.com/comment/43090223
has comment: http://stackoverflow.com/comment/43090876
has comment: http://stackoverflow.com/comment/43090330
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have a simple menu with images. The image source changes depending on viewer's action (mouseover, click, nothing). I am having trouble to reset the non-active images source to default when another image is clicked? (on-click) button1S.jpg -> button1S_active.jpg I have tried to use .not(this).replace, but I get an error according to chrome "Cannot read property 'replace' of undefined". &lt;head&gt; &lt;script type="text/javascript" src="jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;img class="logo" src="logo.jpg"&gt;&lt;br&gt; &lt;img class="menu_btn" src="button1S.jpg"&gt;&lt;br&gt; &lt;img class="menu_btn" src="button2S.jpg"&gt;&lt;br&gt; &lt;img class="menu_btn" src="button3S.jpg"&gt;&lt;br&gt; &lt;img class="menu_btn" src="button4S.jpg"&gt; &lt;/body&gt; &lt;script&gt; $("img.menu_btn").hover( function () { this.src = this.src.replace('.jpg', '_hover.jpg'); $(this).addClass('hovered'); }, function () { this.src = this.src.replace('_hover.jpg', '.jpg'); $(this).removeClass('hovered'); }); $('img.menu_btn').click( function () { var unactive = $('img.menu_btn').not(this); unactive.src = unactive.src.replace('_active.jpg', '.jpg'); //without this, it works but _active.jpg isn't removed when unactive. unactive.removeClass("active"); $(this).addClass('active'); this.src = this.src.replace('_hover.jpg', '_active.jpg'); alert(this.src); }); Thank you very much.
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27315248
has comment: http://stackoverflow.com/comment/43094343
tagged with: menu
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43092339
possible better answer: http://stackoverflow.com/a/27317625
has answer: http://stackoverflow.com/a/27315248
has comment: http://stackoverflow.com/comment/43094760
type: Question

http://stackoverflow.com/q/27360429
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43173282
has comment: http://stackoverflow.com/comment/43173465
possible better answer: http://stackoverflow.com/a/27361210
has comment: http://stackoverflow.com/comment/43172951
linked to: http://stackoverflow.com/q/2027062
answer count: 3
has answer: http://stackoverflow.com/a/27360910
tagged with: function
has answer: http://stackoverflow.com/a/27361210
tagged with: javascript
has comment: http://stackoverflow.com/comment/43173611
tagged with: jquery
tagged with: asp.net
accepted answer: http://stackoverflow.com/a/27360910
score: 0
has body: I am attempting to pass different values to a javascript function depending on which button is clicked. I have two hiddenfields on the page and I want the value of the first field hidA to be used when btnA is clicked and the second field hidB value to be used when btnB is clicked. The value will then be read by javascipt. EXAMPLE onclick="test(22);" However I am unable to read .Net control values without breaking the syntax. ASPX &lt;input id="btnA" type="button" value="A" onclick="test($('#&lt;%= hidA.ClientID%&gt;').val());"/&gt; &lt;input id="btnB" type="button" value="B" onclick="test($('#&lt;%= hidB.ClientID%&gt;').val());"/&gt; Jquery function test(e){ $('#label').text(e); } QUESTION How can ASP.NET control values be passed to a javascript function?
has comment: http://stackoverflow.com/comment/43173105
has answer: http://stackoverflow.com/a/27361117
has comment: http://stackoverflow.com/comment/43173835
has comment: http://stackoverflow.com/comment/43173193
has title: Passing .Net control values to a javascript function

http://stackoverflow.com/a/27415782
downvote count: 0
has body: Amit Joki already has a working answer, but I'd just like to share another solution using reduce: var count = arr.reduce(function(prevVal, currVal) { return prevVal + (!currVal ? 1 : 0); }, 0); if (count === 1) { // Do something }
score: 4
upvote count: 4
answers question: http://stackoverflow.com/q/27415671
type: Answer
has comment: http://stackoverflow.com/comment/43275562

http://stackoverflow.com/a/27596780
has comment: http://stackoverflow.com/comment/43650759
accepted answer of: http://stackoverflow.com/q/27424836
has comment: http://stackoverflow.com/comment/43666179
score: 7
answers question: http://stackoverflow.com/q/27424836
upvote count: 7
has comment: http://stackoverflow.com/comment/43636681
downvote count: 0
type: AcceptedAnswer
has body: The dataset you linked is ordered by model-year; perhaps drastic changes in technology made the engines more efficient? Neural networks are dependent on correct outputs during training. I would try training the network with all but the last row, and then test using that. Can you link me the csv file you're using? The normalizeData function doesn't give us what you want with the linked file (http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data) edit: It seems like regardless of whatever errorThresh you specify, brain won't run more than 20,000 iterations on training runs. There's several ways to get around this. You can specify the learningRate of your neural network. Upping the learningRate to 0.6 (default is 0.3) helped me get more accurate results net.train(trainingData, { log: true, logPeriod: 100, errorThresh: 0.00005, learningRate: 0.6 }); Higher learningRate means more aggressive weight adjustment, which helps when you aren't running as many iterations as you want. Alternatively, you can specify the total amount of iterations in the options object (if not specified, it defaults to 20,000 - see here). net.train(trainingData, { log: true, logPeriod: 100, errorThresh: 0.00005, iterations: 100000 }); Brain stops training when i &lt; iterations &amp;&amp; error &gt; errorThresh evaluates to false. So feel free to crank up the iterations count to ensure that the above expression turns false because the error is below your specified errorTresh (source).
has comment: http://stackoverflow.com/comment/43661674
type: Answer

http://stackoverflow.com/comment/86034863
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27419542
has text: Just wanted to drop in and say that in the meantime ` ` got a [`toBlob()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) method that might be helpful.
type: AnswerComment

http://stackoverflow.com/q/27383179
has body: I am grouping 3 circles together within defs tags so they can be seen in an SVG. I have been also been recommended to use the use tag so I can see this shape that is defined within defs and recreate it anywhere within the SVG. I am creating them and appending them to data using D3.js. However, My problem is when I use the use tag, it seems to me that I am creating a new SVG every time I want to display the shape that is in the defs tag. My questions are: Is there anyway to use the defs tag without using the use tag? The second question is: How can I display that shape within the defs tag many times within only one SVG without creating an SVG every time. Here is my code: <circle cx="200" cy="70" r="25" fill="red" /> <circle cx="170" cy="80" r="20" fill="red" /> <circle cx="230" cy="80" r="20" fill="red" /> Could anyone please help with this issue? Thank you very much in advance.
has comment: http://stackoverflow.com/comment/43241847
has answer: http://stackoverflow.com/a/27399588
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
tagged with: d3.js
has comment: http://stackoverflow.com/comment/43216271
has comment: http://stackoverflow.com/comment/43224320
has comment: http://stackoverflow.com/comment/43216204
has comment: http://stackoverflow.com/comment/43217060
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27399588
type: Question
has title: Append defs tag and use it within SVG in D3.js
has comment: http://stackoverflow.com/comment/43216962
tagged with: javascript

http://stackoverflow.com/a/61981175
has body: Create .jshintrc file in the root dir and add there the latest js version: "esversion": 9 and asi version: "asi": true (it will help you to avoid using semicolons) { "esversion": 9, "asi": true }
answers question: http://stackoverflow.com/q/27441803
type: Answer
upvote count: 12
score: 12
downvote count: 0

http://stackoverflow.com/comment/43191919
type: QuestionComment
comment on: http://stackoverflow.com/q/27370072
has text: Can include your HTML?
score: 0
type: Comment

http://stackoverflow.com/q/27403827
accepted answer: http://stackoverflow.com/a/27404202
has comment: http://stackoverflow.com/comment/43252290
score: -3
has comment: http://stackoverflow.com/comment/43252255
has comment: http://stackoverflow.com/comment/43252382
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43252236
tagged with: reload
downvote count: 3
has comment: http://stackoverflow.com/comment/43259049
has comment: http://stackoverflow.com/comment/43252331
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43252300
has comment: http://stackoverflow.com/comment/43252562
favorite count: 0
has title: How can I reset my Javascript program?
has answer: http://stackoverflow.com/a/27404202
has body: I am trying to make a sort of a physics program in javascript but when its over i want to reload it. I want to do this without reloading the page (if this is possible..). It`s the plan to get a javascript code in the button to reload it. here is my try on the site: tap.96.lt I hope I am clear enough, thank for helping! code: Please get a new browser to watch canvas!
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43252368
has comment: http://stackoverflow.com/comment/43252294
has comment: http://stackoverflow.com/comment/43252267

http://stackoverflow.com/a/27377214
downvote count: 2
has comment: http://stackoverflow.com/comment/43204027
upvote count: 0
answers question: http://stackoverflow.com/q/27377168
type: Answer
score: -2
has body: something like that $.ajax(url).done(function(response) { if (response === true) { $(form).submit(); } else { console.log("not allowed"); });

http://stackoverflow.com/comment/43187906
score: 0
type: Comment
has text: Exposing the routes isn't an issue, and the JSON file is a solution, but the file would be HUGE and the initial page load would be pretty terrible. That's why I created the lookup endpoint -- just to get the one we need.
type: AnswerComment
comment on: http://stackoverflow.com/a/27367666

http://stackoverflow.com/comment/43091034
type: Comment
type: QuestionComment
has text: What did you specify as your form method? You need to specify a POST method e.g. `@using (Html.BeginForm("AddAttachment", "CONTROLLER", null, FormMethod.Post, new {enctype = "multipart/form-data"}))`
comment on: http://stackoverflow.com/q/27315456
score: 0

http://stackoverflow.com/a/27378385
accepted answer of: http://stackoverflow.com/q/27378276
has body: The issue seems to be that you do not have a ; after the definition of that.setProgressUrl. Changing to: // Set progress url that.setProgressUrl = function (url) { that.progressUrl = url; return this; }; Resolves the reported issue. You then have an issue in that you are missing a closing brace and semi colon at the end of the file, not sure if that is just a copy and paste issue. The complete script should look like: var ProgressHandler = function () { "use strict"; // Build a new object var that = {}; // Add basic properties that.taskid = 0; that.timerid = 0; // Timer ID used to push refreshes that.progressUrl = ""; // URL to invoke to read progress that.interval = 500; // The interval for progress refresh that.taskProgressCallback = null; // The user-defined callback that refreshes the UI that.taskCompletedCallback = null; // The user-defined callback that finalizes the call // Set progress url that.setProgressUrl = function (url) { that.progressUrl = url; return this; }; // Set frequency of refresh that.setInterval = function (interval) { that.interval = interval; return this; }; };
has comment: http://stackoverflow.com/comment/43207127
has comment: http://stackoverflow.com/comment/43206297
upvote count: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43206145
score: 3
answers question: http://stackoverflow.com/q/27378276
has comment: http://stackoverflow.com/comment/43209992

http://stackoverflow.com/a/27371174
downvote count: 0
type: Answer
has body: Just a few typos, missing ID on your table and mixing jQuery incorrectly. $("#addTableRow").click( function () { var row = $(" "); row.append($(" Text-1 ")) .append($(" Text-2 ")) .append($(" Text-3 ")) .append($(" Text-4 ")) .append($(" Text-5 ")) .append($(" Text-6 ")) .append($(" Text-7 ")); $("#myTable tbody").append(row); }); Add table row Name Surname Email City Sex Date Time John Morgan mail@mail.com London Male 09.12.14 04:17 a.m.
accepted answer of: http://stackoverflow.com/q/27371109
answers question: http://stackoverflow.com/q/27371109
upvote count: 7
score: 7
type: AcceptedAnswer

http://stackoverflow.com/a/27408192
score: 0
has comment: http://stackoverflow.com/comment/43260844
type: Answer
answers question: http://stackoverflow.com/q/27408047
has comment: http://stackoverflow.com/comment/43260877
has body: You can do something like this in jquery : $("td").not($(this).find("table")).css("padding","5px"); This will add padding to all td that does not have a table has child. You can also do this by adding a class instead of inline style.

http://stackoverflow.com/comment/43121689
comment on: http://stackoverflow.com/a/27331962
type: AnswerComment
score: 0
type: Comment
has text: @Ludovic, I certainly understand that ... just throwing in the random thoughts I'm having after being up all night.

http://stackoverflow.com/a/27336898
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/27335612
upvote count: 1
answers question: http://stackoverflow.com/q/27335612
has body: Right now Ember-Charts code is not included in your built dist\assets\vendor.js file. Installing bower packages in ember-cli doesn't mean that the installed package's code will be included in your app. Ember simply could not find the pie-chart component so it's looking up pie-chart as a property on your controller. You should add to your Brocfile.js the following code: app.import('bower_components/ember-charts/dist/ember-charts.js'); app.import('bower_components/ember-charts/dist/ember-charts.css');
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27331292
favorite count: 0
tagged with: angularjs
has body: I am using AngularJS in front-end and Socket.io for chat application. When a user sends a message, Its getting rendered in UI as follows: {{chat.msg}} But If user sends any link how can I make it clickable? One approach was to pass message to a regular expression and check if it contains a link and put them in a tag and rendering that message in above tag worked. But If message contains some html tags which user is trying to send it across to another user, then it is getting replaced in html. Example: User1: Show me your code in example.com User2: My code is as follows : This is a simple app</b in example.com User3: Looks Good Here in above code only example.com should be clickable and tag should be shown as a part of message instead of rendering it in UI. Any idea how this can be done? Thanks in Advance
has title: Clickable links in UI Chat Application
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
tagged with: socket.io
type: Question
score: 1
answer count: 1
has answer: http://stackoverflow.com/a/27331317
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43291960
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27425011
type: QuestionComment
has text: Please post the code that you have so far.

http://stackoverflow.com/q/27461172
has comment: http://stackoverflow.com/comment/43358762
answer count: 2
has body: In the project bigpicture.js / live demo, I replace every element when zooming (by moving them, and changing their font size). It works. Now I want to test CSS' nice transform: scale(...); feature instead. In the following test, I would like to : zoom the whole when user clicks. zoom out when user CTRL+clicks. The problem is that regardless where we click, the zoom is done the same way. How to zoom on the point that has been clicked instead? (like it already works with my current implementation of bigpicture.js). var container = document.getElementById("container"), wrapper = document.getElementById("wrapper"); var zoom = 1; wrapper.onclick = function (e) { zoom *= e.ctrlKey ? 1/1.2 : 1.2; container.style.transform = "scale(" + zoom + ")"; } Test Important: You absolutely need to go Full Page to understand what it is about. Note: I tried a few things with transform-origin, unsuccessfuly.
has comment: http://stackoverflow.com/comment/43358727
has comment: http://stackoverflow.com/comment/43358715
favorite count: 0
has comment: http://stackoverflow.com/comment/43358797
has answer: http://stackoverflow.com/a/27461367
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43358897
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27604077
accepted answer: http://stackoverflow.com/a/27604077
score: 6
type: Question
tagged with: transform
possible better answer: http://stackoverflow.com/a/27461367
upvote count: 6
tagged with: javascript
has title: Zoom on a container with CSS transform

http://stackoverflow.com/a/27432701
has body: Use jQuery $("#y .x").html("changed it"); That is all
accepted answer of: http://stackoverflow.com/q/27432589
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43312251
answers question: http://stackoverflow.com/q/27432589
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43312112

http://stackoverflow.com/comment/43209817
comment on: http://stackoverflow.com/q/27379842
score: 0
type: Comment
type: QuestionComment
has text: For example: Windows Server 2008 R2 Standard IE 11 V 11.0.9600.17107 Not working

http://stackoverflow.com/q/27432517
score: 0
type: Question
has body: New Restful API's like Google, OpenStreetview use a simple call back mechanism. Basically you call the API, adding a parameter &amp;callback=my function. When executing a call to this API, as a result my function is called passing a JSON dataset. I am trying to create the same mechanisme for a API I am building for my personal use. As far as I understood my API needs to return a javascript, that calls the function that is passed in a script. For a test I created this: function apiCall(URL,values, keyPair,cBackPair) { // URL specifics URL to call // keyPair: &lt;keyname&gt;=&lt;key&gt;; leave black if unneeded // cBacPair: &lt;callBackParametername&gt;=&lt;functionname&gt; // called is: URL?values&amp;keypair&amp;cBackPair var request = (keyPair)?'&amp;'+keyPair:''; request = URL + '?'+ encodeURI(values) + request + '&amp;' + cBackPair; var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", request); document.body.appendChild(script); } function callAPI() { apiCall('http://xllent.nl/map/ajax/answer.php','q=one','','s=doit'); } function doit(result) { alert(result); } To test I call callAPI onload. The script answer.php is very basic: &lt;?$s = $_GET['s']; ?&gt; &lt;script type="text/javascript"&gt; doit('jeroen'); &lt;/script&gt; Later the script would use $s to call the right script, and of course supply user data. For now I am just trying to get the script doit('jeroen'); to be run. But nothing happens. Typing javascript:doit('jeroen'); in the browser window gives the result I would expect. Any suggestions?
tagged with: api
tagged with: javascript
tagged with: callback
has comment: http://stackoverflow.com/comment/43306364
answer count: 1
has title: create callback API
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/27432598

http://stackoverflow.com/comment/43263169
type: Comment
type: QuestionComment
has text: with dynamic i mean the input fields for `env`i can add/remove with a click on a button. the user can add as many `env` values as he want in the form of `envname`and `value`.
comment on: http://stackoverflow.com/q/27407896
score: 0

http://stackoverflow.com/comment/43205197
has text: I've changed the description, sorry for the inconvenience.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27377445
score: 0

http://stackoverflow.com/a/31277826
has body: We recently had a similar issue of trying to integrate static HTML into our React application (In this case the HTML was a template which would have React components 'injected' into it, so it was potentially a little more complex than your situation). Like you, we wanted to be able to create raw HTML (So that it could be generated by standard tools). A colleague created this library to accomplish the task: https://github.com/mikenikles/html-to-react It parses the HTML tree, converting it into a 'React tree' which you can embed into a React component. This avoids the use of dangerouslySetInnerHtml and doesn't require any build-time pre-processing on the HTML.
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/53336083
answers question: http://stackoverflow.com/q/27473280
upvote count: 2
has comment: http://stackoverflow.com/comment/53145577

http://stackoverflow.com/comment/43143753
comment on: http://stackoverflow.com/q/27344134
type: QuestionComment
type: Comment
score: 1
has text: Just wondering, are you generating this string?

http://stackoverflow.com/comment/43245168
comment on: http://stackoverflow.com/q/27386489
type: Comment
has text: Are you handling the backend also? In the json data there should be one field "total". copy paste your store proxy here.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43335631
type: QuestionComment
has text: Which version of IE it is not working? Provide sencha fiddle if possible
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27447310

http://stackoverflow.com/q/27364420
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43180682
type: Question
upvote count: 2
has title: Bootstrap: why is my Modal transparent?
has answer: http://stackoverflow.com/a/27364605
answer count: 1
accepted answer: http://stackoverflow.com/a/27364605
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43180660
has comment: http://stackoverflow.com/comment/43180885
tagged with: css
score: 2
has body: I want to use a Modal from the Bootstrap library. When I click the button, the Modal is displayed, but it is transparent. I can't figure out why this is. JSFiddle link: http://jsfiddle.net/0cqkdjey/ This is my HTML: × Close Log in blablabla This is my JavaScript: $(document).ready( function() { // set focus when modal is opened $('#loginWindow').on('shown.bs.modal', function () { $('#email').focus(); }); // everytime the button is pushed, open the modal, and trigger the shown.bs.modal event $('#loginButton').click(function () { $('#loginWindow').modal({ show: true }); }); });
downvote count: 0
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43180835

http://stackoverflow.com/q/27418145
answer count: 1
has comment: http://stackoverflow.com/comment/43279607
has title: HTML 5 canvas key press time events
tagged with: javascript
type: UnansweredQuestion
has body: I am working on a Stick Hero (famous Android game) clone in HTML 5, I am trying to implement the code for capturing the time of key press (right arrow - ASCII 39) in Javascript and grow a stick accordingly. Stuck Hero ! I having some issues and clarification How to track key press event ? I tried to set a timeout function when key is pressed and I will release the timeout function when the key is released (but having some issues with cleartimeout) How to not accept any events once the key is release , I have to do other animations ? Not tried yet and have no idea Another Common Question How to prepare my mindset as a HTML5 Game developer, any reference link or idea is welcomed, I know basic programming Edit : jsfiddle
upvote count: 4
tagged with: jquery-events
tagged with: canvas
downvote count: 0
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
score: 4
has answer: http://stackoverflow.com/a/27418259

http://stackoverflow.com/q/27371550
has body: sorry i've tried asking this before and got no good results, so here's trying again. I have tried many things and still haven't had any good results. The code is here -> PasteBin I want to add a hyperlink to the data-images for the ninja slider. I've never encountered data-image before but i can't use img src="#" cause that doesn't work with the javascript if you guys need any more information, let me know. This is driving me insane! this is the troublesome part.
has answer: http://stackoverflow.com/a/27371653
has answer: http://stackoverflow.com/a/27371613
tagged with: css
has comment: http://stackoverflow.com/comment/43194629
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/43194567
has title: CSS3 How do i add a hyperlink to
has comment: http://stackoverflow.com/comment/43194649
has answer: http://stackoverflow.com/a/27371614
type: Question
accepted answer: http://stackoverflow.com/a/27371613
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/27371653
upvote count: 2

cordova
tags question: http://stackoverflow.com/q/27404341
tags question: http://stackoverflow.com/q/27331002
tags question: http://stackoverflow.com/q/27350110
tags question: http://stackoverflow.com/q/27455417
tags question: http://stackoverflow.com/q/27346790
tags question: http://stackoverflow.com/q/27413838
tags question: http://stackoverflow.com/q/27320940
tags question: http://stackoverflow.com/q/27413693
tags question: http://stackoverflow.com/q/27435165
tags question: http://stackoverflow.com/q/27420266
tags question: http://stackoverflow.com/q/27315070
tags question: http://stackoverflow.com/q/27420743
tags question: http://stackoverflow.com/q/27317110
tags question: http://stackoverflow.com/q/27328271
tags question: http://stackoverflow.com/q/27419161
tags question: http://stackoverflow.com/q/27347403
tags question: http://stackoverflow.com/q/27351466
tags question: http://stackoverflow.com/q/27456554
tags question: http://stackoverflow.com/q/27314855
tags question: http://stackoverflow.com/q/27458934
tags question: http://stackoverflow.com/q/27318653
tags question: http://stackoverflow.com/q/27457747
tags question: http://stackoverflow.com/q/27470652
tags question: http://stackoverflow.com/q/27467281
tags question: http://stackoverflow.com/q/27350362
tags question: http://stackoverflow.com/q/27376992
tags question: http://stackoverflow.com/q/27381195
tags question: http://stackoverflow.com/q/27356809
tags question: http://stackoverflow.com/q/27448331
tags question: http://stackoverflow.com/q/27474756
tags question: http://stackoverflow.com/q/27438128
tags question: http://stackoverflow.com/q/27407015
tag name: cordova
tags question: http://stackoverflow.com/q/27386167
tags question: http://stackoverflow.com/q/27358459
tags question: http://stackoverflow.com/q/27315791
tags question: http://stackoverflow.com/q/27426390
tags question: http://stackoverflow.com/q/27413787
tags question: http://stackoverflow.com/q/27352222
tags question: http://stackoverflow.com/q/27473787
tags question: http://stackoverflow.com/q/27443350
tags question: http://stackoverflow.com/q/27383907
tags question: http://stackoverflow.com/q/27468070
tags question: http://stackoverflow.com/q/27417926
tags question: http://stackoverflow.com/q/27390733
tags question: http://stackoverflow.com/q/27441714
tags question: http://stackoverflow.com/q/27409755
tags question: http://stackoverflow.com/q/27415998
tags question: http://stackoverflow.com/q/27384431
type: Tag
tags question: http://stackoverflow.com/q/27420367
tags question: http://stackoverflow.com/q/27457943
tags question: http://stackoverflow.com/q/27380794
tags question: http://stackoverflow.com/q/27455884
tags question: http://stackoverflow.com/q/27456363
tags question: http://stackoverflow.com/q/27365313

http://stackoverflow.com/q/27337618
downvote count: 0
has comment: http://stackoverflow.com/comment/43305212
tagged with: javascript
has answer: http://stackoverflow.com/a/27444025
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/43250974
type: AnsweredQuestion
tagged with: parsley.js
accepted answer: http://stackoverflow.com/a/27444025
has title: Parsley.js - Validate optional input for only numbers
has body: I have a form that has one optional input and 3 required input fields. For the optional input I have the below markup: &lt;input type="number" placeholder="0" min="0" max="20000" step="100" data-parsley-validation-threshold="1" data-parsley-trigger="keyup"&gt; This does not fire the validation if I have type in letters or any other characters. It does validate for min and max values. If I put required attribute it does seem to work but I don't want that. I also tried defining a pattern as below: data-parsley-pattern="^[0-9]*$" None of them seem to work. Any ideas?
tagged with: forms
type: Question
score: 12
upvote count: 12
tagged with: validation
answer count: 1

http://stackoverflow.com/q/27443170
accepted answer: http://stackoverflow.com/a/27443393
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27443461
has body: I'd like to find an element's POSITIONS in same array without methods, with an algorithm... Example: var a = [1,2,2,1,4,5,6] to display positions of 1 : position 0 and 3 to display positions of 2 : position 1 and 2 What I have done so far: function count(array,element){ while(element in array){ return array.indexOf(element); } }
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43326040
has answer: http://stackoverflow.com/a/27443461
has title: Find index of same elements in array multiple times
type: Question
tagged with: algorithm
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/27443393

eclipse
tags question: http://stackoverflow.com/q/27368709
tag name: eclipse
tags question: http://stackoverflow.com/q/27375955
tags question: http://stackoverflow.com/q/27425472
tags question: http://stackoverflow.com/q/27450317
tags question: http://stackoverflow.com/q/27373824
type: Tag

http://stackoverflow.com/q/27445440
accepted answer: http://stackoverflow.com/a/27445456
has body: Okay, i've got the following problem. I used jquery to test a string with a regular expression. It works all fine, but.... In the Netherlands the zipcodes are 4 digits followed by 2 characters e.g. 1234AB. Now i use the following regex to find this: [0-9]{4}[A-Z]{2}. But when someone types 1234AB+948203848 for example. It also return true. And i don't want that! How can i make it return false when it's not 4 digits followed by 2 characters? Thanks in advance. JSBIN
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27445454
has answer: http://stackoverflow.com/a/27445454
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43329745
has comment: http://stackoverflow.com/comment/43330270
favorite count: 0
has answer: http://stackoverflow.com/a/27445456
tagged with: regex
type: AnsweredQuestion
upvote count: 1
downvote count: 1
has title: Regular expression in jquery allow only one match
type: Question

http://stackoverflow.com/q/27439965
has comment: http://stackoverflow.com/comment/43320659
has body: I want to be able to provide a different controller for a directive according to a value of a scope variable. been searching along those lines but all the results have been about config of $route. So here is a sample: I want to provide my directive dir1 with a different controller according to model.something's value. Code below. angular.module('mod1', []) .directive('dir1', function() { return { restrict: 'A', scope: { model: '=' }, controller: function($scope) { return control($scope.model.something); } }; }); function control(param) { if(param == 1) return ctrl1; else if(param == 2) return ctrl2; else return ctrl3; } function ctrl1 ($scope,$http) { //something1 } function ctrl2 ($scope,$http) { //something2 } function ctrl3 ($scope,$http) { //something3 } need more info??
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/43320700
tagged with: javascript
has comment: http://stackoverflow.com/comment/43320220
score: 0
has comment: http://stackoverflow.com/comment/43321069
has comment: http://stackoverflow.com/comment/43319701
has comment: http://stackoverflow.com/comment/43320245
has comment: http://stackoverflow.com/comment/43319945
has title: How to change what controller is to be used by a directive according to a variable?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43323225
type: UnansweredQuestion

http://stackoverflow.com/a/27358454
upvote count: 1
type: Answer
has body: You need to use separate variables for the inner and the outer loop. When you exit the inner loop, x will be equal to the length, so the outer loop will end also.
answers question: http://stackoverflow.com/q/27358366
downvote count: 0
score: 1

http://stackoverflow.com/comment/45527583
comment on: http://stackoverflow.com/a/28301046
score: 0
type: Comment
has text: this actually works well. The only thing is using the minimized version of gridster it should be o.move_widget.... right after the resize_widget function.
type: AnswerComment

http://stackoverflow.com/comment/43331824
comment on: http://stackoverflow.com/a/27446002
score: 0
type: AnswerComment
type: Comment
has text: @TheGarrett I'm afraid that's a completely different question. I would need to see more of your code in order to help you, a plunker or a jsFiddle would be nice too. However, keep in mind that the best way for integrating external plugins is to use custom directives.

http://stackoverflow.com/comment/43290800
comment on: http://stackoverflow.com/q/27424419
type: QuestionComment
has text: You can execute string named functions like this `data[0]()`
type: Comment
score: 0

http://stackoverflow.com/comment/43355169
has text: @Caynadian Not that it matters, but the backslashes have no effect here whatsoever. They do not go into the string. Try printing the string to see. The backslashes are consumed by the JS parser while it is parsing the string literal. The string you are defining is precisely the same whether or not you use the escapes. To verify this, type the following into your console: `'"a"' === '\"a\"'`, and you will see that the strings are strictly equal.
score: 0
comment on: http://stackoverflow.com/q/27454931
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27419676
upvote count: 2
tagged with: php
accepted answer: http://stackoverflow.com/a/27419745
type: AnsweredQuestion
score: 1
has title: php variable in a javascript object within a json result
tagged with: http://stackoverflow.com/tag/json
has body: I'm trying to put a php variable within a js script that is in a result variable that will be processed with json but i don't get it to work. I know it has something to do with the "" and '' but i can't figure out what it is. $result["html"] .= " "; Edit: whoohoo i got the 15 points to upvote! Thanks u all!
has comment: http://stackoverflow.com/comment/43282274
downvote count: 1
has comment: http://stackoverflow.com/comment/43282619
type: Question
has comment: http://stackoverflow.com/comment/43282873
tagged with: javascript
has answer: http://stackoverflow.com/a/27419745
has comment: http://stackoverflow.com/comment/43282281
answer count: 1
has comment: http://stackoverflow.com/comment/43282297
favorite count: 0

http://stackoverflow.com/comment/43092783
has text: Convert the number to a string and test the first character? Also, should "Ping" be output for _all_ numbers that start with a 1, or just the numbers that already have some other output because they match one of the other conditions?
type: QuestionComment
comment on: http://stackoverflow.com/q/27316519
score: 0
type: Comment

http://stackoverflow.com/q/27423346
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/21757085
linked to: http://stackoverflow.com/q/27353941
type: Question
has body: I am using Flot Stacked Bar and I'm trying to display text on each series of a bar chart so it shold be something like that as you can see in the image:- Please can you have a look at my code. Many Thanks, Here is my code: var data = [ {label: 'foo', color:'red', data:[[1,<?php echo $red; ?>]]}, {label: 'bar', color:'blue', data:[[1,<?php echo $blue; ?>]]}, {label: 'baz', color:'green', data:[[1,<?php echo $green; ?>]]}, ]; $.plot($("#placeholder"), data, { series: { stack: 1, bars: { show: true, lineWidth: 1, barWidth: 0.8, order: 1, fill: true, label: { show: true, radius:0.7, formatter: function(label, series) { var result =[ <?php echo $red; ?> ,<?php echo $blue; ?> ,<?php echo $green; ?> ]; if ( label == "red") { return ' '+label+' '+(result[0])+' '; } else if (label == "Blue") { return ' '+label+' '+(result[1])+' '; } else if (label == "green") { return ' '+label+' '+(result[2])+' '; } }, background: { opacity: 0.8, } } }, yaxis : { min : 0, tickLength: 0 } , xaxis: { tickLength: 0, axisLabel: "Date", axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelFontFamily: 'Arial', axisLabelPadding: 3, color: "#838383", timeformat: "%b/%y" } } });
duplicate of: http://stackoverflow.com/q/27353941
tagged with: javascript
tagged with: stacked-chart
linked to: http://stackoverflow.com/q/21701504
tagged with: flot
tagged with: bar-chart
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/43297982
favorite count: 0
linked to: http://stackoverflow.com/q/26976161
has title: Stacked Bar Flot Chart - labels inside each series of Stacked Bar

http://stackoverflow.com/q/27422415
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27422524
has comment: http://stackoverflow.com/comment/43287196
has answer: http://stackoverflow.com/a/27422524
has answer: http://stackoverflow.com/a/27422648
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: Creating an object from html elements using JavaScript and jQuery
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27422521
type: Question
has answer: http://stackoverflow.com/a/27422521
has body: I want to create an object from html elements using JavaScript and jQuery. The object i want to create is { array:[{infraStructureType: 'value', hostId: 'value'}, {infraStructureType: 'value', hostId: 'value'}] } So my code to create above object is var obj = {}, dataObj = {compareESX: []}; $('.checkBox:checked').each(function () { obj.infraStructureType = $(event.target).attr('hostId'); obj.hostId = $(event.target).attr('infrastructureType'); console.log(obj); dataObj.compareESX.push(obj); console.log(dataObj); }); In above code "console.log(obj)" gives correct output but, when i push it in array "dataObj.compareESX" Only information of last 'obj' is getting pushed number of times the each loop executes.

http://stackoverflow.com/comment/136149220
has text: `allow-from` is deprecated you have to remove the header to "allow" embedding. `Header always unset X-Frame-Options`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/53526965

http://stackoverflow.com/comment/43337515
score: 1
comment on: http://stackoverflow.com/q/27449349
has text: is that correct? If so I'll put it in answer form so you can accept it.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27441228
answers question: http://stackoverflow.com/q/27441166
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27441166
has body: Try this : attach change event to select box instead of options. NOTE - Please make sure that transferfrom is unique id through out the html document. $(document).on('change','#transferfrom .select2-offscreen',function() { var ID = $(this).val(); alert(ID); $(".reloadtransferform").load('transferfrom.cfm?id='+id+'&amp;cache='+Math.random()); });
type: Answer
score: 0

http://stackoverflow.com/comment/63055743
type: Comment
comment on: http://stackoverflow.com/a/27376421
has text: @CD when there are multiple keys with the same highest value, your solution returns the final key, how can I make this return the first key instead?
type: AnswerComment
score: 0

http://stackoverflow.com/q/27360833
score: 1
has answer: http://stackoverflow.com/a/27362160
has comment: http://stackoverflow.com/comment/43175061
has answer: http://stackoverflow.com/a/27361253
type: Question
has comment: http://stackoverflow.com/comment/43174214
has answer: http://stackoverflow.com/a/27361109
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/43174274
upvote count: 1
has answer: http://stackoverflow.com/a/27361053
downvote count: 0
tagged with: jquery
has title: Check if table tr td is not empty
possible better answer: http://stackoverflow.com/a/27361253
favorite count: 0
has comment: http://stackoverflow.com/comment/43174048
has body: I want to check if the table tr td still gots the dummy text. If thats true then a message should appear that they have to enter some text there ( by drag and dropping ) Drag and drop is working thats not the problem i just need to check if the td still got the dummy tekst else the cannot proceed to the next step here is my html table layout : s s Menu Drop content Menu Drop content Main Content Drop content the p tag is removed if people drop content there if they didn't a message should appear there I tried this : function checkTemplate(){ $jQ('.Required > tbody > tr > td').each(function(index){ if($jQ(this).children().hasClass('dummyText')); console.log('Empty'); }); }
has answer: http://stackoverflow.com/a/27361220
accepted answer: http://stackoverflow.com/a/27361220
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27361140
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43174010

http://stackoverflow.com/comment/43322590
type: QuestionComment
has text: i see nothing on my screen when i click the button just flicking something at div.I'm expecting Dialogbox .I have posted the URL on my Question please look that
comment on: http://stackoverflow.com/q/27441411
score: 0
type: Comment

http://stackoverflow.com/q/27382991
downvote count: 0
has body: I'm trying to change div's top position with animation when I click on it. So I tried something like that: HTML: pink CSS: * { margin:0; padding:0; } html, body { width:100%; height:100%; } .container { width:100%; height:100%; overflow:hidden; position:absolute; display:block; top:0; left:0; background-color: #77c8ff; } .pink { width:100%; height: 100%; background-color: #ff23f0; position: absolute; top:90%; -webkit-transition: top 1s linear ease-out; } JS (in ) var pink; var topPos = 90; window.addEventListener('load', init, false); function init() { pink = document.getElementById('pink'); pink.onclick = function(){raiseDiv()}; } function raiseDiv(){ topPos -= 20; if (topPos <= 0) topPos = 0; pink.style.top = topPos+'%'; } It does raise the div, but without animation. I tried to use for loop and with each iteration raise the div by 1 percent with setTimeout and with setInterval to create a sort of animation, but that didn't work. So how can I make it work? Here's the jsfiddle of the current code.
favorite count: 0
tagged with: animation
tagged with: css
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27383063
upvote count: 1
type: Question
tagged with: javascript
has title: Changing element's top position with animation on click
accepted answer: http://stackoverflow.com/a/27383063
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/27441973
type: Question
has comment: http://stackoverflow.com/comment/43323765
has comment: http://stackoverflow.com/comment/43323525
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43323336
has title: Function not called after location.reload() or location.reload(true)
answer count: 0
type: UnansweredQuestion
has body: I'm calling location.reload on a resize event, but I expect the function to be called every time the page is reloaded. console.log("resize called") is called, but console.log("Function called") is not. What's going on? function sayHello(){ console.log("Function called"); } sayHello(); $(window).resize(function () { console.log("resize called"); location.reload(true); }); Thanks.
has comment: http://stackoverflow.com/comment/43325391
has comment: http://stackoverflow.com/comment/43323732
has comment: http://stackoverflow.com/comment/43323443

http://stackoverflow.com/a/27398506
has body: You need to set stacking option like in the example: http://jsfiddle.net/7pccz1j4/2/ plotOptions:{ series:{ stacking:'normal' } },
answers question: http://stackoverflow.com/q/27384744
type: Answer
accepted answer of: http://stackoverflow.com/q/27384744
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43263597
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/27456330
has answer: http://stackoverflow.com/a/27456360
has body: Hi can some one help me to my problem. I have a html and php function here all i want to to is to echoed a select value not the option value here is my code Ouput: Patrick or any for the name when I select and send the button <?php if(isset($_REQUEST['send'])){echo $_POST['test'];}?> Patrick Maria Fe
has comment: http://stackoverflow.com/comment/43350153
has answer: http://stackoverflow.com/a/27456402
has comment: http://stackoverflow.com/comment/43350136
type: Question
has answer: http://stackoverflow.com/a/27456437
has title: how do i get the select value not the option value in php
tagged with: javascript
tagged with: jquery
answer count: 6
has answer: http://stackoverflow.com/a/27456399
has answer: http://stackoverflow.com/a/27456364
score: 0
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27456432
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/a/27374875
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27374773
has body: That's because the iFrame itself does not have a readyState. You'll need to access the contentWindow (child of the iFrame) to get that result. See document.readyState not working in Firefox and Chrome (and some more here: Iframe.readyState does not work in chrome )
downvote count: 0
score: 1

http://stackoverflow.com/q/27336047
has comment: http://stackoverflow.com/comment/43129842
has comment: http://stackoverflow.com/comment/43129808
answer count: 1
has comment: http://stackoverflow.com/comment/43129028
has comment: http://stackoverflow.com/comment/43130899
has comment: http://stackoverflow.com/comment/43130121
tagged with: javascript
type: UnansweredQuestion
has body: I am using the following expression in JavaScript to get the width of screen, which seems to work fine except that it includes the width of vertical scroll-bar when scrolling is there. var wMax = Math.max(document.documentElement.clientWidth, window.innerWidth || 0) Question: How can the above cross-browser expression be modified so it gives the width of screen excluding the vertical scrollbar? I need to use JavaScript for this and not jQuery. UPDATE 1: I found the following cross-browser expression to give the width excluding the vertical scroll-bar. var wMax = Math.min(document.documentElement.clientWidth, window.innerWidth || screen.width); I used Math.min rather than Math.max, so that whichever width was less was taken for width and also used screen.width instead of 0 in the original expression since screen.width would always be maximum of all widths in this case for all browsers as it will always include scroll-bars.
has comment: http://stackoverflow.com/comment/43130159
has comment: http://stackoverflow.com/comment/43129095
upvote count: 4
has comment: http://stackoverflow.com/comment/43130911
has comment: http://stackoverflow.com/comment/43130954
has comment: http://stackoverflow.com/comment/43130854
downvote count: 0
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/32672929
has comment: http://stackoverflow.com/comment/43129502
has title: Cannot get width of screen without scrollbar using cross-browser expression
has comment: http://stackoverflow.com/comment/64808366
has comment: http://stackoverflow.com/comment/43128973
linked to: http://stackoverflow.com/q/8339377
score: 4

http://stackoverflow.com/comment/43260515
type: AnswerComment
score: 0
type: Comment
has text: Sorry I meant $scope.$watch
comment on: http://stackoverflow.com/a/27407997

http://stackoverflow.com/a/27466560
has body: In css you can use background-image: url("[YOUR IMAGE URL HERE]") to change your background to image In your case, you can change the background when it's 18-19 in the night like this: //18-19 night if (hours &gt; 17 &amp;&amp; hours &lt; 20){ document.write('body{background-image: url("[YOUR IMAGE URL HERE]"); color:#FFFFFF;} a{color: yellow !important}') } Here are resources to help you out with other options in changing an element's background: W3SCHOOLS css background W3SCHOOLS css image background
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27466500

http://stackoverflow.com/comment/43285432
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27420878
has text: How does it "getSolutionURL"? If it is something related to events on index.jsp, then how will it know what happened in the previous page, unless you use post or get? JS files run when page is loaded each time.

http://stackoverflow.com/comment/43215891
type: QuestionComment
has text: Guess: `Sys.Application.add_init(callback)` is asynchronous. Try adding your code to the callback.
comment on: http://stackoverflow.com/q/27383509
score: 0
type: Comment

http://stackoverflow.com/q/27408850
favorite count: 0
has title: How initialize x-editable after DOM has changed?
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27410233
answer count: 2
tagged with: ruby-on-rails
accepted answer: http://stackoverflow.com/a/27410233
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/49777703
has answer: http://stackoverflow.com/a/49777703
has body: I think this kind of noob question, but anyway I had x-editable plugin that initilized in my document $(function(){ $.fn.editable.defaults.mode = 'popup'; $('.editable').editable(); }); after I click on tab and some part of my page is refreshed via partials, the x-editable became not avaliable on this new elements. I try to make this trick: $(document).on('click', '.editable', function(){ $('.editable').editable(); }); this works but now I must click two times to call x-editable on .editable element, first time to initialize x-editable and second time to call x-editable popover. What's the best practice in this situation? Thanks in advance!
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: x-editable

http://stackoverflow.com/comment/43113049
has text: Using `this.a` doesn't look for anything in the prototype at all. `foo` is just a function, there is no attempt to use it to create an object.
comment on: http://stackoverflow.com/a/27326657
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/86956068
type: AnswerComment
type: Comment
has text: @matanster Also, see my comment to OP on two types of "bindings" we have here.
comment on: http://stackoverflow.com/a/39878181
score: 0

http://stackoverflow.com/q/27465030
accepted answer: http://stackoverflow.com/a/27465349
has body: I have some javascript creating a number of DOM nodes, so that the nodes can have various animation functions assigned to them. The animation functions are called by a range of other functions. I have a situation where calling new on an object is removing inner HTML from previously created objects. Using the debugger, I tracked this to a call to appendChild. Before the call, the inner HTML is there, after, it is gone. This is killing me. Here is the HTML source: //modeler.html In the above, note leftDrawer and rightDrawer are both assigned a new Drawer. It is after the assignment of rightDrawer that the problem occurs. // modeler.js function Modeler () { var modeler = document.createElement('div'); modeler.id = 'modeler'; document.body.appendChild(modeler); }; 'modeler' is the main containing element. Stepping through with the debugger shows that the inner HTML of the node created by leftDrawer = new Drawer is present, but when rightDrawer = new Drawer is called, the inner HTML of the node created by leftDrawer is deleted. // drawer.js function Drawer (id, side, contents) { var drawer; this.id = id; this.side = side.toLowerCase(); drawer = document.createElement('div'); drawer.className = 'drawer' + ' ' + 'drawer' + (side[0].toUpperCase() + side.slice(1)); drawer.id = id; if (contents) { drawer.appendChild(contents); // After this point, the inner HTML disappears } else { console.log('No content given to Drawer'); }; document.getElementById('modeler').appendChild(drawer); }; The final HTML contained within the modeller div looks like this: hello world Where it should look like this: hello world hello world Why is the inner HTML disappearing from the previously created elements?
score: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27465349
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: AppendChild causing inner HTML of another node to disappear
type: Question
answer count: 1

http://stackoverflow.com/comment/43136076
has text: yes but your process wrong.. see your code issue in answer
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27339802
type: Comment

http://stackoverflow.com/a/27450805
accepted answer of: http://stackoverflow.com/q/27450636
has body: The error message you are getting appears to be correct. $scope.lines does not exist in your factory but in your controller. So what you might have intended to do would be to pass that value in from the controller to the factory like the below function in controller config.updateLines($scope.lines); function in factory updateLines: function(lines) { $http.post(appPath+'/write.php?handler=update line', lines). success(function(data, status, headers, config) { return true; }).error(function(data, status, headers, config) { return false; }); }
answers question: http://stackoverflow.com/q/27450636
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43340371
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/a/27372584
type: Answer
has comment: http://stackoverflow.com/comment/43196282
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27372544
downvote count: 0
has body: Use getElementsByName() method, document.getElementsByName('username') getElementsByName() returns an array of elements.

http://stackoverflow.com/comment/43168232
has text: Thank you for your answer. Thats the only one?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27357964
type: AnswerComment

http://stackoverflow.com/comment/43367508
has text: what if I don't know if 'objA' exist?
type: AnswerComment
comment on: http://stackoverflow.com/a/27465721
score: 0
type: Comment

http://stackoverflow.com/q/27418805
has comment: http://stackoverflow.com/comment/43281291
favorite count: 0
type: AnsweredQuestion
has title: XPages: How to fetch documents in view and read values?
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27418901
accepted answer: http://stackoverflow.com/a/27418901
type: Question
answer count: 1
tagged with: javascript
tagged with: xpages
tagged with: xpages-ssjs
upvote count: 1
has body: I am a beginner with XPages, and I have looked at the TLCC Intro free training. I have also seen tutorials here. I have no experience with Lotus Notes, XPages or flat-structured databases. But, I do have some experience in JavaScript and good experience (IMO) in Java and Android. I am facing the following problems. 1) I am trying to implement a very basic login mechanism. Currently, I add users manually, based on a form. Now, I want to create a login page. I take a user and a password, and click on a button. In the button, I want to read all documents associated with a view (that displays all usernames/passwords), compare with entered value, and if it exists check if the password fields match too. Can someone please guide me in the correct direction? I can't figure out which functions to use. Also, should I be using Scope Variables? Is there a good document/tutorial regarding that? I have tried the "view.getAllEntries()" method but it always returns null. Am I approaching this correctly? Are there in-depth tutorials that can help me with this? 2) What is the method to debug SSJS? I am currently putting everything in a try/catch and printing the error there. I apologize if this question has been asked elsewhere, I haven't really found anything regarding this. Please point me if there is this is a duplicate.

http://stackoverflow.com/q/27447794
has body: I am trying to use this typescript definition file for ui-router: https://github.com/borisyankov/DefinitelyTyped/blob/master/angular-ui/angular-ui-router.d.ts Here is the code at the top of the definition file: // Type definitions for Angular JS 1.1.5+ (ui.router module) // Project: https://github.com/angular-ui/ui-router // Definitions by: Michel Salib &lt;https://github.com/michelsalib&gt; // Definitions: https://github.com/borisyankov/DefinitelyTyped /// &lt;reference path="../angularjs/angular.d.ts" /&gt; declare module ng.ui { interface IState { ... Here is how I am using it: module MyModule { export class MyStateConfig { constructor( // -&gt; error on the word ng.ui on next line private $stateProvider: ng.ui.IStateProvider, private $urlRouterProvider: ng.ui.IUrlRouterProvider ...) { this.$stateProvider.state(... This was working in Visual Studio but now with WebStorm I get a message saying " module 'ng' has no exported member 'ui' Can someone give me advice on this. Is this something to do with a different module system with WebStorm?
possible better answer: http://stackoverflow.com/a/46164014
type: Question
accepted answer: http://stackoverflow.com/a/27453460
upvote count: 6
tagged with: javascript
tagged with: webstorm
has answer: http://stackoverflow.com/a/27453460
has answer: http://stackoverflow.com/a/46164014
answer count: 2
has title: module 'ng' has no exported member 'ui' when using ui-router type definition for typescript
downvote count: 0
favorite count: 0
tagged with: angularjs
score: 6
tagged with: typescript
type: AnsweredQuestion

http://stackoverflow.com/a/27453731
score: 2
has body: This is all a matter of preference, to be honest with you. I'm a big fan of writing small, independent programs, that each do one thing, and do it well. If you're also like this, it's probably better to write separate programs to run periodically via cron. This way you get guaranteed OS-controlled precision for the time, and small, simple programs that are easy to debug outside the context of your webapp. This is just a preference though.
downvote count: 0
answers question: http://stackoverflow.com/q/27450936
upvote count: 2
type: Answer

http://stackoverflow.com/q/27381703
type: Question
has title: Create random arrays from an array
score: 0
has answer: http://stackoverflow.com/a/27385089
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43212234
linked to: http://stackoverflow.com/q/6274339
has comment: http://stackoverflow.com/comment/43212127
has body: Suppose I have 16 numbers, range 0 to 15. They sit in an array. What I want to achieve is the following arrays: Array with 3 random numbers. Array with 2 random numbers. Array with 3 random numbers. Array with 2 random numbers. Array with 2 random numbers. Array with 3 random numbers. The numbers from the, what I will call, masterarray, can only be used once. So array x holds 1, 5 and 7, array y holds 2, 9 (these should be totally random). I understand that I can get and remove items from an array using indexOf and splice. But how would I go about getting the random numbers from the array while also removing them from this list? A foreach wouldn't go as the array gets altered in this process. Same goes for a for-loop, to my understanding. How can I achieve this?
type: UnansweredQuestion

http://stackoverflow.com/comment/43186168
comment on: http://stackoverflow.com/a/27367053
has text: the way you did in php.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43221629
has text: @kit: Notice that the terminology "private members in prototype" might be confusing. `getName` is *not* a member (property), it's just a local variable.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27386540

http://stackoverflow.com/q/27364948
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: gruntjs
has comment: http://stackoverflow.com/comment/43182182
has comment: http://stackoverflow.com/comment/43182567
accepted answer: http://stackoverflow.com/a/27406906
has body: Edit working version and explanation I want to concat files from different server into my destination folder using grunt, and grunt-concat and with something like that: concat: { options: { separator: ';' }, dist: { src: ['dev.staticcontent.com/media/clientcontent/library/*.js', 'js/*.js'], dest: 'dist/&lt;%= pkg.name %&gt;.js' } }, each time I tried, I received no error from grunt, but my dist/marketing-home.js file is empty... Like it didn't find anything. Console: C:\Project\My&gt;grunt Running "jshint:files" (jshint) task &gt;&gt; 1 file lint free. Running "concat:dist" (concat) task File dist/marketing-home.js created. Running "uglify:dist" (uglify) task Done, without errors. New Version After the help of Kris, I was able to do it without passing through the web using grunt-exec and doing using COPY or XCOPY shell command. ex. exec: { copy : { cmd: function () { var path = "\\\\dev-server123\\WebSites\\Static_Contents\\Media\\clientcontent"; return "copy dist\\*.min.js " + path + " /y"; } } }
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43182269
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27406906
has comment: http://stackoverflow.com/comment/43182124
type: Question
has comment: http://stackoverflow.com/comment/43182356
has title: Grunt concat files on a different domain or on different server
tagged with: grunt-contrib-concat

http://stackoverflow.com/comment/43196307
type: Comment
has text: okay, I think I see what you mean but I would now need combine this with my code, somehow, because this example only allows 1 entry. Right?
comment on: http://stackoverflow.com/a/27372643
type: AnswerComment
score: 0

http://stackoverflow.com/comment/140063894
has text: Although this code might answer the question, I recommend that you also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes.
comment on: http://stackoverflow.com/a/79417522
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43143482
type: Comment
has text: Perhaps it's a typo, I see `jumbtroon` instead of `jumbotron` in your html
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27343829

http://stackoverflow.com/comment/43283816
comment on: http://stackoverflow.com/q/27418479
score: 0
type: Comment
type: QuestionComment
has text: I think that `thumbnail.ext` reference to *images/locations/test_1/thumbnail/thumbnail/ext*. Try to change `thumbnail.ext` to `thumbnailExt` and call it like `json.locations[index].thumbnailExt`

http://stackoverflow.com/comment/45133237
has text: @Blazemonger Is there also an error on the line with `var card = cards[0];` in the same [docs for $resource](https://docs.angularjs.org/api/ngResource/service/$resource)
score: 0
comment on: http://stackoverflow.com/q/27359448
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27389666
has comment: http://stackoverflow.com/comment/43227753
has answer: http://stackoverflow.com/a/27389877
score: 0
has title: AngularJS two-way binding an input to a decimal number
tagged with: angularjs-ng-repeat
accepted answer: http://stackoverflow.com/a/27389877
has comment: http://stackoverflow.com/comment/55969500
tagged with: angularjs
has body: I have an HTML 'input' that I'm two-way binding to a decimal number. The problem is that trying to enter a decimal point does not show up. But if I 'mouse' the caret to the middle of the digits, then hit '.', then it does insert it - but then it truncates the rest of the test after the numbers. Decimals key presses really do wierd things in different situations. {{rdg.Value}} {{rdg.Uom}} rdg.ManualValue is a number, which I understand kicks off this extra number validation in AngularJS, regardless of the input 'type'. But is there a way to get decimals to be 'naturally' entered? i.e. as you type them? Bonus question: is there any way to hide the number spinners in any number entry? Thanks for any advice. Corey.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27389968
has answer: http://stackoverflow.com/a/27389968
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/43246240
comment on: http://stackoverflow.com/a/27400295
has text: @SecondRikudo where it says that OP wants the most efficient way? He provided two examples and want to know what the difference is between then.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27316654
answers question: http://stackoverflow.com/q/27316509
score: 0
type: Answer
has body: One other way would be to call a function right after adding the class like: $.fn.classAdded = function() { var $button = $(this); if($button.hasClass('id_button')) { // ... } return $button; } $(id_element).addClass("active").classAdded();

http://stackoverflow.com/a/27440625
has body: if (object.dataList.state || object.dataList.count) { // ... }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27440257

http://stackoverflow.com/comment/43377851
comment on: http://stackoverflow.com/q/27470217
type: QuestionComment
score: 0
has text: that's your fiddle who didn't work on IE or your original page ?
type: Comment

http://stackoverflow.com/q/27332797
tagged with: ajax
has title: Chat list system
score: 0
has comment: http://stackoverflow.com/comment/43123060
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43135149
has comment: http://stackoverflow.com/comment/43134905
tagged with: php
has body: recently i was trying to build a conversation list, whereby a list of conversations will be displayed on the left and users can click which one they want to see, therefore, i wrote the following: aJax: Basically this code here waits for users to select the div (id left conversation) and when users select, gets the class of the div which is assigned an unique variable for varied conversations, after which POSTING the cid to the conversation.php page which processes the data in database, and echoes out the html, with which ajax appends to div id right. Here is my php code: <?php session_start(); include_once("config.php"); if (isset($_POST['cid'])){ $query= mysqli_query($mysqli,"SELECT R.cr_id,R.time,R.reply,U.Memberid,U.Username,U.Email, U.Picture FROM members U, conversation_reply R WHERE R.user_id_fk=U.Memberid and R.c_id_fk='".$_POST['cid']."' ORDER BY R.cr_id ASC LIMIT 20") or die(mysqli_error($mysqli)); while($row=mysqli_fetch_array($query)) { $cr_id=$row['cr_id']; $time=$row['time']; $reply=$row['reply']; $user_id=$row['Memberid']; $username=$row['Username']; $email=$row['Email']; $picture=$row['Picture']; echo ' '; echo ' '; echo ' '; //echo $username; echo ' '; echo ' '; echo $reply; echo ' '; echo ' '; }}else { echo 'Sorry it failed'; } ?> This code down here fetches all the conversation replies and echoes it out back to ajax for ajax to print it out, however, this script does not work and clicking on the div does not even do anything. I didn't set a datatype, so I'm not sure whether that could be causing the error, but i don't think so. Is there any step which i did wrongly? Thanks!
has comment: http://stackoverflow.com/comment/43123367
type: Question
tagged with: chat
has comment: http://stackoverflow.com/comment/43123090
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43220686
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27386246
has text: probably you have to chain the http posts, when one is finished, start another

http://stackoverflow.com/comment/43266725
comment on: http://stackoverflow.com/a/27410317
type: Comment
has text: Thanks, I finally see it now. Thanks for your help (and for not downvoting me)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43274286
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27415145
has text: Maybe it is just hidden (also by CSS)?
type: QuestionComment

http://stackoverflow.com/q/27409837
has body: I want to only resolve and return promise once an http get request is set to a few conditions. var getPromise = function(url) { // Return a new promise. return new Promise(function(resolve, reject) { // Do the usual XHR stuff var req = new XMLHttpRequest(); req.open('GET', url, true); req.onload = function() { // This is called even on 404 etc // so check the status if (req.status == 200) { console.log(req); if (req.response === '"1"') { // Resolve the promise with the response text resolve(req.response); console.log(req.response); } } else { // Otherwise reject with the status text // which will hopefully be a meaningful error reject(Error(req.statusText)); console.log(Error(req.statusText)); } }; // Handle network errors req.onerror = function() { reject(Error("Network Error")); }; // Make the request req.send(); }); } window.promise = getPromise(url); window.promise.then(function(response) { // Execute code after agent leg is connected console.log("Connected!!!!!"); }, function(error) { console.error("Failed!", error); }); The problem I am having is that the HTTP get request only resolves 1 time and sets the promise to a pending state. in order to see the changed state i need to run this code again in the console. It was my understanding that setting req.open(,,true) would make this async. I want it to only set the promise object when req.response = '"1"' thanks in advance
has comment: http://stackoverflow.com/comment/43265134
has comment: http://stackoverflow.com/comment/43267710
tagged with: promise
type: UnansweredQuestion
tagged with: xmlhttprequest
answer count: 0
has comment: http://stackoverflow.com/comment/43264502
type: Question
has comment: http://stackoverflow.com/comment/43270066
has comment: http://stackoverflow.com/comment/43267694
tagged with: javascript
has comment: http://stackoverflow.com/comment/43264569
score: 0
has title: javascript promise not async
has comment: http://stackoverflow.com/comment/43264540
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/43264501

twitter-bootstrap
tags question: http://stackoverflow.com/q/27361489
tags question: http://stackoverflow.com/q/27456407
tags question: http://stackoverflow.com/q/27326161
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/27440715
tags question: http://stackoverflow.com/q/27411179
tags question: http://stackoverflow.com/q/27458530
tags question: http://stackoverflow.com/q/27381272
tags question: http://stackoverflow.com/q/27401488
tags question: http://stackoverflow.com/q/27424843
tags question: http://stackoverflow.com/q/27394860
tags question: http://stackoverflow.com/q/27385691
tags question: http://stackoverflow.com/q/27441037
tags question: http://stackoverflow.com/q/27353435
tags question: http://stackoverflow.com/q/27362053
tags question: http://stackoverflow.com/q/27384145
tags question: http://stackoverflow.com/q/27406486
tags question: http://stackoverflow.com/q/27396414
tags question: http://stackoverflow.com/q/27317982
tags question: http://stackoverflow.com/q/27382950
tags question: http://stackoverflow.com/q/27339750
tags question: http://stackoverflow.com/q/27383120
tags question: http://stackoverflow.com/q/27330577
tags question: http://stackoverflow.com/q/27372323
tags question: http://stackoverflow.com/q/27456231
tags question: http://stackoverflow.com/q/27368137
tags question: http://stackoverflow.com/q/27364420
tags question: http://stackoverflow.com/q/27415477
tags question: http://stackoverflow.com/q/27473404
tags question: http://stackoverflow.com/q/27324144
tags question: http://stackoverflow.com/q/27317612
tags question: http://stackoverflow.com/q/27418506
tags question: http://stackoverflow.com/q/27370103
tags question: http://stackoverflow.com/q/27382375
tags question: http://stackoverflow.com/q/27322250
tags question: http://stackoverflow.com/q/27315482
tags question: http://stackoverflow.com/q/27437752
tags question: http://stackoverflow.com/q/27369410
tags question: http://stackoverflow.com/q/27394793
tags question: http://stackoverflow.com/q/27405138
tags question: http://stackoverflow.com/q/27317093
tags question: http://stackoverflow.com/q/27414265
tags question: http://stackoverflow.com/q/27443254
tags question: http://stackoverflow.com/q/27352567
tags question: http://stackoverflow.com/q/27368407
tags question: http://stackoverflow.com/q/27470259
tags question: http://stackoverflow.com/q/27369399
tags question: http://stackoverflow.com/q/27391043
type: Tag
tags question: http://stackoverflow.com/q/27417730
tags question: http://stackoverflow.com/q/27401843
tags question: http://stackoverflow.com/q/27341350
tags question: http://stackoverflow.com/q/27349257
tags question: http://stackoverflow.com/q/27321481
tags question: http://stackoverflow.com/q/27401035
tags question: http://stackoverflow.com/q/27391715
tags question: http://stackoverflow.com/q/27391115
tags question: http://stackoverflow.com/q/27450924
tags question: http://stackoverflow.com/q/27408013
tags question: http://stackoverflow.com/q/27333172
tags question: http://stackoverflow.com/q/27329657
tags question: http://stackoverflow.com/q/27427581
tags question: http://stackoverflow.com/q/27454679
tags question: http://stackoverflow.com/q/27418595
tags question: http://stackoverflow.com/q/27394729
tags question: http://stackoverflow.com/q/27331669
tags question: http://stackoverflow.com/q/27341388
tags question: http://stackoverflow.com/q/27468110
tags question: http://stackoverflow.com/q/27470402
tags question: http://stackoverflow.com/q/27324693
tags question: http://stackoverflow.com/q/27324170
tags question: http://stackoverflow.com/q/27395287
tags question: http://stackoverflow.com/q/27384198
tags question: http://stackoverflow.com/q/27397449
tags question: http://stackoverflow.com/q/27420168
tags question: http://stackoverflow.com/q/27323723
tags question: http://stackoverflow.com/q/27450209
tags question: http://stackoverflow.com/q/27327796
tags question: http://stackoverflow.com/q/27448827
tags question: http://stackoverflow.com/q/27436785

http://stackoverflow.com/q/27319499
has comment: http://stackoverflow.com/comment/43163637
has answer: http://stackoverflow.com/a/27355568
favorite count: 0
has comment: http://stackoverflow.com/comment/43163656
downvote count: 0
tagged with: css
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/43163436
has title: CSS Z-Index: How to show element above parent's sibling? (and have cousin above parent)
type: Question
has comment: http://stackoverflow.com/comment/43163487
has comment: http://stackoverflow.com/comment/43163071
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27355568
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I have this project: http://jsfiddle.net/dmzq1938/3/. The generated stuff is a little messy, but it's the hovered elements I'm interested in anyway. In the fiddle, if you hover over one of the Blue/Green/Grey rectangles in the top row, you can see what the issue is. But if you hover over one on the bottom row, you can see how it should look. I understand the whole Z-Index relying on it's parent's relationship with it's siblings and I have tried making it so that on hover it makes the whole row a z-index above the others, however the problem then becomes that you can have one clicked on, and hover over another at the same time so you have a row overlapping. What I want is to be able to click and/or hover over the boxes and the tooltip bubble to appear over the top of all the boxes. Ideally without having to put all the tooltips on the same level as the whole row! For Completeness sake: JS $(document).on('click', '.routetimeline .bars &gt; div.stop, .routetimeline .bars &gt; div.driving, .routetimeline .bars &gt; div.break', function () { var AllDivs = $('.routetimeline .bars &gt; div'); AllDivs.removeClass('selected'); var AllBalloons = $('.routetimeline .bars div.balloon'); AllBalloons.hide(); AllBalloons.css('box-shadow', '0'); var ThisDiv = $(this); var ThisBar = ThisDiv.parent(); var ThisBalloon = ThisDiv.next('.balloon'); if (ThisDiv.hasClass('selected')) { ThisDiv.css('z-index', 'auto'); ThisDiv.removeClass('selected'); ThisBalloon.hide(); ThisBalloon.css('box-shadow', '0'); } else { ThisDiv.css('z-index', '100'); ThisDiv.addClass('selected'); ThisBalloon.show(); ThisBalloon.css('box-shadow', '1px 1px 2px 1px #7A7A7A'); } }); $(document).on('mouseenter', '.routetimeline .bars &gt; div.stop, .routetimeline .bars &gt; div.driving, .routetimeline .bars &gt; div.break', function () { var ThisDiv = $(this); if (!ThisDiv.hasClass('selected')) { ThisDiv.css('z-index', '100'); var ThisBalloon = ThisDiv.next('.balloon'); ThisBalloon.show(); ThisBalloon.css('box-shadow',…

http://stackoverflow.com/a/27454724
has body: Use the gems, if they work reliably for you. Easier updates, typically with a Gemfile and bundler. Gems can be better organized. For example a gem can contain files for javascript, css, icon images, binary commands, etc. When you keep things organized this way it tends to be easier. Testing coverage can be presumed. The gems work, and ideally have their own tests, so your app's test suite doesn't need to cover the gems' internal units. Your app can still do integration testing as usual. My personal experience is that the gems are not 100% reliable especially if you have a need to track the newest JS updates. Also take a look at rails assets, which is akin to bundler plus bower: https://rails-assets.org/ (It's the best of both worlds for tracking rapidly-updating JS libraries)
type: Answer
answers question: http://stackoverflow.com/q/27454554
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/27403554
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27403407
type: AcceptedAnswer
has body: you have to do the same but with document.on("click") $(document).on("click", ".buttonClass", function() { console.log("inside"); }); $('.divmain').on("click" make a kind of binding when document is loaded, so when you add dynamix elements to the dom it is noit catched. Whith the use od document.on, it works even if you add dynamic content to the document.
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/27403407

http://stackoverflow.com/comment/44352283
comment on: http://stackoverflow.com/a/27527914
has text: Oh indeed @alex. But i solved it before i saw your answer. Sorry for answering so late. And thanks for your contribution!
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27328577
possible better answer: http://stackoverflow.com/a/27328665
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27328665
tagged with: jquery
tagged with: ajax
linked to: http://stackoverflow.com/q/21648356
accepted answer: http://stackoverflow.com/a/27328688
tagged with: http://stackoverflow.com/tag/html
score: 1
tagged with: css
favorite count: 0
has body: So what I'm trying to do is append content from an HTML document to a DIV that I've already loaded content into (from the same file) using AJAX. I'm trying to have it so when you click the "previous" and "next" buttons it loads the previous or next project. Here's what I have for code. HTML (I'm loading content into #ajax) Close jQuery $(document).ready(function() { $('.p-load').on('click', function(e) { e.preventDefault(); var href = $(this).attr('href'); if ($('#ajax').is(':visible')) { $('#ajax').css({ display:'block' }).animate({ height:'auto' }).empty(); } $('#ajax').css({ display:'block' }).animate({ height:'auto' },function() { $('#ajax').html(' '); $('#loader').css({ border:'none', position:'absolute', top:'50%', left:'50%', margin:'-24px 0 0 -24px', boxShadow:'none' }); $('#ajax').load('includes/projects.html ' + href, function() { $('#ajax').hide().fadeIn('slow'); }); }); }); }); DEMO (Scroll down to the "Work" section — it works to load each project individually if you open a project and then close it, but when I use the same code above on the "prev" and "next" triggers inside the project popup, it doesn't do anything) Any help is greatly appreciated!
upvote count: 1
type: AnsweredQuestion
has title: Append DIV content using AJAX - Previous/Next
has answer: http://stackoverflow.com/a/27328688
type: Question
answer count: 2

http://stackoverflow.com/a/27394771
answers question: http://stackoverflow.com/q/27394666
has body: Assign one id to your body tag like &lt;body id="bdy"&gt; change your droppable code with body id, see in following $("#bdy").droppable({ drop: function (event, ui) { if ($("#bdy img").length == 0) { $("#bdy").html(""); } ui.draggable.addClass("dropped"); $("#bdy").append(ui.draggable); } });
type: Answer
has comment: http://stackoverflow.com/comment/43245018
has comment: http://stackoverflow.com/comment/43247766
score: 0

http://stackoverflow.com/comment/43236692
score: 0
has text: Are you getting 'total' in your response data?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27386489

http://stackoverflow.com/comment/43146091
has text: @OskarLindberg 1 thing which i could do is to make a factory or service and save the current session statistics with expiration time and at the next time when user come first i could check the time period, if it returns false then i could re-initialize the session. the problem with this logic is it will cause a post to server and call the response. I only want to save time in client-side session rather than server posted
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27345202
score: 0

http://stackoverflow.com/comment/43114226
has text: possible duplicate of [is it possible to open a popup with javascript and then detect when the user closes it?](http://stackoverflow.com/questions/3291712/is-it-possible-to-open-a-popup-with-javascript-and-then-detect-when-the-user-clo)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27327191

http://stackoverflow.com/a/27337824
downvote count: 0
score: 1
type: Answer
has body: I try to make an easy explain of HTTP Requests... At first you have your Backend code on a Webserver, in your case written in php. This Script doesnt do anything else, then process the data you send to it and maybe post (echo) a failure, or succeed of its processing back to the frontend client. In your case thats all. On Frontend side its almost the same procedure, whatever language or device you take. You invoke a HTTP POST or GET request in an asynchronous task, in your case jQuery does that for you by calling its $.ajax function to your php. Also in that request, you define a callback function which will be invoked automatically, after async processing is finished. jQuery does that for you too, its the .done() function right after the $.ajax. To indicate loading, the best way would be to Show your loading image right before the $.ajax line of code... And hide or remove it inside the .done() function... To indicate loading is done... Thats all.
upvote count: 1
answers question: http://stackoverflow.com/q/27337566

http://stackoverflow.com/comment/43316387
has text: Have you tried `shell_exec`? http://php.net/manual/en/function.shell-exec.php
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27438070
type: QuestionComment

http://stackoverflow.com/a/27349609
type: Answer
score: 2
has body: Specify the complete callback function. $( '.dimg-main' ).animate({ top: "-=38%", borderSpacing: -360 },{ step: function(now) { $(this).css('-webkit-transform','rotate('+now+'deg)'); $(this).css('-moz-transform','rotate('+now+'deg)'); $(this).css('transform','rotate('+now+'deg)'); }, duration:4000, complete: function(){ $('header, main').fadeIn(2000); } });
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27349574
accepted answer of: http://stackoverflow.com/q/27349574
upvote count: 2

http://stackoverflow.com/q/27323950
type: Question
tagged with: requirejs
upvote count: 1
tagged with: obfuscation
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has body: For further uglification of a script bundle that was optimized by requirejs' r.js optimizer, it makes sense to obfuscate/anonymize the module names inside that package. Unfortunately, browsing through the documentation of r.js, I did not find a way to enable this. Is this possible? An example of what I mean module "ProductsController" could be "module1", module "BillingRepository" could be "module17" and so on. It would make it harder to make sense of the uglified code.
has comment: http://stackoverflow.com/comment/43219008
has comment: http://stackoverflow.com/comment/43201977
downvote count: 0
has title: Uglify module names with r.js optimizer
score: 1
favorite count: 0

http://stackoverflow.com/a/27342994
score: 4
accepted answer of: http://stackoverflow.com/q/27342927
has comment: http://stackoverflow.com/comment/43141663
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43141634
downvote count: 0
has body: You need to set tabindex attribute in order to get DIV element focusable, e.g: &lt;div class="main" tabindex="-1"&gt; Then for styling purpose, you could wish to set outline CSS property: .main { outline: 0; ... } -DEMO-
answers question: http://stackoverflow.com/q/27342927
type: Answer

http://stackoverflow.com/a/47884807
upvote count: 2
downvote count: 0
has body: If you do not want to change original CSS of .modal-dialog, do this when init tinymce: setup: function (editor) { editor.on('FullscreenStateChanged', function (e) { if (e.state) { $('.modal-dialog').attr('style', 'transform: none !important'); } else { $('.modal-dialog').attr('style', 'transform: translate(0,0)'); } }); }
answers question: http://stackoverflow.com/q/27405138
type: Answer
score: 2

http://stackoverflow.com/a/27463096
type: Answer
answers question: http://stackoverflow.com/q/27459899
has comment: http://stackoverflow.com/comment/43372070
has body: Well, it's just streams so you could listen for the end event (Watch out for the pyramid of doom!) gulp.task("dostuff", function (callback) { gulp .src("...") .pipe(gulp.dest("...")) .on('end', function () { gulp .src("...") .pipe(gulp.dest("...")) .on('end', function () { gulp .src("...") .pipe(gulp.dest("...")) .on('end', callback); }); }); }); But it's probably a better pattern to split it up in multiple tasks each one with a dependency on the previous one.
upvote count: 5
has comment: http://stackoverflow.com/comment/43374134
has comment: http://stackoverflow.com/comment/43362413
downvote count: 1
score: 4
has comment: http://stackoverflow.com/comment/43395255
has comment: http://stackoverflow.com/comment/43362465

http://stackoverflow.com/q/27429388
has title: Move Gridster Widgets programmatically
favorite count: 0
type: UnansweredQuestion
has body: I am trying to move Gridster widget programmatically , I want to achieve the effect like dragging the gridster widget . Currently i am assigning data-col and data-row attribute using Jquery but the gridster widget simply just overlapped with other gridster widgets and other widgets are not repositioning like they do while dragging the gridster widget .What should i do ? TIA.
has answer: http://stackoverflow.com/a/27438297
tagged with: gridster
upvote count: 5
has answer: http://stackoverflow.com/a/28301046
type: Question
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43305147

http://stackoverflow.com/q/27333336
tagged with: css
favorite count: 0
has title: How do I remove function added to clicked element, when I click outside of it?
upvote count: 2
type: UnansweredQuestion
tagged with: horizontal-scrolling
score: 2
has body: I have a funcition that adds mousewheel horizontal scrolling to selected div. I want to add this function to the element when I click on it, and remove it when I click outside of it. Not sure how to do it though, adding functionality works fine, but I can't figure out how to remove this function if I click outside the div (so even if mouse is within the div, horizontal scrolling won't take place). Here's my jquery: $mainDiv.on('click', function() { $(this).find($scrollableContainer).horizontal(); }); Function responsive for horizontal scroll (mousewheel plugin): $.fn.horizontal = function() { $(this).mousewheel(function(e, delta) { this.scrollLeft -= (delta * 40); e.preventDefault(); }); }; In other words, what I'm trying to achieve is: if user clicks on $mainDiv - add horizontal() function to $scrollableContainer, but if user then clicks outside $mainDiv, remove horizontal() function from $scrollableContainer. I did try clicking on the body but that didn't work: $('body').on('click', function() { $(this).find($scrollableContainer).off(); }); Anyone can help please?
type: Question
tagged with: function
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27333500
answer count: 1

http://stackoverflow.com/q/27396041
score: -7
accepted answer: http://stackoverflow.com/a/27396084
has title: Has something changed in Javascript implementations recently (or is it me)?
has body: It seems a solution for error message TypeError: Cannot read property XXX of undefined when using something like if (item.property) {....} is no longer valid. In fact, it seems even getting that error message is no longer possible because now you get ReferenceError: item is not defined I came across this because quite some time ago I had posted an accepted and 13 times upvoted answer to just such a question. I was not the only one giving the code that I gave as an answer, here is another one - same code, for the same type of problem. But those solutions now result in an error immediately! I DID test my code, and if it had not worked it would hardly have been upvoted and accepted, same for the other Q/A I link to. What is going on? I can't seem to provoke that error message (Cannot read property XXX of undefined) any more either, I tried by accessing a property of an undefined or a null variable. Have I gone mad, or has something else changed?
has answer: http://stackoverflow.com/a/27396321
has comment: http://stackoverflow.com/comment/43238436
upvote count: 1
has answer: http://stackoverflow.com/a/27396084
possible better answer: http://stackoverflow.com/a/27396321
favorite count: 0
has comment: http://stackoverflow.com/comment/43238394
linked to: http://stackoverflow.com/q/8004617
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/5113374
type: Question
downvote count: 8
answer count: 2
tagged with: javascript

http://stackoverflow.com/q/27315593
has comment: http://stackoverflow.com/comment/43091182
type: Question
has comment: http://stackoverflow.com/comment/43091213
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/4076321
has answer: http://stackoverflow.com/a/27315616
has answer: http://stackoverflow.com/a/27315991
has title: Javascript - Calculate age
score: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43091349
linked to: http://stackoverflow.com/q/4060004
has body: Im trying to calculate the date of a user but its not calculating the right way here is my code var cpr = cprValue.toString(); // cpr is = 0102907896 var dd = cpr.substr(0, 2); // 01 var mm = cpr.substr(2, 2); // 02 var yy = cpr.substr(4, 2); // 90 // Calculate if 90 is &gt; 50 if (yy &gt; 50) { var year = 1900; } else { var year = 2000; } var curDate = new Date(); var curYear = curDate.getUTCFullYear(), curMonth = curDate.getUTCMonth(), curDay = curDate.getUTCDate(); var myAge = curYear % year; if (curMonth &lt; mm &amp;&amp; curDay &lt; dd || curMonth &lt; mm &amp;&amp; curDay === dd || curMonth == mm &amp;&amp; `curDay &lt; dd) {` myAge -= 1; } console.log(myAge); My output is 13 but it should be 24 BUT if i change the dd,mm,yy and hardcode it like this var dd = 01; var mm = 02; var year = 1990; Then it works and output is 24 years. what im i doing wrong here? EDIT I have tried this instead, but i still get 114 if my year is 1990, but if i hardcore the date its fine :S var cpr = cprValue.toString(); //cpr is = 0102907896 var dd = cpr.substr(0, 2); // 01 var mm = cpr.substr(2, 2); // 02 var yy = cpr.substr(4, 2); // 90 //Calculate if 90 is &gt; 50 if (yy&gt;50) { var year = 1900; } else { var year = 2000; } var final = year + "-" + mm + "-" + dd; console.log("Final: "+ final); var alder = moment().diff(final, 'years'); console.log(alder);
tagged with: date

http://stackoverflow.com/comment/43202453
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27376286
has text: this is regarding timezone.

http://stackoverflow.com/q/27374975
tagged with: google-sheets
has body: i am developing an app for googlesheet. focus() doesn't work for me. i have tried using autofocus property also. that also doesn't work because of caja security. Here is my code: > code.gs code > ============= function onOpen() { ui.createMenu('MyApp').addItem('Show Sidebar', 'showSidebar').addToUi(); } function showSidebar() { ui.showSidebar(HtmlService.createTemplateFromFile('myapp.html').evaluate()); } >myapp.html code >=============
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/27393028
has comment: http://stackoverflow.com/comment/43220397
score: 0
answer count: 1
has title: jquery focus method not working with google spreadsheet when trying to focus on input in sidebar
linked to: http://stackoverflow.com/q/15387457
tagged with: google-apps-script

http://stackoverflow.com/comment/43294800
type: AnswerComment
comment on: http://stackoverflow.com/a/27413345
type: Comment
has text: The shorting to 600px is Ok, but back to the original size isn't :(
score: 0

http://stackoverflow.com/comment/43219988
score: 0
type: Comment
type: QuestionComment
has text: @webeno : Yes, I want to have it close instead
comment on: http://stackoverflow.com/q/27385691

http://stackoverflow.com/a/27372004
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27370104
has body: What you need to do is use the removeClass() function on the other elements where you are adding the class in your directive. As an example, if all other are anchor tags you could use the following code:- element.parent().find("a").removeClass("active-tab"); //add this to remove class from other elements element.addClass("active-tab"); //you already have this Check out this plnkr:- http://plnkr.co/edit/Re6EAL6XRsKHqqHPq5kw?p=preview As for your border problem, as skv said in his answer, you have set the border on both the element and hover styles. Just remove the border from hover and it'll work as you expect it to.
type: Answer
accepted answer of: http://stackoverflow.com/q/27370104
score: 0

http://stackoverflow.com/comment/43289495
type: Comment
has text: Maybe this can help? http://stackoverflow.com/questions/2572333/google-chrome-window-open-workaround
type: QuestionComment
comment on: http://stackoverflow.com/q/27423606
score: 0

http://stackoverflow.com/q/27380361
has comment: http://stackoverflow.com/comment/43209840
has comment: http://stackoverflow.com/comment/43209896
type: Question
upvote count: 0
has title: link outside doesn't wrap element when it's another link inside
has comment: http://stackoverflow.com/comment/43209846
tagged with: javascript
has answer: http://stackoverflow.com/a/27380660
favorite count: 0
has comment: http://stackoverflow.com/comment/43209989
has answer: http://stackoverflow.com/a/27380437
has answer: http://stackoverflow.com/a/27381058
tagged with: http://stackoverflow.com/tag/html
has body: I made a &lt;a&gt; link outside of &lt;div&gt; to wrap the whole element and gave it display: block property, but when I make inside the &lt;div&gt; another &lt;a&gt; link wrapping just some text inside the &lt;div&gt; the outer link becomes height: 0. Is it able to combine one link inside the other? I made jsfiddle sample to show what I want to achieve, so without the inner link the whole red rectangle is wrapped as a link, but when I add inner link, there remains no link wrapping rectangle. JSFiddle sample - http://jsfiddle.net/ynbc2d6f/2/
score: -2
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/27380655
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/comment/43173790
has text: I've edited the answer, check if it is what you are looking for.
comment on: http://stackoverflow.com/a/27360714
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27317658
has title: On mixing `this`, array notation and the module pattern in IE8
has comment: http://stackoverflow.com/comment/43098094
type: UnansweredQuestion
tagged with: handlebars.js
answer count: 0
has comment: http://stackoverflow.com/comment/43120350
type: Question
tagged with: internet-explorer-8
tagged with: javascript
tagged with: module-pattern
linked to: http://stackoverflow.com/q/2635018
score: 0
has body: My "single page app" is built with code in multiple files, using the "loose augmented module" pattern described by Ben Cherry. Here are two stripped back examples of modules. Some "data" in one module: var application = (function ( App ){ App.usesvar = { one: 'one', two: 'two', three: 'three' } return App; }( application || {} )); A "master" module that represents the app in total and initialises the application: // the 'master' module var application = (function ( App ){ console.log( 'Using `var` (should log "three"): ' + App.usesvar.three ); return App; }( application || {} )); These work as expected. The data is imported to the page first and the master module can access it and prints out the expected values. A part of my app can't be built this way. Instead some JavaScript is generated by a build step and it's output is like this: this["application"] = this["application"] || {}; this["application"]["usesthis"] = this["application"]["usesthis"] || {}; this["application"]["usesthis"]["one"] = 'uno'; this["application"]["usesthis"]["two"] = 'dos'; this["application"]["usesthis"]["three"] = 'tres'; Notice it's trying to use the same application namespace as the earlier code and as such, usesthis should be visible to the "master" module, just like usesvar from the first snippet. Adding console.log( 'Using `this` (should log "tres"): ' + App.usesthis.three ); to the "master" module logs what you would expect in Chrome, Safari Firefox (recent), and IE10. In IE8 (I've not tested IE9 yet), it doesn't. In IE8, the "master" module, doesn't have access to properties declared using the `this['namespace']['property'] notation. In the examples, please assume the files are loaded in the right order. The actual application also imports the files in the right order. If the example JavaScript is written into an HTML file's &lt;script&gt;&lt;/script&gt; tags, rather than imported, the problem still occurs. Disclosure: the this['foo']['bar'] notation is generated by the Handlebars.j…

http://stackoverflow.com/a/27362367
has comment: http://stackoverflow.com/comment/43179982
has comment: http://stackoverflow.com/comment/43182044
answers question: http://stackoverflow.com/q/27362224
score: 0
has comment: http://stackoverflow.com/comment/43179896
has comment: http://stackoverflow.com/comment/43182710
has comment: http://stackoverflow.com/comment/43183751
has comment: http://stackoverflow.com/comment/43179992
has comment: http://stackoverflow.com/comment/43180128
has body: A better option rather than requesting a url and trusting the users we can use ajax and then get a response back with our json function navigateTo(search) { resetExitedState(); var ajax = new XMLHttpRequest(); //any request headers //ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); ajax.onreadystatechange = function(){ if (ajax.readyState === 4) { if (ajax.status === 200) { //make a function to process the JSON processJSON(); } else { alert('There was a problem with the request.'); } } }; var formData = new FormData(); formData.append('q',search); httpRequest.open('POST', 'https://thesmartstore.org/search.php', true); httpRequest.send(formData); }
has comment: http://stackoverflow.com/comment/43180078
has comment: http://stackoverflow.com/comment/43177642
type: Answer

http://stackoverflow.com/a/27442410
score: 0
has body: Use jquery dialog. In your View add: &lt;div id="confirm-dialog"&gt;&lt;/div&gt; and change your function: $('table.dataList tbody a[linktype="Delete"]').click(function (e) { e.preventDefault(); $("#confirm-dialog").dialog({ title: "Are you sure you want to delete this Department?", autoOpen: false, modal: true, height: 'auto', close: function () { $(this).dialog("close"); } }); $("#confirm-dialog").dialog({ buttons: { "OK": function () { $.ajax({ type: 'POST', url: '/DepartmentController/DeleteConformed/', dataType: 'script', success: function () { alert('Are you sure you want to Delete this Department'); }, error: function (req, status, err) { alert(err); } }); }, "Cancel": function () { $(this).dialog("close"); } } }); });
type: Answer
answers question: http://stackoverflow.com/q/27442223
has comment: http://stackoverflow.com/comment/43325541
has comment: http://stackoverflow.com/comment/43325464

http://stackoverflow.com/comment/43393064
type: Comment
comment on: http://stackoverflow.com/a/27475155
has text: And pravin if i have 5 string so is it i have append each string and then in controller i have to use requestparm of all these string can i use here model ?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/111994527
type: AnswerComment
comment on: http://stackoverflow.com/a/55044587
type: Comment
score: 1
has text: But there are caveats: https://stackoverflow.com/questions/15339379/node-js-spawning-a-child-process-interactively-with-separate-stdout-and-stderr-s#comment24510829_16280786

http://stackoverflow.com/comment/43097796
has text: This is just perfect :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27319056
type: Comment

http://stackoverflow.com/comment/43219802
type: AnswerComment
type: Comment
has text: yes i have seen but in my app its not working..i also dont know why its not working..
comment on: http://stackoverflow.com/a/27381110
score: 0

http://stackoverflow.com/comment/43232791
type: Comment
type: QuestionComment
has text: can you share some more details about the problem... because it should work fine... can you log the value of `$(quantityId)` and see what is logged
comment on: http://stackoverflow.com/q/27392688
score: 1

http://stackoverflow.com/a/27432442
has comment: http://stackoverflow.com/comment/43309014
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/43309055
has body: It seems to be like this: function getEmails(start, max) { var threads = GmailApp.search("in:inbox", start, max); var myMsgs = " "; for (var i = 0; i < threads.length; i++) { myMsgs+= " "+ threads[i].getFirstMessageSubject() +" " } myMsgs += " " return myMsgs; } Get message(s) Get Groups 2 10 25 50 I add the parameter start because you might want to develop the scenario in which you show pagination.
answers question: http://stackoverflow.com/q/27432304
upvote count: 0
has comment: http://stackoverflow.com/comment/43308767
has comment: http://stackoverflow.com/comment/43308596
type: Answer

http://stackoverflow.com/q/27343640
tagged with: jasmine
has comment: http://stackoverflow.com/comment/43142680
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43155888
has comment: http://stackoverflow.com/comment/43143136
has comment: http://stackoverflow.com/comment/43142838
has answer: http://stackoverflow.com/a/44929840
tagged with: angular-templatecache
has comment: http://stackoverflow.com/comment/43143354
type: Question
has comment: http://stackoverflow.com/comment/43143143
has comment: http://stackoverflow.com/comment/43143005
has comment: http://stackoverflow.com/comment/43143698
tagged with: javascript
has comment: http://stackoverflow.com/comment/43142857
tagged with: karma-jasmine
score: 0
has title: Inject inline templates into $templateCache for Jasmine tests
answer count: 1
has body: If all of my templates are in my index.html, with each inside its own &lt;script type="text/ng-template" id="foo"&gt;...&lt;/script&gt; block, how can I get them into the $templatecache so that Jasmine knows they exist? Currently, Jasmine treats all of my templateUrl values as if they were all remote paths. I have looked through karma-ng-html2js-preprocessor, but it appears that this is for getting discrete template files into $templatecache, rather than script blocks. Here is a plunker showing how the inline templates are loaded.

http://stackoverflow.com/comment/93945510
type: Comment
has text: For anyone that stumble over this answer and wonder why it doesn't work, select2 change the name of the option from `formatSelection` to `templateSelection`.
score: 1
comment on: http://stackoverflow.com/a/27414367
type: AnswerComment

http://stackoverflow.com/comment/43120503
score: 0
type: Comment
type: QuestionComment
has text: Given the code means that the ranges are given. Resulting range is just (sum mimima(ranges)..sum maxima(ranges). What are you trying to ask here?
comment on: http://stackoverflow.com/q/27331107

http://stackoverflow.com/a/27362956
downvote count: 0
answers question: http://stackoverflow.com/q/27362884
type: Answer
score: 1
upvote count: 1
has body: Well just try: $('#content').html(Modules); Use the HTML DOM innerHTML Property to change elements content. Or just using javascript and getElementById property: document.getElementById("content").innerHTML=Modules;
has comment: http://stackoverflow.com/comment/43178351

http://stackoverflow.com/comment/43283182
comment on: http://stackoverflow.com/a/27400994
type: AnswerComment
has text: You must be right in some way. I just didnt get your Iceland example and when you started talking about rightclick in an I-Frame I just thought you where way of - but I do admit that there is some sort of truth to what you are saying. I havent been playing with the html5 filesystem API yet but it sure enough doesnt have to do anything with iframes and iceland :D - but it seems to be capable of doing file operations on your local system.
type: Comment
score: 1

http://stackoverflow.com/a/34321926
answers question: http://stackoverflow.com/q/27334365
has comment: http://stackoverflow.com/comment/99299432
has comment: http://stackoverflow.com/comment/134813198
has comment: http://stackoverflow.com/comment/120705117
downvote count: 0
score: 30
has body: EDIT (2021): This no longer works as /deep/ was removed a few years ago. Combining a few of the above approaches you can iterate over everything in use and spit out a unique list of custom (and registered) elements: function isRegistered(name) { return document.createElement(name).constructor.__proto__ !== window.HTMLElement; } var allElems = document.querySelectorAll('html /deep/ *'); var nodeNames = [].map.call(allElems, el =&gt; el.nodeName.toLowerCase()) .filter((value, index, self) =&gt; self.indexOf(value) === index) console.log('all elements', nodeNames); console.log('registered, custom elements', nodeNames.filter(isRegistered))
upvote count: 30
has comment: http://stackoverflow.com/comment/120154626
type: Answer

http://stackoverflow.com/a/38725219
score: -1
has body: I encountered the same issues on my firebase project and I solved that like this. Please take a look. var formRef = firebase.child('links').child(currentLink); formRef.orderByChild('createdAt').on('value', function (snap) { console.log(snapshot.val()); }); It will works. Best Regards.
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/27369731

http://stackoverflow.com/comment/43149746
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27343925
has text: I would advise against designing your system to include PHP files from other servers. I think that would expose you to many security and deployment issues. However, in the academic interest of solving the immediate issue, I would pass the including file's request url to the included script via the querystring: ex., include('{remote_url}?request_url=' . $_SERVER['REQUEST_URI']);

http://stackoverflow.com/comment/44885913
has text: It seems that this is a result of Polymer keeping track of which elements it registers. Given the lack of a native way to fetch a list of custom registered elements, it would actually be a good idea to keep track of them yourself while registering new elements. However, this doesn't necessariy solve the original problem here, as it's not clear from the question whether or not he registers the elements himself. There might be some library/framework included in his app that does the registering without keeping track.
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28259806
type: AnswerComment

http://stackoverflow.com/q/27385778
type: Question
accepted answer: http://stackoverflow.com/a/27385873
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43219887
score: -2
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/43219855
tagged with: javascript
has answer: http://stackoverflow.com/a/27385873
has comment: http://stackoverflow.com/comment/43219767
has body: HTML 5.0 4.0 JQuery behaving different in all cash.. Working fine when add JQuery in html page head tag it self but when I tried to add in Joomla custom html doesn't work at all.. When I tried at "jsfiddle" giving me span but with out width.. How do I add span with width.? Jquery should return something like this ""
type: AnsweredQuestion
upvote count: 0
tagged with: jquery
has title: doesn't add width to span
favorite count: 0

http://stackoverflow.com/comment/43114231
has text: According to this other stackoverflow post: http://stackoverflow.com/questions/7335780/how-to-post-a-django-form-with-ajax-jquery User: user931920, indicates that "django code can process the AJAX post the same way it processes other form submissions"
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27327369

http://stackoverflow.com/q/27345602
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27345999
has title: How to change all options of all select tags using JavaScript
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27345999
answer count: 1
score: 1
has body: I would like to make a list of select tag that they have two values, yes and no. I've created it(with a while statement in the php). now, I want to create a select tag with two values(yes and no) that it should change all select tags.ex: if I select yes option, all options must be yes. all yes no <?php $result = mysql_query("my query..."); while($row=mysql_fetch_object($result)){ echo " $row->title yes no "; } ?>
upvote count: 1
tagged with: php

http://stackoverflow.com/q/27418196
score: 3
downvote count: 0
has title: JS console showing wrong results
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/27418315
has comment: http://stackoverflow.com/comment/43279653
has comment: http://stackoverflow.com/comment/43279934
upvote count: 3
tagged with: revealing-module-pattern
answer count: 2
has comment: http://stackoverflow.com/comment/43279665
tagged with: firefox
has body: I get a strange behaviour with Firefox when modifying a variable and displaying it (live demo here): var MyModule = ( function() { var currentPosition = {x : 1, y : 2, z : 3}; function changePosition() { currentPosition.x = 17; }; return { changePosition : changePosition, currentPosition : currentPosition }; } )(); console.log(MyModule.currentPosition); // 17, 2, 3 instead of 1, 2, 3 !! MyModule.changePosition(); console.log(MyModule.currentPosition); // 17, 2, 3 Why did this happen ? (Why does current.Position give 17 before it was modified to 17?) More generally, how to get/set a variable in a Revealing Module Pattern? Screenshot with Firefox:
tagged with: javascript
type: UnansweredQuestion
tagged with: module-pattern
has answer: http://stackoverflow.com/a/27418307

http://stackoverflow.com/q/27343099
tagged with: safari
upvote count: 5
has title: Get continuous scroll events in iOS Chrome
has answer: http://stackoverflow.com/a/27343165
answer count: 1
downvote count: 0
tagged with: ios
tagged with: javascript
favorite count: 0
has body: In Safari Mobile on iOS &lt;8, all Javascript was paused while the user was scrolling. Since the release of iOS 8, this is no longer the case, as you can read here: http://developer.telerik.com/featured/scroll-event-change-ios-8-big-deal/ This is great news. Executing Javascript while scrolling (if done right), opens the possibility for many usability enhancements (like sticky menus) and effects (like parallax). Is there a way to get the same thing in Chrome Mobile on iOS? The same website states that the first mobile browser that supported live scroll events was Chrome on Android 4.0. If that's the case, why is it still disabled in the newest Chrome on iOS?
accepted answer: http://stackoverflow.com/a/27343165
type: AnsweredQuestion
score: 5
tagged with: google-chrome
type: Question

http://stackoverflow.com/a/28016538
answers question: http://stackoverflow.com/q/27326161
has body: I had the same problem; kind of. I had an editor in a tabcontainer and the first time I entered the tab the editor worked(loaded). I would go to a different tab and back again and it would fail (Unhandled exception at line 84, column 9 in). For my solution I turned off autoPostBack on the tabContainer. Back in the day you used to be programmer; now your a property jockey...it's all voodoo.
score: 0
type: Answer

http://stackoverflow.com/q/27380531
has comment: http://stackoverflow.com/comment/43212942
type: UnansweredQuestion
tagged with: node.js
score: 7
upvote count: 7
tagged with: middleware
has answer: http://stackoverflow.com/a/27382545
type: Question
has comment: http://stackoverflow.com/comment/43210722
tagged with: javascript
has body: is there a way to see if there is a function after the current middleware. ie router.get('/', function(req, res, next){ if(next){//always returns true } }); I have a function to fetch the information and depending on the route that information will either be displayed in a table or a form or it will be combined with other data. I wanted to have a function similar to function findAll(req, res, next){ db.findAll(function(err, docs){ if(next){ req.list = docs return next(); }else{ res.render('table', {list:docs}; } }); } that way I could use the same function in either router.get('/', findAll, handleData); or router.get('/', findAll); and in either case a response will be sent. is there a way i can define the stack for the router like express does in the next() handler example var layer = stack[idx++]; this catches the next function if it exists but I cannot access this scope from my function. is there a way i can define the layers myself. This seems like it could be very usefull in preventing redundant code
tagged with: express
answer count: 3
has answer: http://stackoverflow.com/a/70582509
downvote count: 0
has comment: http://stackoverflow.com/comment/43210895
has title: check if there is a next() function express
favorite count: 0
has answer: http://stackoverflow.com/a/61651545

http://stackoverflow.com/q/27342945
has title: Regex for matching HashTags in any language
downvote count: 0
has answer: http://stackoverflow.com/a/76705233
favorite count: 0
tagged with: multilingual
linked to: http://stackoverflow.com/q/21927479
tagged with: regex
possible better answer: http://stackoverflow.com/a/63420705
answer count: 4
linked to: http://stackoverflow.com/q/336210
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/72311686
has comment: http://stackoverflow.com/comment/43141494
tagged with: hashtag
score: 7
has comment: http://stackoverflow.com/comment/43142085
has body: I have a field in my application where users can enter a hashtag. I want to validate their entry and make sure they enter what would be a proper HashTag. It can be in any language and it should NOT precede with the # sign. I am writing in JavaScript. So the following are GOOD examples: Abcde45454_fgfgfg (good because: only letters, numbers and _) 2014_is-the-year (good because: only letters, numbers, _ and -) בר_רפאלי (good because: only letters and _) арбуз (good because: only letters) And the following are BAD examples: Dan Brown (Bad because has a space) OMG!!!!! (Bad because has !) בר רפ@לי (Bad because has @ and a space) We had a regex that matched only a-zA-Z0-9, we needed to add language support so we changed it to ignore white spaces and forgot to ignore special characters, so here I am. Some other StackOverflow examples I saw but didn't work for me: Other languges don't work Again, English only [edit] Added explanation why bad is bad and good is good I don't want a preceding # character, but if I would to add a # in the beginning, it should be a valid hashtag Basically I don't want to allow any special characters like !@#$%^&amp;*()=+./,[{]};:'"?>&lt;
has comment: http://stackoverflow.com/comment/43142008
has answer: http://stackoverflow.com/a/63420705
upvote count: 7
type: Question
has answer: http://stackoverflow.com/a/27343333
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27343333
has comment: http://stackoverflow.com/comment/43141680
has comment: http://stackoverflow.com/comment/43141773

http://stackoverflow.com/comment/43382585
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27474052
has text: It's not part of the specification of JavaScript; it's a web browser thing. It's not supposed to be anything but a valid language tag, but Firefox causes the string to reflect the same value as the "Accept-Language" HTTP header, and that can be a string like the one you're seeing.
type: Comment

http://stackoverflow.com/comment/43092086
score: 0
has text: If I use post, entire page gets refreshed. Here I am trying to refresh only grid after selecting the file.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27315456

http://stackoverflow.com/comment/43169817
comment on: http://stackoverflow.com/a/27322141
has text: RE350 if possible can u pls look now i have edited the question and its content. thanks in advance
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43242493
comment on: http://stackoverflow.com/q/27384026
has text: Dojo Drag and Drop - which node are you talking about ? Is it related to Dojo tree - Programatically selecting Dojo tree node ?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27449431
tagged with: javascript
tagged with: filter
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I am trying to add a filter to change the colour of something to a dark green, like you can add the style 'Tint' in Flash and then set alpha and rgb. I have tried adding a colour matrix filter and have managed to get a fluorescent green, but can't see how to make it a dark green. I don't understand colour matrixes very well so I'm not sure if it is even possible. I am using the pixi javascript library, but I think colour matrixes are a pretty standard thing. Any help would be greatly appreciated! This is the matrix which gets fluorescent green: 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0
tagged with: colormatrix
upvote count: 1
has answer: http://stackoverflow.com/a/27464695
score: 1
has title: Add color tint effect with colour matrix
type: Question
tagged with: flash

http://stackoverflow.com/comment/43338280
has text: @Todd I can not share that code. but, that does different operations and based on argument it do some task.
comment on: http://stackoverflow.com/q/27449724
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27458465
has title: Speeding-up Indexed Color images operations, pseudo-palette shifting and color cycling techniques in HTML5 canvas
has body: recently I've created this little experiment in Javascript (here the source code). It is a little attempt to simulate old video game engines inside a web page taking advantage of the HTML5 canvas object. So I've simulated indexed color images, pseudo-color palette and Palette Shifting and in future I will implement Color Cycling technique too. Due to the fact this application is strongly based upon pixels manipulation I need to work at low level: I started using the 2dcontext.getImageData() and 2dcontext.putImageData() functions. Unfortunately to simply render a 640x480 image using these functions causes the frame rate to dangerously fall down. I've tested an alternative method creating a series of 1x1 rectangles with 2dcontext.fillRect() but this seems to go much slower. I know that WebWorkers are not the solution: they only will help in multithreaded situations. I thought that maybe moving all calculation to GPU instead of using CPU expensive method like 2dcontext.getImageData() and 2dcontext.putImageData() could help. But what the best way to do it, considering I always need to access single pixels color information all the time if I want to implement Palette Shifting and Color Cycling techniques? Is WebGL a solution? Is it possible to create a custom shader program that can do what I need (link)? thank you very much for the support!
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
linked to: http://stackoverflow.com/q/19695658
answer count: 0
upvote count: 2
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/19695658
score: 2
tagged with: pixel
tagged with: webgl
type: Question
tagged with: canvas
linked to: http://stackoverflow.com/q/13221961
has comment: http://stackoverflow.com/comment/43358315
downvote count: 0
linked to: http://stackoverflow.com/q/21989387
tagged with: javascript
has comment: http://stackoverflow.com/comment/43433314

http://stackoverflow.com/q/27387886
has title: Models, naming, and this
type: Question
answer count: 2
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
has body: While running through the starter tutorial on EmberJS' site, a few things have me a little confused now. One thing to note immediately is that I decided to use the ember 1.9.0beta4 with handlebars 2.0.0 instead of 1.8.1 / 1.3.0 included in the starter pack. First the code included in the screencast: app.js App.Router.map(function() { this.resource('about'); this.resource('posts'); this.resource('post', {path: ':post_id'}) }); App.PostsRoute = Ember.Route.extend({ model: function() { return posts; } }); and index.html {{#each model}} {{#link-to 'post' this}} {{title}} by {{author.name}} {{/link-to}} {{/each}} This works exactly as expected and the requested post appears when clicked. However, because I'm using 1.9.0, the preceding code produces a deprecated warning for {{#each}}, telling me to use {{#each foo in bar}} instead. I understand why this appears and agree the verbosity helps show exactly what data is being looped through. So I change the line {{#each model}} to {{#each post in model}} and every bit of data disappears... I then try to change the code to: updated index.html {{#each post in model}} {{#link-to 'post' this}} {{post.title}} by {{post.author.name}} {{/link-to}} {{/each}} Great! The title and author's name once again appear for each post. But clicking either post gives me an undefined id. I change {{#link-to 'post' this}} to {{#link-to 'post' this.id}}. Same result. I change it to {{#link-to 'post' post.id}}. The id is now included but when I click the link I get this error: Error while processing route: post Assertion Failed: You used the dynamic segment post_id in your route post, but App.Post did not exist and you did not override your route's `model` hook. My questions are: What happens internally that forces the post. prefix if I simply include the post in code? To me I should be able to use either this or continue to not need any prefix. After adding post in to the each statement, what happens to this? Why does it no longer refer to the same…
has answer: http://stackoverflow.com/a/27392262
tagged with: ember.js
favorite count: 0
possible better answer: http://stackoverflow.com/a/27392262
tagged with: handlebars.js
has answer: http://stackoverflow.com/a/27392171
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27392171

http://stackoverflow.com/q/27464500
has comment: http://stackoverflow.com/comment/43365254
has answer: http://stackoverflow.com/a/27464611
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43365178
tagged with: var
has comment: http://stackoverflow.com/comment/43365345
has answer: http://stackoverflow.com/a/27464601
has comment: http://stackoverflow.com/comment/43365197
downvote count: 3
possible better answer: http://stackoverflow.com/a/27464611
type: Question
has body: Im trying to pass 3 variables to one main variable and then put it into text the part of the code that doesn't work is text: "+won+", does anyone know how to fix this part? little extra so you can understand what im doing ...all the vars will be displayed as text in a div called quote. var w = "W"; var o = "o"; var n = "n"; var won1 = w + o + n; (function() { var quotes = [ { text: "+won+", img: "https://i.sstatic.net/FqBE6.jpg?s=32&amp;g=1" }, { text: "+won+", img: "https://www.gravatar.com/avatar/ca3e484c121268e4c8302616b2395eb9?s=32&amp;d=identicon&amp;r=PG" } ]; var quote = quotes[Math.floor(Math.random() * quotes.length)]; document.getElementById("quote").innerHTML = '&lt;center&gt;' + '&lt;p&gt;' + quote.text + '&lt;/p&gt;' + '&lt;img src="' + quote.img + '"&gt;' + '&lt;/center&gt;'; })(); whats happening: what is happening is it isnt getting vars for example if i put +won1+ it displays the text "+won1+" instead of the variables which read "won" Many thanks for reading :)
has comment: http://stackoverflow.com/comment/43365276
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27464601
has title: Passing variables to text javascript?
answer count: 2
has comment: http://stackoverflow.com/comment/43365175
upvote count: 0
has comment: http://stackoverflow.com/comment/43365323
has comment: http://stackoverflow.com/comment/43365420
has comment: http://stackoverflow.com/comment/43365433
tagged with: variables
favorite count: 0
score: -3

http://stackoverflow.com/comment/43141577
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27342595
type: QuestionComment
has text: I can't find the comments on any page.

http://stackoverflow.com/a/27352279
has body: wrap the div in tag
answers question: http://stackoverflow.com/q/27352252
score: 0
type: Answer

http://stackoverflow.com/q/27442332
tagged with: javascript
has body: I'm following the book "Pro AngularJS" by Adam Freeman. But I'm stuck at listing 15-10. The code he provided doesn't work at all. The demo code is below. It's supposed to work in the following manner: when we click on the button to modify the prices, this list must update automatically. Would you please let me know how to fix his code? I've googled a lot but .... Products Change prices
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43324931
has comment: http://stackoverflow.com/comment/43324554
tagged with: angularjs
type: AnsweredQuestion
tagged with: watch
has title: Using $watch method in AngularJS
has answer: http://stackoverflow.com/a/27442845
type: Question
accepted answer: http://stackoverflow.com/a/27442845

http://stackoverflow.com/comment/43213116
type: AnswerComment
comment on: http://stackoverflow.com/a/27379562
type: Comment
score: 0
has text: Ok, how your "data" variable looks like, after calling all functions? Could you paste it?

http://stackoverflow.com/comment/43238060
has text: The problem may lie in the fact that [the reference](http://vsk.me/en/28/adding-an-autosave-plugin-to-tinymce-2) you used used tinymce-2, not tinymce-4.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27395803

http://stackoverflow.com/q/27463771
score: 6
type: Question
tagged with: object
upvote count: 6
has comment: http://stackoverflow.com/comment/43363793
has comment: http://stackoverflow.com/comment/43363867
has answer: http://stackoverflow.com/a/27463838
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27463838
has comment: http://stackoverflow.com/comment/43363982
answer count: 3
has answer: http://stackoverflow.com/a/27471597
linked to: http://stackoverflow.com/q/10705482
possible better answer: http://stackoverflow.com/a/77421959
tagged with: jquery
favorite count: 0
has title: Setting property value from other property value inside object
has body: Is there a way to set the value of a property within an object relative to another property within the same object? For example: var myObj = { prop1 = 10, prop2 = prop1 + 5 }; alert(myObj.prop2); //Alerts 15 Another example would be for when I create objects within an object aswell var mainObj = { obj1: {x: 100, y:100}, obj2: {x: obj1+10, y: obj1+10} }; alert(mainObj.obj2.x); //Alerts 110 I want certain properties to stay relative to other properties in the same object, so that when I change one property, it will affect the other property.
tagged with: properties
has comment: http://stackoverflow.com/comment/128047606
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4616202
downvote count: 0
has comment: http://stackoverflow.com/comment/43363942
has answer: http://stackoverflow.com/a/77421959

http://stackoverflow.com/a/27339943
answers question: http://stackoverflow.com/q/27339929
upvote count: 3
score: 3
has body: foo = new (require('./foo'))('some string') You should be just fine doing this instantiation on one line, you just need to make sure and actually new the object, and call the proper constructor method.
accepted answer of: http://stackoverflow.com/q/27339929
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43136349
has comment: http://stackoverflow.com/comment/43136289
type: Answer

http://stackoverflow.com/a/27436455
has body: It's because your 'item' is an index, not an 'object' as you want. you have to use the second parameter: $.each(data.itemList, function (index, item) { a.push("&lt;li&gt;" + item.title + "&lt;/li&gt;"); }); also, where is hasNextPage defined? is it defined? you might also shorten that to: if (!hasNextPage) return;
has comment: http://stackoverflow.com/comment/43313718
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27436274

http://stackoverflow.com/a/27464426
upvote count: 1
has body: If you want to know which one is faster, you can run your own benchmark tests. There should be almost no difference between the two, though. I tend to prefer the first structure because it is easier to understand, and it allows you to pass the object as a parameter if you ever need to. For example, I can write a function: function shiftWalkPoint(walkPoint, n) { walkPoint.x += n; walkPoint.y += n; } for (var i = 0; i &lt; walk.length; i++){ shiftWalkPoint(walk[i], 5); } However, with your second format, you cannot do that. You would have to pass the entire walk object as well as the index to any function that wants to use it, which is more awkward. You could also run into problems if something bad happens to your data and x.length != y.length.
downvote count: 0
answers question: http://stackoverflow.com/q/27464306
score: 1
type: Answer

http://stackoverflow.com/comment/110656899
comment on: http://stackoverflow.com/a/35653867
score: 0
type: AnswerComment
has text: It seems there is some change, because for FullCalendar 4.0, the format is maxTime='29:59:00'
type: Comment

http://stackoverflow.com/comment/43110572
has text: Your answer is already asked - Look here... http://stackoverflow.com/questions/8284960/clear-text-area
score: 0
comment on: http://stackoverflow.com/q/27325533
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43318032
type: QuestionComment
comment on: http://stackoverflow.com/q/27438313
has text: See my answer. Yes, it is possible.
score: 0
type: Comment

http://stackoverflow.com/comment/43239783
type: Comment
type: QuestionComment
has text: add the `crontab` user to the (for example) `adm` group as: `usermod -a -G adm crontab`, and assign the group to the folder `chown :adm /path`. add write permisstion for group: `chmod g+w /path` and retry: `sudo su -c '/usr/bin/node /path/main.js >> /path/cron.log' crontab`
comment on: http://stackoverflow.com/q/27396029
score: 0

http://stackoverflow.com/q/27350139
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27351168
linked to: http://stackoverflow.com/q/26331548
upvote count: 1
accepted answer: http://stackoverflow.com/a/27350209
downvote count: 1
has comment: http://stackoverflow.com/comment/43156028
type: Question
has comment: http://stackoverflow.com/comment/43155919
score: 0
answer count: 3
tagged with: regex-lookarounds
has body: I am trying to create a regex in JavaScript that matches the character b if it is not preceded or followed by the character a. Apparently, JavaScript regexes don't have negative lookbehind readily implemented, making the task difficult. I came up with the following one, but it does not work. "ddabdd".replace(new RegExp('(?:(?![a]b(?![a])))*b(?![a])', 'i'),"c"); is the best I could come up with. Here, the b should not match because it has a preceding it, but it matches. So some examples on what I want to achieve "ddbdd" matches the b "b" matches the b "ddb" matches the b "bdd" matches the b "ddabdd" or "ddbadd" does not match the b
tagged with: javascript
tagged with: negative-lookbehind
has comment: http://stackoverflow.com/comment/43156083
has answer: http://stackoverflow.com/a/27350209
favorite count: 0
has title: Javascript regexes - Lookbehind and lookahead at the same time
possible better answer: http://stackoverflow.com/a/27350877
has answer: http://stackoverflow.com/a/27350877
has comment: http://stackoverflow.com/comment/43156265
tagged with: regex

http://stackoverflow.com/q/27441009
has body: I'm trying to render github readme's using remarkable and angular. Everything related to parsing the markdown is working properly but unfortunately the product owner has some more wishes for the application. He wants to be able to put youtube video's and html forms in the readme. I'm currently using the Youtube-embed directive made by Brandly but unfortunately it does not render in our page. I am using a script which uses ng-bind-html in combination with $sce.trustAsHtml in order to parse html in the page. Normal HTML is picked up just fine (form tags and other stuff) but angular stuff (youtube directive as example) aren't. I also noticed that angular directives such as ng-click, ng-submit etc aren't working. Does anyone know how to make angular work in html which is bieing parsed within the angular application using ng-bind-html? Here is a code example on how the html is bieing parsed to the template: JS: case 'markdown': $scope.fileContent = $sce.trustAsHtml(remarkable.render(content)); break; HTML: &lt;pre class="fileContent"&gt;&lt;code ng-bind-html="fileContent"&gt;&lt;/code&gt;&lt;/pre&gt; i've added a Plunker example with the problem I am having, as you can see it never executes the ng-submit that I added in the form. ~ Archcry
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27480860
linked to: http://stackoverflow.com/q/27428308
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/43321813
upvote count: 3
has title: Render angular code within a ng-bind-html
type: Question
has comment: http://stackoverflow.com/comment/43321665
tagged with: ng-bind-html
answer count: 1
has comment: http://stackoverflow.com/comment/43322426
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27480860
has comment: http://stackoverflow.com/comment/43322276
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43249344
comment on: http://stackoverflow.com/a/27393432
type: AnswerComment
has text: `document.write` should never be used. -1.
score: 0
type: Comment

http://stackoverflow.com/q/27459102
has comment: http://stackoverflow.com/comment/43355107
type: Question
answer count: 2
tagged with: for-loop
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/43355119
score: 0
type: UnansweredQuestion
has body: In my program I have to compare array values to a variable, but it looks like my array is only comparing the last value to the variable. How should I proceed to compare all of them? Here is the code: for(var n=0; n&lt;arrayLength; n++) { console.log(occupiedArray[n][0]); if(occupiedArray[n][0] == clickedX &amp;&amp; occupiedArray[n][1] == clickedY ) { occupied = true; } else { occupied = false; } } And here is my array : var occupiedArray = [[4,0], [5,0], [6,0]]; When I use console.log it displays 4,5,6 just like I wanted, but it's only comparing the '6' value to my variable 'clickedX'. Any idea? Thanks
has title: Javascript : Comparing Arrays values to a variable
has answer: http://stackoverflow.com/a/27459214
tagged with: loops
has answer: http://stackoverflow.com/a/27459360

http://stackoverflow.com/comment/43195712
type: QuestionComment
has text: It's telling you that the result of `handlers = elem.events[e.type]` is that the value of *handlers* is undefined.
score: 0
comment on: http://stackoverflow.com/q/27372344
type: Comment

http://stackoverflow.com/comment/43201351
type: QuestionComment
type: Comment
has text: Oop, now I feel dumb. So, in the javascript dev console, it says "Uncaught SyntaxError: Unexpected token ." Assuming the "." on line 10, "Snap.load('ringing-phone.svg', function (phone)", both of the periods seem fine to me there, one denotes file format, the other a method declaration. Sorry about this, my background is more in the Java/C++ side of things, this is my first foray into web design.
score: 0
comment on: http://stackoverflow.com/q/27369795

forms
tags question: http://stackoverflow.com/q/27441405
tags question: http://stackoverflow.com/q/27439905
tags question: http://stackoverflow.com/q/27385005
tags question: http://stackoverflow.com/q/27348361
tags question: http://stackoverflow.com/q/27345092
tags question: http://stackoverflow.com/q/27407045
tags question: http://stackoverflow.com/q/27421105
tags question: http://stackoverflow.com/q/27459027
tags question: http://stackoverflow.com/q/27398074
tags question: http://stackoverflow.com/q/27338599
tags question: http://stackoverflow.com/q/27351574
tags question: http://stackoverflow.com/q/27320331
tags question: http://stackoverflow.com/q/27449273
tags question: http://stackoverflow.com/q/27469228
tags question: http://stackoverflow.com/q/27328528
tags question: http://stackoverflow.com/q/27428457
tags question: http://stackoverflow.com/q/27349825
type: Tag
tags question: http://stackoverflow.com/q/27391462
tags question: http://stackoverflow.com/q/27450120
tags question: http://stackoverflow.com/q/27428416
tags question: http://stackoverflow.com/q/27356802
tags question: http://stackoverflow.com/q/27383209
tags question: http://stackoverflow.com/q/27407896
tags question: http://stackoverflow.com/q/27447924
tags question: http://stackoverflow.com/q/27473706
tags question: http://stackoverflow.com/q/27419602
tags question: http://stackoverflow.com/q/27403315
tags question: http://stackoverflow.com/q/27431519
tags question: http://stackoverflow.com/q/27465552
tags question: http://stackoverflow.com/q/27462245
tags question: http://stackoverflow.com/q/27386588
tags question: http://stackoverflow.com/q/27469088
tags question: http://stackoverflow.com/q/27446737
tags question: http://stackoverflow.com/q/27360407
tags question: http://stackoverflow.com/q/27451518
tags question: http://stackoverflow.com/q/27325828
tags question: http://stackoverflow.com/q/27416595
tags question: http://stackoverflow.com/q/27362053
tags question: http://stackoverflow.com/q/27349259
tags question: http://stackoverflow.com/q/27340341
tags question: http://stackoverflow.com/q/27462247
tags question: http://stackoverflow.com/q/27316670
tags question: http://stackoverflow.com/q/27322382
tags question: http://stackoverflow.com/q/27368878
tags question: http://stackoverflow.com/q/27401714
tags question: http://stackoverflow.com/q/27383010
tags question: http://stackoverflow.com/q/27440459
tags question: http://stackoverflow.com/q/27381115
tags question: http://stackoverflow.com/q/27380096
tags question: http://stackoverflow.com/q/27463220
tags question: http://stackoverflow.com/q/27419646
tags question: http://stackoverflow.com/q/27424082
tags question: http://stackoverflow.com/q/27364911
tags question: http://stackoverflow.com/q/27348036
tags question: http://stackoverflow.com/q/27412775
tags question: http://stackoverflow.com/q/27319042
tags question: http://stackoverflow.com/q/27325439
tags question: http://stackoverflow.com/q/27377093
tags question: http://stackoverflow.com/q/27421205
tags question: http://stackoverflow.com/q/27422667
tags question: http://stackoverflow.com/q/27390872
tags question: http://stackoverflow.com/q/27367731
tags question: http://stackoverflow.com/q/27371243
tags question: http://stackoverflow.com/q/27365804
tag name: forms
tags question: http://stackoverflow.com/q/27334690
tags question: http://stackoverflow.com/q/27359276
tags question: http://stackoverflow.com/q/27455281
tags question: http://stackoverflow.com/q/27393336
tags question: http://stackoverflow.com/q/27381644
tags question: http://stackoverflow.com/q/27437727
tags question: http://stackoverflow.com/q/27432006
tags question: http://stackoverflow.com/q/27347008
tags question: http://stackoverflow.com/q/27338106
tags question: http://stackoverflow.com/q/27454557
tags question: http://stackoverflow.com/q/27335693
tags question: http://stackoverflow.com/q/27404838
tags question: http://stackoverflow.com/q/27331993
tags question: http://stackoverflow.com/q/27417436

http://stackoverflow.com/comment/43188481
type: QuestionComment
comment on: http://stackoverflow.com/q/27368213
has text: Have you looked at [``Math.round()``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round)? I think that may be what you're looking for.
score: 0
type: Comment

http://stackoverflow.com/comment/43193254
score: 0
has text: make a "fetch all comments" tool, and just run it every 5 seconds. it can grab new stuff only. then update each section if/as needed using the client's CPU instead of the servers. that way you drastically reduce the amount of work the server does, and you don't have to start all over.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27370032

http://stackoverflow.com/q/27451723
has comment: http://stackoverflow.com/comment/43342058
score: 0
answer count: 1
has title: ajax PHP MySQL query
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43342100
tagged with: php
has answer: http://stackoverflow.com/a/27451961
has comment: http://stackoverflow.com/comment/43341963
tagged with: mysql
type: Question
tagged with: javascript
has body: I need help with an ajax call, but I'm a newbie with ajax and I'm not sure as to how to do it. I have the following PHP code (phonecall.php): <?php $con = mysqli_connect('localhost','root','root','mydb'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"mydb"); $sql="SELECT * FROM incoming_calls"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { $callArray[] = array('phonenumber' => $row['phone_number'], 'id' => $row['phone_login_id']); print " "; print_r($callArray); print " " } mysqli_close($con); ?> I want to make a page update in real time automatically anytime something new is posted to the table. Here is my non-working page: Phone calls
tagged with: ajax

http://stackoverflow.com/comment/43318293
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27437727
has text: I think the down votes are because you need to improve and clarify your question. The code you posted is incomplete or has some problems with unmatched braces. Is the id for the publish button 'publish' or 'publish_api'? Why are you using an anchor tag for the publish button? Why aren't you using for the submit button?

http://stackoverflow.com/comment/43260585
comment on: http://stackoverflow.com/q/27405344
score: 0
type: Comment
type: QuestionComment
has text: the request is reaching the server

http://stackoverflow.com/comment/43263984
type: QuestionComment
has text: onbeforeunload and beforeunload don't work ? what have you else you tried ?
comment on: http://stackoverflow.com/q/27407967
type: Comment
score: 0

http://stackoverflow.com/comment/43359911
type: Comment
has text: If my answer helps you, plz do validate it as the correct one. Hope it helps.
comment on: http://stackoverflow.com/q/27456675
score: 0
type: QuestionComment

http://stackoverflow.com/q/27341498
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43138936
has comment: http://stackoverflow.com/comment/43138948
has comment: http://stackoverflow.com/comment/43138837
has answer: http://stackoverflow.com/a/50182425
score: 21
upvote count: 21
linked to: http://stackoverflow.com/q/2305069
type: Question
has title: How to prevent iframe affecting browser history
has comment: http://stackoverflow.com/comment/51526483
has comment: http://stackoverflow.com/comment/43138830
has comment: http://stackoverflow.com/comment/43139387
tagged with: javascript
has comment: http://stackoverflow.com/comment/43139232
has comment: http://stackoverflow.com/comment/43158447
has comment: http://stackoverflow.com/comment/138926471
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43138957
favorite count: 0
has body: I'm encountering a browser history issue when working on a web project. Theres an iframe in my page, which I would change its src value using Javascript. The whole thing works just fine except this change of src would affect the browser history. I do not want to push the browser history, when I change the iframe url. I'm expecting that the user would leave the whole base page and go to the previous location when clicking on the back button, rather than just going back on the changed iframe. What I've tried: remove the former iframe, and replace with a new one having the new src value use replaceWith() method from jQuery use iframe.contentWindow.location.replace() to replace the iframe location Both methods above behaved nothing different than just changing the src directly on my Safari browser. The back button is still affected. Haven't tested yet on other browsers, but I assume other webkit browsers would be the same.
linked to: http://stackoverflow.com/q/18951691

http://stackoverflow.com/q/27356273
tagged with: google-chrome
has answer: http://stackoverflow.com/a/27390215
has answer: http://stackoverflow.com/a/27408756
downvote count: 1
answer count: 7
has comment: http://stackoverflow.com/comment/43191547
has answer: http://stackoverflow.com/a/27356503
score: 110
has answer: http://stackoverflow.com/a/27356696
has comment: http://stackoverflow.com/comment/43165761
has comment: http://stackoverflow.com/comment/43173552
possible better answer: http://stackoverflow.com/a/27356503
has title: A very, very, very big div
has comment: http://stackoverflow.com/comment/43189862
type: AnsweredQuestion
upvote count: 111
has comment: http://stackoverflow.com/comment/43237586
has comment: http://stackoverflow.com/comment/43235694
has comment: http://stackoverflow.com/comment/43180980
has answer: http://stackoverflow.com/a/27356568
tagged with: javascript
has comment: http://stackoverflow.com/comment/43203317
favorite count: 0
has comment: http://stackoverflow.com/comment/43199094
type: Question
has answer: http://stackoverflow.com/a/27356607
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/14829022
tagged with: css
has answer: http://stackoverflow.com/a/27693326
has body: For a project of mine (see BigPictu.re or bigpicture.js GitHub project), I have to deal with potentially a very, very, very big container. I knew there was a risk of poor performance with the simple approach I use, but I did not expect it to be mostly present with ... Chrome only! If you test this small page (see code below), panning (click + drag) will be: Normal / smooth on Firefox Normal / smooth even on Internet Explorer Very slow (nearly crashing) on Chrome! Of course, I could add some code (in my project) to do that when you're zoomed in a lot, text with potentially very very big font-size would be hidden. But still, why does Firefox and Internet Explorer handle it correctly and not Chrome? Is there a way in JavaScript, HTML, or CSS to tell the browser not to try to render the whole page (which is 10000 pixels wide here) for every action? (only render the current viewport!) Small text Very big text
accepted answer: http://stackoverflow.com/a/27356568
has comment: http://stackoverflow.com/comment/43239745
has comment: http://stackoverflow.com/comment/43187098

http://stackoverflow.com/q/27441411
has body: I used this Plugin in Webforms. I have Content Place holder on my Form so I converted the Code into Below: <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon. Open Dialog </asp:Content> But it is not working. How do i solve this ?
answer count: 1
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/36805484
tagged with: asp.net
favorite count: 0
has title: Jquery Dialogbox in webforms
has comment: http://stackoverflow.com/comment/43322590
has comment: http://stackoverflow.com/comment/43337004
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43353874
has comment: http://stackoverflow.com/comment/43349139
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/43322407
tagged with: javascript
tagged with: webforms

http://stackoverflow.com/a/27317614
has comment: http://stackoverflow.com/comment/43095022
upvote count: 23
has body: This will work: function dateCompare(date1, date2){ return new Date(date2) > new Date(date1); } Returns true if date2 is later, false otherwise. Call with dateCompare('01/12/2014', '02/24/2014'). function dateCompare(date1, date2){ return new Date(date2) > new Date(date1); } // Demo (uses jQuery) $("tbody tr").each(function(){ $tr = $(this); $td = $tr.children('td'); date1 = $td.eq(0).text(); date2 = $td.eq(1).text(); result = dateCompare(date1,date2); $td.eq(2).text(result); if($td.eq(2).text() == $td.eq(3).text()) $tr.css('background','green'); else $tr.css('background','red'); }); table{ border-collapse: collapse; } td{ padding: 5px; border: 1px solid #000; } date1 date2 Result Expected 01/12/2014 02/24/2014 true 01/12/2013 02/24/2012 false 01/12/2014 02/24/2018 true 01/12/2015 02/24/2011 false I also made a fiddle, if you prefer. Further reading: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
answers question: http://stackoverflow.com/q/27317437
score: 22
has comment: http://stackoverflow.com/comment/43094952
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/43095356
has comment: http://stackoverflow.com/comment/43094916

http://stackoverflow.com/a/27334454
type: Answer
answers question: http://stackoverflow.com/q/27334231
downvote count: 0
has body: When you use the variable ticket(); you are doing one more function call than you would do otherwise. Basically the first buildTicket call by itself... buildTicket(parkRides, fastPassQueue, wantsRide); looks like... (function buildTicket(allRides, passRides, pick) { //... your code here that is returning a function }(parkRides, fastPassQueue, wantsRide); under the hood, and will return an anonymous function containing an alert that has not been invoked yet. Looking like... (function () { //... your code containing an alert }); and since it has not been bound to a variable it is just sitting there unable to be invoked because you have no references to it now. There are 2 ways around this problem: 1) you have already figured out which is assigning the anonymous function to a variable and invoking the function using the variable. 2) Is to immediately invoke the returned function by adding another set of parens. In the end they both do the same thing and will end up giving you the alert via (function () { //... your code containing an alert })(); Also, if all you want is to invoke the alert, you can forget about the extra function statement and the return call and just have function buildTicket(allRides, passRides, pick){ if(passRides[0]==pick){ var pass = passRides.shift(); alert(); }else { for(var i = 0; i&lt;allRides.length; i++){ if(allRides[i][0] == pick){ alert(); } } } }
score: 1
upvote count: 1

http://stackoverflow.com/q/27322316
has body: For example, there is a following piece of code: $scope.posts = Post.query({ user_id: $stateParams.user_id }) How does this construction work? When JS execute this line posts may be empty, but after some time server side will return some posts and my view will render a lot of posts. But how 'query' function may return value in future? I don't understand it, because AJAX call is asynchronous, and I don't send any value in any function. Please, describe this moment. Thanks. I know about promises and $q, but I don't understand how it works here.
answer count: 1
has title: How does ServiceNameQuery work in AngularJS
has answer: http://stackoverflow.com/a/27324215
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27324215
tagged with: angularjs
type: Question
score: 0

http://stackoverflow.com/q/27382604
upvote count: 2
has title: Why doesn't Ractive capture every key pressed in an input on MacOS in InDesign?
answer count: 1
tagged with: ractivejs
downvote count: 0
tagged with: adobe-indesign
has comment: http://stackoverflow.com/comment/43221118
favorite count: 0
accepted answer: http://stackoverflow.com/a/27398130
has comment: http://stackoverflow.com/comment/43253444
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27398130
has comment: http://stackoverflow.com/comment/43240764
type: Question
has comment: http://stackoverflow.com/comment/43214285
has body: I have an html input I have two-ways binded with Ractive: "password" here is a two-ways binded value in my Ractive. I then have a computed value using it: computed : { validPassword : function() { return $.trim(this.get("password")).length > 0; }, }, This computed value is used to (de)activate a button: <div {{#if validPassword}} connect {{else}} connect {{/if}} When I type something in the input, it seems the validPassword value is not recomputed by Ractive. But funnily, when I remove a character from the input, then the value is recomputed and the state of the button is updated. Have I missed something in Ractive configuration that could make it recompute the computed value at each key pressed (any observer?)? PS: This issue only happens on a Mac OS (10.9). This works fine on Windows.
has comment: http://stackoverflow.com/comment/43214504
tagged with: javascript

http://stackoverflow.com/a/27459508
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27459011
upvote count: 2
type: Answer
has body: Here's another solution. It works on a variable number of file inputs and doesn't require a lot of code nor markup. DEMO js $(function() { var $fileInputs = $(':file[name*="gallery_"]'), // could be whatever next = 0; $fileInputs.not(':first').hide(); $fileInputs.change(function (){ $fileInputs.eq(++next).show(); }); }); html

http://stackoverflow.com/comment/119770786
has text: if it is not programmatically accessible, then how is chrome able to access it? is there maybe access to using chrome debugger through an extension? I'm interested in doing this only locally
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/27404645
type: Comment

http://stackoverflow.com/a/36509214
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27412603
has body: Absolutely right about the rightAlign Property and good news is we can set it in the addGraph function as follows: chart.legend.rightAlign(false);
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/43314873
comment on: http://stackoverflow.com/a/27423876
score: 0
type: AnswerComment
type: Comment
has text: Thanks for your reply, i got solution for that. just add these code $('#successmsg').modal('toggle'); $('#successmsg').modal('open');

http://stackoverflow.com/a/27344482
has comment: http://stackoverflow.com/comment/43144732
downvote count: 0
answers question: http://stackoverflow.com/q/27344024
has body: Use matches: elt.matches('.blah *') See https://developer.mozilla.org/en-US/docs/Web/API/Element.matches. Check browser compatibility. See also Test if a selector matches a given element. Modernizr can help if the browser you are targeting requires a prefix: var ms = Modernizr.prefixed("matchesSelector", HTMLElement.prototype, elt) ms('.blah *') See http://modernizr.com/docs/#prefixeddom.
has comment: http://stackoverflow.com/comment/43145256
type: Answer
has comment: http://stackoverflow.com/comment/43144520
has comment: http://stackoverflow.com/comment/43156266
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43144446

http://stackoverflow.com/a/27422260
has comment: http://stackoverflow.com/comment/43287003
downvote count: 0
has comment: http://stackoverflow.com/comment/43287026
has body: I think you want this : $('.item').each(function(){ var element = $(this);//element contain the element selected for one iterate //here your code to check one div is visible });
upvote count: 2
has comment: http://stackoverflow.com/comment/43286900
has comment: http://stackoverflow.com/comment/43286968
answers question: http://stackoverflow.com/q/27422210
type: Answer
score: 2

http://stackoverflow.com/q/27391788
has title: How make a file a module in Node.js
tagged with: node.js
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43231223
answer count: 1
has answer: http://stackoverflow.com/a/27392476
has comment: http://stackoverflow.com/comment/43232669
has body: I want separate this code below in one file, and then call it in other file. This is possible with exports.module, right? var express = require('express'); var passport = require('passport'); var FacebookStrategy = require('passport-facebook').Strategy; var configAuth = require('./authentication'); var app = express(); function ensureAuthenticated(req, res, next) { console.log('isAuthenticated', req.isAuthenticated()); if (req.isAuthenticated()) { return next(); } res.send('not authenticated'); } passport.use(new FacebookStrategy({ clientID: configAuth.facebook.clientID, clientSecret: configAuth.facebook.clientSecret, callbackURL: configAuth.facebook.callbackURL }, function(accessToken, refreshToken, profile, done) { process.nextTick(function() { return done(null, profile); }); } )); app.get('/auth/facebook', passport.authenticate('facebook')); app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/' }), function(req, res) { res.redirect('facebook.com/celicoo'); }); I don't know how make this call. For example, i have this code in the authentication.js file, and i want call it in my routes.js file, how can i do that?
type: UnansweredQuestion

http://stackoverflow.com/comment/43265438
comment on: http://stackoverflow.com/a/27409908
score: 0
type: Comment
has text: well what about "1" + "11" = `111` "1" + "11" * 1 = `12`
type: AnswerComment

http://stackoverflow.com/q/27379774
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to add bar-header and form-input. But the username form doesn't appear, probably because it's overlapping with the bar-header. I've added class="has-header" in ion-content but this doesn't work and the username form and the bar-header still overlap eachother. Can anyone help me out? This is my code: bar-calm Username Password Username Password Footer `enter code here`
tagged with: css
has answer: http://stackoverflow.com/a/27381556
has title: Ionic bar-header overlap with ion-content
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43209210
score: 1
upvote count: 1
tagged with: ionic-framework
type: Question
has comment: http://stackoverflow.com/comment/43209933
downvote count: 0
accepted answer: http://stackoverflow.com/a/27381556
tagged with: javascript
answer count: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/43256170
type: Comment
comment on: http://stackoverflow.com/a/27405452
score: 0
type: AnswerComment
has text: I have tried like this too. Because I didn't know right solution.

http://stackoverflow.com/a/27406878
answers question: http://stackoverflow.com/q/27406763
downvote count: 0
type: Answer
has body: You can't have DOMElements with the same ID unfortunatly, that won't work for jQuery. You must use classes. $(".TEST").mouseenter(function(){ $(this).animate({"height":"200px"},200); }); $(".TEST").mouseleave(function(){ $(this).stop(); $(this).animate({"height":"100px"},200); }); Here is the solution: http://jsfiddle.net/ruxhighwind/veuc80he/6/
score: 1
upvote count: 1

http://stackoverflow.com/comment/43100518
type: Comment
has text: what if I have the variable defined as such: var x = parseFloat(self.y()); In that case x always becomes NaN whether x is undefined or NaN. Is there any way I can check if X is undefined ?
score: 0
comment on: http://stackoverflow.com/a/27320221
type: AnswerComment

http://stackoverflow.com/q/27326349
has answer: http://stackoverflow.com/a/27326581
tagged with: coffeescript
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43111836
tagged with: jquery
has body: My code currently looks like this.. $(row).children("td").eq(index).html() and this gives me: Click This From the console taking the above element var item = $(row).children("td").eq(index); item[0].innerText() // outputs "Click Me" but doesn't work in my app. But this doesn't work in the js in my Rails app and generates an error. How do I structure this code so it properly outputs 'Click Me' as Im wanting? For background I'm developing a Rails4 App and using coffeescript, but I don't think that's immediately relevant here. [Edit 1:] When I use this code: $(row).children("td").eq(index)[0].Text() Produces the error: 'Uncaught TypeError: undefined is not a function' It's a table sorter that I'm building. I'm addressing the fact that the sorter is working fine for table entries built from plain text, eg the City field, but that it's incorrectly sorting the Name field as it is processing the whole A field string. I need to be able to have it extract the text field within an address tag if there is one and otherwise just sort on the text field if the sort field is not within an address tag.
score: 0
accepted answer: http://stackoverflow.com/a/27326581
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/43111762
has title: jQuery to extract 'Click Me' from Click Me
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43111770

http://stackoverflow.com/q/27349988
has body: I'm trying to see if the Google Maps API supports the ability to see if: 1) There are 2 sets of coordinates, and basically draw a straight line route between them. This I can already do. 2) Check if a 3rd set of coordinates lies within x feet\meters of the drawn line. If the API does not support this, any ideas as to how to determine this? Thanks!
has title: Calculate if Coordinates exist on straight line between 2 other coordinates
duplicate of: http://stackoverflow.com/q/13887910
type: Question
has comment: http://stackoverflow.com/comment/43155225
answer count: 1
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has answer: http://stackoverflow.com/a/27350520
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/13887910

http://stackoverflow.com/q/27384982
upvote count: 5
tagged with: conventions
has body: In Node.js, should I use errors for flow control, or should I use them more like exceptions? I'm writing an authentication controller and some unit tests in Sails.js, and currently, my registration method checks to see if a user with the same username exists. If a user already exists with the username, my model method calls its callback arguments with a new Error object, like so: Model: exists: function (options, cb) { User.findOne({ where: { username: typeof options === 'Object' &amp;&amp; options.username ? options.username : options }, }).exec(function (err, user) { if (err) return cb(err); if (user) return cb(new Error("A user with that username already exists.")); cb(null, !!user); }); }, Controller: User.exists(req.body.user.username, function (err, exists) { if (err) { console.log("error: ", err); return res.status(409).json({ message: err }); } User.create(req.user).then(function (data) { res.status(201).json({ user: data }); }); }); Is this best practice? I'm not sure if node conventions favor errors for exceptional cases, or for flow control. I'm thinking I should rewrite this, but I want to know conventions before I do so. I think I've seen some examples written this way in Sails. Thanks!
tagged with: node.js
has answer: http://stackoverflow.com/a/27597956
accepted answer: http://stackoverflow.com/a/27597956
type: AnsweredQuestion
has title: NodeJS best practices: Errors for flow control?
has comment: http://stackoverflow.com/comment/43219359
downvote count: 0
type: Question
answer count: 2
score: 5
tagged with: sails.js
possible better answer: http://stackoverflow.com/a/27387277
tagged with: javascript
has answer: http://stackoverflow.com/a/27387277
favorite count: 0
has comment: http://stackoverflow.com/comment/43221298

http://stackoverflow.com/q/27349545
type: Question
has answer: http://stackoverflow.com/a/67760721
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43155989
tagged with: browser
has title: Javascript clipboard access
answer count: 1
has comment: http://stackoverflow.com/comment/43153749
favorite count: 0
tagged with: clipboard
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43153684
linked to: http://stackoverflow.com/q/4604057
has comment: http://stackoverflow.com/comment/43153720
has comment: http://stackoverflow.com/comment/43153653
has body: Is it possible for the browser to access clipboard when user presss CTRL + C? Using pure Javascript approach. The idea being, I have a web application that needs to be able to access the clipboard when user press the key combination.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43153781
linked to: http://stackoverflow.com/q/233719
has comment: http://stackoverflow.com/comment/43153840

http://stackoverflow.com/a/27463044
has comment: http://stackoverflow.com/comment/43362334
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27462937
has comment: http://stackoverflow.com/comment/43362385
downvote count: 0
has body: Make sure you are using parseInt before adding to previousValue. $("#zoomIn").on('click', function () { var previousValue = $(".table tr td").css("padding"); console.log(previousValue); previousValue = parseInt(previousValue) + 10; console.log(previousValue); $(".table tr td").css('padding', previousValue + 'px'); }); JSFIDDLE DEMO
has comment: http://stackoverflow.com/comment/43362383
type: Answer

http://stackoverflow.com/q/27432777
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43306842
type: Question
has body: I have the value of a textarea, how do I find out if the textarea starts off with a carriage return? I read some posts and understand that the CR is represented as \n? But how can I find out if the very first thing (character?) in the textarea is a return? If not, how can I add one to it? I'm picturing something like this: var content = $("#myTextArea").val(); if (content.charAt(0)=="\n"){ //do nothing } else { content.before("/n") } Apparently it's wrong but how should I do it?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43306853
has title: How to detect if the first character is a carriage return, and add carriage return
has answer: http://stackoverflow.com/a/27432872
answer count: 2
tagged with: carriage-return
score: 0
has comment: http://stackoverflow.com/comment/43306828
accepted answer: http://stackoverflow.com/a/27432872
possible better answer: http://stackoverflow.com/a/27432874
tagged with: textarea
has answer: http://stackoverflow.com/a/27432874

http://stackoverflow.com/comment/43307689
has text: setInterval is much faster? is this right? http://jsperf.com/animation123
type: Comment
comment on: http://stackoverflow.com/q/27423828
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43222161
type: AnswerComment
has text: Of course not. We just had very similar answers. It's not like this is rocket surgery here, there's a pretty clear solution.
type: Comment
comment on: http://stackoverflow.com/a/27386913
score: 1

http://stackoverflow.com/a/27394036
score: 0
has comment: http://stackoverflow.com/comment/43235658
type: Answer
has body: try this : function encryptData(data) { var encryptedData = null; if (typeof data == 'object') { encryptedData = {}; angular.forEach(data, function (value, key) { encryptedData[key] = encryptData(value); } } else if (data instanceof Array) { encryptedData = []; for (var i = 0; i &lt; data.length; i++) { encryptedData.push(encryptData(data[i])); } } else { encryptedData = base64.encode(data.toString()); } return encryptedData; }
answers question: http://stackoverflow.com/q/27393454

http://stackoverflow.com/comment/43317603
comment on: http://stackoverflow.com/a/27438529
type: Comment
has text: Javascript is single-threaded ([edge cases aside](http://stackoverflow.com/questions/2734025/is-javascript-guaranteed-to-be-single-threaded)). So, `.then` registers a handler and returns synchronously. Then your `console.log("Second Execution")` is called. You can't stop the execution (if you could, it would freeze your browser)
score: 0
type: AnswerComment

http://stackoverflow.com/q/27381448
linked to: http://stackoverflow.com/q/4326845
type: UnansweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43212385
score: 1
type: Question
has title: Toggle mobile navigation depending on scroll direction
has answer: http://stackoverflow.com/a/27382039
tagged with: javascript
has body: I have this navigation for mobile that i want to hide/show depending on which direction the viewport gets scrolled in. So if scrolling down i want it to hide, and scrolling up i want it to show. My current code looks like this. It just toggles on scroll top. Anyone? $(function() { $(window).on("scroll touchmove", function () { $('.mobile-nav').toggleClass('tiny', $(document).scrollTop() &gt; 0); }); });
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27415580
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43275280
score: -1
has comment: http://stackoverflow.com/comment/43276715
has body: I have 3 values that i define in localStorage in a javascript file. 2 are strings and 1 is an integer. Because i cannot pass parameters through the onLoad, I redirect to a new html page, assign each stored value to a variable and then call the function onload that uses the values. The strings work but the integer is always returned undefined. I thought that it was returned as a string and the function attempts to use it as an integer. So i tried parseInt() and JSON.parse() but it is still returned undefined. The integer is defined and used to load a page but it cannot be retrieved in a page. HTML Continue Javascript function WinLose() { var myDiv = document.getElementById("placeHere"); var myH1 = document.getElementById("winMessage"); var content = document.createTextNode(""); if (JSON.parse(localStorage.getItem("lives")) == 0) { content = document.createTextNode(" You have run out of lives GAME OVER "); myDiv.appendChild(content); } else if (JSON.parse(localStorage.getItem("challengeNumber")) == 3) { GotoChallenge(5); } else { switch (challLOCAL) { case 0: if (itmLOCAL == "shovel") { if (winLOCAL == true) { content = document.createTextNode("You dig around your legs until you are able to free them"); } else { content = document.createTextNode("You attempt to dig around your legs but the compressed sand is like concrate and will not release you."); } }
upvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43276310
favorite count: 0
has comment: http://stackoverflow.com/comment/43275885
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43275895
has title: localStorage integer defined elsewhere becomes undefined when called on new page
has comment: http://stackoverflow.com/comment/43275424
has answer: http://stackoverflow.com/a/27478214
type: UnansweredQuestion
tagged with: local-storage

photoswipe
tags question: http://stackoverflow.com/q/27427417
tags question: http://stackoverflow.com/q/27399863
type: Tag
tag name: photoswipe

http://stackoverflow.com/q/27344650
linked to: http://stackoverflow.com/q/26468608
tagged with: javascript
has body: I am trying to get my angular / node application to render dynamic Open graph meta content. I have been trying to follow this tutorial http://www.codewarmer.com/posts/1394433236-configuring-angularjs-nodejs-for-search-bots#! I am having some problems with phantom working with node, my issue seems to be similar to this Error message when using PhantomJS, breaks at random intervals except that my error does not happen at random intervals, it happens all the time. EDIT: Here is my code In my server.js I require a module i created based on the above tut called PhantomHandler.js and it is called like so. var crawler = require('./modules/PhantomHandler'); This is what PhantomHandler.js looks like: var phantom = require('phantom'); var models = require('../models'); mongoose = require('mongoose'); Snapshot = models.Snapshot; url = require('url'); var baseUrl = 'my url'; function crawlSite(idx, arr, page, callback) { crawlUrl(arr[idx], page, function(data) { data.links.forEach(function(link) { if (arr.indexOf(link) &lt; 0) arr.push(link); }); Snapshot.upsert(data); if (++idx === arr.length) callback(); else crawlSite(idx, arr, page, callback); }); } function startPhantom(cb) { phantom.create(function(ph) { phInstance = ph; ph.createPage(function(page) { phPage = page; cb(ph, page); }); }); } function crawlUrl(path, page, cb) { uri = url.resolve(baseUrl, path); page.open(uri, function(status) { var evaluateCb = function(result) { result.path = path; cb(result); }; //Timeout 2000ms seems pretty enough for majority ajax apps setTimeout(function() { if (status == 'success') page.evaluate(function() { var linkTags = document.querySelectorAll('a:not([rel="nofollow"])'); var links = []; for (var i = 0, ln; ln = linkTags[i]; i++) links.push(ln.getAttribute('href')); return { 'links': links, 'html': document.documentElement.outerHTML }; }, evaluateCb); }, 2000); }); } exports.crawlAll = function(callback) { startPhantom(function(ph, page) { crawlSite(0, ['/'], page, function() { ph.…
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/43328195
tagged with: facebook
tagged with: node.js
favorite count: 0
tagged with: facebook-opengraph
downvote count: 0
has comment: http://stackoverflow.com/comment/43328608
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27447393
accepted answer: http://stackoverflow.com/a/27447393
type: Question
has title: Facebook OG Meta with Angular and Node
answer count: 1

http://stackoverflow.com/q/27329400
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43117169
score: 0
has body: How to create div in javascript for each create elements(DOM) and retrieve their values? for (i = 1; i &lt;= 3; i++) { var input = document.createElement('input'); input.setAttribute("id", "x" + i); var div = document.createElement('div'); div.id = "div"+i;}
has title: create div for each createelement, javascript
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43117136
has answer: http://stackoverflow.com/a/27329438
has comment: http://stackoverflow.com/comment/43117308
has comment: http://stackoverflow.com/comment/43117190
answer count: 2
has answer: http://stackoverflow.com/a/33548853

http://stackoverflow.com/comment/43203242
has text: You probably should add this to your question or format this as an answer.
comment on: http://stackoverflow.com/a/27376670
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43173093
has text: @NiettheDarkAbsol This is one of the questions from some Javascript quiz, if I'm not mistaken.
comment on: http://stackoverflow.com/q/27360513
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27343883
tagged with: jquery
has answer: http://stackoverflow.com/a/27343952
has comment: http://stackoverflow.com/comment/43143235
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question
has comment: http://stackoverflow.com/comment/43143392
accepted answer: http://stackoverflow.com/a/27343952
has title: Iterate Through an HTML Array With a Dropdown Box
score: 0
answer count: 1
has body: I have an arrary of values in an html page: e.g. later on in the script tag I iterate through all the values using: $('input[id="ibillingCity[]"]').each(function() { $billingCity = $(this); This works as expected and no issues with this However when I try the same with a dropdown (select), it does not iterate through the values like a simple text field (i.e. like above) Alberta Brittish Columbia Shouldn't the $('input...').each(function) work the same as the first snippet (i.e. billingCity) as above?
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/a/27359357
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27359294
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27359294
has body: Use .animate() to animate and marginLeft to push the div to its right. $('#mob-home-btn').click(function() { $("#superDiv").animate({ marginLeft: '227' }); }) #mob-home-btn { width: 70px; height: 20px; text-align: center; line-height: 20px; background-color: magenta; } #superDiv { width: 100px; height: 100px; background-color: coral; } Click Me Using CSS transitions, you can do it this way without any jQuery. #mob-home-btn { width: 110px; height: 20px; text-align: center; line-height: 20px; background-color: magenta; } #superDiv { width: 100px; height: 100px; background-color: coral; transition: margin-left 1s; } #mob-home-btn:hover + #superDiv { margin-left: 227px; } Hover Over Me

http://stackoverflow.com/comment/43191380
has text: @Havvy Got a reference to that first one? As far as I can tell, it doesn't exist
type: AnswerComment
comment on: http://stackoverflow.com/a/27369832
type: Comment
score: 2

http://stackoverflow.com/comment/44675089
score: 0
type: Comment
type: QuestionComment
has text: @RobertE.McIntosh Oh wew, that's confusing! Did you contact the folk from CDNJS about that yet? In any case, could you suggest an edit to the question with a better link, that still reproduces the issue?
comment on: http://stackoverflow.com/q/27381272

http://stackoverflow.com/q/27394861
tagged with: preg-match
tagged with: php
tagged with: regex
answer count: 4
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/27394970
type: Question
has answer: http://stackoverflow.com/a/27394888
has comment: http://stackoverflow.com/comment/43236413
has body: I have this html string, that contains a very specific url that I need to grab. $string = 'Hi, this is a long string, some more text, and then suddenly, a script tag! more text here and then, the end...'; The catch is, I need the 123456 value, which happens to be inside this string; http://www.example.com/static/xxxxxx/js/SpecificScript.js Since that value can (and will) change in the string, it needs to be parsed dinamically. My first approach was to find all urls inside the string, but that can be too expensive if there are many urls. TL;DR: How can I get the xxxxxx value that is inside a url, which is inside a larger html string?
tagged with: javascript
has answer: http://stackoverflow.com/a/27394903
has comment: http://stackoverflow.com/comment/43236482
has title: Get querystring value from URL inside larger string with PHP
possible better answer: http://stackoverflow.com/a/27394888
accepted answer: http://stackoverflow.com/a/27394970
has comment: http://stackoverflow.com/comment/43236529
has answer: http://stackoverflow.com/a/27394992

http://stackoverflow.com/q/27374937
tagged with: node.js
tagged with: mysql
upvote count: 1
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: gruntjs
has title: Adding AngularJS to existing node-express-mysql app
has body: I am new to AngularJS and would like to install it on an existing Node-Express-MySQL-Passport-EJS based app. Where should I start? Do I have to install Grunt and Bower first? I'm aware of the Mean.js stack but I don't use Mongo, my database is relational.
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/27375743

http://stackoverflow.com/q/27374481
has comment: http://stackoverflow.com/comment/43200424
has comment: http://stackoverflow.com/comment/43200615
favorite count: 0
has comment: http://stackoverflow.com/comment/43200267
has comment: http://stackoverflow.com/comment/43201294
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43200222
type: Question
has body: I need to validate the floor fields that mention below. &lt;form id="test_form" &gt; &lt;input name="floor[abc]" type="text" class="input_txt_l " value="" /&gt; &lt;input name="floor[cde]" type="text" class="input_txt_l " value="" /&gt; &lt;/form&gt; I tried with jquery validator plug-in. jQuery("#test_form").validate({ rules: { 'floor[]':{ required:true }}, messages: { 'floor[]':{ required:"floor is required." } } }); In here validation is not working. but if the floor has no index , It works well. If someone have idea to fix this issue please help me.
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/10843399
has comment: http://stackoverflow.com/comment/43199570
has answer: http://stackoverflow.com/a/27375216
accepted answer: http://stackoverflow.com/a/27375216
has title: Jquery Validation validate form-array with index
duplicate of: http://stackoverflow.com/q/10843399
upvote count: 1
tagged with: validation
answer count: 1

http://stackoverflow.com/q/27358784
has body: I want to style my progress bar using with percentages but following ng documentation I can't seem to grasp it. It should be 20% with, but it's 100% (default). Fiddle: http://jsfiddle.net/u6xp8csh/ Here is what I have tried HTML {{ progress }} JS function ProgressBarController($scope) { $scope.progress = 20; } CSS .progress-bar-container { width: 300px; height: 100px; box-sizing: border-box; border: 1px solid black; } .progress-bar { height: 100px; background-color: green; }
has answer: http://stackoverflow.com/a/27358840
possible better answer: http://stackoverflow.com/a/27358889
favorite count: 0
tagged with: angularjs
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27358890
downvote count: 2
has answer: http://stackoverflow.com/a/27358889
type: Question
has title: How to style element width % using ng-style
has answer: http://stackoverflow.com/a/27358890
has answer: http://stackoverflow.com/a/59704256
tagged with: javascript
upvote count: 11
score: 9

http://stackoverflow.com/comment/43263132
has text: Found it in the documentation...about 3/4 of the way down the API developer guide. They reference it several times before this, but explain it a bit towards the end of the document.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27407709

http://stackoverflow.com/a/27373193
has body: After fixing ids of relevant items, this code calculates result $("#as").on('change', function(event) { var as = $(event.target).val(); var txt1 = 0; var txt2 = 0; if ($('#txt1').val()) txt1 = $('#txt1').val(); if ($('#txt2').val()) txt2 = $('#txt2').val(); var d = 0; if ($('#cbx3').is(":checked")) { d = parseFloat($("#cbx3").val(), 10); } var a = parseFloat(as, 10); var b = parseFloat(txt1, 10); var c = parseFloat(txt2, 10); var total = parseFloat(a, 10) + parseFloat(b, 10) + parseFloat(c, 10) + d; $('#gt').val(total.toFixed(2)); }); 10 20 30
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/27372774
answers question: http://stackoverflow.com/q/27372774
type: Answer

http://stackoverflow.com/q/27430689
has comment: http://stackoverflow.com/comment/43307230
accepted answer: http://stackoverflow.com/a/27440807
has comment: http://stackoverflow.com/comment/43305424
has comment: http://stackoverflow.com/comment/43304662
has comment: http://stackoverflow.com/comment/43302825
answer count: 1
tagged with: email
downvote count: 0
has comment: http://stackoverflow.com/comment/43312309
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/43309149
has comment: http://stackoverflow.com/comment/43302999
tagged with: momentjs
score: 2
type: AnsweredQuestion
has body: I need to send email reminders to people in the future. I have implemented MomentJS and I can get dates I'd need my email to send, I just couldn't find anything in meteor docs for Email.send(options) to have anything there. Is there a different package you can recommend? Here is some of my code as per @richsilv 's advice createTransfer.js (client) Template.createTransfer.events({ 'submit form': function (event, template) { event.preventDefault(); Transfers.insert(transfer, function (error, id) { if (error) { showError(error); } else { Session.set('files'); showAlert('Transfers sent!'); transfer._id = id; Meteor.call('sendEmail', transfer); scheduleEmail(transfer); // send reminder email Router.go('viewTransfer', {_id: id}); } }); // scheduleEmail(transfer); console.log(transfer); function scheduleEmail(transfer) { if (transfer.invoice.due == "7 Days"){ console.log('its due in 7 days'); if (moment(transfer.date).add(7, 'days').calendar() == moment(new Date()).format("MM/DD/YYYY")) { Meteor.call('sendMail',transfer); } } else if (transfer.invoice.due == "14 Days") { if (moment(transfer.date).add(14, 'days').calendar() == moment(new Date()).format("MM/DD/YYYY")) { Meteor.call('sendMail',transfer); } } else if (transfer.invoice.due == "30 Days") { if (moment(transfer.date).add(30, 'days').calendar() == moment(new Date()).format("MM/DD/YYYY")) { Meteor.call('sendMail',transfer); } } else if (transfer.invoice.due == "90 Days") { if (moment(transfer.date).add(90, 'days').calendar() == moment(new Date()).format("MM/DD/YYYY")) { Meteor.call('sendMail',transfer); } } else { console.log('need to initiate cron!'); var thisId = FutureEmails.insert(transfer); console.log('inserted into db'); Meteor.call('addCronMail',thisId, transfer); } } methods.js (lib) Meteor.methods({ sendMail: function(transfer) { check([transfer.senderEmail, transfer.recipientEmail, transfer.message, // transfer.invoice.total ], [String]); // Let other method calls from the same client start running, // wi…
upvote count: 2
has title: How to get Email.send to send emails in the future (7 days, 14 days from now, etc)
type: Question
has answer: http://stackoverflow.com/a/27440807
tagged with: javascript
has comment: http://stackoverflow.com/comment/43306271

http://stackoverflow.com/comment/43239203
score: 0
type: AnswerComment
type: Comment
has text: Thanks for help, upvoted it; but @Avinash Raj's solution seems me the easiest!
comment on: http://stackoverflow.com/a/27396431

http://stackoverflow.com/comment/43406815
comment on: http://stackoverflow.com/a/27481539
score: 0
type: Comment
has text: Thanks for sharing this. Please tell me if this is good idea to call multiple drupal_add_js in one PHP file.
type: AnswerComment

http://stackoverflow.com/comment/43286287
comment on: http://stackoverflow.com/q/27417516
type: Comment
type: QuestionComment
score: 0
has text: can u make this code happen..........??

http://stackoverflow.com/q/27395893
duplicate of: http://stackoverflow.com/q/11922383
type: Question
upvote count: 0
has body: How can access the following JSON object in JavaScript: { "data": { "1": { "id": "1", "name": "ZAIN", "cards": { "12": { "id": "12", "name": "Zain 5000", "count": "4", "value": "Z5", "price": "5000", "barcode": "654123987456", "position": "0", "days": "15", "howtouse": "*101# Zain Recharge Code # and OK", "background": null }, "13": {}, "14": {}, "24": {}, "25": {}, "26": {} } }, "2": {}, "3": {}, "4": {} } }
answer count: 1
tagged with: javascript
score: -3
has answer: http://stackoverflow.com/a/27395949
favorite count: 0
type: UnansweredQuestion
has title: How To Access JSON Object In JavaScript
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
linked to: http://stackoverflow.com/q/4935632

http://stackoverflow.com/q/27368951
type: AnsweredQuestion
upvote count: 2
tagged with: garbage-collection
has title: Are Stores created in the initComponent function memory leaks once the component is destroyed or will these stores be garbage collected?
has answer: http://stackoverflow.com/a/27374842
type: Question
has body: This is a question that surged from this other one: Best practice to have the same view and store multiple times in ExtJS 4 So in a scenario where stores are created in the initComponent function of a grid. Should I override onDestroy of the grid to also destroy the store ? Or these stores would be garbage collected because simply there are no references to them?
tagged with: javascript
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/27374842
favorite count: 0
tagged with: extjs
linked to: http://stackoverflow.com/q/27333787
tagged with: extjs4
tagged with: memory-leaks
score: 2

href
tags question: http://stackoverflow.com/q/27419509
tag name: href
type: Tag
tags question: http://stackoverflow.com/q/27458776
tags question: http://stackoverflow.com/q/27377013

http://stackoverflow.com/q/27366848
upvote count: 1
has comment: http://stackoverflow.com/comment/43185941
has comment: http://stackoverflow.com/comment/43185943
linked to: http://stackoverflow.com/q/22348705
favorite count: 0
has body: I see that a lot of people are using this module for using Node along with a mysql database: node-mysql In everything I read people are storing their passwording and usernames in plain text in the js file. Javascript files can be read pretty easily, so isn't this a terrible thing? Here is the connection code in the docs: var connection = mysql.createConnection({ host : 'localhost', user : 'me', password : 'secret' }); Am I missing a piece of the puzzle that disallows people from viewing your JS file on the server in plain text, password fully available?
has answer: http://stackoverflow.com/a/27366930
type: UnansweredQuestion
tagged with: node-mysql
tagged with: node.js
has title: How do I store my node mysql password NOT in plain text?
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/55389217
has comment: http://stackoverflow.com/comment/43186943
tagged with: mysql
has answer: http://stackoverflow.com/a/27367202
type: Question
has comment: http://stackoverflow.com/comment/55181523
tagged with: javascript
has comment: http://stackoverflow.com/comment/43185993
answer count: 2

http://stackoverflow.com/comment/43187259
comment on: http://stackoverflow.com/q/27367668
has text: I don't know what to do other than a parents recursion check...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27466969
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27466982
type: Question
has body: Using javascript (preferably not jquery) I'm trying to change the line: &lt;input type="number" name="price" required="" id="id_price"&gt; into &lt;input type="number" name="price" required="" id="id_price" step="any"&gt; I know the solution's got to be easy but I just can't crack it. Help would be much appreciated!!
answer count: 1
upvote count: 14
accepted answer: http://stackoverflow.com/a/27466982
tagged with: dom
has title: How to add attribute to HTML element using javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/43369725
score: 14
type: AnsweredQuestion

youtube
tags question: http://stackoverflow.com/q/27331579
tags question: http://stackoverflow.com/q/27388173
tags question: http://stackoverflow.com/q/27338520
type: Tag
tag name: youtube
tags question: http://stackoverflow.com/q/27443967
tags question: http://stackoverflow.com/q/27371268
tags question: http://stackoverflow.com/q/27441832
tags question: http://stackoverflow.com/q/27442471

http://stackoverflow.com/q/27352718
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: body onload not working in firefox after clicking back button of browser?
has answer: http://stackoverflow.com/a/27352843
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43159136
type: Question
has body: This is my first JSP page: JSP Page This is my second JSP page: JSP Page Hello World When I submit form on first page and goes to second page.After clicking the back button of browser the body onload method works in Chrome and IE but not in firefox.Is there any way so that method works even after clicking the back button of firefox.
linked to: http://stackoverflow.com/q/158319

http://stackoverflow.com/q/27368476
has body: I'm sure the answer to this one is quite simple but I couldn't figure it out... Here is my code in Cloud Code: Parse.Cloud.define("acceptFriendRequest", function(request, response) { Parse.Cloud.useMasterKey(); var query = new Parse.Query("_User"); var userFrom = new Parse.User(); userFrom = query.get(request.params.userFrom); console.log(userFrom); var userTo = new String(); userTo = request.params.userTo; userFrom.addUnique("friend", userTo); user.save().then(function (user) { response.success(); }, function (error) { console.log(error); response.error(error); }); response.success(); }); and here is my code in iOS: [PFCloud callFunctionInBackground:@"acceptFriendRequest" withParameters:@{@"userFrom":userFrom.objectId, @"userTo":[PFUser currentUser].objectId} block:^(id object, NSError *error) { if (error) { NSLog(@"Error: %@ %@", error, [error userInfo]); } }]; but I'm getting the error: error = "TypeError: Object [object Object] has no method 'addUnique'\n at main.js:33:12"; I also tried just the plain userFrom.add() method but it came with the same error! Can anyone help?
accepted answer: http://stackoverflow.com/a/27369685
tagged with: objective-c
type: AnsweredQuestion
has title: error = "TypeError: Object [object Object] has no method 'addUnique'\n at main.js:33:12"; Cloud code parse.com
tagged with: parse-platform
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27370145
type: Question
possible better answer: http://stackoverflow.com/a/27370145
has comment: http://stackoverflow.com/comment/43190770
has answer: http://stackoverflow.com/a/27369685
score: 0
answer count: 2
tagged with: ios
tagged with: javascript
favorite count: 0
tagged with: parse-cloud-code

http://stackoverflow.com/comment/43162350
score: 0
type: Comment
has text: Thanks. It was so easy, and I was messing with the JS the whole time. :-D
comment on: http://stackoverflow.com/a/27349518
type: AnswerComment

http://stackoverflow.com/comment/43320133
comment on: http://stackoverflow.com/a/27439244
type: AnswerComment
has text: My main goal is to pass the num value into the setServo function.
score: 0
type: Comment

http://stackoverflow.com/comment/43207976
type: AnswerComment
type: Comment
has text: Hi @rmuller, still not working, but thanks for the try.
comment on: http://stackoverflow.com/a/27378230
score: 0

http://stackoverflow.com/q/27456181
has comment: http://stackoverflow.com/comment/43364951
has comment: http://stackoverflow.com/comment/44350808
tagged with: mongodb
has body: I have a Mongo database. I want to create a scripted HTML browser for that data - basically a table of data with a search filter, and sort by column capabilities. I want to build the native Mongo query client side, and just have the server side pretty much straight up execute those (arbitrary) queries. Is that done? Is that bad practice? I will still implement limits and authentication of course.
type: Question
has title: Javascript to Mongo query passthru. Secure? Bad practice?
has answer: http://stackoverflow.com/a/27979574
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43417253
has comment: http://stackoverflow.com/comment/43369286
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/43254771
type: AnswerComment
comment on: http://stackoverflow.com/a/27391740
type: Comment
has text: @Tomalak I'm not criticizing you, but the "big idea": I would use this on very rare cases, when I need very fast reponse times. Only in this case. In all other cases, I'd go for LAMP solution.
score: 0

http://stackoverflow.com/comment/43198719
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27372964
has text: I dont know if you get my question clearly. But Same as JSON API plugin, I am able to get post via Javascript HTTP request. And I need a way to do the same using Javascript to access videos from a wordpress site
score: 0

http://stackoverflow.com/comment/43422465
type: QuestionComment
comment on: http://stackoverflow.com/q/27454211
has text: Could you give a concrete example of what your extension does? I tried to pinpoint your problem by asking for clarifications, but somehow your answers don't help with narrowing down your original question to a situation with a practical solution.
score: 0
type: Comment

http://stackoverflow.com/comment/43383089
has text: The question is very broad and it will probably be closed. But for your information some engines (e.g. Chakra) still compile Javascript to Bytecode and then compile the bytecode to machine code, and still keep up with the competition.
score: 0
comment on: http://stackoverflow.com/q/27474367
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27344366
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43157832
has comment: http://stackoverflow.com/comment/43159428
has body: Quick dirty one line style XD var str = "Discount 50GB + 1,000GB + Kit"; str.replace(/[^\+\d]/g,'').split('+').reduce(function(a, b) { return (+a) + (+b) }) Explanation: trim all characters that isn't digit or plus sign (+) split the trimmed string with plus sign (+), thus we get array of number-like strings (and empty string) in reduce method, convert number-like string to real number and sum up, whereas +"" becomes number 0. EDIT: this is a liitle different from previous one. var str = "Discount 50GB + 1,000GB + Kit + 60GB 80GB 10Gb"; str.replace(/[^\d\s]/g,'').split(/\s+/).reduce(function(a, b) { return (+a) + (+b) }) Explanation: trim all characters that isn't digit or white space (word separater) split the trimmed string with white space gaps (one or more continuous white spaces), thus we get array of number-like strings (and perhaps empty string) in reduce method, convert number-like string to real number and sum up, whereas +"" becomes number 0. To be more careful and guaranteed, your chosen answer is also good.
answers question: http://stackoverflow.com/q/27344134
has comment: http://stackoverflow.com/comment/43157639
has comment: http://stackoverflow.com/comment/43158099
has comment: http://stackoverflow.com/comment/43157732
has comment: http://stackoverflow.com/comment/43158240
downvote count: 0

http://stackoverflow.com/a/27394391
accepted answer of: http://stackoverflow.com/q/27394308
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43236607
type: Answer
answers question: http://stackoverflow.com/q/27394308
has body: Document denotes the whole document width : (#)line denotes the width of the #line div : $( document ).on( "mousemove", function( event ) { $( "#line" ).text( "pageX: " + event.pageX ); }); $("#line").on( "mousemove", function( event ) { $("#blue").css("width", event.pageX); });

http://stackoverflow.com/comment/43190701
has text: I'm not sure why your code isn't working, but I cleaned up the first part for you since it looked so long and tedious http://jsfiddle.net/p80xyptL/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27369189
score: 1

http://stackoverflow.com/a/27418959
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27418841
type: Answer
answers question: http://stackoverflow.com/q/27418841
has body: Services. Controller is not the best fit to locate this type of logic, everything that is not DOM manipulation and logic should be encapsulated into services and then this dilema is solved. Lets say you have 2 controller and a function called validate: Service: angular('mymodule').factory('validateService', function() { var service = { validate: function() { //validation logic } } return service; }); Ctrl 1: angular('mymodule').controller('MyCtrl1',['$scope', 'validateService', function($scope, validateService) { $scope.validate = function() { validateService.validate(); } }]); Ctrl 2: angular('mymodule').controller('MyCtrl2',['$scope', 'validateService', function($scope, validateService) { $scope.validate = function() { validateService.validate(); } }]);
upvote count: 1
has comment: http://stackoverflow.com/comment/43281662

http://stackoverflow.com/comment/43292942
type: QuestionComment
comment on: http://stackoverflow.com/q/27424108
score: 2
has text: Don't delete your question like that -.-
type: Comment

http://stackoverflow.com/comment/43236830
has text: i'm referring on update, of course on selected row, then `num_rows` respectively
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27394425
type: Comment

http://stackoverflow.com/q/27364000
favorite count: 0
has body: I need to write a JavaScript module that rotates banner images displayed in a SharePoint web part. I would like to rely on SharePoint APIs as little as possible, and keep as much as possible self contained in the JavaScript module that drives the web part. I would like to keep track of the last time my code advanced to the next image in a list, and what that image was. The list will itself will be persisted in SharePoint and available through the REST API. So, in the modern browser JavaScript runtime environment, is there any means of locally persisting the small record I describe above?
has title: Persistence in a JavaScript module
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27364095
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43181740
accepted answer: http://stackoverflow.com/a/27364095
type: Question
tagged with: browser
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43179918
answer count: 1
tagged with: client-side

http://stackoverflow.com/q/27334757
tagged with: charts
tagged with: chart.js
type: Question
downvote count: 0
has title: Chart.js responsive option - Chart not filling container
tagged with: javascript
tagged with: jquery
answer count: 1
has answer: http://stackoverflow.com/a/27334921
favorite count: 0
upvote count: 11
accepted answer: http://stackoverflow.com/a/27334921
score: 11
has body: Check out this fiddle. What am I doing wrong? Isn't the responsive option supposed to force the chart to fill it's container? &lt;div style="width:800px; height:400px;"&gt; &lt;canvas id="myChart"&gt;&lt;/canvas&gt; &lt;/div&gt; &lt;script&gt; $( document ).ready(function() { var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [65, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 86, 27, 90] } ] }; options = { responsive: true }; // Get context with jQuery - using jQuery's .get() method. var ctx = $("#myChart").get(0).getContext("2d"); // This will get the first returned node in the jQuery collection. var myLineChart = new Chart(ctx).Line(data, options); }); &lt;/script&gt;
type: AnsweredQuestion

http://stackoverflow.com/comment/43147120
type: Comment
comment on: http://stackoverflow.com/a/27345933
type: AnswerComment
score: 0
has text: Thanks! BTW, how can I know when the encryption is done?

http://stackoverflow.com/a/28259806
answers question: http://stackoverflow.com/q/27334365
score: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/44885913
upvote count: 8
type: Answer
has body: While I am not sure it applies to other Web Component frameworks, while using Polymer in Chrome, I have a CustomElements object to the window object. The CustomElements object has a key/value collection of all registered custom elements called registry. function isRegistered(name) { if (window.CustomElements &amp;&amp; window.CustomElements.registry) return name in window.CustomElements.registry; return undefined; }
has comment: http://stackoverflow.com/comment/44896030

http://stackoverflow.com/comment/43116748
has text: Thanks for the help, @Nick Tomlin. With the above, I get a server 500 error, which reports `Exception while invoking method 'createClientToken' TypeError: Object [object Object] has no method 'validateParams'`. It seems that `createClientToken` doesn't want an object, which I assume it's being given by passing `this` along with the `generateToken` wrapAsync method?
type: Comment
comment on: http://stackoverflow.com/a/27325071
score: 0
type: AnswerComment

http://stackoverflow.com/q/27397982
tagged with: javascript
score: 2
has title: Fancytree not visible has class ui-helper-hidden
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: fancytree
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28418716
has body: I have just started with fancytree 2.6.0 and I am populating it from a web service request. My problem is that all the nodes are present but are made invisible by the ui-helper-hidden class. I have put in a temporary fix with: $(rootNode.ul).removeClass('ui-helper-hidden'); but I am sure I am missing something. The scripts and css: &lt;link href="Scripts/jquery-plugins/fancytree-2.6.0/src/skin-themeroller/ui.fancytree.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="Scripts/jquery-1.11.1/jquery-1.11.1.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/jquery-1.11.1/jquery-migrate-1.2.1.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/jquery-ui-1.11.2/jquery-ui.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="Scripts/jquery-plugins/fancytree-2.6.0/src/jquery.fancytree.js" type="text/javascript"&gt; &lt;/script&gt; &lt;script src="Scripts/jquery-plugins/fancytree-2.6.0/src/jquery.fancytree.themeroller.js" type="text/javascript"&gt; &lt;/script&gt; The code: $('#selectedClausesDiv').fancytree(); $.when( $.getJSON("Handlers/GetQuotationHandler.ashx?jsoncallback=?", { quoteReference: quoteReference, quoteVersion: quoteVersion }) ).then(function (data) { if (data.ErrorCode == 0 &amp;&amp; data.Quotation != null) { var rootNode = $("#selectedClausesDiv").fancytree("getRootNode"); $.each(data.Quotation.Covers, function (index, item) { addCover(rootNode, item); }); // FIXME: why is this necessary ?? // $(rootNode.ul).removeClass('ui-helper-hidden'); } }); function addCover(rootNode, cover) { var coverId = 'selected_' + cover.BusinessClassId + '_' + cover.CoverId; var coverNode = rootNode.addChildren({ title: cover.Name, tooltip: "This folder and all child nodes were added programmatically.", folder: true }); } The generated html: &lt;div class="grid_13 alpha omega" id="selectedClausesDiv"&gt; &lt;ul class="ui-fancytree fancytree-container ui-fancytree-source ui-helper-hidden" tabindex="0"&gt; &lt;li class=""&gt;…
type: Question
downvote count: 0

http://stackoverflow.com/q/27355256
tagged with: onclick
duplicate of: http://stackoverflow.com/q/347512
has answer: http://stackoverflow.com/a/27355294
has body: I have a page with several buttons(name SousMenu), all this buttons have onclick action. Now I've create a main button to control all the button(idMenu). When the main button isn't checked, buttons aren't cheked. if(document.getElementById(idMenu).checked == false) { var x = document.getElementsByName(SousMenu); var i; for (i = 0; i &lt; x.length; i++) { x[i].checked = false; x[i].onclick; } } Now I want to execute function for all buttons when the main button isn't checking, I've try something like x[i].onclick but it doesn't work.. Thanks for your help
linked to: http://stackoverflow.com/q/347512
answer count: 1
tagged with: button
tagged with: javascript
score: 0
has title: execute onclick action with function
accepted answer: http://stackoverflow.com/a/27355294
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/27327266
has body: I want to have a javascript client process get the HTTP status code that a server is returning when the client makes a websocket upgrade request and that request is unsuccessful. I have my server returning HTTP 400 to indicate that a websocket upgrade is unsuccessful. I am using Google Chrome and when i open the developer console I can see the following message: WebSocket connection to 'wss://' failed: Error during WebSocket handshake: Unexpected response code: 400 However, the onerror handler does not contain this message, it receives a 1006 error but does not indicate that the closure occured as a result of getting HTTP 400. How does a javascript developer handle handshake errors? I would like to provide the client with an informative message when they get a handshake error. I have put the websocket error below, it does not seem to contain anything that I can use to indicate that this error is a result of a websocket handshake error. Websocket Error: {"path":{"length":0},"cancelBubble":false,"returnValue":true,"srcElement":{"binaryType":"blob","protocol":"","extensions":"","bufferedAmount":0,"readyState":3,"url":"wss://&lt;my address&gt;","URL":"wss://&lt;my address&gt;"},"defaultPrevented":false,"timeStamp":1417828938039,"cancelable":false,"bubbles":false,"eventPhase":2,"currentTarget":{"binaryType":"blob","protocol":"","extensions":"","bufferedAmount":0,"readyState":3,"url":"wss://&lt;my address&gt;","URL":"wss://&lt;my address&gt;"},"target":{"binaryType":"blob","protocol":"","extensions":"","bufferedAmount":0,"readyState":3,"url":"wss://&lt;my address&gt;","URL":"wss://&lt;my address&gt;"},"type":"error"}
score: 5
upvote count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27336934
downvote count: 0
answer count: 1
tagged with: websocket
favorite count: 0
has title: Handling unsuccessful websocket upgrade requests in Javascript Client
tagged with: handshake
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27336934

http://stackoverflow.com/comment/43224790
score: 7
has text: Do you call `init()` anywhere?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27388453

http://stackoverflow.com/comment/43252635
has text: Sorry I don't understand ? Required attribute ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27403347
score: 0

http://stackoverflow.com/a/27488166
accepted answer of: http://stackoverflow.com/q/27459451
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43408385
has body: You should use textContent rather than innerText to copy the text data i.e. // set the text from the template if(rawElement.localName === 'text'){ replacement.textContent = rawElement.textContent; } Firefox does not support the non-standard innerText property, only the standards compliant textContent.
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27459451

http://stackoverflow.com/comment/43298680
type: QuestionComment
has text: @MariusStanescu added a sample for the call. Im using jQuery there.
comment on: http://stackoverflow.com/q/27428481
score: 0
type: Comment

http://stackoverflow.com/q/27317718
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: New to JSON. How to create a json file when submitting a form and where to view it?
downvote count: 2
has answer: http://stackoverflow.com/a/27317796
has comment: http://stackoverflow.com/comment/43094968
type: Question
score: -2
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: JSP PAGE: &lt;form id="login" action="loginaction"&gt; &lt;input type="text" id="username"/&gt; &lt;input type="text" id="userpass"/&gt; &lt;input type="submit"/&gt; &lt;/form&gt; Basically I want to port a website running on a local sever to mobile. For that i need the mobile application to collect the data from JSON.
answer count: 2
has comment: http://stackoverflow.com/comment/43095507
upvote count: 0
has answer: http://stackoverflow.com/a/27317883

http://stackoverflow.com/q/27450263
type: Question
linked to: http://stackoverflow.com/q/25082248
has title: Can $interval's time parameter be dynamically changed between intervals?
score: -1
duplicate of: http://stackoverflow.com/q/25082248
has comment: http://stackoverflow.com/comment/43339437
downvote count: 2
has comment: http://stackoverflow.com/comment/43339201
has comment: http://stackoverflow.com/comment/43340200
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/27450609
tagged with: javascript
has comment: http://stackoverflow.com/comment/43339701
has comment: http://stackoverflow.com/comment/43339069
type: AnsweredQuestion
favorite count: 0
has body: I'm polling for upload progress of [sometimes large] entities. Within the first minute, I can be chatty with my upload service for status updates, but after the first minute, I can afford to ask less often. Must i destroy the existing $interval and create a new one with a longer interval time value? or can I update the existing $interval's time parameter somehow?
has answer: http://stackoverflow.com/a/27450609
tagged with: angularjs

http://stackoverflow.com/comment/43373530
score: 1
has text: What does your `addMarker` function look like? Add it to your question please.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27468033

http://stackoverflow.com/q/27341729
tagged with: socket.io
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27345693
score: 0
possible better answer: http://stackoverflow.com/a/27342000
has answer: http://stackoverflow.com/a/27342000
has title: save the socket of a user to be used on different pages
has comment: http://stackoverflow.com/comment/43140624
tagged with: sockets
accepted answer: http://stackoverflow.com/a/27345693
tagged with: node.js
type: AnsweredQuestion
has body: Description : I have the following code snippet that seems to work great &lt;script src="https://cdn.socket.io/socket.io-1.2.0.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/jquery-1.11.1.js"&gt;&lt;/script&gt; &lt;script&gt; var socket = io(); &lt;/script&gt; Now with socket created I am using it to do different tasks that user wants e.g user is chatting with other online people ... Now what if user navigates to some other page and performs something else ... for that I am going to need the same socket that was assigned to that user ... I have an array on the server side that holds all the sockets of connected user along with their id ... How can I keep the socket with me all the times while visiting different pages of the website.. e.g I click on a link and that takes me to a page ... Now I post something on that page for that I want the socket that was given to me .

http://stackoverflow.com/a/27403180
has comment: http://stackoverflow.com/comment/43251399
has body: You can put it in the layout but active it only if your on the login page : if(window.location.href.toLowerCase().indexOf("login") &gt; -1) { function preventBack() { window.history.forward(); } setTimeout("preventBack()", 0); }
score: 0
upvote count: 1
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/43251343
has comment: http://stackoverflow.com/comment/43297629
answers question: http://stackoverflow.com/q/27403062
has comment: http://stackoverflow.com/comment/43251199
has comment: http://stackoverflow.com/comment/43251312

http://stackoverflow.com/comment/43348079
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27455087
has text: I'm afraid that one doesn't work either. The this is, if I replace the code where with the link with a simple alert() code, the program works. The alert() window will pop up, so I know that the rest of the code works.

http://stackoverflow.com/a/27348618
answers question: http://stackoverflow.com/q/27348248
score: 0
has body: EDIT : Oups, question has been edited a lot! So I need to tell this is an answer to this revision of the question. I tried to fix things and answer while trying to keep close to the question code. You have several mistakes in your code : If you start a number with "0", it must be a valid octal value. So avoid 078. You have a spelling mistake in findNumber definition. function vs "Function" An improper way of doing things in findNumber (see below) Bad transmission of the query to the function Try this : var NumberArray = [5, 65, 02, 04, 05, 80, 90, 01, 46, 87, 05, 6, 20, 48, 056, 78, 9, 7, 88, 9, 87, 65, 48, 6, 54, 3, 51, 90, 95, 60, 100]; document.write("These are all of the numbers in the array"); document.write(" "); document.write(NumberArray); document.write(" "); var sum = 0; for (var i = 0; i < NumberArray.length; i++) { sum += Number(NumberArray[i]); var average = sum / NumberArray.length; } document.write("This is the sum of the array"); document.write(" "); document.write(sum); document.write(" "); document.write("This is the average of the array"); document.write(" "); document.write(average); function findNumber(Query) { for (i = 0; i < NumberArray.length; i++) { if (Query == NumberArray[i]) { alert(Query + " was found at position " + i); return; } } alert(Query + "is not found in the array"); } /* Not relevant here var lookingFor = prompt("who to look for?"); for (i = 0; i < people.length; i++) { if (lookingFor == people[i]) { alert(lookingFor + " was found at position " + i); } } */ Array Search Test Search Array If you are a beginner at javascript, you should start with the smallest code possible and test frequently when you complexify things. Don't forget to read error messages in the console. As a side note, I'd suggest you to learn the following : Read a book like "JavaScript: The Good Parts" (by Douglas Crockford) first. Learn the basics of jQuery, you would definitely easily avoid document.write and alert if you knew the basics of jQuery (although…
type: Answer

function
tags question: http://stackoverflow.com/q/27439321
tags question: http://stackoverflow.com/q/27435567
tags question: http://stackoverflow.com/q/27432330
tag name: function
tags question: http://stackoverflow.com/q/27324716
tags question: http://stackoverflow.com/q/27433275
tags question: http://stackoverflow.com/q/27391682
tags question: http://stackoverflow.com/q/27413364
tags question: http://stackoverflow.com/q/27443708
tags question: http://stackoverflow.com/q/27416760
tags question: http://stackoverflow.com/q/27401833
tags question: http://stackoverflow.com/q/27373116
tags question: http://stackoverflow.com/q/27322325
tags question: http://stackoverflow.com/q/27333336
tags question: http://stackoverflow.com/q/27411982
tags question: http://stackoverflow.com/q/27431383
tags question: http://stackoverflow.com/q/27344529
tags question: http://stackoverflow.com/q/27327691
tags question: http://stackoverflow.com/q/27329935
tags question: http://stackoverflow.com/q/27397687
tags question: http://stackoverflow.com/q/27399787
tags question: http://stackoverflow.com/q/27348248
tags question: http://stackoverflow.com/q/27386068
tags question: http://stackoverflow.com/q/27429799
type: Tag
tags question: http://stackoverflow.com/q/27404706
tags question: http://stackoverflow.com/q/27340843
tags question: http://stackoverflow.com/q/27393542
tags question: http://stackoverflow.com/q/27386233
tags question: http://stackoverflow.com/q/27448973
tags question: http://stackoverflow.com/q/27433737
tags question: http://stackoverflow.com/q/27450196
tags question: http://stackoverflow.com/q/27320920
tags question: http://stackoverflow.com/q/27468503
tags question: http://stackoverflow.com/q/27336424
tags question: http://stackoverflow.com/q/27467569
tags question: http://stackoverflow.com/q/27351803
tags question: http://stackoverflow.com/q/27433097
tags question: http://stackoverflow.com/q/27405659
tags question: http://stackoverflow.com/q/27360429
tags question: http://stackoverflow.com/q/27424419
tags question: http://stackoverflow.com/q/27412543
tags question: http://stackoverflow.com/q/27414079
tags question: http://stackoverflow.com/q/27360513
tags question: http://stackoverflow.com/q/27365082
tags question: http://stackoverflow.com/q/27398772

http://stackoverflow.com/comment/43226693
type: Comment
has text: @mangseth: It's not that you're a newbie; it's that you made no effort to solve it on your own.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27388456

http://stackoverflow.com/comment/43197089
type: QuestionComment
comment on: http://stackoverflow.com/q/27373026
has text: above array having 2 objects, i need object index value when loop in that section object, and i need to pass that index value in another function.
score: 0
type: Comment

http://stackoverflow.com/comment/43120632
type: Comment
comment on: http://stackoverflow.com/q/27331370
has text: You want to delete *one specific position* of this array or make something like a *free(animals)* as we do in C ?
score: 0
type: QuestionComment

http://stackoverflow.com/a/41278766
has body: For anybody interested in an Angular 2 solution for this same issue, I was unable to find one, so I published this small directive to NPM: https://www.npmjs.com/package/ng2-inline-href
answers question: http://stackoverflow.com/q/27422884
score: 0
type: Answer

express
tags question: http://stackoverflow.com/q/27331669
tags question: http://stackoverflow.com/q/27337700
tags question: http://stackoverflow.com/q/27386238
tags question: http://stackoverflow.com/q/27390502
tags question: http://stackoverflow.com/q/27343331
tags question: http://stackoverflow.com/q/27343757
tags question: http://stackoverflow.com/q/27389523
tags question: http://stackoverflow.com/q/27424886
tags question: http://stackoverflow.com/q/27413764
tags question: http://stackoverflow.com/q/27427358
tags question: http://stackoverflow.com/q/27315779
tags question: http://stackoverflow.com/q/27398817
tags question: http://stackoverflow.com/q/27447869
tags question: http://stackoverflow.com/q/27415400
tags question: http://stackoverflow.com/q/27315849
tags question: http://stackoverflow.com/q/27369414
tags question: http://stackoverflow.com/q/27348530
tags question: http://stackoverflow.com/q/27366980
tags question: http://stackoverflow.com/q/27465850
tags question: http://stackoverflow.com/q/27322410
tags question: http://stackoverflow.com/q/27330953
tags question: http://stackoverflow.com/q/27337953
tags question: http://stackoverflow.com/q/27435004
tags question: http://stackoverflow.com/q/27454776
tags question: http://stackoverflow.com/q/27342615
tags question: http://stackoverflow.com/q/27441946
tags question: http://stackoverflow.com/q/27332555
tags question: http://stackoverflow.com/q/27424589
tags question: http://stackoverflow.com/q/27415712
tags question: http://stackoverflow.com/q/27356061
tags question: http://stackoverflow.com/q/27371720
tag name: express
tags question: http://stackoverflow.com/q/27419014
tags question: http://stackoverflow.com/q/27435837
tags question: http://stackoverflow.com/q/27353722
tags question: http://stackoverflow.com/q/27380531
tags question: http://stackoverflow.com/q/27317119
tags question: http://stackoverflow.com/q/27336882
type: Tag
tags question: http://stackoverflow.com/q/27427507
tags question: http://stackoverflow.com/q/27404935
tags question: http://stackoverflow.com/q/27391608
tags question: http://stackoverflow.com/q/27337485
tags question: http://stackoverflow.com/q/27383222
tags question: http://stackoverflow.com/q/27347810
tags question: http://stackoverflow.com/q/27405344
tags question: http://stackoverflow.com/q/27332810
tags question: http://stackoverflow.com/q/27410685

http://stackoverflow.com/q/27402840
tagged with: javascript
has title: Insert a tab or spaces in html
favorite count: 0
type: Question
has body: I'm new to html and I got this piece of code: @{ ViewBag.Title = "Index"; } View1 @foreach (var item in Model.Data) { @item.Key @item.Value } I want to add a tab or spaces between: @item.Key and @item.Value how do I do that? I guess adding css is the best way but I don't understand how to use it.
has answer: http://stackoverflow.com/a/27403008
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/339923
has answer: http://stackoverflow.com/a/27402959
possible better answer: http://stackoverflow.com/a/27402929
upvote count: 49
downvote count: 1
has answer: http://stackoverflow.com/a/27402929
duplicate of: http://stackoverflow.com/q/339923
linked to: http://stackoverflow.com/q/2070817
has answer: http://stackoverflow.com/a/27402943
has comment: http://stackoverflow.com/comment/43250549
score: 48
has comment: http://stackoverflow.com/comment/43250398
answer count: 4
accepted answer: http://stackoverflow.com/a/27402943
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43250444

http://stackoverflow.com/q/27442753
has answer: http://stackoverflow.com/a/27443623
accepted answer: http://stackoverflow.com/a/27443623
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43325985
has body: So I am not wanting to use the plugin because I want control over this slider. I am having issues with it not utilising the styles and js files. I am calling them in through the functions files and the files are situated in the CSS and JS folders within the theme. Here is the function for calling in the js with the jquery. function theme_name_scripts() { wp_enqueue_script( 'bxslider', get_template_directory_uri() . '/js/jquery.bxslider.js', array(), '1.8.2', true ); } add_action( 'wp_enqueue_scripts', 'theme_scripts' ); Similarly here is the css (All works aside from the bxslider) function theme_styles () { wp_enqueue_style('normalize', get_template_directory_uri() . '/css/normalize.css' ); wp_enqueue_style('grid', get_template_directory_uri() . '/css/grid.css' ); wp_enqueue_style('main', get_template_directory_uri() . '/style.css' ); wp_enqueue_style('social', get_template_directory_uri() . '/css/webfonts/ss-social.css' ); wp_enqueue_style('social', get_template_directory_uri() . '/css/jquery.bxslider.css' ); } add_action( 'wp_enqueue_scripts', 'theme_styles'); I have placed the slider directly into front-page.php like the following: I am also wanting to show posts instead of hard coded images so here is the php I am using for that: <?php $content = ' '; $loop = new WP_Query( array( 'post_type' => 'your_post_type', 'posts_per_page' => 10, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC' ) ); while ( $loop->have_posts() ) : $loop->the_post(); $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'full', true); $content .= ' '; endwhile; $content .= ' '; echo $content; ?> I just need an eye to see what appears to be failing here?
tagged with: bxslider
tagged with: php
has title: BXSlider within wordpress
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43326082
tagged with: wordpress
type: Question
tagged with: javascript

http://stackoverflow.com/a/52568892
upvote count: 2
answers question: http://stackoverflow.com/q/27441803
has body: If you are using Webstorm and if you don't have your own config file, then just enable EcmaScript.next in Relaxing options in in Settings | Languages &amp; Frameworks | JavaScript | Code Quality Tools | JSHint See this question How-do-I-resolve-these-JSHint-ES6-errors
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/43100361
comment on: http://stackoverflow.com/q/27320127
type: Comment
has text: Well, you usually come here with at least a start... But well, here is a start : do some maths ! Calculate the coordinates of the 4 points of your objects with some `position()`, `Math.cos()`, `height()`, ... and see if any of them are within another object. Check this on the `mousemove` event
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43293528
type: AnswerComment
score: 0
type: Comment
has text: @Mark Did you even read my comment? I was saying you could have told the OP how to include jQuery in there webpage. Just adds a little something to your answer, so its more than just a line of text.
comment on: http://stackoverflow.com/a/27425444

http://stackoverflow.com/q/27403407
tagged with: javascript
tagged with: jquery
has title: how to handle click event on dynamic content?
tagged with: http://stackoverflow.com/tag/html
has body: i have this HTML code on a page when my page loaded: Add 123 when you click on that span it will create another span and show hi alert to you, when the page loaded for the first time it works fine and write another span on that dive as the same the old span but after that if you click on the new span it works not. i did some test and found if i add this code : $('.spn').on("click", function (e) { showalert(this); }); on the "spanwriter" function it will works , i mean if that function be like this: function spanwriter(master) { var rows = '123'; $('.divmain').html(rows); <------- this event must be add here until it ---------------> $('.spn').on("click", function (e) { works showalert(this); }); } why i should add click event at the end of wrote content until span can get that event and works? i used jquery-1.10.2.js on my sample my all codes are: $(function () { $('.divmain').on("click", function (e) { spanwriter(this); }); $('.spn').on("click", function (e) { showalert(this); }); }); function spanwriter(master) { var rows = '123'; $('.divmain').html(rows); } function showalert(master) { alert("hi"); }
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43251453
score: 0
has answer: http://stackoverflow.com/a/27403554
possible better answer: http://stackoverflow.com/a/27403651
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27403651
accepted answer: http://stackoverflow.com/a/27403554

http://stackoverflow.com/comment/43359535
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27461595
type: Comment
has text: @adeneo I will use localStorage to save and load dates with JSON, but now, "I need vote-up once". Because now I can vote-up infinitely by every click that I do.

http://stackoverflow.com/comment/43328077
type: QuestionComment
has text: `new Date("11/28/2014 11:00 am")` works in Chrome.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27444581

http://stackoverflow.com/comment/43204470
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/66467/discussion-between-user2202257-and-amit-joki).
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27377140

http://stackoverflow.com/a/27360687
has comment: http://stackoverflow.com/comment/43173932
answers question: http://stackoverflow.com/q/27349544
type: Answer
downvote count: 0
score: 1
has body: The simplest solution is to just return an empty already-resolved promise in the else clause: return $.Deferred().resolve(); To avoid the Promise anti-pattern your code might be better structured thus: function show_stuff(html) { return $.Deferred(function(def) { $('#box').append(html); $('#box').addClass('visible'); $('#box').on('transitionend webkitTransitionEnd', def.resolve); }); } function do_stuff() { if (got_the_data) { return $.Deferred().resolve(); } else { return $.ajax(...).then(show_stuff); } } Note that there's no line (yet) setting got_the_data = true - you should consider whether it's really appropriate to wait until the data has been displayed to set this flag, otherwise there's nothing to prevent multiple invocations of do_stuff all resulting in new stuff getting added to #box. IMHO you would be better with a getting_the_data flag.
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43173741
accepted answer of: http://stackoverflow.com/q/27349544

http://stackoverflow.com/a/27463687
type: Answer
accepted answer of: http://stackoverflow.com/q/27462984
upvote count: 59
has comment: http://stackoverflow.com/comment/43363672
answers question: http://stackoverflow.com/q/27462984
has comment: http://stackoverflow.com/comment/43363656
score: 59
has comment: http://stackoverflow.com/comment/68313284
has comment: http://stackoverflow.com/comment/43363740
has comment: http://stackoverflow.com/comment/43363710
has comment: http://stackoverflow.com/comment/84707506
type: AcceptedAnswer
downvote count: 0
has body: The code you're using to load jQuery is invalid and you aren't loading datepicker (jQuery UI Datepicker) at all. I've posted a few answers regarding the correct way to use jQuery in WordPress so I'll provide a working example and then a link if you'd like to read more. Replace the code you've inserted into your child theme functions.php with: /** * Load jQuery datepicker. * * By using the correct hook you don't need to check `is_admin()` first. * If jQuery hasn't already been loaded it will be when we request the * datepicker script. */ function wpse_enqueue_datepicker() { // Load the datepicker script (pre-registered in WordPress). wp_enqueue_script( 'jquery-ui-datepicker' ); // You need styling for the datepicker. For simplicity I've linked to the jQuery UI CSS on a CDN. wp_register_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css' ); wp_enqueue_style( 'jquery-ui' ); } add_action( 'wp_enqueue_scripts', 'wpse_enqueue_datepicker' ); Finally replace your usage with: &lt;script&gt; jQuery(document).ready(function($) { $("#datepicker").datepicker(); }); &lt;/script&gt; jquery requires the word Jquery instead of $

http://stackoverflow.com/comment/43097021
type: AnswerComment
comment on: http://stackoverflow.com/a/27318589
type: Comment
has text: Something so simple thank you so much !! Also do you have links to tutorials showing some good examples on javascript to swift?
score: 0

http://stackoverflow.com/q/27364851
upvote count: 2
has body: I'm currently building a custom serialization function. This turns an array like this {user_ids: [1,2,3], types: ['foo', 'bar']} into a string like this: ui-1,2,3,,ty-foo,bar I have an XML file which tells me that "user_ids" maps to "ui", etc. I'm using XML2JSON to turn the XML file into something JavaScript can work with. I want to store the abbreviations in local storage so the next time I need them I don't need to fetch the XML file or run the XML2JSON javascript again. However, I'm having trouble with getting everything to be executed in the correct order. The abbreviation function can be called multiple times from various parts of the page. The first thing it does is that it checks whether the local storage is filled. If it's not, XML has to be loaded, XML2JSON has to be executed, the result has to be put in local storage, and only then I can continue. Asset.javascript has an onLoad(), Request has onComplete, but they're not waiting nicely for eachother (seems that Asset.javascript is asynchronous no matter what). I've tried to use Chain with callChain() in each function (so they only proceed once they have truly finished doing their part), but then I'm still stuck with having to return something - the result of the abbreviation function - which I can't figure out. var Shorten = { dict: [], compact: function(args){ if(dict.length == 0){ // Check local storage if(!localStorage.dict){ new Request({ url: 'shorten.xml', contentType: 'application/xml', method: 'get', onSuccess: (function(rdf){ Asset.javascript('xml2json.js', { id: 'xml2json', onLoad: (function(){ var x2js = new X2JS(); var jsonObj = x2js.xml_str2json(rdf); var dict = []; jsonObj.parameters.alias.each(function(alias){ dict[alias._long] = alias._short; }); localStorage.dict = dict; }) }); }) }).send(); } else{ this.dict = localStorage.dict; } } else{ args.each(function(item){ // Check dictionary and replace with abbreviated version. }); } } };
has comment: http://stackoverflow.com/comment/43182152
has comment: http://stackoverflow.com/comment/43224447
answer count: 1
has answer: http://stackoverflow.com/a/27375939
has title: Load XML and the JS to process it in a strictly sequential order
tagged with: mootools
score: 2
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27375939
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43183748
type: Question
has comment: http://stackoverflow.com/comment/43182548

http://stackoverflow.com/q/27347889
type: Question
tagged with: javascript
score: 4
has body: I'm working on a rails application and building a 'follow/unfollow' feature. When a (un)follow button is clicked, a js file is called to rerender a partial. The Jquery .html() function is somehow failing to update an element on the screen and in the Inspect Element tool, but calling .html() on that updated element outputs what should be the new html content. I'm not sure where to go next with debugging.. _job_info.html.haml partial: .job_info //..stuff.. .right{id: "bookmark-job-#{job.id}"} = render partial: 'jobs/bookmark_job', locals: { job: job } _bookmark_job.html.haml Partial: - bookmarked = current_user.following?(job) - if bookmarked = link_to '', unfollow_job_path(job), class: 'bookmarked-job', data: { remote: true, method: :post } - else = link_to '', follow_job_path(job), class: 'add-bookmark-job', data: { remote: true, method: :post } JS action _follow.js.erb: console.log('&lt;%= @job.id %&gt;'); // This fires and outputs the correct ID $('#bookmark-job-&lt;%= @job.id %&gt;').html('&lt;%= j(render(partial: 'jobs/bookmark_job', locals: { job: @job })) %&gt;'); // ** $('#jobs_companies').html('&lt;%= j(render(partial: 'nav/following_info')) %&gt;'); // This correctly updates a user info section BEFORE FIRING an unfollow action: Partial HTML (from Inspect Element) &lt;div class="right" id="bookmark-job-1"&gt; &lt;a class="bookmarked-job" data-method="post" data-remote="true" href="/jobs/1/unfollow"&gt;&lt;/a&gt; &lt;/div&gt; $('#bookmark-job-1').html() console output for the element: (spacing intact) " &lt;a class="bookmarked-job" data-method="post" data-remote="true" href="/jobs/1/unfollow"&gt;&lt;/a&gt; " AFTER FIRING the unfollow action &amp; .html() update: The second line here is supposed to change the HTML of that element. After it is fired, the screen and the 'Elements' view in the inspector show no change. BUT using the console to call $('#bookmark-job-1') does return the updated HTML. Partial HTML (from Inspect Element) => Remains unchanged, same as…
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/71208003
type: UnansweredQuestion
upvote count: 4
answer count: 0
downvote count: 0
has title: Jquery .html() doesn't update an element with X, but then calling .html() on it returns X
has comment: http://stackoverflow.com/comment/43150937
has comment: http://stackoverflow.com/comment/43151214
tagged with: ruby-on-rails

http://stackoverflow.com/q/27382375
possible better answer: http://stackoverflow.com/a/27386003
has answer: http://stackoverflow.com/a/27386003
tagged with: twitter-bootstrap
answer count: 2
has title: Autosaving a Knockout viewmodel on tab navigation - how to get view model bound to DOM element
has comment: http://stackoverflow.com/comment/43225957
score: 0
tagged with: knockout.js
has body: I'm trying to call my save methods on a Knockout viewmodel when a user navigates away from a tab (Bootstrap 2) This works to fire a save when the tab is shown //This section should save when flipped away from Cardio //Click handler works here as well, navigating from Cardio to Respiratory should save Cardio Respiratory This is given by the documentation of Bootstrap for events that can be bound to on the tabs $('a[data-toggle="tab"]').on('shown', function (e) { e.target // activated tab e.relatedTarget // previous tab }) Is there any way that I can get the binding context of the previous tab and save it? My only idea was in the main viewmodel writing a function with a switch or if/elseif that would evaluate the tab selected and call that save method but that seems sloppy In my Knockout viewmodel, I've got nested viewmodels like this var mainViewModel = function() { self.cardio = new cardioViewModel(); } var cardioViewModel = function() { self.save = function() { //ajax call here } } and each nested viewmodel has a save method on it EDIT So per the selected answer below, I've got the following script $('#generalAssessment a[data-toggle="tab"]').on('shown', function (e) { var boundElement = $(e.relatedTarget).attr("href"); context = ko.contextFor($(boundElement)[0]); }) The idea being that the Bootstrap tab's target is the element that has data-bind="with: whateverViewModel" attached to it. Below is the code for the tab pane itself bound to a child viewmodel //All of my viewmodel stuff is bound here However doing ko.contextFor or ko.dataFor is giving me the root viewmodel in this case, mainViewModel instead of the viewmodel that is bound by the with clause, which is cardioViewModel. Is there any way to reference that context easily? EDIT 2 Since the ko.dataFor or ko.contextFor gets the context of the binding on the selected element, the tab itself is still bound by the mainViewModel, so that's working as expected. I just have to traverse down an extra element that is …
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27388876
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27388876

http://stackoverflow.com/comment/43294537
has text: [refer this for adding csv into fiddle](http://stackoverflow.com/questions/22890836/loading-external-csv-file-in-jsfiddle)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27423130

http://stackoverflow.com/comment/43351876
comment on: http://stackoverflow.com/a/27457366
score: 0
type: Comment
has text: Good debug, but what could be wrong with the positioning? That's not a CSS issues, I checked in Inspector Elements panel.
type: AnswerComment

http://stackoverflow.com/tag/xml
tags question: http://stackoverflow.com/q/27314704
tags question: http://stackoverflow.com/q/27445114
tags question: http://stackoverflow.com/q/27428713
tags question: http://stackoverflow.com/q/27423564
tags question: http://stackoverflow.com/q/27473797
type: Tag
tags question: http://stackoverflow.com/q/27366950
tags question: http://stackoverflow.com/q/27320975
tags question: http://stackoverflow.com/q/27327682
tags question: http://stackoverflow.com/q/27438590
tags question: http://stackoverflow.com/q/27432947
tags question: http://stackoverflow.com/q/27440326
tag name: xml
tags question: http://stackoverflow.com/q/27439479
tags question: http://stackoverflow.com/q/27331470
tags question: http://stackoverflow.com/q/27363205
tags question: http://stackoverflow.com/q/27330892
tags question: http://stackoverflow.com/q/27317963
tags question: http://stackoverflow.com/q/27325733
tags question: http://stackoverflow.com/q/27330149
tags question: http://stackoverflow.com/q/27336649
tags question: http://stackoverflow.com/q/27327583
tags question: http://stackoverflow.com/q/27433789
tags question: http://stackoverflow.com/q/27458019
tags question: http://stackoverflow.com/q/27429700
tags question: http://stackoverflow.com/q/27380391
tags question: http://stackoverflow.com/q/27360579
tags question: http://stackoverflow.com/q/27361557

http://stackoverflow.com/comment/43273051
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27395741
has text: the error occured gridcomplete event.
score: 0

http://stackoverflow.com/a/31781719
upvote count: 4
downvote count: 0
has body: I think the better solution here is to wrap the text not the icon: First name abc And: $('th').on("click", function (event) { if($(event.target).is("div")) event.stopImmediatePropagation(); }); Please note: you should use normal click even instead of click.DT because in this case it will be fired before DataTables one. http://jsfiddle.net/mae29pau/38/
score: 4
answers question: http://stackoverflow.com/q/27318162
type: Answer

http://stackoverflow.com/comment/43161678
has text: @dayuloli no way to prevent outside event from one selector, `:not()` function work on selected element but it can't prevent from `not(<selector>)` inner elements
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27353361
score: 1

http://stackoverflow.com/comment/43178452
type: AnswerComment
comment on: http://stackoverflow.com/a/27363036
score: 0
has text: I tried first 2 options: Erron 1st: Unable to set property 'value' of undefined or null reference Erron 2nd: Syntax error, unrecognized expression: #<%= control_TimeMeasured.ClientID %> I cahnged the 2nd value to $("#" + control_TimeMeasured.ClientID)[0].value = 'hi'; Then it is giving error as first one
type: Comment

http://stackoverflow.com/comment/43136360
has text: Javascript has simple and complex data types. An object is a complex data type, and the key will be a reference to that object instead of the value of variable. You are doing it the hard way, but you are learning javascript OO principles along the way. Your code will need to be nested loop with the inner loop having a function that compares two cards and determines equality. You need an if..else, where the posted code was able to avoid it.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27339900
score: 0

http://stackoverflow.com/comment/60473462
type: Comment
has text: Not true as you should use db.foo.insert({looksLike:'int', value:NumberInt(5)})
comment on: http://stackoverflow.com/a/27448360
type: AnswerComment
score: 0

http://stackoverflow.com/q/27411239
tagged with: grid
type: Question
has title: Hide row in Extjs grid view not work
answer count: 1
tagged with: javascript
tagged with: extjs
has body: I need to hide duplicate rows in master/detail grid. I found this fiddle http://jsfiddle.net/tPB8Z/1465/ that hides some cells based user choice, but when I applied this in my code http://jsfiddle.net/alebotello/axvhtrcL/21/ method addRowCls() from view grid, it did not work for rows. Master and detail grids shared same store, and I only want to change rows visibility in master grid, without modify store or create a new one. In master grid listeners: afterrender: function (comp) { var st = comp.getStore(); var arr = []; var i = 0; var view = comp.getView(); st.each(function (record) { // console.log(record); if (arr.indexOf(record.data['idOrden']) === -1) { arr.push(record.data['idOrden']); } else { view.removeRowCls(record, 'x-grid-view'); view.addRowCls(record, 'oculto'); // console.log(view); } i++; }); css .oculto{ display: none; }
score: 0
has answer: http://stackoverflow.com/a/27420571
tagged with: view
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/a/27398280
score: 11
answers question: http://stackoverflow.com/q/27398074
upvote count: 11
has body: You can use datauri and new download property of anchor elements () to achive it, without a server. Just randomly type something in the text box, click "export" and see what happens: var container = document.querySelector('textarea'); var anchor = document.querySelector('a'); anchor.onclick = function() { anchor.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(container.value); anchor.download = 'export.txt'; }; Export You can achive other types of file download, just change text/plain to the proper MIME type, and ensure that you encode the file content correctly. For example, is a good approach for generating images.
has comment: http://stackoverflow.com/comment/43245089
has comment: http://stackoverflow.com/comment/43248745
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/58022183
accepted answer of: http://stackoverflow.com/q/27398074
type: Answer
has comment: http://stackoverflow.com/comment/58018012

http://stackoverflow.com/comment/43119275
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27330652
has text: Good point :D! I've changed the CSS to look at the `.btn-group` instead of the `button` as the `.btn-group` contains both the button and the dropdown-menu. the `>` is needed as there is another `.btn-group` around all buttons, so without it hovering any button would open all menu's :)

http://stackoverflow.com/a/27559771
has comment: http://stackoverflow.com/comment/124848830
type: Answer
answers question: http://stackoverflow.com/q/27348997
has body: You have to add a push message handler to handle the push message. Like this if (window.navigator.mozSetMessageHandler) { window.navigator.mozSetMessageHandler('push', function(e) { console.log('My endpoint is ' + e.pushEndpoint); console.log('My new version is ' + e.version); //Remember that you can handle here if you have more than }); } else { // No message handler } For more details please see this section Happy Coding
has comment: http://stackoverflow.com/comment/43586126
score: 0
has comment: http://stackoverflow.com/comment/124837411

http://stackoverflow.com/comment/43152621
comment on: http://stackoverflow.com/a/27348761
type: AnswerComment
score: 0
type: Comment
has text: why nothing happened in `success: function(data) { .. }` when it done?

http://stackoverflow.com/comment/43225820
type: Comment
has text: Yeap, I did a bit more research and appaerently it's a lot better to use another input type and just add the +/- functionality myself. I'll post it after in case someone else needs it in the future.
type: QuestionComment
comment on: http://stackoverflow.com/q/27388779
score: 0

http://stackoverflow.com/comment/43280556
has text: @KevinVoorn your syntax was correct so no error in console in this case
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27418460
type: Comment

http://stackoverflow.com/q/27354488
has answer: http://stackoverflow.com/a/27354557
has comment: http://stackoverflow.com/comment/43162311
has comment: http://stackoverflow.com/comment/43163265
has comment: http://stackoverflow.com/comment/43163232
answer count: 4
type: Question
has body: I have the following codes. I don't know what part I got wrong. What it does is, a value will be shown in the textboxes, depending on the selected option in the dropdown. Then, the values in the two textboxes will be added. And its answer will be shown on the third textbox. The showing of values in the textbox is perfectly running, the only problem is it does not add and it does not show on the third textbox. A B C 1 2 3 jquery $(document).ready(function(){ $("#Dropdown1").change(function(){ if($(event.target).val() == 'A'){ $("#Dropdown2").change(function(){ if($(event.target).val() == '1'){ $('#txt1').val('10.00'); $('#txt2').val('15.00'); }else if($(event.target).val() == '2'){ $('#txt1').val('45.00'); $('#txt2').val('23.00'); }else { $('#txt1').val('30.00'); $('#txt2').val('53.00'); } if($(event.target).val() == 'B'){ $("#Dropdown2").change(function(){ if($(event.target).val() == '1'){ $('#txt1').val('11.00'); $('#txt2').val('17.00'); }else if($(event.target).val() == '2'){ $('#txt1').val('23.76'); $('#txt2').val('46.00'); }else { $('#txt1').val('33.00'); $('#txt2').val('53.76'); } if($(event.target).val() == 'C'){ $("#Dropdown2").change(function(){ if($(event.target).val() == '1'){ $('#txt1').val('20.00'); $('#txt2').val('17.00'); }else if($(event.target).val() == '2'){ $('#txt1').val('23.76'); $('#txt2').val('40.00'); }else { $('#txt1').val('37.00'); $('#txt2').val('43.76'); } }); javascript function subtotal(){ var a = document.getElementById("txt1").value; var b = document.getElementById("txt2").value; var stotal = parseInt(a)+ parseInt(b); document.getElementById("total").innerHTML = "$" + stotal; }
has answer: http://stackoverflow.com/a/27354577
has title: Getting value from textboxes that depends on dropdown menu then adding the values
score: 0
has answer: http://stackoverflow.com/a/27354728
has answer: http://stackoverflow.com/a/27354792
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27347198
downvote count: 2
has answer: http://stackoverflow.com/a/27348227
tagged with: css
has title: Is there an alternative way to hide divs and slide them up?
upvote count: 0
type: Question
score: -2
has comment: http://stackoverflow.com/comment/43149207
tagged with: javascript
tagged with: jquery
has body: I'm having issues with this script including not working on latest Firefox &amp; IE versions! I'm using this script to hide divs that have class of container and show the one with id #home.And then show elements depending on href="#customid. Although I have it working on a live website, could it be an issue with running a webpage locally? or could it be a problem of html markup which containes only divs that are well closed. In general, is their any "better" way of doing this? JS $(document).ready(function() { // hides all DIVs with the CLASS container // and displays the one with the ID 'home' only $(".container").css("display","none"); $("#home").css("display","block"); // makes the navigation work after all containers have bee hidden showViaLink($("aside button#navigation a")); // listens for any navigation keypress activity $(document).keypress(function(e) { switch(e.which) { // user presses the "a" case 97: showViaKeypress("#home"); break; // user presses the "s" key case 115: showViaKeypress("#about"); break; // user presses the "d" key case 100: showViaKeypress("#contact"); break; // user presses the "f" key case 102: showViaKeypress("#awards"); break; // user presses the "g" key case 103: showViaKeypress("#links"); } }); }); // shows a given element and hides all others function showViaKeypress(element_id) { $(".container").css("display","none"); // if multiple keys are pressed rapidly this will hide all but the last pressed key's div $(".container").hide(1); $(element_id).slideDown("slow"); } // shows proper DIV depending on link 'href' function showViaLink(array) { array.each(function(i) { $(this).click(function() { var target = $(this).attr("href"); $(".container").css("display","none"); $(target).slideDown("slow"); }); }); }
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43252904
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27381189
has text: yes if i dont use the calendar functions, it works, strange... but thanks for helping!!
type: AnswerComment

http://stackoverflow.com/q/27394500
has title: Using a csv file with imacros
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has body: I have this script that works with imacros, but when i convert the code to javascript its giving me an error: "Data source file does not exist, line: 1 " The script is simple, it gets the info from line 1 on the csv file and submits it as a comment on a site. I'm guessing the way the data source info is set is not cooperating with javascript so how should I do this, var startingUrl; startingUrl = "CODE:"; startingUrl += "URL GOTO=http://example.com"; var inputInfo; inputInfo = "CODE:"; inputInfo += "SET !DATASOURCE E:\example.csv" + "\n"; inputInfo += "SET !DATASOURCE_COLUMNS 5" + "\n"; inputInfo += "SET !DATASOURCE_LINE 1" + "\n"; inputInfo += "TAG POS=1 TYPE=TEXTAREA FORM=NAME:input ATTR=NAME:comment CONTENT=" + "\n"; inputInfo += "WAIT SECONDS=2" + "\n"; inputInfo += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:input ATTR=VALUE:Submit" + "\n"; iimPlay(startingUrl); iimPlay(inputInfo);
has answer: http://stackoverflow.com/a/27395993
favorite count: 0
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27395993
tagged with: imacros
score: 1

http://stackoverflow.com/a/27399026
has body: You'll want to use ng-options instead of a ng-repeat to set select options: Now, working with strings as index values really doesn't work that well. I'd suggest changing a couple of things in your data model: $scope.names = [ {id: 1, name: 'Henry', age: 20}, {id: 2, name: 'John', age: 21}, // etc... ]; $scope.dat = [ {id: 0, dats: 'qwe', namer: 1}, {id: 1, dats: 'ads', namer: 4}, // etc... ]; First of all, namer in $scope.dat should be a reference to a name's id. This prevents duplication of data. Also, id's shouldn't be strings. Now, if you combine that data with a ng-options: You'll have this working example: function Main($scope) { $scope.names = [ {id: 1, name: 'Henry', age: 20}, {id: 2, name: 'John', age: 21}, {id: 3, name: 'Mark', age: 22}, {id: 4, name: 'Will', age: 23} ]; $scope.dat = [ {id: 0, dats: 'qwe', namer: 1}, {id: 1, dats: 'ads', namer: 4}, {id: 2, dats: 'zxc', namer: 2}, {id: 3, dats: 'pqr', namer: 3}, {id: 4, dats: 'jgh', namer: 4}, {id: 5, dats: 'mnb', namer: 3}, {id: 6, dats: 'tyu', namer: 2}, {id: 7, dats: 'dfg', namer: 1}, {id: 8, dats: 'vcx', namer: 4}, {id: 9, dats: 'lmt', namer: 2}, ]; } {{t.dats}}
type: Answer
answers question: http://stackoverflow.com/q/27398479
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27398479

http://stackoverflow.com/a/27414778
score: 2
upvote count: 2
downvote count: 0
has body: There is no child() method. You probably want children().
answers question: http://stackoverflow.com/q/27414772
type: Answer

http://stackoverflow.com/q/27413929
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has body: I am stucking a bit with my little project. I got an local HTML file where some Forms are in it. All stylesheets and Javascript files are located on a webserver. So my problem is. Im submitting all forms via AJAX. When i normally open the HTML file local on my desktop NOTHING happens. When I uplod the html file on my webserver visit it, all is working fine. So is there any solution to get the forms submitted local while the related JS / PHP Files are located on a webserver? EDIT: Information - All Stylesheets and Javascript files ( where also the ajax part is included ) are located on an runnning Webserver. If its not working, maybe there is an other solution to get the forms submitted local by opening the html file with the browser and submitting without reloading the page?
has title: Local HTML File Form submit via Ajax to external URL
favorite count: 0
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/27413984
downvote count: 1
has comment: http://stackoverflow.com/comment/43272065
type: Question
answer count: 1

http://stackoverflow.com/comment/43193482
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27370995
score: 0
has text: Mobile devices do not play well with hover events

http://stackoverflow.com/a/27434571
score: 0
has comment: http://stackoverflow.com/comment/43335968
has comment: http://stackoverflow.com/comment/43310910
has comment: http://stackoverflow.com/comment/43333737
has comment: http://stackoverflow.com/comment/43310877
type: Answer
has comment: http://stackoverflow.com/comment/43311051
has comment: http://stackoverflow.com/comment/43337383
answers question: http://stackoverflow.com/q/27428922
has body: instead of doing calculations later with check object values, why not just do those when instantiating them. This could definitely be further optimized, but it works!! Btw, as you can see, I ended up not using jquery. js fiddle (per usual) was acting wonky, so I wrote a DEMO ON CODEPEN var checks = {}; function selectedCheck(quantity, price, projectedQuantity, projectedPrice, itemNumber) { var check = { pricePerCheck: (price - quantity).toFixed(2), projectedPricePerCheck: (projectedPrice - projectedQuantity).toFixed(2), priceBulk: (price / quantity * projectedQuantity).toFixed(2), projectedPriceBulk: (projectedPrice / projectedQuantity * projectedQuantity).toFixed(2), getSavings: function() { return (this.priceBulk - this.projectedPriceBulk).toFixed(2) } }; checks[itemNumber] = check; } selectedCheck(50, 66.99, 250, 169.99, "1785-00050/check-11"); selectedCheck(250, 169.99, 500, 230.99, "1785-00250/check-11"); selectedCheck(500, 230.99, 1000, 327.99, "1785-00500/check-11"); selectedCheck(1000, 327.99, 2000, 514.99, "1785-01000/check-11"); document.addEventListener('DOMContentLoaded', function() { var priceDrpSelect = document.querySelector('.priceDrp5'), savings = document.getElementById("savings"), selectedCheck; console.log(JSON.stringify(checks, null, 4)) priceDrpSelect.addEventListener('change', function(e) { var key = this.options[this.selectedIndex].getAttribute('value'); selectedCheck = checks[key]; savings.innerHTML = selectedCheck.getSavings(); }); priceDrpSelect.dispatchEvent(new Event('change')); });
has comment: http://stackoverflow.com/comment/43334067
has comment: http://stackoverflow.com/comment/43310409

http://stackoverflow.com/comment/43334316
type: Comment
has text: Note that `delete` can delete properties of objects referred to by local variables (`var x = {foo: "bar"}; delete x.foo;`) but it never deletes local variables themselves, because local variables are not properties of an object.
comment on: http://stackoverflow.com/a/27447252
type: AnswerComment
score: 1

http://stackoverflow.com/comment/43222489
score: 0
has text: @j08691 I think this is not a duplicate, I'm referring to *dynamically added attribute, not element.*
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27387181

http://stackoverflow.com/q/27314404
answer count: 2
downvote count: 1
tagged with: javascript
tagged with: web
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43088910
upvote count: 0
has comment: http://stackoverflow.com/comment/43090717
has comment: http://stackoverflow.com/comment/43090077
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27314454
has body: I am trying to develop a website which displaying content follow the time of the user when they surfing on it. For example, when morning time, the user will see a morning scene content, while at night time, the user will see a good-night content. How this can be done? I don't know what this should be call. Anyone familiar with this please help Thank you &lt;script&gt; $(document).ready(function() { var hour = new Date().getHours(); if (hour &lt; 10){ // morning $('body').addClass("morning"); } else if (hour &gt; 16){ // evening $('body').addClass("evening"); } // Check once every hour setInterval(function(){ // Remove all existing classes $('body').removeClass("morning evening"); var hour = new Date().getHours(); // Add back specific classes based on the hour if (hour &lt; 10){ // morning $('body').addClass("morning"); } else if (hour &gt; 16){ // evening $('body').addClass("evening"); } }, 60000 ); }); &lt;/script&gt; &lt;style type="text/css"&gt; body.morning #background{ background: url(images/morning.jpg); colour: blue; } body.evening #background{ background: url(images/evening.jpg); colour: red; } &lt;/style&gt; while on html part: &lt;body&gt; &lt;div id="background"&gt;&lt;/div&gt; &lt;/body&gt;
type: Question
has title: script - different time showing different content
has comment: http://stackoverflow.com/comment/43090020
has answer: http://stackoverflow.com/a/27314488
score: -1

http://stackoverflow.com/q/27440394
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: How to copy element of a web page to other web pages using JavaScript
has body: I know that I can change the value of a web page using following code in Java script &lt;p id="demo"&gt;&lt;/p&gt; &lt;script&gt; document.getElementById("demo").innerHTML = "Hello World!"; &lt;/script&gt; I want to assign a new value for my p tag which get value from another web page other web site
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27440543
type: Question
has comment: http://stackoverflow.com/comment/43320575
tagged with: javascript
has comment: http://stackoverflow.com/comment/43324021
accepted answer: http://stackoverflow.com/a/27440543

http://stackoverflow.com/comment/43248340
type: Comment
has text: I think I can make that work! Thanks! I knew that Knockout had something to get this done but couldn't figure out what for the life of me.
comment on: http://stackoverflow.com/a/27388876
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43346341
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27453215
has text: That was a mistake in my query because I copied and pasted from another query and forgot to change it. I know this is poor implementation that's why I'm posting here in hopes to get some examples of what I should do. I'm an not great with Ajax, jquery, etc. so any examples would be greatly appreciated

http://stackoverflow.com/comment/43368112
has text: @Barmar sorry first time i use $.getJSON I'm not sure if I'm using it the correct way, though google maps documentation shows the following adding a marker snippet, `var myLatlng = new google.maps.LatLng(33.890537,35.513477); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Hello World!' });`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27466015

http://stackoverflow.com/q/27453212
has comment: http://stackoverflow.com/comment/43345163
upvote count: 1
downvote count: 1
has body: Assume the following method(Just curious, I'm hopefully fail in js) foo(0); function foo(i){ if(i&lt;1000){ setTimeout(function(){foo(i+1);}, 1000); } alert('I am foo'); } So if I got it true, it should alerts around 1000 I am foos after 1000 seconds. So doesn't it bother the browser about keeping the is in a sort of big stack? it should be too much I think or I'm wrong?
has answer: http://stackoverflow.com/a/27453282
type: Question
score: 0
has answer: http://stackoverflow.com/a/27453360
has answer: http://stackoverflow.com/a/27453501
tagged with: javascript
has title: Javascript stack and recursive calls
has answer: http://stackoverflow.com/a/27453288
favorite count: 0
has comment: http://stackoverflow.com/comment/43345197
has comment: http://stackoverflow.com/comment/43345190
answer count: 4
has comment: http://stackoverflow.com/comment/43345164
type: UnansweredQuestion

http://stackoverflow.com/comment/43161968
has text: @Jonast92 nope. The client Id is the one that I've copied from "Web settings" section.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27354337

http://stackoverflow.com/comment/43202057
comment on: http://stackoverflow.com/q/27375928
score: 0
type: QuestionComment
type: Comment
has text: It is giving me **TypeError: "#toggle-view li".click is not a function** .Have you tried Bhoomi Shah's solution ?

http://stackoverflow.com/q/27410300
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
type: Question
score: 1
has body: So I am trying to use ng-flow to upload images to my Rails server. Currently I have this html done: Choose file Upload And now if I click the Upload button, then I pass the file to my angular controller which looks like this: angular.module('app').controller "MediumNewCtrl", ($scope, $timeout, $routeParams, $location, $http, $window) -> $scope.media = [] $scope.upload = ($file) -> $scope.media = $file[0] $http({ method: 'POST', url: './media' + '.json', data: comment: {image_video: $scope.media, text: "text"} }).success( (data) -> console.log(data) ).error( -> # Display error notification ) But doing this will give me a TypeError: Converting circular structure to JSON in my javascript console. Has anyone else here gotten ng-flow to work with Rails successfully? Would appreciate some help with this. They have samples only for php, and it's hard to make anything out of it as it works differently.
has title: Stuck with sending ng-flow image to Rails server
downvote count: 0
tagged with: javascript

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/27336182
tags question: http://stackoverflow.com/q/27460562
tags question: http://stackoverflow.com/q/27363641
tags question: http://stackoverflow.com/q/27426398
tags question: http://stackoverflow.com/q/27471248
tags question: http://stackoverflow.com/q/27457892
tags question: http://stackoverflow.com/q/27466279
type: Tag

http://stackoverflow.com/comment/43550726
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27562332
has text: I have to add that my model consists solely of orders. That custom date I put in front is my own implementation to show the data as shown in the image. (I will add this information to the question too)

http://stackoverflow.com/a/27358394
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: Actually, Jenkov mentions (and quite clearly) one thing: with $scope.formName.inputName you'll get an instance of ngModelController (and only if this input is already bound - with ng-model or in some other way). This instance has many uses; you can get back its view value (via $viewValue property; see this demo), check whether or not it passes validation etc. - but it's still an Object, not a string.
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/43170967
accepted answer of: http://stackoverflow.com/q/27358019
answers question: http://stackoverflow.com/q/27358019

http://stackoverflow.com/q/27391638
tagged with: jquery-chaining
score: 0
answer count: 1
tagged with: jquery
tagged with: asynchronous
has title: Using Chained Promises with .when
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43231777
has comment: http://stackoverflow.com/comment/43231625
has body: I have 2 methods which return promises (shortened with non-async resolves) function methodA () { var d = $.Deferred(); d.resolve('A'); return d.promise(); } function methodB (dependency) { var d = $.Deferred(); // dependency would be used here d.resolve('B'); return d.promise(); } And then I have another method which chains these function chainer () { return methodA().then(function(result) { return methodB(result); }); } And then I have another method which calls .when on this chainer function main () { $.when(chainer()).done(function (answer) { console.log(answer); }); } The answer printed to the console is 'A', not 'B' as I would have expected! Why is this? And how can I get the result of methodB, since this method is dependant on methodA. Thanks R
has comment: http://stackoverflow.com/comment/43230957
has comment: http://stackoverflow.com/comment/43231754
has answer: http://stackoverflow.com/a/27392850
has comment: http://stackoverflow.com/comment/43233012
type: Question
has comment: http://stackoverflow.com/comment/43231288
tagged with: javascript

http://stackoverflow.com/q/27322250
tagged with: ajax
tagged with: twitter-bootstrap
has body: My ajax script sends json objects to browser but the table is unable to load the json object. My Ajax script: $.ajax({ type : "POST", url : "getLabels.jsp", data : "mailingID=" + selectedValue, // posCodeSelected success : function(data) { response = $.parseJSON(data);// this statement sends data succesfully to browser }, error : function(response) { var responseTextObject = jQuery.parseJSON(response.responseText); } }); This is my bootstrap table embedded into my jsp page. ID first name last name organization city state Just to let you guys now this is my json response in browser: {"rowNumber":1,"mailingID":3,"firstname":"Brian","lastname":"Fairhurst","organization":"Florida State University","city":"Tallahassee","state":"FL"}
linked to: http://stackoverflow.com/q/25187349
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43104023
type: Question
has comment: http://stackoverflow.com/comment/43105132
has answer: http://stackoverflow.com/a/27322471
has title: bootstrap table unable to load json objects
has comment: http://stackoverflow.com/comment/43104213
tagged with: javascript
has answer: http://stackoverflow.com/a/27323041
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43104033
tagged with: jsp

http://stackoverflow.com/comment/43184819
has text: Alright, I figured out to make it works. I used : `requestAnimFrame @update` But I told me that `@update` was not a function. So I looked upon and find that `requestAnimFrame @update.bind(@)` was working. Indeed, `function.bind(this)` is used to return a function usable in any case with **this = this from update**
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27357657
type: AnswerComment

http://stackoverflow.com/comment/43331652
comment on: http://stackoverflow.com/q/27446037
type: Comment
has text: `var c = 5; $('#slider-range-min').slider("option", "max", c);` - I just tested this in my own code and it seems to work fine. Like @RoryMcCrossan said you have `slide()` defined twice, but other than that I dont see why the code above isnt working. Are you getting any errors?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43338847
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27450108
has text: what are the values of choice1 and choice2

webbrowser-control
type: Tag
tag name: webbrowser-control
tags question: http://stackoverflow.com/q/27365037
tags question: http://stackoverflow.com/q/27467151

http://stackoverflow.com/q/27457261
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27457306
has answer: http://stackoverflow.com/a/27457306
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27457286
favorite count: 0
type: Question
answer count: 2
has body: I am adding a "like" feature to my screenshot gallery. I have successfully worked it out to change color to red when someone likes... and go back to gray when unlike... and then a php script handles all the DB magic. But I can't wrap my head around how to change the actual text value shown; i.e. if someone likes, change the text from 10 to 11. If they unlike, change from 2 to 1, etc. Can anyone suggest an approach to look into? These are my javascript & html snippets if they help. The text in the HTML I want to change here is represented by "$row['Likes']" $(".ajax-unlike").submit(function(){ var refid = $(this).find('input[name="refid"]').val(); var data = { "action": "unlike" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "POST", dataType: "json", url: "galleryajax.php", //Relative or absolute path to response.php file context: document.getElementById(refid), //!! ADD THIS data: data, success: function(data) { //!! REMOVE refid FROM HERE $(this).removeClass("thumb-comment-red", 1000); } }); return false; }); profile_fields['pf_minecraftname'].'" /> profile_fields['pf_minecraftname'],"",$row['Likers']).'" /> '.$row['Likes'].' new code for comment down below //Look for forms with "like" class $(".ajax-like").submit(function(){ var refid = $(this).find('input[name="refid"]').val(); var btnrefid = "button#" + refid; var formrefid = "form#" + refid; var data = { "action": "like" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "POST", dataType: "json", url: "galleryajax.php", //Relative or absolute path to response.php file context: document.getElementById(refid), data: data, success: function(data) { $(this).addClass("thumb-comment-red", 1000); $(btnrefid).html(" " + data["newlikes"]); //Now stop further changes from recording based on submissions from this specific form $(formrefid).submit(function(){ alert("You have already liked or unliked this screenshot. Please reload the page if you want to change your mind."); }); } }); r…
accepted answer: http://stackoverflow.com/a/27457286
upvote count: 1
has title: How to dynamically change text with javascript

http://stackoverflow.com/a/27428552
score: 2
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27412113
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27412113
type: Answer
has body: You are right, d3's nest.rollup handles only leaf groups. So you need to write a recursive function to traverse nest's entry tree and calculate agregates. Here's example for sum: var topChildren = d3.nest() .key(function(item) { return item['fiscal_quarter']; }) .key(function(item) { return item['fiscal_period']; }) .entries(data); var root = {'values': topChildren, 'key': null}; function rollup(node) { node['sum'] = node['values'].reduce(function(result, item) { return result + (item['values'] ? rollup(item) : item['total']); }, 0); return node['sum']; } rollup(root); console.log(root); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"&gt;&lt;/script&gt; &lt;script&gt; var data = [ { 'account_name':'abc123', 'fiscal_quarter':'q1', 'fiscal_period':'q1p1', 'fiscal_week_period':'q1p1w1', 'total':50.0 }, { 'account_name':'abc234', 'fiscal_quarter':'q2', 'fiscal_period':'q2p3', 'fiscal_week_period':'q2p3w1', 'total':60.0 }, { 'account_name':'abc345', 'fiscal_quarter':'q2', 'fiscal_period':'q2p4', 'fiscal_week_period':'q1p4w1', 'total':70.0 }, { 'account_name':'abc456', 'fiscal_quarter':'q3', 'fiscal_period':'q3p1', 'fiscal_week_period':'q3p1w1', 'total':80.0 }, { 'account_name':'abc456', 'fiscal_quarter':'q3', 'fiscal_period':'q3p2', 'fiscal_week_period':'q3p2w1', 'total':90.0 } ]; &lt;/script&gt; Side note. + operator takes precedence over ternary operator, so you need parentheses to change the priority. It works without an error otherwise, but just with incorrect result. If you want to challenge yourself to understand one (weak typing, which shouldn't be confused with dynamic typing) of JavaScript's design shortcomings, remove parentheses and try to understand why it works this way. I just have done, forgetting about operator precedence :-/
has comment: http://stackoverflow.com/comment/43302072

http://stackoverflow.com/comment/43231864
type: Comment
comment on: http://stackoverflow.com/q/27392087
has text: How about marking it as spam when there are excess number of non-alphanumeric characters in the title?
score: 0
type: QuestionComment

http://stackoverflow.com/q/27365024
has answer: http://stackoverflow.com/a/27365453
has title: Angularjs remote reload
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27365453
has answer: http://stackoverflow.com/a/27365876
type: Question
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/27365876
has body: I have a function to change a scope object in an angularjs app: function change() { var appElement = document.querySelector('[ng-controller="appController"]'); var $scope = angular.element(appElement).scope(); $scope.$apply(function() { $scope.globalUrl = 'http://google.com/'; }); } this is working for the browser calling the function. Is it possible to change this scope for every Browser currently viewing the app (someone clicks a button and everyone gets a notice)?
tagged with: angularjs

http://stackoverflow.com/q/27362470
accepted answer: http://stackoverflow.com/a/27364828
has title: reusable Bar chart showing bars one over another which have same names
tagged with: angularjs
tagged with: d3.js
has body: The problem I am having is my schedules bar Chart have names on the X axis and values on Y axis, names sometimes were so big that I have to do a substring(0,6) to reduce the name size and display full name in the tool tip. By doing that what happened was the schedules which have the same 6 alphabets were overlapped and both were showing one over another. Like below:- I want to make sure all bars have their own X Axis and they don't overlap each other, even if they have the same 6 alphabets of their names. My application is really complex I won't be able to create a fiddle , but the chart code is below its mostly modified from reusable bar charts http://bl.ocks.org/biovisualize/5372077. I call this bar chart like this; var chart = d3.custom.barChart(), chartEl = d3.select(element[0]); chartEl.datum(scope.setBarData).call(chart); Code:- d3.custom = {}; d3.custom.barChart = function module() { var dispatch = d3.dispatch('customHover'); function bar(selection) { var margin = {top: 30, right: 10, bottom: 50, left: 50}, width = 900, height = 420, xRoundBands = 0.2, xValue = function(d) { return d }, yValue = function(d) { return d; }, xScale = d3.scale.ordinal(), yScale = d3.scale.linear(), yAxis = d3.svg.axis().scale(yScale).orient("left"), data, xAxis = d3.svg.axis().scale(xScale); selection.each(function(data) { var dataX = data.name.map(function(d, i) { return xValue.call(data.name, d, i); }); var dataY = data.value.map(function(d, i) { return yValue.call(data.value, d, i); }); data = d3.zip(dataX, dataY); //showing full name of rotation on tool tip on X axis var tip = d3.tip() .attr('class', 'x-tip') .offset([-10,0]) .html( function (d, i) { return "Rotation Name: " + d[0] + " Value: " + d[1] + "" }); // Update the x-scale. xScale .domain(data.map(function(d) { return d[0].substring(0,6);} )) .rangeRoundBands([0, width - margin.left - margin.right], xRoundBands); // Update the y-scale. yScale .domain(d3.extent(data.map(function(d) { return d[1];} ))) .range([height -…
type: AnsweredQuestion
tagged with: charts
has answer: http://stackoverflow.com/a/27364828
type: Question
answer count: 1
tagged with: bar-chart
tagged with: javascript
score: 0

http://stackoverflow.com/comment/43382573
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27474091
has text: try `$(".editIncome").click(editIncome)`. Passing as reference will give you `this` context
score: 0

http://stackoverflow.com/comment/43173942
type: QuestionComment
has text: aah yes, only a custom one that I made, so not ng-repeat, ng-show,..
comment on: http://stackoverflow.com/q/27316686
score: 0
type: Comment

http://stackoverflow.com/q/27318148
has answer: http://stackoverflow.com/a/27324907
downvote count: 2
has title: Adobe Livecycle - form submit occurring before field exit
type: Question
has body: My office is working with LiveCycle ES4 and I'm kinda new to it. I have a form that contains some custom validation javascript which gets called in the submit event of a submit button, which works fine. The form is deployed in Livecycle Workbench, which replaces the in-form submit button with the workbench 'complete' button. We're running into a problem where if a user enters data in one of the required fields, then clicks the Workbench Complete button, the exit event for that field doesn't fire, which means the rawValue is not set to the value the user entered. So when the validation runs as part of the submit event, it fails, even though the user has entered text in that field. Is there some way to change this up so it shifts focus out of the current field when clicking the Workspace button?
has comment: http://stackoverflow.com/comment/43099985
tagged with: javascript
score: -1
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43096157
tagged with: events
tagged with: adobe
tagged with: livecycle

http://stackoverflow.com/comment/43269469
score: 0
type: Comment
type: QuestionComment
has text: Can you please post the full controller code.
comment on: http://stackoverflow.com/q/27411982

http://stackoverflow.com/q/27379303
has comment: http://stackoverflow.com/comment/43208951
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27379390
answer count: 1
has comment: http://stackoverflow.com/comment/43210580
favorite count: 0
has body: When I hover my mouse over an image ,the image should be saved temporarily in "localStorage" with the help of javascript.Then it should be send to server via AJAX. there are 2 ques. 1) how to save the image on the localStorage when the mouseover on it. 2) how to send the image from localstorage to server. sorry for not being clear abt the question at first.
score: -3
has title: on mouse hover save image temporarily in localstorage and send to server via AJAX
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43236219
downvote count: 3
has answer: http://stackoverflow.com/a/27379390
type: Question
upvote count: 0
tagged with: javascript

memoization
type: Tag
tags question: http://stackoverflow.com/q/27430358
tag name: memoization

http://stackoverflow.com/comment/43158469
score: 0
comment on: http://stackoverflow.com/q/27352222
has text: I specified above that I am looking to emulate this C# code in Javascript
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27396281
tagged with: javascript
favorite count: 0
has body: In javascript, how can I replace all punctuation (including underscore) marks with hyphen? Moreover, it should not contain more than one hyphen sequentially. I tried "h....e l___l^^0".replace(/[^\w]/g, "-") but it gives me h----e---l___l--0 What should I do so that it returns me h-e-l-l-0 instead?
has answer: http://stackoverflow.com/a/27396330
accepted answer: http://stackoverflow.com/a/27396330
tagged with: regex
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27396331
has answer: http://stackoverflow.com/a/27396431
type: Question
has title: Regarding JavaScript RegEx - Replace all punctuation including underscore
score: -1
possible better answer: http://stackoverflow.com/a/27396331
answer count: 3
downvote count: 1

http://stackoverflow.com/comment/43168779
type: Comment
type: AnswerComment
has text: Glad it helped! Anyway, returning a function is not what I suggested. What I suggested is writing a self-contained application, say popup.js, and including that in your host application with a ` ` element. This way you don't need cross-application authentication
comment on: http://stackoverflow.com/a/27356673
score: 0

http://stackoverflow.com/comment/43231625
has text: Btw, you should simplify to `methodA().then(methodB)` and `chainer().done(…)`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27391638
score: 0

http://stackoverflow.com/q/27397880
has body: Please help me with this. It could be a duplicate question, but I couldn't find the solution anywhere. I am creating an objective type questionnaire and the options are in radio buttons. Some of the options are mandatory and if the user click that option the comment box will change to a required field. The name of the answers are the question Id. Here is the input field which I am using &lt;input type='radio' name='answer_value[&lt;?php echo $gques; ?&gt;]' value='&lt;?php echo $gans; ?&gt;' id="rtr" onclick='ajaxFunction()'/&gt; I want to do it with ajax, because when the user select the mandatory option it has fetch the answer id and use that id to execute a query to check whether that answer is mandatory or not. If true it will make the comment box a required text area. The ajax code I used is function ajaxFunction(){ var ajaxRequest; try{ ajaxRequest = new XMLHttpRequest(); }catch (e){ try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); }catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e){ alert("Your browser broke!"); return false; } } } ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } var ans_id = $("input[id=rtr]:checked").val(); var dataString = 'id='+ ans_id; alert(dataString); ajaxRequest.open("POST", "anschq.php" +dataString,true); ajaxRequest.send(); } In the anschq.php I put an alert script to check whether the value is sent or not. But when I click on the radio button the alert box is not displayed from the other page. But the alert(dataString) here is displaying the value of the checked button. Can anyone find the solution for this problem.....
has answer: http://stackoverflow.com/a/27398021
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27398021
favorite count: 0
tagged with: ajax
tagged with: mysqli
has title: radio button values send using ajax php mysql
type: AnsweredQuestion
upvote count: 1
tagged with: php
type: Question
score: 1

http://stackoverflow.com/comment/43272026
has text: Thanks a lot its almost working how i intended. What I want to make happen is that only one div can show at a time. For example, I want the about me to show on load like it is and the other 3 to be hidden. If I click projects I want all the other divs to hide and that one to slide into view. Do you understand what im trying to say?
type: AnswerComment
comment on: http://stackoverflow.com/a/27413908
score: 0
type: Comment

http://stackoverflow.com/q/27393358
has answer: http://stackoverflow.com/a/27393535
type: AnsweredQuestion
has title: Issue on Targeting .prev() closest() Class of a Text Box
has answer: http://stackoverflow.com/a/27393374
has body: Can you please take a look at This Demo and let me know why I am not able to target the first .fa class before the text box #name ? I am trying this: $(this).prev().closest(".fa").addClass("err"); at this code Name Contact but cant target the .fa can you please let me know how to fix this? Thanks,
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27393374
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27393408
possible better answer: http://stackoverflow.com/a/27393408

http://stackoverflow.com/comment/43150541
has text: You're welcome. If you're satisfied with the answer, please select this as the chosen answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27347902
type: AnswerComment

http://stackoverflow.com/a/27389035
has comment: http://stackoverflow.com/comment/43226191
accepted answer of: http://stackoverflow.com/q/27389009
has body: Add a debugger line to the code; it will break the code there for inspection.
answers question: http://stackoverflow.com/q/27389009
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/q/27391239
type: Question
tagged with: javascript
has title: Backbone Collection not populating fully from JSON
score: 0
answer count: 1
tagged with: backbone.js
type: UnansweredQuestion
has body: I'm trying to populate a Backbone collection from JSON data. However, after I try populating the collection I'm only getting one of the items when I should be getting 12. Any ideas of what's going on? JS: (function ($) { var Sponsor = Backbone.Model.extend({ defaults: { link: "http://www.google.com", photo: "http://placekitten.com/g/500/500" } }); var Sponsors = Backbone.Collection.extend({ model: Sponsor, url: '../json/sponsors.json' }); var SponsorView = Backbone.View.extend({ tagName: "li", className: "sponsors-container", template: $("#sponsorTemplate").html(), render: function() { var tmpl = _.template(this.template); this.$el.html(tmpl(this.model.toJSON())); return this; } }); var SponsorsView = Backbone.View.extend({ el: $(".sponsors"), initialize: function() { this.collection = new Sponsors(); this.collection.on("sync", this.render, this); this.collection.fetch(); }, render: function() { var that = this; _.each(this.collection.models, function(item) { that.renderSponsor(item) }, this); }, renderSponsor: function(item) { var sponsorView = new SponsorView({ model: item }); this.$el.append(sponsorView.render().el); } }); var sponsor = new SponsorsView(); } (jQuery)); JSON: { "sponsors":[ {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://placekitten.com/g/500/500"}, {"link":"http://google.com", "photo":"http://pla…
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43230848
linked to: http://stackoverflow.com/q/8608184
has answer: http://stackoverflow.com/a/27398095

http://stackoverflow.com/q/27348991
score: 0
tagged with: frontend
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43152912
answer count: 0
tagged with: resources
type: Question
has body: As far as i know there are so many restrictions, for security reasons, on the javascript on browser environment, like file I/O (even that are some sand boxes that make it possible), book marks removal. I would like to list what resources are accessible directly through javascript, and what resources aren't accessible? Somebody have this list easy? Some examples of resources are: camera, microphone, file system, browser features (bookmarks, history, extensions) etc.
has comment: http://stackoverflow.com/comment/43152899
has title: What kinds of resources are accessible through javascript on browser environment?
tagged with: javascript
tagged with: browser

http://stackoverflow.com/a/27414332
has comment: http://stackoverflow.com/comment/43331067
score: -2
has body: Obfuscate your JS, your above code would turn into this if you don't want to show your url: eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$(3(){8 6=\'d://c.b\';$.9({a:\'f\',g:6,j:3(5){5.h(3(1){8 0=[];0.4(\'&lt;2&gt;\'+1.7+\'&lt;/2&gt;\');0.4(\'&lt;2&gt;\'+1.7+\'&lt;/2&gt;\');$(\'1\').k(0.i(\'\'))})},l:3(e){}})})',22,22,'HTML|something|td|function|push|data|host|date|var|ajax|type|com|mysensitivemongolaburl|https||GET|url|forEach|join|success|append|error'.split('|'),0,{})) there are plenty of other places where you can do the same thing. you can also do it on here. http://www.jsobfuscate.com/ or you can try the other following techniques: JavaScript Beautifier – make your JavaScript code look pretty! JavaScript Minifier – The minifier enables you to improve the performance of your Ajax applications by reducing the size of your Cascading Style Sheet and JavaScript files (which also provides the hypercrunch option to make it less readable) JavaScript Obfuscator – This uses obfuscation techniques (shown in image above!). Nice. encode base 64 – http://www.shell-tools.net/index.php?op=base64_enc decode base 64 – http://www.shell-tools.net/index.php?op=base64_dec http://jsutility.pjoneil.net/ – JavaScript Utility Version 3 – Obfuscation Program in my opinion you can't do much about the front-end besides js/jquery code obfuscation. Have you thought of authenticating the users? you are going to get random people viewing your page if its going to be public.
answers question: http://stackoverflow.com/q/27414295
downvote count: 2
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/43272778
has comment: http://stackoverflow.com/comment/43272927

http://stackoverflow.com/comment/43352213
type: QuestionComment
has text: if you find one let me and the others on here who have asked the exact same question know.....
type: Comment
comment on: http://stackoverflow.com/q/27457427
score: 0

kendo-combobox
tag name: kendo-combobox
tags question: http://stackoverflow.com/q/27403303
type: Tag

http://stackoverflow.com/comment/43246887
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27400404
has text: i have done it "; but nothing is happening

http://stackoverflow.com/a/27364395
has comment: http://stackoverflow.com/comment/43182728
has comment: http://stackoverflow.com/comment/43181847
has comment: http://stackoverflow.com/comment/43182948
has comment: http://stackoverflow.com/comment/43181338
has body: To make this work reliably, you're going to have to change how you receive the data. An object gives no guarantee of order of enumeration, so it may give the appearance of working for a while, but it can fail at any time. Instead use some other format. Below I'm going to use strings with a : separator. Like this: Array.prototype.multiSort = function() { // Make an array of arrays: // [ ["name" :"asc" ], // ["age" :"desc"], // ["money":"desc"] ] var sorters = Array.prototype.map.call(arguments, function(s) { return s.split(":"); }); function compare(a, b) { // Iterate over the sorters, and compare using the first non-equal values. for (var i = 0; i &lt; sorters.length; i++) { var a_val = a[sorters[i][0]]; var b_val = b[sorters[i][0]]; if (a_val === b_val) { continue; // They're equal values, so try the next sorter } // Swap values if not ascending if (sorters[i][1] !== "asc") { var temp = a_val; a_val = b_val; b_val = temp; } // Use `.localeCompare()` if they're both strings if (typeof a_val === "string" &amp;&amp; typeof b_val === "string") { return a_val.localeCompare(b_val); } return a_val - b_val; } } return this.sort(compare); }; var data = [ { "name": "a", "age": 1, "money": 4 }, { "name": "f", "age": 4, "money": 1 }, { "name": "c", "age": 2, "money": 3 }, { "name": "a", "age": 0, "money": 1 }, { "name": "f", "age": 4, "money": 3 }, { "name": "c", "age": 1, "money": 4 }, { "name": "c", "age": 3, "money": 1 } ]; var data = data.multiSort("name:asc", "age:desc", "money:desc"); document.body.innerHTML = "&lt;pre&gt;" + JSON.stringify(data, null, 4) + "&lt;/pre&gt;"; So what this does is it splits each string on the :, so that we get a resulting array with the key to sort and the direction. Then in the compare function, we just loop over the sorters, grab the value from a and b, and if they're not equal, we go ahead and return the comparison. If they are equal, we need to move on to the next sorter and try with that one. So there's no real need for an extra functio…
accepted answer of: http://stackoverflow.com/q/27363952
has comment: http://stackoverflow.com/comment/43181396
upvote count: 3
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43181350
downvote count: 0
has comment: http://stackoverflow.com/comment/43181484
has comment: http://stackoverflow.com/comment/43181591
answers question: http://stackoverflow.com/q/27363952
score: 3

http://stackoverflow.com/q/27372513
has body: I'm working on a project using raphaelJS, I'm trying to draw arrows at both ends of an arch and while I have the arch down, but it's hard to get arrows. Thanks in advance for any input! the issue: how do you draw arrows at the end of curved raphael lines? The mockup What I got so far, in a JS Fiddle The Body Tag &lt;html&gt; &lt;body&gt; &lt;div id="arrows"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; The Coffeescript/Javascript window.ready = -&gt; $canvas = $('body').find '#arrows' paper = Raphael $canvas[0], 500, 500 WIDTH = 500 HEIGHT = 500 center = [WIDTH / 2, HEIGHT / 2] radius = 230 stroke = 5 paper.customAttributes.arc = (center_x, center_y, degrees, radius) -&gt; return unless radius radians = (90 - degrees) * Math.PI / 180 arc_x = center_x + radius * Math.cos radians arc_y = center_y - radius * Math.sin radians path = [ ['M', center_x, center_y - radius] ['M', center_x, center_y - radius] ['A', radius, radius, 0, +(degrees &gt; 180), 1, arc_x, arc_y] ] return {path} arrow_1 = paper.path() arrow_1.node.setAttribute 'class', 'arrow_1' arrow_1.attr {arc: [center[0], center[1], 80, radius]} arrow_1.rotate 80, center[1], center[0] THE CSS #arrows { display: block; height: 500px; width: 500px; } #arrows circle, #arrows path { stroke: #fff; stroke-opacity: 1; stroke-width: 2; }
type: AnsweredQuestion
score: 3
tagged with: coffeescript
tagged with: raphael
has comment: http://stackoverflow.com/comment/43196034
type: Question
tagged with: javascript
has title: RaphaelJS - how to draw arrow-heads at the end of archs?
upvote count: 3
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27377379
accepted answer: http://stackoverflow.com/a/27377379
favorite count: 0

http://stackoverflow.com/q/27462978
accepted answer: http://stackoverflow.com/a/27463064
has body: I am trying to execute last modified JavaScript after i change it, however, browsers insist on using cached data. I use shift+f5 to override cached data and download fresh copy from the server. It works for this case. Lets assume that i launched the site and its used constantly. After i change a JavaScript file. None of the user will not be able to see the changes (for who entered the site before the change). So, how can i force all clients to erase or ignore current cached data and download all the site. I found a workaround. If i change the file name, browser downloads it. Which is not surprising. Is there any other solution (preferably more professional) to make browser ignore cached data?
has answer: http://stackoverflow.com/a/27463064
type: AnsweredQuestion
type: Question
has title: How to make browser ignore cached data and reload it
tagged with: browser-cache
tagged with: javascript
tagged with: caching
score: 0
answer count: 1

http://stackoverflow.com/comment/43364420
has text: Thanks so much Macell! Your suggestion did work. Is there a way to avoid wrapping my function within an anonymous function? Any syntactic sugar? Do you have any reading to recommend which explains the difference between a standard function, and making it callable in an anonymous function?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27464040

http://stackoverflow.com/q/27374517
has comment: http://stackoverflow.com/comment/43199970
accepted answer: http://stackoverflow.com/a/27374936
has body: while loop in javascript function calc(){ var one = document.getElementById("fv").value; var two = document.getElementById("sv").value; var one1 = parseInt(one); var two1 = parseInt(two); var total = 0; if(one1<=two1){ while (one1 <= two1){ total = total+one1; one1++; total=total; } document.getElementById("tv").value = total; }} calc() //call function There are some confusion using while loop in java script. can i use while loop for those type of calculation? "Calculation of sum between two numbers" First Number Second Number Value Calculate
answer count: 1
has comment: http://stackoverflow.com/comment/43199347
has title: Value will blink only once at the html text box
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27374936
has comment: http://stackoverflow.com/comment/43199371
type: AnsweredQuestion
score: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: Question
upvote count: 3

http://stackoverflow.com/a/27358921
upvote count: 0
answers question: http://stackoverflow.com/q/27356619
accepted answer of: http://stackoverflow.com/q/27356619
score: -1
has body: The id is an HTML element's id, not the value function addcommas(id) { //Not really needed, but just to shorten the details below var x = document.getElementById(id); //Current value but removes anything aside from numbers 0-9 and comma (not really needed) var curval = x.value.replace(/[^\d,]/g,''); //Strips the comma from the current value if someone entered it manually. var nocomma = x.value.replace(/[^\d]/g,''); //If not blank, prevent NAN error if (nocomma.length&gt;0) { //Converts text to int nocomma = parseInt(nocomma, 10); //Dont know why, but doesnt work without this nocomma = nocomma+0; //Converts it back to string to add the comma nocomma = nocomma+""; //Adds comma every 3 numbers, I got this from other research, dont know how it works x.value = nocomma.replace(/(\d)(?=(\d{3})+$)/g, '$1,'); } } My Input in the HTML is as follows //for iphone, this will popout the numberpad with choices 0-9 only. Easier to type, better mobile usability. &lt;input type="text" pattern="\d*" maxlength="12" id="f2f11c3" value="0"&gt;&lt;/input&gt;
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43172167
has comment: http://stackoverflow.com/comment/43170773
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/43173364

http://stackoverflow.com/a/27354055
downvote count: 0
type: Answer
has body: after a lot of trials and errors, I came up with this idea . Its working as per requirement . Try it $(function() { // run chosen plugin $("#my-dropdown").chosen({ disable_search_threshold: 10, no_results_text: "No Results Found!", width: "50%" }); $(".default").keyup(function() { $(".chosen-results li").sort(sort_bey).appendTo('.chosen-results'); function sort_bey(a, b) { var str = $(a).text(); var str2 = $(b).text(); var v = $('.default').val(); var p1 = str.indexOf(v.charAt(0)); var p2 = str2.indexOf(v.charAt(0)); return (p1 > p2) ? 1 : -1; } }); }); one one two one three two two three
upvote count: 1
answers question: http://stackoverflow.com/q/27331465
accepted answer of: http://stackoverflow.com/q/27331465
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/43153692
has text: There should be a disconnect event on the server if you're listening for the right event.
comment on: http://stackoverflow.com/q/27349252
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27367668
has comment: http://stackoverflow.com/comment/43187387
downvote count: 1
has answer: http://stackoverflow.com/a/27367881
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27367843
has answer: http://stackoverflow.com/a/27384128
type: Question
score: 5
has comment: http://stackoverflow.com/comment/43187259
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27367881
favorite count: 0
has body: How to select the nearest element with a specific class that is or may not be on the same level as the clickable element? For example, lets says that this is the output: A Click on this will change A B Click on this will change B C Click on this will change C Click on this will change D D Click on this will change E E I want when I click on p.click that it will find the nearest p.change-on-click element. Just like this, but unfortunately I can't change the HTML. $('.click').on('click', function(){ $(this).closest('.parent').find('.change-on-click').css('color', 'red'); }); A Click on this will change A B Click on this will change B C Click on this will change C Click on this will change D D Click on this will change E E Here's a fiddle with the second situation
tagged with: jquery-selectors
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has title: Select nearest element by class on the same(or not) level
answer count: 4
has answer: http://stackoverflow.com/a/27367987
has answer: http://stackoverflow.com/a/27367843

http://stackoverflow.com/comment/43370359
comment on: http://stackoverflow.com/a/27467286
score: 0
type: AnswerComment
type: Comment
has text: I understand @kosturko , but since the File Data has the Top Searches i would always like to display the data from there and meanwhile fetch other records too from the DB (of course both the results will be separated by a "list divider" , hence making the user aware of what data is what and from where) . Also the data fetch from the DB is irrespective of the presence in the File . As i mentioned that even if the matching results were found from the File, the logic will still hit DB (or better the cached result from DB) to show both results (divided by a marker or a divider ).

http://stackoverflow.com/q/27319208
tagged with: phantomjs
score: 0
answer count: 1
tagged with: javascript
has title: Get nothing when scraping Facebook using Casperjs
has answer: http://stackoverflow.com/a/27319470
type: UnansweredQuestion
tagged with: facebook
tagged with: casperjs
has body: I am trying to use casperjs to scrape the main page of Facebook. I just modified the example code to scrape Google by casperjs: identify the element with class=fbxWelcomeBoxName, and retrieve the link out of it. Their example works fine for Google.com, but it seems it does not work when scraping on Facebook. I heard about Facebook banning scraping about customer audience. But my scraping has nothing to do with that. Did I miss anything? Thanks in advance! var links = []; var casper = require('casper').create(); function getLinks() { var links = document.querySelectorAll('.fbxWelcomeBoxName'); return Array.prototype.map.call(links, function(e) { return e.getAttribute("href"); }); } casper.userAgent('Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1'); casper.start('https://www.facebook.com', function() { // search for 'casperjs' from facebook form this.fill('form#login_form', { email: '***your email***', pass: '***your password***' }, true); }); casper.then(function() { // aggregate results links = this.evaluate(getLinks); }); casper.run(function() { // echo results in some pretty fashion this.echo(links.length + ' links found:'); this.echo(' - ' + links.join('\n - ')).exit(); }); Result: john@john-ubuntu-ssd:~/tests/casperjs$ casperjs --verbose --log-level=debug --ssl-protocol=any test11.js [info] [phantom] Starting... [info] [phantom] Running suite: 3 steps [debug] [phantom] opening url: https://www.facebook.com/, HTTP GET [debug] [phantom] Navigation requested: url=https://www.facebook.com/, type=Other, willNavigate=true, isMainFrame=true [debug] [phantom] url changed to "https://www.facebook.com/" [debug] [phantom] Successfully injected Casper client-side utilities [info] [phantom] Step anonymous 2/3 https://www.facebook.com/ (HTTP 200) [info] [remote] attempting to fetch form element from selector: 'form#login_form' [debug] [remote] Set "email" field value to myemail@hotmail.com [debug] [remote] Set "pass" field v…
type: Question

http://stackoverflow.com/a/27942402
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/27382766
accepted answer of: http://stackoverflow.com/q/27382766
upvote count: 3
has body: If you're disabling search this will also hide the placeholder even when there is no selection. The placeholder span element : My Placeholder Just removed the "$select.searchEnabled &&" in the template .js file and the placeholder will appear again. As seen on by hthabet on github
type: AcceptedAnswer

http://stackoverflow.com/a/27362619
accepted answer of: http://stackoverflow.com/q/27341388
upvote count: 11
score: 11
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27341388
has body: The solution was the following: I had to change the HTML by addiong ID to the lable Option 1 Option 2 and by using following jQuery: var answer= ''; $('#Group .active').each(function(){ answer= $(this).attr('id'); });
type: Answer

http://stackoverflow.com/q/27372457
has comment: http://stackoverflow.com/comment/43196192
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43195891
has answer: http://stackoverflow.com/a/27374520
favorite count: 0
duplicate of: http://stackoverflow.com/q/7545641
has comment: http://stackoverflow.com/comment/43196345
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43195904
tagged with: php
has title: How to create multi dimensional javascript object in php?
downvote count: 2
type: Question
tagged with: object
has body: How to create multi-dimensional javascript object in php? I want to create javascript object from below php array, $arrCat = array(); $arrCat['vehicles']['id'][0] = 2; $arrCat['vehicles']['name'][0] = 'cars'; $arrCat['vehicles']['id'][1] = 3; $arrCat['vehicles']['name'][1] = 'bikes'; $arrCat['property']['id'][0] = 5; $arrCat['property']['name'][0] = 'house'; $arrCat['property']['id'][1] = 6; $arrCat['property']['name'][1] = 'apartments'; Please help!
score: -2
tagged with: javascript

http://stackoverflow.com/a/43683893
score: 2
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27459899
has body: run-sequence: Runs a sequence of gulp tasks in the specified order. This function is designed to solve the situation where you have defined run-order, but choose not to or cannot use dependencies. npm install --save-dev run-sequence // runSequence will ensure this task will run the following tasks in the listed order gulp.task('things-to-do', callback =&gt; runSequence( 'clean-up-workspace', // clean up before copying new files 'copy-new-files', // wait till copy-new-files done before linting 'lint', // wait till lint is done before running minify 'minify', // wait till minify is done before starting laundry and dinner ['do-laundry', // do laundry and cook dinner at the same time 'cook-dinner'], 'bath-cat', // don't bath the cat till both laundry and dinner are done callback )); https://www.npmjs.com/package/run-sequence

http://stackoverflow.com/comment/43289564
score: 2
has text: which language are you using?
comment on: http://stackoverflow.com/q/27423806
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27411506
has comment: http://stackoverflow.com/comment/43267852
has comment: http://stackoverflow.com/comment/43267765
answer count: 0
type: Question
tagged with: javascript
has body: I'm committed to learning d3.js but I'm having a very difficult time parsing different types of data in d3.js. In this case it's just a simple .csv file for a line graph with tooltips but I can not figure it out. I would appreciate it if someone could take a look at my jsfiddle and offer some suggestions. Thank you for your help! d3.csv("http://www.corsproxy.com/dvl.thomascooper.com/data/mapleleaf.csv", data.forEach(function(d) { //please see fiddle for complete code d.date = parseDate(d.date); d.value = +d.value; }); http://jsfiddle.net/tommy6s/k6euLgrp/
has title: hit a wall with d3.js line chart
score: 0
has comment: http://stackoverflow.com/comment/43268639
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/a/27462555
accepted answer of: http://stackoverflow.com/q/27462403
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27462403
type: Answer
has body: Although as pointed out it is advisable to use transform without vendor prefixes (because jQuery automagically adds vendor prefixes for you), that is not the source of the problem. I realized that using event.offsetX and event.offsetY is giving conflicting values that constantly flips between positive and negative values upon mousemove, causing the slope calculation to be borked (thus flickering). I have created a fork of your fiddle to demonstrate how offsetX/Y and clientX/Y measurements are different, and why using the latter is preferable: Instead, use the .clientX and .clientY objects instead: $(document).bind("mousemove", function(event) { if (getClickStarted){ if (event &amp;&amp; event.preventDefault){ event.preventDefault(); } // Use clientX/Y instead of offsetX/Y curX = event.clientX; curY = event.clientY; var width = Math.sqrt(Math.pow(curX - centerX, 2) + Math.pow(curY - centerY, 2)); var slope = Math.atan2(curY - centerY, curX - centerX)*180/Math.PI; // Use unprefixed transform $("#line").css({ "width": + width +"px", "height": "4px", "transform": "rotate(" + slope + "deg)" }); } }); See fixed fiddle here: http://jsfiddle.net/teddyrised/hepbob75/12/
has comment: http://stackoverflow.com/comment/43361670
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/27325508
accepted answer: http://stackoverflow.com/a/27326436
linked to: http://stackoverflow.com/q/24366312
tagged with: file
has comment: http://stackoverflow.com/comment/43119967
type: Question
has body: Is it possible to use javascript File API to read a file object of unknown id? I use a custom file upload form in which the code doesn't have an input element. It uses plupload.js API and I can't determine how to access to the contents of file object. For example if the code had something like the line 1, I could access the contents of file object using the code of line 2 input type="file" id="data" var finput = document.getElementById("data"); var f = finput.files[0]; I tried something like document.files[0] but it doesn't work. Do you know something similar?
tagged with: object
type: AnsweredQuestion
has title: javascript read file object unknown id
tagged with: plupload
has answer: http://stackoverflow.com/a/27326436
linked to: http://stackoverflow.com/q/20537696
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/27358771
has comment: http://stackoverflow.com/comment/43171748
has comment: http://stackoverflow.com/comment/43170334
answer count: 1
has title: Prototype concept as given in Mozilla docs
has comment: http://stackoverflow.com/comment/43171961
accepted answer: http://stackoverflow.com/a/27359333
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/17245580
has comment: http://stackoverflow.com/comment/43176366
type: Question
has comment: http://stackoverflow.com/comment/43171609
has body: I was reading the JavaScript Object Model as given in Mozilla documents (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model) and have what might be a very silly question. As you can see, it describes a prototype-based inheritance hierarchy (Manager inherits from Employee) as the following: function Employee() { this.name = ""; this.dept = "general"; } function Manager() { Employee.call(this); this.reports = []; } Manager.prototype = Object.create(Employee.prototype); Shouldn't the last line say Employee instead of Employee.prototype? I think it should be the former if we're going to build a prototype chain. Please explain.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43171685
has answer: http://stackoverflow.com/a/27359333
score: 0

http://stackoverflow.com/q/27345449
has comment: http://stackoverflow.com/comment/43146244
has comment: http://stackoverflow.com/comment/43146136
score: 0
has comment: http://stackoverflow.com/comment/43146164
has comment: http://stackoverflow.com/comment/43146300
has body: I've been trying to understand some of the documentation available regarding multidimensional arrays and JSON parsing, but I am just not grasping the concept. I was hoping someone could help me understand a bit more. I have the following JSON: var obj1 = { "couples": [ { "id": "1", "state": ME", "attributes": [ { "NAME": "John &amp; Jane", "BABY": "Kristen" } I am trying to output the states of each couple in a table row (there are multiple, I just cut the JSON short for the sake of example. Here's my code, what am I doing wrong? document.write('&lt;table&gt;&lt;tr&gt;'); var i; for (i = 0; i &lt; obj1.couples.length; i++) { document.write('&lt;td&gt;' + couples[i].state); } Also, how might i get the name of the couple?
answer count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Loop through JSON multidimentional array using Javascript
has comment: http://stackoverflow.com/comment/43146115
has comment: http://stackoverflow.com/comment/43146210
type: Question
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/27419942
tagged with: google-chrome-app
has comment: http://stackoverflow.com/comment/43332762
favorite count: 0
has body: I am trying to make chrome App which can access localfile system and keep watch on specific directory to check if any new file came or not? , so i need to use chrome.filesystem for that as per this code provided by google , its giving me error that chrome.filesystem is undefined. Code : chooseDirButton.addEventListener('click', function(e) { chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function(theEntry) { if (!theEntry) { output.textContent = 'No Directory selected.'; return; } // use local storage to retain access to this file chrome.storage.local.set({'chosenFile': chrome.fileSystem.retainEntry(theEntry)}); loadDirEntry(theEntry); }); }); Menifest File : { "manifest_version": 2, "name": "Test", "short_name": "Test", "minimum_chrome_version": "31", "description": "Description for Test", "version": "0.0.1.0", "icons": { "16": "assets/icon_16.png", "128": "assets/icon_128.png" }, "app": { "background": { "scripts": ["background.js"], "persistent": false } }, "permissions": [ {"fileSystem": ["write", "retainEntries", "directory"]}, "storage","notifications","webview","http://*/*","fileSystem" ], "file_handlers": { "text": { "types": [ "text/*" ] } } } background.js: chrome.app.runtime.onLaunched.addListener(function(launchData) { chrome.app.window.create('index.html', {id:"fileWin", innerBounds: {width: 800, height: 500}}, function(win) { win.contentWindow.launchData = launchData; }); }); How can i use chrome.filesystem ? please help. Thank you.
has comment: http://stackoverflow.com/comment/43282821
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/43283073
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43283211
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/43283300
score: 2
has comment: http://stackoverflow.com/comment/43283035
tagged with: google-chrome-devtools
has comment: http://stackoverflow.com/comment/43282727
type: Question
has title: Error while using Chrome.filesystem : Chrome.fileSystem is undefind
has comment: http://stackoverflow.com/comment/43282966
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43282896
has comment: http://stackoverflow.com/comment/43306112

http://stackoverflow.com/q/27343656
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27343851
has comment: http://stackoverflow.com/comment/43143227
has title: jQuery Ajax File fetching issue
has body: I am trying to fetch the files contents using ajax but it is not working ? I dont know why, even though I have written the same code written on w3schools.com examples. $().ready(function(){ $("button").click(function(){ $.ajax({url:"Sample.txt", success:function(result) { alert(result); //$("#changedText").text(result); } }); }); });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43143398
has comment: http://stackoverflow.com/comment/43143456
has comment: http://stackoverflow.com/comment/43143290
has comment: http://stackoverflow.com/comment/43142765
has comment: http://stackoverflow.com/comment/43143093
has comment: http://stackoverflow.com/comment/43143077
downvote count: 2
tagged with: file
upvote count: 1
has comment: http://stackoverflow.com/comment/43142772
type: Question
has answer: http://stackoverflow.com/a/27343851
has comment: http://stackoverflow.com/comment/43142982
score: -1
has comment: http://stackoverflow.com/comment/43142754
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43143049
favorite count: 0

http://stackoverflow.com/q/27468110
tagged with: css
has comment: http://stackoverflow.com/comment/43371683
has title: Pure CSS website translate
upvote count: 1
tagged with: lang
has answer: http://stackoverflow.com/a/27468232
has answer: http://stackoverflow.com/a/27469175
tagged with: javascript
type: UnansweredQuestion
answer count: 4
has comment: http://stackoverflow.com/comment/43372132
has body: I have found solution for pure css translation on stackoverflow. Here. In css I have: .en, .sl { display:none; } /* hide all elements with a language class */ .en:lang(en), .sl:lang(sl) { display:block; } /* show those elements that match their language class */ In HTML: and Pozdravljeni Hello For change of lang attribute I use js: function setLang(lang) { document.getElementsByTagName('html')[0].setAttribute('lang',lang); } It works ok on my computer in Chrome. It work on my iphone. On ipad mini. But it does NOT work on my girlfriends computer in Chrome. And not in IE. And it seems it does NOT work on my computer on IE. Problem is in css. This code: .en, .sl { display:none; } works, and this not: .en:lang(en), .sl:lang(sl) { display:block; } I can't figure it out what is wrong.
has answer: http://stackoverflow.com/a/27468211
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27468332
has comment: http://stackoverflow.com/comment/43372125
favorite count: 0
type: Question
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43372741

http://stackoverflow.com/q/27426005
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43293971
has answer: http://stackoverflow.com/a/27426211
possible better answer: http://stackoverflow.com/a/27426074
answer count: 4
has answer: http://stackoverflow.com/a/27426074
upvote count: 2
downvote count: 2
type: AnsweredQuestion
has body: In html, I have used hidden fields with dynamic ids. something 1 something 2 something 3 Here I am getting the id of the above hidden element in jquery. var hiddenID = $('input[name$="edit_hid"]').attr('id'); alert(hiddenID ); Whenever I click the hyperlink something 1, something 2, something 3, I am always getting the id as edit_0 How can I get the dynamic id for each hyperlink? so that I can get the value of those dynamic ids.
accepted answer: http://stackoverflow.com/a/27426211
type: Question
has comment: http://stackoverflow.com/comment/43294079
has comment: http://stackoverflow.com/comment/43293845
has comment: http://stackoverflow.com/comment/43293874
has answer: http://stackoverflow.com/a/27426085
has title: How to get dynamic hidden id value in jquery?
has answer: http://stackoverflow.com/a/27426277
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/27327682
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27327809
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/27327809
has body: I have the following JavaScript which brings in some data from a XML file: function ajaxRequest(){ var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken) for (var i=0; i<activexmodes.length; i++){ try{ return new ActiveXObject(activexmodes[i]) } catch(e){ //suppress error } } } else if (window.XMLHttpRequest) // if Mozilla, Safari etc return new XMLHttpRequest() else return false } var mygetrequest=new ajaxRequest() if (mygetrequest.overrideMimeType) mygetrequest.overrideMimeType('text/xml') mygetrequest.onreadystatechange=function(){ if (mygetrequest.readyState==4){ if (mygetrequest.status==200 || window.location.href.indexOf("http")==-1){ var xmldata=mygetrequest.responseXML //retrieve result as an XML object var rssentries=xmldata.getElementsByTagName("TUTORIAL") var output=' ' for (var i=0; i<rssentries.length; i++){ output+=' ' output+='' output+=rssentries[i].getElementsByTagName('TITLE')[0].firstChild.nodeValue+'' output+=' ' } output+=' ' document.getElementById("result").innerHTML=output } else{ alert("An error has occured making the request") } } } mygetrequest.open("GET", "../xml/tutorials.xml", true) mygetrequest.send(null) Here is the XML file: <?xml version="1.0" encoding="ISO-8859-1"?> Script Tutorials http://www.script-tutorials.com Web Topics Tutorials en 19/08/2014 HTML/CSS <TITLE>Sliding single-level menu Menu is one of the important components of any site. Today it is difficult to find a website without the navigation menu. Today we have prepared a modern looking single-level menu. You might think again, but the menu looks really interesting, its feature is a sliding panel which highlights the active elements. <LINK>http://www.script-tutorials.com/sliding-single-level-menu/ 01/11/2013 HTML/CSS <TITLE>Whirling CSS3 dropdown menu Various dropdown menus can be easily created with CSS3 with the help …
score: 0
answer count: 1
tagged with: javascript
has title: JavaScript & XML How to bring in more information?

http://stackoverflow.com/q/27457208
has comment: http://stackoverflow.com/comment/43351597
type: Question
tagged with: javascript
answer count: 3
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/43351591
has answer: http://stackoverflow.com/a/27460413
has comment: http://stackoverflow.com/comment/43351637
has answer: http://stackoverflow.com/a/27464532
score: -4
has comment: http://stackoverflow.com/comment/43351574
tagged with: php
tagged with: css
downvote count: 4
has comment: http://stackoverflow.com/comment/43351614
possible better answer: http://stackoverflow.com/a/27460413
has body: &lt;img onmouseover="http://www.habbohut.com/_images/_content/_habbohut/facebook_sign2.png" align="right" alt="facebook" name="facebook" width="231" height="231" border="0" id="facebook" style="margin-top: -12px; margin-right: -60px;"&gt; Its not working. It comes up as a box, not a broken image but a box which doesn't display the image. I'm adding it to my website, could i be putting it in the wrong place? Also, i put it in my forum wrapper and i want the image to be displayed and when you hover your mouse over it so it changes to image 2 please help.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43351603
upvote count: 0
has title: Change image on mouse over
has comment: http://stackoverflow.com/comment/43351686
has comment: http://stackoverflow.com/comment/43351585
has answer: http://stackoverflow.com/a/27457276
accepted answer: http://stackoverflow.com/a/27457276

http://stackoverflow.com/q/27319691
tagged with: html5-canvas
tagged with: webrtc
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27321146
type: UnansweredQuestion
has title: Real-time shared document preview with markup tools in web browser using HTML5 and ASP .NET MVC back-end
has body: I have an issue with shared document (pdf, docx, xlsx) viewing and marking tools (simple line, shapes, arrows) for ASP .NET MVC web site using HTML5 capabilities. I need to implement some kind of google docs within website so the end users can view and put marks to the same document and see it is being marked at the browser window for all other users viewing such document at real-time. The best solution is to use some kind of peer-to-peer communication without server-side to be involved (like WebRTC). All markup functionality seems to be done using HTML5 canvas. Document storage on the server is not mandatory. All marks are stored within the connection session. For now I have found some pretty complex and expensive approaches like crocodoc and groupdocs that actually provide much more functionality that is needed for my project. Please suggest anything that can help me with my goal achieving Thanks for all responses!
has answer: http://stackoverflow.com/a/27319784
tagged with: asp.net-mvc
tagged with: javascript
type: Question
score: 0
answer count: 2

http://stackoverflow.com/comment/43158915
comment on: http://stackoverflow.com/q/27352088
has text: @ShunmugaAshok That's not a "map", which has a very specific meaning, it's an "object", or some might call it a "hash". Please change the title of your question. Meanwhile, read a basic tutorial on JS objects. You don't need to "iterate" or "check", you just need to access the key, as in `object[key]`. That's what objects exist for.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27450281
type: Answer
has body: Array.prototype.filter is great for a problem like this. This code should produce what you're looking for: data.some = data.some.filter(function(item) { return item.info.filter(function(i) { return i.next &gt; 0; }).length &gt; 0; });
has comment: http://stackoverflow.com/comment/43340297
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43340250
downvote count: 0
answers question: http://stackoverflow.com/q/27450028
has comment: http://stackoverflow.com/comment/43340267
has comment: http://stackoverflow.com/comment/43339955

http://stackoverflow.com/q/27427577
has answer: http://stackoverflow.com/a/27427740
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has body: I am trying to clone a form for multiple entries on a page. I am using jquery clone method. It is working except when I come to an onchange event. My onchange event when changed creates checkboxes based on selection. This is an additional javascript function I have created. The onchange and dynamic checkboxes are not functioning the the cloned forms. This is my jquery for cloning: This is the html form I am using: Seed Variety [Choose] <?= $optionHtml2?> Seed Size [Choose] MP RP XTRM Treatments Pails and this is the javascript that creates the checkboxes: function populate(seedSize, slct2) { var s1 = document.getElementById(seedSize); var s2 = document.getElementById(slct2); s2.innerHTML = ""; if (s1.value == "MP") { var optionArray = ["Poncho", "Kabina", "T45"]; } else if (s1.value == "RP") { var optionArray = ["Poncho", "Kabina", "T45"]; } else if (s1.value == "XTRM") { var optionArray = ["Poncho", "Kabina", "T20"]; } for (var option in optionArray) { if (optionArray.hasOwnProperty(option)) { var pair = optionArray[option]; var checkbox = document.createElement("input"); checkbox.type = "checkbox"; checkbox.name = "treatments[]"; checkbox.value = pair; s2.appendChild(checkbox); var label = document.createElement('label') label.htmlFor = pair; label.appendChild(document.createTextNode(pair)); s2.appendChild(label); s2.appendChild(document.createElement("br")); } } document.getElementById('reload').disabled = false; } Thanks for the help!!
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Cloning select with onchange

http://stackoverflow.com/comment/43203503
has text: @user3428422 No probs, glad I could help :)
comment on: http://stackoverflow.com/a/27376847
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43092467
type: Comment
has text: Lars. Thank you very much for your help. One more question please. Is there any possibility to append the shapes to SVG? The problem is I am working on SVG and would like to append them to that SVG. Do you think there is any way to do so? Once again, thank you very much for your help. It is very much appreciated.
score: 0
comment on: http://stackoverflow.com/q/27314557
type: QuestionComment

http://stackoverflow.com/comment/43225616
type: QuestionComment
comment on: http://stackoverflow.com/q/27388779
has text: I guess FF assumes that since the field is a number, leading zeroes are insignificant and removes them automatically.
score: 0
type: Comment

http://stackoverflow.com/comment/43208532
has text: I would try getting rid of the line `game.HexRenderer = game.HexRenderer || {};` just in case, as it shouldn't do anything anyways. It's possible the javascript optimization is stopping at that for some reason.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27358645

http://stackoverflow.com/q/27396290
type: Question
has comment: http://stackoverflow.com/comment/43238867
tagged with: javascript
has body: what i Need I Need to call function from href . html code &lt;a href="#" onclick="peopleattending('.$_COOKIE['user'].', '.$_COOKIE['evnt_id'].');"&gt; js code &lt;script&gt; $(document).ready(function() { function peopleattending(user_id,event_id) { console.log(user_id); console.log(event_id); $.ajax({ type:"GET", url:"{{get_hash_attend(user_id,event_id) }}", success: function(data) { $("#attend").text("Attending"); } }); } peopleattending(user_id,event_id); }); &lt;/script&gt; problem problem Uncaught ReferenceError: user_id is not defined in peopleattending(user_id,event_id); though im getting values say user_id=112223 and event_id=9. where im wrong if passing values in function in url : get_hash_attend(user_id,event_id) same error appears.
has answer: http://stackoverflow.com/a/27396425
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: symfony
has comment: http://stackoverflow.com/comment/43238873
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27396425
upvote count: 2
score: 1
tagged with: mysql
downvote count: 1
has title: Uncaught ReferenceError: user_id is not defined

http://stackoverflow.com/comment/43098869
type: Comment
has text: I've given more details.
score: 1
comment on: http://stackoverflow.com/a/27318895
type: AnswerComment

http://stackoverflow.com/q/27385346
tagged with: javascript
tagged with: jquery
has body: When I run this $('#tgsBox1').droppable({ accept: "#tgsSquirrel", drop: function(e, ui) { ui.draggable.animate({ left: $(this).position().left + 25, top: $(this).position().top + 131 }).destroy(); } }); The draggable element is actually destroyed (is not draggable anymore) but it gives an error: TypeError: ui.draggable.animate(...).destroy is not a function ui.draggable.animate({ Looks similar to the old thread: jquery ui error for ui.draggable("destroy"), but the assumed solution (updating the jQuery-ui) doesn't sort that out.
favorite count: 0
upvote count: 1
tagged with: draggable
has answer: http://stackoverflow.com/a/27385393
has title: jQuery droppable object executes destroy() but throws an error
type: AnsweredQuestion
score: 1
type: Question
linked to: http://stackoverflow.com/q/10024990
tagged with: jquery-ui
tagged with: destroy
accepted answer: http://stackoverflow.com/a/27385393
answer count: 1
downvote count: 0

http://stackoverflow.com/q/27435013
has comment: http://stackoverflow.com/comment/43324129
type: Question
has title: How to position modal dialog adjacent to button
has answer: http://stackoverflow.com/a/27435481
answer count: 1
has comment: http://stackoverflow.com/comment/43310951
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: Hello I am using a jquery supplied dialog modal popup, see: http://jqueryui.com/dialog/#modal-message It seems that by default the dialog box appears in the middle of the frame. I would like to have the modal box next to a button on my webpage. How would I go about doing this? What code would I add? Thanks! The code for the modal box is in the link
type: UnansweredQuestion

http://stackoverflow.com/q/27345202
has comment: http://stackoverflow.com/comment/43146722
type: Question
has comment: http://stackoverflow.com/comment/43145943
tagged with: session
tagged with: javascript
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/43145733
has comment: http://stackoverflow.com/comment/43146091
has title: How to maintain session in AngularJS
tagged with: jquery
has comment: http://stackoverflow.com/comment/43145788
has comment: http://stackoverflow.com/comment/43146604
tagged with: angularjs
type: UnansweredQuestion
has body: I am just exploring AngularJs and comes to a point where i need to maintain user session like if login then redirect it to home page else keep user to login Page. The two techniques which i discovered for this purpose is to use web browser local storage or session storage. My web application is user based, such that if user closes the browser its session must be killed. So that next time when it open browser it must singin. This could not be achieved by using localstorage because it will be availalbe for next time. Currently, i am using sessionstorage but the problem is that if tab is close or user open navigation in a new tab the current session is not available. So how do i maintain session for a user unless and untill it closes the browser. My implementation is as: app.controller('loginCtrl', ['$scope', '$rootScope', '$location', function ($scope, $rootScope, $location) { if (typeof (Storage) !== "undefined") { if (sessionStorage.storedInfo) { $rootScope.loginUser = JSON.parse(sessionStorage.storedInfo); } else { sessionStorage.setItem('storedInfo', JSON.stringify($rootScope.loginUser)); } } else { alert("Sorry, your browser does not support web storage..."); } if ($rootScope.loginUser.loginTrue) { $location.path('/home'); } else { $scope.logObj = { Username: 'hass', Password: '', session: $rootScope.session, loginUser: $rootScope.loginUser }; $scope.submitForm = function () { if ($scope.logObj.Username == 'hassaan' &amp;&amp; $scope.logObj.Password == 'hassaan') { $rootScope.loginUser.username = $scope.logObj.Username; $rootScope.loginUser.password = $scope.logObj.Password; $rootScope.loginUser.loginDateTime = new Date(); $rootScope.loginUser.loginTrue = true; sessionStorage.setItem('storedInfo', JSON.stringify($rootScope.loginUser)); $location.path('/home'); } } } }]) Any guidance to resolve the problem?
has comment: http://stackoverflow.com/comment/43145748
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/43145936

http://stackoverflow.com/q/27464912
upvote count: 1
has comment: http://stackoverflow.com/comment/43366663
type: Question
tagged with: recursion
has comment: http://stackoverflow.com/comment/43367044
tagged with: algorithm
tagged with: javascript
tagged with: data-structures
answer count: 2
has comment: http://stackoverflow.com/comment/43367127
downvote count: 0
has answer: http://stackoverflow.com/a/27465963
favorite count: 0
possible better answer: http://stackoverflow.com/a/27465503
has answer: http://stackoverflow.com/a/27465503
has comment: http://stackoverflow.com/comment/43367133
has body: I have a data structure that looks like this: var someDataStructure = [ { opts: {_id:1} }, { opts: {_id: 2}, children: [ { opts: {_id: 3}, children: [ { opts: {_id: 4} } ] } ] }, { opts: {_id: 5} }, { opts: {_id: 6}, children: [ { opts: {_id: 7}, children: [ { opts: {_id: 8} } ] } ] } ]; That's an array of objects, all with an opts property, and an optional children property. If it exists the children property will be an array of the same sort of objects. Given any opts._id, I need to find the _id of all parent objects. The _id's I give here are only sequential for convenience. You may not assume they are sequential integers This project is using both jquery and lodash so both of those libraries are available for use. Example desired output: Given 4, return [2, 3]. Given 3, return [2]. Given 8, return [6, 7]. Given 7, return [6]. I have no problem recursing in and finding the given _id. However, I'm feeling dumb and stuck on maintaining the array of parents.
has comment: http://stackoverflow.com/comment/43366677
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43367559
accepted answer: http://stackoverflow.com/a/27465963
has title: Finding parent objects in nested arrays of objects. How?

http://stackoverflow.com/comment/43369511
comment on: http://stackoverflow.com/q/27461491
score: 0
type: Comment
type: QuestionComment
has text: that picks up the right element, but not picking the updated 'todo' value, after the div content is edited.

http://stackoverflow.com/comment/43191882
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27370058
type: AnswerComment
has text: Note that `$.each` is not the same function as `$.fn.each`. Which was the OP expecting? Neither.

http://stackoverflow.com/q/27413848
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43271960
has title: How can i prevent default in confirm dialog in Angular JS
tagged with: events
has comment: http://stackoverflow.com/comment/43271842
type: AnsweredQuestion
tagged with: preventdefault
type: Question
has comment: http://stackoverflow.com/comment/43271857
has answer: http://stackoverflow.com/a/27414394
accepted answer: http://stackoverflow.com/a/27414394
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43271797
has body: I have this in my save function $scope.saveData = function () { if (confirm("Are you sure you want to save") === false) { return } // do saving Now if i use above code then i get this after clicking yes. Even if i click cancel i still get same error in firebug. But my data get saved if i click yes but error is still there. I only see this in firefox and not in chrome. If i remove confirm dialog then that error is gone. so its definitely related to dialog Error: [$rootScope:inprog] $apply already in progress http://errors.angularjs.org/1.2.25/$rootScope/inprog?p0=%24apply SO i was thinking may be i need to e.preventDefault(); How can i use that in above function. I am using like this ng-click = "saveData()"

http://stackoverflow.com/q/27393454
type: Question
tagged with: object
tagged with: javascript
has comment: http://stackoverflow.com/comment/43235373
has body: Im currently making a chrome app and Im using local storage. Then my backend returns JSON data and then I saved this locally, then I encrypt all items inside this JSON. My problem is I have different sets of JSON and also have different functions to encrypt this. I was trying to create dynamic function that will return a copy of these sets of JSON data but with each item encrypted, but i cant make it. My JSON consist of arrays and objects. My question is, is it possible? If so, I need a working sample. By the way, I'm using angularJS and this is my current code. // this function returns a copy of a JSON but with encrypted values. // encrypts objectData using base 64 // param -&gt; objectData = data from database (rater and its ratees) fac.encryptData = function(param) { var raterObject = param; var resultObject = { 'ratees':[] }; // final value will be equivalent to raterObject for(property in raterObject) { if(raterObject[property] instanceof Array) { angular.forEach(raterObject[property], function(ratee, rateeKey) { var rateeObject = { 'competencies':[] }; for(property in ratee) { if(ratee[property] instanceof Array) { angular.forEach(ratee[property], function(competency, competencyKey) { var competencyObject = { 'proficiencies':[], 'competencyScoreInfo':[] }; for(property in competency) { if(competency[property] instanceof Array) { if(property == 'proficiencies') { angular.forEach(competency[property], function(proficiency, proficiencyKey) { var proficiencyObject = {}; for(property in proficiency) { if(proficiency[property] == null ) { proficiency[property] = ''; } if(property != '$$hashKey') { proficiencyObject[property] = base64.encode(proficiency[property].toString()); } else { proficiencyObject[property] = proficiency[property]; } } competencyObject.proficiencies.push(proficiencyObject); }); } else if(property == 'competencyScoreInfo') { // di pa tapos angular.forEach(competency[property], function(proficiency, proficiencyKey) { var proficiencyObject = { 'ind…
has comment: http://stackoverflow.com/comment/43235762
has comment: http://stackoverflow.com/comment/43234104
score: 0
tagged with: for-loop
answer count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/27394036
has comment: http://stackoverflow.com/comment/43235441
has title: recursive iterate over json data with no known length and depth
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43234794
type: UnansweredQuestion

http://stackoverflow.com/a/27400559
type: Answer
downvote count: 0
score: 1
has body: try this: $(document).ready(function(){ var msMinute = 60*1000; var msDay = 60*60*24*1000; var start = '10-12-2014'; // October 12 var statarr=start.split('-'); var end = '12-15-2014'; // December 15 var endarr=end.split('-'); var dstart = new Date(statarr[0]+'/'+statarr[1]+'/'+statarr[2]).getTime(); var dend = new Date(endarr[0]+'/'+endarr[1]+'/'+endarr[2]).getTime(); var diff = parseInt(dend-dstart); console.log(Math.floor(diff / msDay) + ' full days between ' + end + ' and ' + start); difference = Math.floor((end - start) / msDay); if(difference &gt; 30){ } }); // for UK formate use this: var start = '12-10-2014'; // October 12 var statarr=start.split('-'); var end = '15-12-2014'; // December 15 var endarr=end.split('-'); var dstart = new Date(statarr[1]+'/'+statarr[0]+'/'+statarr[2]).getTime(); var dend = new Date(endarr[1]+'/'+endarr[0]+'/'+endarr[2]).getTime(); and rest is same.
has comment: http://stackoverflow.com/comment/43247103
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27400179
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27400179
has comment: http://stackoverflow.com/comment/43247150
has comment: http://stackoverflow.com/comment/43247795

http://stackoverflow.com/comment/43277635
has text: glad to help @Tibs , i hope the links are helpful.
score: 0
comment on: http://stackoverflow.com/q/27416640
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27414639
has body: Ok, so basically what I need is that when I select some text in an &lt;input&gt; or in a &lt;textarea&gt;, a tooltip appears with two buttons, and then get the selected text in a Javascript variable. The image below is an example of what I need: var selectedText = "s is an in" I'm using Powertip for the tooltip and Rangy for manipulating selections in &lt;input&gt; and &lt;textarea&gt;, the problem is that I can't manage to popup the tooltip and get the selected text in a JS variable after I select the text with the cursor. Any suggestions on how to achieve this? Thanks in advance. UPDATE: Thanks to Todd answer, I'm sharing what I was trying to achieve: JSFiddle
downvote count: 0
tagged with: tooltip
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27414986
answer count: 3
tagged with: http://stackoverflow.com/tag/html
score: 1
has answer: http://stackoverflow.com/a/27415053
favorite count: 0
accepted answer: http://stackoverflow.com/a/27415157
has comment: http://stackoverflow.com/comment/43275872
tagged with: css
type: AnsweredQuestion
has title: HTML Tooltip after selecting text in an or in a
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27414986
has answer: http://stackoverflow.com/a/27415157

http://stackoverflow.com/comment/43317831
comment on: http://stackoverflow.com/q/27423564
score: 0
type: Comment
has text: You need to know how the filenames are created to predict them OR you need to have a source for the list of file names.
type: QuestionComment

http://stackoverflow.com/comment/43135317
comment on: http://stackoverflow.com/a/27339307
type: AnswerComment
score: 0
type: Comment
has text: All this will accomplish is setting all of the RGB values to 255 in an extremely inefficient fashion.

http://stackoverflow.com/q/27427931
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43297581
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/43297566
has comment: http://stackoverflow.com/comment/43297467
has comment: http://stackoverflow.com/comment/43301222
has title: How to use a JS array produced by PHP after a xmlhttprequest when user hits a button
type: Question
has comment: http://stackoverflow.com/comment/43297416
has body: My page can't access the produced JS array. When I view source, I can verify the data is there. I use the following User loads the page by selecting a option box load.php: &lt;script&gt; var OptIndex= new array(); function Load() { var str=""; var xmlhttp=new XMLHttpRequest(); document.getElementById("LoadDiv").innerHTML="Waiting.."; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("LoadDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","adminload.php",true); xmlhttp.send(); } &lt;/script&gt; adminload.php: Then during the loading of adminload, I check to make sure a a php variable named "info" is set, if so I output to the OptIndex variable declared above like so for($c=0;$c&lt;$info-&gt;GetCount();$c++){ //Get real index simply returns an index in an array, //the values are right when outputted. echo "OptIndex.push(".$info-&gt;GetRealIndex($c).");"; } Now back to Load.php: After the data is loaded, I have the user press a button to run the following function function GetInfo(index) { var c=0; var str=""; alert("I am working");//Fires off alert("Len: "+OptIndex.length);//Code dies here. If I change it to alert("Len: "+$(OptIndex).length); then len is 0. for(c=0;c&lt;OptIndex.length;c++) { var theitem="#Option_"+OptIndex[c]+"_"+index;//This is right str=str+"opt_"+OptIndex[c]+"="+$(theitem).val(); if(c+1==OptIndex.length) break; str= str+"&amp;"; } } Example data while GetInfo is running OptIndex.push(3);OptIndex.push(4);OptIndex.push(5);OptIndex.push(6);OptIndex.push(7);OptIndex.push(8);OptIndex.push(9);OptIndex.push(10);OptIndex.push(11);OptIndex.push(12);OptIndex.push(13);OptIndex.push(14);OptIndex.push(15);OptIndex.push(16);OptIndex.push(17);OptIndex.push(18);OptIndex.push(19);OptIndex.push(21);OptIndex.push(22);OptIndex.push(23);OptIndex.push(24);OptIndex.push(25);OptIndex.push(26);OptIndex.push(27);OptIndex.push(28);OptIndex.push(29); How do I get GetInfo to properly access th…
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0

http://stackoverflow.com/q/27397297
accepted answer: http://stackoverflow.com/a/27397460
type: Question
has answer: http://stackoverflow.com/a/27397809
has body: I am trying to get all the values present in my dynamic HTML table and POST the values to AJAX. I have HTML table like this When i press '+' , I can able to add rows dynamically . When i click save, How to POST array values from this HTML table to AJAX, so that i can meanwhile INSERT those values into MYSQL I have tried getting the 'text' of each td present in my table var rows = $("tbody tr",$("#myTable")).map(function() { return [$("td",this).map(function() { return this.innerHTML; }).get()]; }).get(); This is getting me -> &lt;input type="text"&gt; and so on.
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 3
score: 2
downvote count: 0
favorite count: 0
upvote count: 2
has title: POST dynamic HTML table values to jQuery AJAX
tagged with: php
has answer: http://stackoverflow.com/a/27397460
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27397443
has answer: http://stackoverflow.com/a/27397443
has comment: http://stackoverflow.com/comment/43240710
tagged with: mysql

http://stackoverflow.com/q/27315482
tagged with: twitter-bootstrap
tagged with: php
has comment: http://stackoverflow.com/comment/43091250
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43090894
possible better answer: http://stackoverflow.com/a/27315621
has comment: http://stackoverflow.com/comment/43091509
has comment: http://stackoverflow.com/comment/43091324
has answer: http://stackoverflow.com/a/27315621
type: Question
has answer: http://stackoverflow.com/a/27315643
tagged with: javascript
tagged with: jquery
has title: How can javascript distinguish one button of a form from another?
has body: Here the code of index.php: &lt;html&gt; &lt;head&gt; &lt;link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Name&lt;/td&gt; &lt;td&gt;Band&lt;/td&gt; &lt;td&gt;Indx&lt;/td&gt; &lt;td&gt;Send&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Bruce&lt;/td&gt; &lt;td&gt;Iron Maiden&lt;/td&gt; &lt;td&gt;95&lt;/td&gt; &lt;td&gt; &lt;form action="" class="form" method="POST"&gt; &lt;input class="name" name="name" type="hidden" value="Bruce"&gt; &lt;input class="band" name="band" type="hidden" value="Iron Maiden"&gt; &lt;input class="indx" name="indx" type="hidden" value="95"&gt; &lt;button class ="send" type="submit"&gt;SEND&lt;button&gt; &lt;/form&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;James&lt;/td&gt; &lt;td&gt;Metallica&lt;/td&gt; &lt;td&gt;90&lt;/td&gt; &lt;td&gt; &lt;form action="" class="form" method="POST"&gt; &lt;input class="name" name="name" type="hidden" value="James"&gt; &lt;input class="band" name="band" type="hidden" value="Metallica"&gt; &lt;input class="indx" name="indx" type="hidden" value="90"&gt; &lt;button class ="send" type="submit"&gt;SEND&lt;button&gt; &lt;/form&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;div class="result"&gt;&lt;/div&gt; &lt;script src="https://code.jquery.com/jquery-1.11.1.js"&gt;&lt;/script&gt; &lt;script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function(){ $('.form').submit(function(){ $.ajax({ data: $('.form').serialize(), type: 'POST', url: 'remote.php', success: function(data){ $('.result').html(data); } }); return false; }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; And here the code of remote.php &lt;?php $name = $_POST['name']; $band = $_POST['band']; $indx = $_POST['indx']; $up = $indx * 2; $output = ' &lt;div id="rock-modal" class="modal fade in" role="dialog" tabindex="-1" aria-labelledby="myLargeModalLabel" aria-hidden="true"&gt; &lt;di…
has comment: http://stackoverflow.com/comment/43091230
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43090833
has comment: http://stackoverflow.com/comment/43091354
has answer: http://stackoverflow.com/a/27315686
accepted answer: http://stackoverflow.com/a/27315686

http://stackoverflow.com/comment/43093353
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27316562
has text: @kjelelokk—yes, that would be very much more reliable.

http://stackoverflow.com/comment/43343008
has text: First of all, I am not sure how AJAX call would redirect you to a error page. If at all, it should return you a error view from the server. If you can fix that, you dont have to worry about window load and unload techniques. IMO, it sound very hackish. Can you make a api call to check if the user has access to a folder and decide what to display to the user?
comment on: http://stackoverflow.com/a/27434813
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43098928
score: 1
has text: Not getting this. Your `stringVar` is not a string, it's just an Array object. You don't need to eval it or parse it or anything else. Did you mean to say `stringVar = "[....]"`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27319647

typeahead
type: Tag
tag name: typeahead
tags question: http://stackoverflow.com/q/27392963

http://stackoverflow.com/a/27488216
has comment: http://stackoverflow.com/comment/43594234
has comment: http://stackoverflow.com/comment/43465800
has comment: http://stackoverflow.com/comment/43604017
has comment: http://stackoverflow.com/comment/43495569
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43409855
has comment: http://stackoverflow.com/comment/43495863
has comment: http://stackoverflow.com/comment/43605124
has comment: http://stackoverflow.com/comment/43504517
accepted answer of: http://stackoverflow.com/q/27466658
has comment: http://stackoverflow.com/comment/43471570
has comment: http://stackoverflow.com/comment/43591819
type: Answer
has comment: http://stackoverflow.com/comment/43609419
has comment: http://stackoverflow.com/comment/43577024
has comment: http://stackoverflow.com/comment/43578745
has comment: http://stackoverflow.com/comment/43505955
has body: It sounds like your problem can be solved using the onEdit trigger. However, since you want to send an email you'll need to add the trigger manually because the function requires authorization to send emails. Try this: function assessmentOnEdit(e) { var range = e.range; if (range.getColumn() &gt;= 10) { // Only check column I and up var editedSheet = e.source.getActiveSheet(); var editedRow = range.getRow(); var value = range.getValue(); if (typeof value === 'number') { if (value &lt; 0.6) { var studentData = editedSheet.getRange(editedRow, 1, 1, 9).getValues(); var message = 'Assessment score: ' + Math.round((value * 100) * 10) / 10 + ' %' + '\nStudentId: ' + studentData[0][0] + '\nName: ' + studentData[0][1] + '\nHR: ' + studentData[0][2] + '\nTeacher: ' + studentData[0][3] + '\nGrade: ' + studentData[0][4] + '\nRace: ' + studentData[0][5] + '\nG: ' + studentData[0][6] + '\nEd: ' + studentData[0][7] + '\nAVG: ' + Math.round((studentData[0][8] * 100) * 10) / 10 + ' %'; var emailAddress = 'john.doe@example.com'; var subject = 'ALERT - Assessment score below 60% inputted.'; MailApp.sendEmail(emailAddress, subject, message); } } } } Check the google referance pages for more info on triggers: https://developers.google.com/apps-script/guides/triggers/events EDIT Since you want to use IMPORTRANGE the onEdit trigger will not fire. Try using the function below and use this function with onChange instead of onEdit. function assessmentOnChange(e) { var editedSheet = e.source.getActiveSheet(); var scriptProperties = PropertiesService.getScriptProperties(); var propertyKey = 'currentColumn'; var currentColumn = scriptProperties.getProperty(propertyKey); if (currentColumn === null) { currentColumn = 14; //Fisrt Empty column is N } var table = editedSheet.getRange(3, Number(currentColumn), editedSheet.getLastRow(), editedSheet.getLastColumn()).getValues(), rowNumber = 3, valuesToProcess = []; table.forEach(function(row) { var column = 0; row.forEach(function(cell) { if (typeof c…
has comment: http://stackoverflow.com/comment/43505153
has comment: http://stackoverflow.com/comment/43590615
answers question: http://stackoverflow.com/q/27466658

http://stackoverflow.com/comment/43141912
comment on: http://stackoverflow.com/a/27336761
type: AnswerComment
score: 0
type: Comment
has text: Ok I will be happy to help. Can you comment here once you post?

http://stackoverflow.com/comment/43343059
type: Comment
has text: @ninty9notout ok, so the only way I see is to use multiple js with sourcemaps and concat them for internet usage after development.
comment on: http://stackoverflow.com/q/27446759
score: 0
type: QuestionComment

http://stackoverflow.com/q/27452887
tagged with: javascript
tagged with: jquery
favorite count: 0
downvote count: 3
has comment: http://stackoverflow.com/comment/43344249
has comment: http://stackoverflow.com/comment/43345016
upvote count: 0
has comment: http://stackoverflow.com/comment/43345123
tagged with: angularjs
type: UnansweredQuestion
score: -3
has comment: http://stackoverflow.com/comment/43344289
has answer: http://stackoverflow.com/a/27452963
has comment: http://stackoverflow.com/comment/43344291
has comment: http://stackoverflow.com/comment/43344451
has body: For some reason when I'm using the true/false values and checking if at least one of the values is true, the if/else statement is not working correctly. I have this: $scope.checkValues = function (qId) { var airport = $scope.airports[0].questID; var destAirport = $scope.destAirports[0].questID; var airportVal = isFalseOrUndefined($scope.answers[airport]); var destAirportVal = isFalseOrUndefined($scope.answers[destAirport]) if (airportVal == false || destAirportVal == false) { $surveyNav.skipPage = true; } } function isFalseOrUndefined(val) { if(val == null || val === false) { return true; } else { return false; } } In this image below, as you can see the value for airportVal is true, the other value for destAirportVal in that same scenario is true, but I'm still able to get correctly in to the if condition and set the scope value. Does anyone see any issue?
has title: JavaScript true false not executing correctly in if else statement
has comment: http://stackoverflow.com/comment/43344841
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43344362
has answer: http://stackoverflow.com/a/27453033

http://stackoverflow.com/comment/43189204
type: QuestionComment
comment on: http://stackoverflow.com/q/27368655
has text: but how do i change the css in my javascript
score: 0
type: Comment

loops
tags question: http://stackoverflow.com/q/27317226
tags question: http://stackoverflow.com/q/27445793
tags question: http://stackoverflow.com/q/27429005
tags question: http://stackoverflow.com/q/27369600
type: Tag
tags question: http://stackoverflow.com/q/27433392
tags question: http://stackoverflow.com/q/27370605
tags question: http://stackoverflow.com/q/27337263
tags question: http://stackoverflow.com/q/27415735
tags question: http://stackoverflow.com/q/27432921
tags question: http://stackoverflow.com/q/27396784
tag name: loops
tags question: http://stackoverflow.com/q/27459102
tags question: http://stackoverflow.com/q/27346579

http://stackoverflow.com/q/27406256
tagged with: javascript
has title: nested for...in loop that lists properties(objects) of a multidimensional object
possible better answer: http://stackoverflow.com/a/27406306
answer count: 2
accepted answer: http://stackoverflow.com/a/27406316
has body: I can't wrap my head around how to nest for...in loops in each other to list out all the properties in a multi dimensional object. var list = {}; list.one = { a: true, b: false, c: true }; list.two = { a: true, b: false, c: true }; var listing = function(obj) { for (prop in obj) { document.write(prop+"&lt;br&gt;"); for (props in obj) { //not sure what to write here document.write("---"+props+"&lt;br&gt;"); } } listing(list); How do I write the for loops to get something like this: one ---true ---false ---true two ---true ---false ---true Does each successively nested for...in loop need to be more complex, testing whether the object is indeed multidimensional? I'm pretty lost.
type: AnsweredQuestion
score: 0
type: Question
has answer: http://stackoverflow.com/a/27406316
has answer: http://stackoverflow.com/a/27406306

http://stackoverflow.com/q/27327288
tagged with: jquery
has body: I am using drupal JSON field formatter to encode HTML body field. I got this result in json "\"\u2022 Big eggplant\r\n\u2022 2 tomatoes cut in slices\r\n\u2022 1 green pepper cut in slices\r\n\u2022 250gm minced meat\r\n\u2022 \u00bdtbsp of salt\r\n\u2022 \u00bdtbsp dried oregano\r\n\u2022 1tsp black pepper\r\n\u2022 \u00bd cup chopped onions\r\n\u2022 \u00bc cup oil to cook the meat\"" how can decode it using JS ? I tried this code but it is not working fine function htmlbody(x){ var bodi=''; bodi=x.replace('\n', '&lt;br /&gt;') // Removes all encoded newline characters bodi=x.replace('\t', '') // Removes all encoded tab characters bodi=x.replace(/(?:\s+)?&lt;(?:\s+)?/g, '&lt;') // Removes any whitespace before or after a tag-start delimiter. bodi=x.replace(/(?:\s+)?&gt;(?:\s+)?/g, '&gt;') // Removes any whitespace before or after a tag-stop delimiter. bodi=x.replace(/\s+/g, ' '); return bodi; }
has comment: http://stackoverflow.com/comment/43113581
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43113623
tagged with: drupal
has comment: http://stackoverflow.com/comment/43113630
has answer: http://stackoverflow.com/a/27327564
has title: How to decode encoded json to HTML JS
type: Question
has comment: http://stackoverflow.com/comment/43113561
score: 0
answer count: 1
tagged with: javascript

ajax
tags question: http://stackoverflow.com/q/27458327
tags question: http://stackoverflow.com/q/27417516
tags question: http://stackoverflow.com/q/27352249
tags question: http://stackoverflow.com/q/27407203
tags question: http://stackoverflow.com/q/27330149
tags question: http://stackoverflow.com/q/27338465
tags question: http://stackoverflow.com/q/27462373
tags question: http://stackoverflow.com/q/27343382
tags question: http://stackoverflow.com/q/27455922
tags question: http://stackoverflow.com/q/27439479
tags question: http://stackoverflow.com/q/27363951
tags question: http://stackoverflow.com/q/27349976
tags question: http://stackoverflow.com/q/27385410
tags question: http://stackoverflow.com/q/27384751
tags question: http://stackoverflow.com/q/27322250
tags question: http://stackoverflow.com/q/27473844
tags question: http://stackoverflow.com/q/27454473
tags question: http://stackoverflow.com/q/27439904
tags question: http://stackoverflow.com/q/27442120
tags question: http://stackoverflow.com/q/27346205
tags question: http://stackoverflow.com/q/27441844
tags question: http://stackoverflow.com/q/27323474
tags question: http://stackoverflow.com/q/27413565
tags question: http://stackoverflow.com/q/27355786
tags question: http://stackoverflow.com/q/27324684
tags question: http://stackoverflow.com/q/27334953
tags question: http://stackoverflow.com/q/27407928
tags question: http://stackoverflow.com/q/27384991
tags question: http://stackoverflow.com/q/27321072
tags question: http://stackoverflow.com/q/27466871
tags question: http://stackoverflow.com/q/27457349
tags question: http://stackoverflow.com/q/27457365
tags question: http://stackoverflow.com/q/27468567
tags question: http://stackoverflow.com/q/27435732
tags question: http://stackoverflow.com/q/27405762
tags question: http://stackoverflow.com/q/27471806
tags question: http://stackoverflow.com/q/27443254
tags question: http://stackoverflow.com/q/27470259
tags question: http://stackoverflow.com/q/27348758
tags question: http://stackoverflow.com/q/27444282
tags question: http://stackoverflow.com/q/27422408
tags question: http://stackoverflow.com/q/27373333
tags question: http://stackoverflow.com/q/27367534
tags question: http://stackoverflow.com/q/27430362
tags question: http://stackoverflow.com/q/27332797
tags question: http://stackoverflow.com/q/27359735
tags question: http://stackoverflow.com/q/27457406
tags question: http://stackoverflow.com/q/27328577
type: Tag
tags question: http://stackoverflow.com/q/27455719
tags question: http://stackoverflow.com/q/27353430
tags question: http://stackoverflow.com/q/27364388
tags question: http://stackoverflow.com/q/27341308
tags question: http://stackoverflow.com/q/27335914
tags question: http://stackoverflow.com/q/27417730
tags question: http://stackoverflow.com/q/27353703
tags question: http://stackoverflow.com/q/27401843
tags question: http://stackoverflow.com/q/27469496
tags question: http://stackoverflow.com/q/27347436
tags question: http://stackoverflow.com/q/27455405
tags question: http://stackoverflow.com/q/27469091
tags question: http://stackoverflow.com/q/27413929
tags question: http://stackoverflow.com/q/27360778
tags question: http://stackoverflow.com/q/27434861
tags question: http://stackoverflow.com/q/27333140
tags question: http://stackoverflow.com/q/27412949
tags question: http://stackoverflow.com/q/27389866
tags question: http://stackoverflow.com/q/27401583
tags question: http://stackoverflow.com/q/27391442
tags question: http://stackoverflow.com/q/27424687
tags question: http://stackoverflow.com/q/27341619
tags question: http://stackoverflow.com/q/27405864
tags question: http://stackoverflow.com/q/27462322
tags question: http://stackoverflow.com/q/27397297
tags question: http://stackoverflow.com/q/27472039
tags question: http://stackoverflow.com/q/27437768
tags question: http://stackoverflow.com/q/27467463
tags question: http://stackoverflow.com/q/27332280
tags question: http://stackoverflow.com/q/27360859
tags question: http://stackoverflow.com/q/27463768

http://stackoverflow.com/q/27323352
tagged with: graph-visualization
favorite count: 0
tagged with: data-visualization
tagged with: sigma.js
has body: I'm implementing a visualization with Sigma.js (using the neighborhood plugin, if that's of any relevance). Out of the box, Sigma.js displays a rectangular label and blurred border on all hovered nodes. For greater visual clarity, I'm interested in implementing a border (preferably not blurred) strictly around the circular node on all nodes as a default, rather than just hovered or clicked ones. I understand the prepackaged settings allow alterations only to hovered node borders. Any guidance regarding modifying all node borders is greatly appreciated. I anticipate this will involve tinkering with the original Sigma.js source, but it is unclear where. Thanks all!
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Sigma.js border on all nodes
type: Question
accepted answer: http://stackoverflow.com/a/27324054
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27324054
upvote count: 1
answer count: 1

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/27414265

http://stackoverflow.com/q/27407424
has answer: http://stackoverflow.com/a/27408245
accepted answer: http://stackoverflow.com/a/27408245
tagged with: timezone
upvote count: 1
tagged with: google-chrome
tagged with: safari
has body: Just some background: I'm on OS X 10.9.5, my timezone is set to Singapore Standard Time (GMT+8 - we don't have daylight saving time here, I believe we never had it in the past as well, as Singapore is right next to the equator so there is virtually no seasonal difference in day light). When I try out the below javascript on Firefox console, this is what I get: &gt; new Date(0).toLocaleString() &lt; "01/01/1970 7:30:00 am" &gt; new Date(0).getTimezoneOffset() &lt; -450 It seems that Firefox mistakes my timezone for GMT+7.30. When I try the same thing in Safari and Chrome console, this is what I get (for both): &gt; new Date(0).toLocaleString() &lt; "1 January, 1970 7:30:00 am GMT+7:30" &gt; new Date(0).getTimezoneOffset() &lt; -480 Again, it seems that toLocaleString() in Safari and Chrome mistake the timezone for GMT+7.30; however getTimezoneOffset() gets it right. Are these behaviours by designed in Firefox, Safari and Chrome respectively (ie. there is a reason behind them), or are they just bugs?
type: AnsweredQuestion
has title: Why do getTimezoneOffset() and toLocaleString() in Chrome, Safari and Firefox assume that Singapore is on timezone GMT+7.30?
score: 1
type: Question
tagged with: firefox
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/43142759
type: Comment
type: QuestionComment
has text: In your first array sorted, the ids are 1, 3, 5 ... got it. In the second sorted, the ids are 1, 3, 5, 2, 4 or 1, 3, 5, 4, 2 ... that's not in order.
comment on: http://stackoverflow.com/q/27343505
score: 0

http://stackoverflow.com/q/27409254
has comment: http://stackoverflow.com/comment/43262943
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
downvote count: 0
has answer: http://stackoverflow.com/a/27409339
score: 1
accepted answer: http://stackoverflow.com/a/27409339
type: Question
type: AnsweredQuestion
has title: apply listener to only new items with ajax infinite scroll
has body: I'm using ajax infinite scroll to load content on my website, and I have a listener event for each item that shows a new element with additional information. ... Next var ias = jQuery.ias({ container: '.items', item: '.item', pagination: '#pagination', next: '.next' }); And I'm using this to load the listener for each new page: ias.on('rendered', function(items) { var $items = $(items); $items.each(function() { $('.fa').click(function() { show($(this).attr('id')); }); }); }); function show(what) { $('body').append(' '); $('.options').load('options.php?id='+id); } My problem is that each time a new page loads, the listener gets applied to EVERY item, so when page 2 is loaded, items from page 1 will now append TWO .options and load it twice, and when page 3 is loaded, page 1 items load three times, and page 2 items load twice, etc. How can I apply the listener to only the new page items when each new page loads?

http://stackoverflow.com/q/27427484
has body: I have a video directive which plays html5 video: (function(){ angular.module('app.video') .directive('demoVideo', demoVideo); function demoVideo(){ return{ templateUrl: "videoTemplate.html", controller: function(videoService, $sce){ var vm = this; videoService.get().then(function(data){ vm.videoDataUrlMp4 = $sce.trustAsResourceUrl(data.video);//"http://pdl.vimeocdn.com/89496/595/203684545.mp4?token2=1418313891_4826d99475da5695f5d7999863fb212c&aksessionid=732c8c4ae38ae4aa" }); }, bindToController: true, controllerAs: 'video' } } })(); The template is: Your user agent does not support the HTML5 Video element. The problem is that the video is not loaded. (I can see that the src is set to video's source, but it is not loaded. When I change the binding to be direct (not inside a callback), it does work! I tried $scope.$apply() with no luck (throws an error). What am I missing here? tnx!
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive
tagged with: javascript
tagged with: html5-video
has answer: http://stackoverflow.com/a/27427691
score: 0
has title: Angularjs - video not played when binded inside promise
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/68141764

http://stackoverflow.com/comment/43214376
comment on: http://stackoverflow.com/a/27382856
has text: ' <add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> <add key="Email.WriteAsFile" value="true" /> ' These are my app settings. They are true...I am thinking there is an incompatible javascript library or something... I have no clue.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43163808
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27355205
has text: is there a php Form Validation ???
type: Comment

http://stackoverflow.com/comment/43178004
type: Comment
has text: It's hard to tell what the issue here is. Can you post a screenshot of the object as displayed by the debugger in Chrome's devtools?
comment on: http://stackoverflow.com/a/27362592
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43213930
has text: Ok as a matter of fact this isnt working out when you hover the background first and go to the overlapping div directly
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27381532
type: AnswerComment

http://stackoverflow.com/comment/43343171
type: AnswerComment
has text: Cool thanks for the quick reply! That makes perfect sense. Can we add multiple conditions like - `(conditions) ? assignIfTrue : assignIfFalse;`
comment on: http://stackoverflow.com/a/27452304
type: Comment
score: 0

http://stackoverflow.com/a/27335134
upvote count: 3
type: Answer
downvote count: 0
score: 3
has body: To display a simple error message you simply echo it above the form. See if this works <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; $errors = array(); $msg = ""; //define an error msg variable if (isset($_POST['username'], $_POST['password'])) { $connect = mysql_connect("localhost", "root", "") or die("Could not connect"); mysql_select_db("login") or die("Could not find database"); $query = mysql_query("SELECT * FROM users WHERE username ='$username'"); $numrows = mysql_num_rows($query); if ($numrows != 0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($username == $dbusername && $password == $dbpassword) { echo header('Location: member.php'); $_SESSION['username'] = $dbusername; $_SESSION['userid'] = $userid; } else $msg = "Incorrect password"; } else $msg = "That user dosen't exist"; } else $msg = "Please enter a username and a password"; ?> <?php echo $msg; ?> Username: Password: Register
has comment: http://stackoverflow.com/comment/43149578
answers question: http://stackoverflow.com/q/27334690

http://stackoverflow.com/comment/43165836
comment on: http://stackoverflow.com/a/27355962
type: AnswerComment
score: 0
has text: Hi @Mohso, is there a way to show breadcrumbs like if i selected nephi then it should show me "Home / Nephi" similar to this
type: Comment

flex4.6
tags question: http://stackoverflow.com/q/27373712
type: Tag
tag name: flex4.6

http://stackoverflow.com/q/27454432
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27454516
tagged with: http://stackoverflow.com/tag/html
has title: How do I get my images to fade-in in a gallery using pure JavaScript?
type: Question
has answer: http://stackoverflow.com/a/27454526
has comment: http://stackoverflow.com/comment/43346899
score: 0
answer count: 2
has body: My images are changing but the fade-in effect is not being applied. How do I get it to work? Should I be setting the opacity outside the changeImage() function? JavaScript beginner here. SCRIPT: var imageArray = ["IMG1.jpg","IMG2.jpg", "IMG3.jpg","IMG4.jpg"]; var imageIndex = 0; var done = true; var fading_image = document.getElementById("currentImg"); //To fade image function function_opacity(opacity_value, fade_in_or_fade_out){ fading_image.style.opacity = opacity_value / 100; fading_image.style.filter = 'alpha(opacity=' + opacity_value + ')'; if (fade_in_or_fade_out == 'in' &amp;&amp; opacity_value == 1) { fading_image.style.display = 'block'; } if (fade_in_or_fade_out == 'in' &amp;&amp; opacity_value == 100) { done = true; } } //To change image function changeImage(){ document.getElementById("currentImg").src = imageArray[imageIndex]; imageIndex++; if(imageIndex &gt;= imageArray.length){ imageIndex = 0; } //Setting opacity if (done &amp;&amp; fading_image.style.opacity != '1') { done = false; for (var i = 1; i &lt;= 100; i++) { setTimeout("function_opacity(" + i + ",'in')", i * 5); } } }; setInterval(changeImage, 2000); HTML &lt;img src="IMG1.jpg" id="currentImg" alt="Gallery Image"&gt;
tagged with: javascript

http://stackoverflow.com/comment/43332117
type: Comment
has text: @T.J.Crowder - Good to know.. I often forget about older browsers :\ - updating answer.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27446570

http://stackoverflow.com/comment/43337805
comment on: http://stackoverflow.com/a/27437528
has text: The issue with this method is that I am receiving a value even before I click the button, which I don't want to happen either. I want for the user to arrive on the page without a value loading until the button is clicked.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28583636
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: Please try the below code. var zip = new JSZip(); zip.file("Hello.txt", "Hello World\n"); var img = zip.folder("images"); img.file("smile.gif", imgData, {base64: true}); var content = zip.generate({type:"blob"}); // see FileSaver.js saveAs(content, "example.zip");
score: 1
accepted answer of: http://stackoverflow.com/q/27405510
answers question: http://stackoverflow.com/q/27405510

http://stackoverflow.com/a/27318006
answers question: http://stackoverflow.com/q/27315814
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43096869
has comment: http://stackoverflow.com/comment/43095641
type: Answer
has body: Did you put your routes into a particle subdir? Your container is loading its particles from the lib/ subdir. Are your routes in a particle dir? Something like lib/&lt;particle name&gt;/route1.js.
accepted answer of: http://stackoverflow.com/q/27315814
score: 1
has comment: http://stackoverflow.com/comment/43095581
upvote count: 1
has comment: http://stackoverflow.com/comment/43095931

http://stackoverflow.com/a/27405036
upvote count: 1
has comment: http://stackoverflow.com/comment/43255385
accepted answer of: http://stackoverflow.com/q/27404932
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27404932
has body: A simple solution without seeing your code would be: $(function(){ $('.revealButton').click(function(){ $('.hiddenDiv').toggle(); }); }); Hope this helps, however, once your code is here I will update this answer :) UPDATE Here is a working jQuery version for you: jsFiddle $(function () { $('.revealButton').click(function () { $('#hidden').toggle(); }); }); Also, on your button remove onClick="myFunction()" and add class="revealButton". and that's it. UPDATE 2 If you would like a slide animation (as mentioned in the comments) use this: jsFiddleUpdate $(function () { $('.revealButton').click(function () { $('#hidden').slideToggle(); }); });
score: 1

http://stackoverflow.com/a/27453867
type: Answer
downvote count: 0
has body: You need to get the offsets from canvas.getBoundingClientRect(); Using canvas.offsetTop and canvas.offsetLeft gives you offsets relative to the parent. var canvas, ctx, flag = false, prevX = 0, currX = 0, prevY = 0, currY = 0, dot_flag = false; window.onload = function () { canvas = document.getElementById('canvas'); ctx = canvas.getContext("2d"); w = canvas.width; h = canvas.height; canvas.addEventListener("mousemove", function (e) { findxy('move', e) }, false); canvas.addEventListener("mousedown", function (e) { findxy('down', e) }, false); canvas.addEventListener("mouseup", function (e) { findxy('up', e) }, false); canvas.addEventListener("mouseout", function (e) { findxy('out', e) }, false); } function draw() { ctx.beginPath(); ctx.moveTo(prevX, prevY); ctx.lineTo(currX, currY); ctx.strokeStyle = "black"; ctx.lineWidth = 2; ctx.stroke(); ctx.closePath(); } function findxy(res, e) { if (res == 'down') { prevX = currX; prevY = currY; rect = canvas.getBoundingClientRect(); currX = e.clientX - rect.left; currY = e.clientY - rect.top; flag = true; dot_flag = true; if (dot_flag) { ctx.beginPath(); ctx.fillStyle = "black"; ctx.fillRect(currX, currY, 2, 2); ctx.closePath(); dot_flag = false; } } if (res == 'up' || res == "out") { flag = false; } if (res == 'move') { if (flag) { prevX = currX; prevY = currY; currX = e.clientX - rect.left; currY = e.clientY - rect.top; draw(); } } }
score: 3
accepted answer of: http://stackoverflow.com/q/27453729
upvote count: 3
answers question: http://stackoverflow.com/q/27453729
type: AcceptedAnswer

http://stackoverflow.com/q/27404314
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27404450
score: 1
has answer: http://stackoverflow.com/a/27404511
has title: jQuery synchronize animations jquery
accepted answer: http://stackoverflow.com/a/27404511
type: Question
tagged with: jquery-animate
tagged with: javascript
tagged with: jquery
has body: I have fixed header, that should disappear on button click. HTML header sidebar hide header Content Bssic CSS .wrapper{ width: 100%; height: 100%; overflow: hidden; padding-left: 100px; position: relative; } .page-container, .page-wrapper{ min-height: 400px; height: 100%; } .header, .sidebar{ position: fixed !important; top: 0; left: 0; } .header{ width: 100%; height: 65px; background: #2c3e50; z-index: 90; } .sidebar{ top: 65px; height: 100%; width: 100px; background-color: #efefef; } .page{ top: 65px; position: relative; } I created some JQuery code that animate header height: 0;and sidebar and page top property to 0. DEMO The problem is that the animations work asynchronously. The header disappear, then the content and sidebar go up. can someone say, how I can synchronize the animations.
has answer: http://stackoverflow.com/a/27404450
answer count: 2
upvote count: 1
downvote count: 0
favorite count: 0
tagged with: animation

http://stackoverflow.com/q/27384346
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: C# novice in need
has comment: http://stackoverflow.com/comment/43217584
downvote count: 2
has answer: http://stackoverflow.com/a/27384836
type: Question
tagged with: c#
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: Below is the code to our cs.aspx recall page. The idea is that we scan a barcode and it references the code to see of a UPC is on the recall list. If it is, the "STOP SIGN" is supposed to show, if it is not on the list, the "GREEN Light" is supposed to show. The problem with the code below is that after the "GREEN LIGHT" icon is called, it requires a manual enter on the keyboard for the next barcode scan to work properly. Here is what the results are: Scan Barcode 12345 Green light icon shows Scan Barcode 54321 Green light icon goes away (this is where I need the Green Light to show again or stay) I am lost. Here is the code (we use Chrome or Firefox browser to call the cs.aspx) <%@ Page Language="C#" AutoEventWireup="true" CodeFile="CS.aspx.cs" Inherits="CS" %> Enter UPC: (I am not sure what I am doing)
type: UnansweredQuestion

http://stackoverflow.com/a/27478550
type: Answer
accepted answer of: http://stackoverflow.com/q/27380763
answers question: http://stackoverflow.com/q/27380763
type: AcceptedAnswer
score: 0
has body: So I solved the same using : chrome.tabs.create({url:chrome.extension.getURL("../capturetab.html?tabImage=" + request.source )}); capturetab.html : visibketab.js $( document ).ready(function() { var imageblob = getUrlParameter('tabImage'); //Set canvas attribute var myCanvas = document.getElementById('canvas'); var ctx = myCanvas.getContext('2d'); var img = new Image; img.onload = function(){ // set width and height ctx.canvas.height = this.height; ctx.canvas.width = this.width; ctx.drawImage(img,0,0); // Or at whatever offset you like }; img.src = imageblob; }); function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } }

http://stackoverflow.com/q/27384991
tagged with: ajax
linked to: http://stackoverflow.com/q/6761415
has comment: http://stackoverflow.com/comment/43218640
score: 0
has answer: http://stackoverflow.com/a/27385417
tagged with: cross-domain
has body: Is it possible to set a cookie on a different domain? If so, what would be the best way to go about doing it? So For example if I was on attackersite.com and wanted to set a cookie called 'name' with a value on victimsite.com Thanks.
duplicate of: http://stackoverflow.com/q/6761415
has title: Setting a cookie on a different domain?
type: UnansweredQuestion
type: Question
tagged with: cross-site
answer count: 1
tagged with: csrf
tagged with: javascript

http://stackoverflow.com/a/27541466
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: I have the same problem and i found out that in my auth interceptor i check the response status. if the response status is 401 i do something, but i forgot to set if not to return the promise, so the interceptor doesnt forward the rejection. So make sure you have this code in the end: return $q.reject(rejection);
accepted answer of: http://stackoverflow.com/q/27423983
upvote count: 5
answers question: http://stackoverflow.com/q/27423983
score: 5

http://stackoverflow.com/comment/43364376
type: AnswerComment
type: Comment
has text: @Regent I agree it's not the kind of code style that I like. I just focused on the problem as stated. Leave the OP first discover how to make it work, and later get to good practices ...
comment on: http://stackoverflow.com/a/27463963
score: 0

http://stackoverflow.com/comment/43264734
score: 0
comment on: http://stackoverflow.com/a/27410151
has text: This is just as bad as using `eval` because it evalutes javascript code at runtime. I would not encourage it.
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27436370
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/32839922
tagged with: node.js
has body: My Sails.js application has a model called 'Ideas' and using the default blueprint REST api, I can access the contents of the collection when I go to: http://example.com/ideas/find Furthermore, by default, I can also limit the data to get specific titles: http://example.com/ideas/find?title=How to Watch TV Although what I want to do is display the JSON data of ALL titles that contain the keyword 'T' but when I replace the above with the likes of a) ?title=TV b) ?q=TV c) ?query=TV d) ?where(title : (contains:'TV') none of them work How can I get JSON output that contains all titles that contains a particular keyword?
type: Question
tagged with: sails.js
tagged with: javascript
has answer: http://stackoverflow.com/a/27437122
score: 0
has title: Sails.js - Have a 'contains' or query in url to fetch appropriate JSON data
tagged with: sails-mongo
answer count: 2

http://stackoverflow.com/q/27327596
has answer: http://stackoverflow.com/a/27327616
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27327657
possible better answer: http://stackoverflow.com/a/27327616
has answer: http://stackoverflow.com/a/27327635
has title: Jquery selects too many elements on mouseclick
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27327657
linked to: http://stackoverflow.com/q/4616694
type: Question
tagged with: javascript
tagged with: jquery
tagged with: click
has body: I want to get the ID of an element that I click. It should only give me the ID if it has one. I have this code to alert me the element ID: $("[id]").click(function(event) { event.preventDefault(); var id_name = $(this).attr("id"); alert(id_name); }); But I only want the foremost element's ID. I have a button inside a div, both with an id-attribute. If I click the button, I only want the ID of the button. However, my script alerts me of both the buttons ID and the div's ID. Why is that/How can I get only the foremost element's ID?

http://stackoverflow.com/a/27461645
downvote count: 0
has comment: http://stackoverflow.com/comment/43655102
has comment: http://stackoverflow.com/comment/43655759
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27461595
has body: Simply do this: voteUp.addEventListener('click', function(){ //call your function method to what you want to do with voteUp //and call this this.removeEventListener('click'); });

http://stackoverflow.com/comment/43181635
type: QuestionComment
comment on: http://stackoverflow.com/q/27364891
score: 0
has text: Why are you looping to read a file five times?
type: Comment

http://stackoverflow.com/a/27367078
upvote count: 4
answers question: http://stackoverflow.com/q/27366980
downvote count: 0
has comment: http://stackoverflow.com/comment/43195119
has body: require is for code, but JSON is pure data. You don't want JSON to be code, as non-javascript environments should be able to parse it. As with any data file, you process it in two steps. First you read in the data, then you parse it. fs.readFile should let you read the file into a string. And then you can JSON.parse(result) that string to get JSON data. fs.readFile('./JSON1', function(err, result) { if (err) { throw err; } var data = JSON.parse(result); console.log(data); // parsed JSON data! yay! });
score: 4
has comment: http://stackoverflow.com/comment/43190221
type: Answer

http://stackoverflow.com/comment/43094952
has text: By why round at all if you are using seconds? Surely you need to truncate to the closest date (i.e. midnight).
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27317614
score: 0

http://stackoverflow.com/comment/43357493
comment on: http://stackoverflow.com/a/27460388
has text: Too bad there is no generic way, as I would need to provide a pattern while working with micro-units and so on. For example a domain **[0.0001, 0.0002]** - instead of **100µ** I would like to show **0.1m**. The point is really in going to next SI in **/100 steps**, instead of **/1000**. I guess I need to provide a function like yours for all possible units. It is a best solution I could get though, so thanks a lot for pointing it out.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27419419
has comment: http://stackoverflow.com/comment/43292838
has comment: http://stackoverflow.com/comment/43296443
has comment: http://stackoverflow.com/comment/43283210
score: 0
type: Answer
has body: You may wanna try something like this: //this object you should be returned as a json_encoded(USERS_ARRAY) at your php controller var jsonEncodedObject = '[{"name":"Gonsalo Sousa","age":23,"address":"Some Address"},{"name":"Jonh Doe","age":40,"address":"Some Address"}]'; //parseJSON to use with jscript var users = $.parseJSON(jsonEncodedObject); //now run the object using $.each() $(users).each(function(index) { //appends each user to the #users $('#users').append(' ' + this.name + ' ' + ' ' + this.age + ' ' + ' ' + this.address + ' '); }); [class*="user"] { border: 1px solid black; margin-bottom: 5px; padding: 5px; } UPDATE Maybe this can help you var i = 0; jQuery(dashboard_info["details"]).each(function(){ var className = "user"+i; jQuery('#users').append(' /*rest of your html*/ ') i++; });
has comment: http://stackoverflow.com/comment/43285855
answers question: http://stackoverflow.com/q/27418887
has comment: http://stackoverflow.com/comment/43288152
has comment: http://stackoverflow.com/comment/43289565

http://stackoverflow.com/comment/43282475
type: AnswerComment
score: 0
type: Comment
has text: Would you not like to explain why you've done this? instead of just saying "change to this"
comment on: http://stackoverflow.com/a/27419816

http://stackoverflow.com/a/27440244
has body: Wrap both your input &amp; key with &lt;label&gt; tag. Hope it'll work!
answers question: http://stackoverflow.com/q/27440177
score: 0
type: Answer

http://stackoverflow.com/q/27379232
has answer: http://stackoverflow.com/a/27379272
tagged with: asp.net
has answer: http://stackoverflow.com/a/74096275
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27379326
has body: I want to get the value of an EditorFor in ASP but it returns me nothing. Thank you for your helps &lt;div class="form-group" id="ParticipantNumber"&gt; @Html.LabelFor(model =&gt; model.ParticipantNumber, new { @class = "control-label col-md-2"}) &lt;div class="col-md-10"&gt; @Html.EditorFor(model =&gt; model.ParticipantNumber, new { @class = "ParticipantNumber", disabled = "disabled" }) @Html.ValidationMessageFor(model =&gt; model.ParticipantNumber) &lt;/div&gt; &lt;/div&gt; My JavaScript code $('#ParticipantNumber').keyup(function () { var s = $('#ParticipantNumber').val(); console.log(s) }
has title: How to get the value of an EditorFor JavaScript ASP
type: Question
tagged with: javascript
score: 0
answer count: 3

http://stackoverflow.com/a/58407238
answers question: http://stackoverflow.com/q/27441803
score: 9
upvote count: 9
has comment: http://stackoverflow.com/comment/108160627
downvote count: 0
type: Answer
has body: In your package.json you can tell Jshint to use es6 like this "jshintConfig":{ "esversion": 6 }

http://stackoverflow.com/q/27429496
type: Question
has answer: http://stackoverflow.com/a/27429542
score: 0
answer count: 1
tagged with: javascript
has body: So I find this really hard to explain what im doing, but its easy to show in an example. I have these 2 strings and I need a regular expression that will only return a value for one of them Ref Numbers: RCPT:02972, VLBL#:7158461 $930.38 2012-10- 01 5558461 abagaa I need the 5558461 but not the 7158461, so basically a 7 digit number. I was trying to do this where Ref Numbers exists do not return anything, but if it doesn't then return the 7 digit number. I've tried many different things but I just cannot get what I need. does anyone out there have an idea what needs to be done? Thanks
has title: Trying to get a subset of data using ECMAScript Regular Expression where one string doesnt exist
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27429542

http://stackoverflow.com/q/27438553
has comment: http://stackoverflow.com/comment/43317815
has body: Here my HTML code... 1.<?xml version="1.0"?> 2. 3. 4. 5. 6. 7. 8. <!--$(document).ready(function() { 9. var line; 10. var read_testsuites = 0; 11. var read_libraries = 0; 12. var read_klockwork_projects = 0; 13. for (line in lines) { 14. if (match_found = lines[line].match(/Project:\s*(\w+)/i)) { 15. project_name = match_found[1]; 16. if (project_name.match(/^HSS/i)) { 17. project_name = "HSS"; 18. } 19. 20. var repo = "/vobs/ims_hss1/moduletest/testcases/" + project_name; 21. populateOption(repo, repo, repository); 22. } 23. } 24. 25. MT Debug Folder Path 26. 27. 28. 29. 30. 31. In Line 20, repo is a path. I have an environment variable GITWORK which is /imsgit/work/v149kumar(v149kumar is my id. it will change if another user login). I want to use this value of GITWORK before /vobs, it should like /imsgit/work/v149kumar/vobs/ims_hss1/testcases. Now go to line number 27... There also a path is given with /vobs/ims_hss1/, There also i want to have value of GITWORK before /vobs. How to read the ENVIRONMENT VARIABLE here. As I am new to HTML, Please help me with this problem.
has title: Using environment variable in html file
type: Question
has comment: http://stackoverflow.com/comment/43317429
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27438661
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43317077
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27438694
has comment: http://stackoverflow.com/comment/43317076

http://stackoverflow.com/q/27470402
has comment: http://stackoverflow.com/comment/43379093
has comment: http://stackoverflow.com/comment/43378387
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43379871
has answer: http://stackoverflow.com/a/27471455
has comment: http://stackoverflow.com/comment/43379556
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43377526
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43378932
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43378827
has body: I am using dangrossman daterangepicker in a site here is the code. $('#reportrange').daterangepicker( { ranges: { //My added value 'New Value':['This is just string value'], 'Today': [moment(), moment()], 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], 'Last 7 Days': [moment().subtract('days', 6), moment()], 'Last 30 Days': [moment().subtract('days', 29), moment()], 'This Month': [moment().startOf('month'), moment().endOf('month')], 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] }, startDate: moment().subtract('days', 6), endDate: moment() }, function(start, end) { $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); } ); JsFiddle Link I just want in that list the ranges options will work as they are working but adding one more option here with the name of 'Newvalue' for this option I just want when user select this, string will be written in this div . The error I am seeing is invalid date the ranges value is an array. I have tried this with double qoute single qoute values and with two values but it is not working. You can see its Fiddle.
has title: Date Range Bootstrap
type: Question

http://stackoverflow.com/q/27412886
has comment: http://stackoverflow.com/comment/43270266
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27413175
tagged with: calculator
has title: Adding percentage button to javascript calculator
type: Question
answer count: 1
score: 0
has body: I am working on a calculator program to practice and aid in learning javascript. I have this so far: Calculator On-Line Calculator I have a couple questions: I need a working percentage button, the one I have now does not do what I need it to do. It should display what precent the first input number is of the second. I.e. if the first number is 5 and the second is 20, then the result should be 25 (meaning 25 %). I need to display all the operations entered, not only the results of the calculations performed by the user. For example, on 3+4, instead of just displaying "7", display "3 + 4 = 7". Keep the display of all previous calculations in the input field, instead of just the current one. Can someone help me out here? Thanks!

http://stackoverflow.com/comment/43298766
score: 0
type: Comment
has text: that's why you need to set it to display:none by default in your CSS. You want it to never display till the javascript function tells it to. 'unset' is not valid css and therefor is ignored by the browser.
comment on: http://stackoverflow.com/a/27428384
type: AnswerComment

http://stackoverflow.com/q/27416195
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27416267
type: AnsweredQuestion
has title: How to change the text of link
accepted answer: http://stackoverflow.com/a/27416267
type: Question
has body: what i need i need to change text of link on click of that link. html code Attend js code function peopleattending(evt_id,user,click) { $.ajax({ type:"GET", url:"{{login_url_http}}/ticket_transaction/autosubmit_advance/"+evt_id + "/" + user+ "?visitor_flag=1&source=get-direction-oneclick", success: function(data) { $('click').text("Attending"); $( ".col-md-4" ).removeClass("mobilelisting" ); } }); } debug on console.log click : url . i have also tried $(this).find("#attend").text("Attending"); not working. working $("#attend").text("Attending"); but my requirment i change text particular text of link text .
tagged with: javascript

http://stackoverflow.com/comment/43183974
comment on: http://stackoverflow.com/a/27327842
type: AnswerComment
has text: Thanks! Worked like a charm.
score: 0
type: Comment

http://stackoverflow.com/comment/43260439
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27407884
type: AnswerComment
has text: I am interested in reverse engineering Facebook comment box!

http://stackoverflow.com/comment/43240696
score: 0
comment on: http://stackoverflow.com/a/27397234
type: AnswerComment
has text: i understand the problem but i dont know how to solve in that dynatable.js file.could you please fix this?
type: Comment

http://stackoverflow.com/a/27426421
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27424856
answers question: http://stackoverflow.com/q/27424856
has comment: http://stackoverflow.com/comment/43304187
type: AcceptedAnswer
downvote count: 0
has body: wp_localize_script will not actually change the values already in a script. Rather, it enables you to set global Javascript variables, which can then be utilized by a script. See below. PHP $images = array( array("image" =&gt; 'slider-images/image01.jpg', "title" =&gt; "Chakra"), array("image" =&gt; 'slider-images/image02.jpg', "title" =&gt; "Another title") ); wp_register_script( 'main', trailingslashit( THEME_URI ) .'_include/js/main.js', false, '1.0', true ); wp_localize_script( 'main', 'My_Slide_Images', $images ); wp_enqueue_script( 'main' ); In the JS file slides: window.My_Slide_Images
type: Answer
score: 1

http://stackoverflow.com/a/27332606
has comment: http://stackoverflow.com/comment/43122720
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43122910
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43122946
accepted answer of: http://stackoverflow.com/q/27332280
type: Answer
answers question: http://stackoverflow.com/q/27332280
has body: You had three main problems that I discovered. The variables you are incrementing were undefined see the changes at the top of the javascript code. Without any initial value then there is no way to increment or decrement the values. See patch 1 You had no content for your close question button(I added an X to click on). See Patch 2 You needed a way to update question numbers. I added an each function to update the question numbers. See patch 3 link to jsfiddle: http://jsfiddle.net/larryjoelane/bjenoe0c/ Javascript code changes: var i = 0; /*begin patch # 1: You variable were not defined*/ //define createdDivs<-fixes not defined error var createdDivs; //define mcqCount<-fixes not defined error var mcqCount; //define deletedDivs<-fixes not defined error var deletedDivs; /*end patch 1*/ $(document).ready(function () { $(document).on('click', '#new-mcq', function () { if (i == 0) $(".insert-question-container").html(''); i++; createdDivs++; mcqCount++; /*patch 2: added text to close-btn-mcq, it can not be clicked if there is no content */ $(".insert-question-container").append(' |X| '+i+'Multiple Choice Question ').show('slow'); //alert("MCQ: "+mcqCount); }); }); $(document).on('click', '.close-btn-mcq', function () { var id = $(this).attr("id"); var className = $(".add-question-new").attr("id"); $("#" + id).remove(); //alert(id); deletedDivs++; mcqCount--; i--; /*patch 3: add each function to change question numbers */ $(".add-question-name").each(function(i){//begin each function //update the question number $(this).html((i + 1) + " Multiple Choice Question"); });//end each function //debug only alert("i = " + i); //alert("mcq = " + mcqCount); if (createdDivs == deletedDivs) i = 0; });

http://stackoverflow.com/comment/130298004
type: Comment
has text: where i need to add this lines ? in proxy ?
comment on: http://stackoverflow.com/a/53526965
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43419211
type: QuestionComment
type: Comment
score: 0
has text: Where do you want the label to go (and what input element is it labeling)? What does the `table` look like before the label is injected? What should it look like after?
comment on: http://stackoverflow.com/q/27465239

http://stackoverflow.com/a/27454586
answers question: http://stackoverflow.com/q/27454557
has body: It looks like your total is storing a string instead of a number. Try using parseInt(number) to convert the string into a number.
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/27417730
tagged with: ajax
type: Question
has body: I am having problem with bootstrap tabs. On bootstrap tabs links I put my page id before the #link, its work from id 1 to 9 but after id 10 to up its not working error page not found. Here is the browser behaviour if i click ID 1 to 9 the link like this http://example.com/page/1 and the id 10 to up like this http://example.com/page/(missing num)5 My code looks like: Albums <a href="<%= id %>/#videos" aria-controls="videos" role="tab" data-toggle="tab">Videos <a href="<%= id %>/#biography" aria-controls="biography" role="tab" data-toggle="tab">Biography <a href="<%= id %>/#comments" aria-controls="comments" role="tab" data-toggle="tab">Comments Albums Biography <%= bio %> <div class="fb-comments" data-href="<%= player_root %>artist/<%= id %>" data-width="100%" data-num-posts="10" og:image="'+player_root+'static/artists/<%= id %>_large.jpg" og:title="<%= name %>">
has comment: http://stackoverflow.com/comment/43278801
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/30148198
tagged with: twitter-bootstrap
score: 0
answer count: 2
has title: bootstrap tabs not working properly
tagged with: http://stackoverflow.com/tag/json
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27425508
tagged with: javascript

http://stackoverflow.com/q/27422293
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27422480
has comment: http://stackoverflow.com/comment/43286975
has body: I am using append to append some input data with div. After some appending, I have data as below : &lt;div id="holder"&gt; &lt;/div&gt; var data = "&lt;div id=1&gt;&lt;input type='text' id='test_1' name='test_1'&gt;&lt;/div&gt;&lt;div id=2&gt;&lt;input type='text' id='test_2' name='test_2'&gt;&lt;/div&gt;" $("#holder").append(data ); I am appending data using append. Now, I want to remove particular div based on id. For i.e. if id is 1 then remove this row. &lt;div id=1&gt;&lt;input type='text' id='test_1' name='test_1'&gt;&lt;/div&gt; and like that for all. I tried $("#holder").remove(), but it will remove all data. I want to remove particular div then what to do ?
favorite count: 0
has answer: http://stackoverflow.com/a/27422452
has comment: http://stackoverflow.com/comment/43287001
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43286856
downvote count: 6
type: AnsweredQuestion
score: -5
upvote count: 1
accepted answer: http://stackoverflow.com/a/27422452
type: Question
has comment: http://stackoverflow.com/comment/43287029
answer count: 2
has answer: http://stackoverflow.com/a/27422480
has title: Remove particular dynamic div using jQuery

http://stackoverflow.com/q/27465724
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27465872
has title: Change DIV text with jQuery multiple times
has body: I have the following code: <?=$exercises[$currentExc]?> The above code displays a title. Skip The above code calls the below function, which should change the title. //Skip to the next exercise function skipExc() { <?php $currentExc++; ?> $("#titleText").html('<?php echo $exercises[$currentExc]; ?>'); } It actually works, but only once. Let's say I have 5 different titles (5 items in my $exercises array), the code above only go from the first title to the second title and then stops updating. I have tested and the function is called, but the title doesn't change. Can anybody please help me with this? Thanks.
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/43367566
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43367596
tagged with: wordpress
upvote count: 1
accepted answer: http://stackoverflow.com/a/27465872
downvote count: 1
type: Question

http://stackoverflow.com/q/27333173
has comment: http://stackoverflow.com/comment/43139889
has answer: http://stackoverflow.com/a/27333220
has comment: http://stackoverflow.com/comment/43143787
downvote count: 0
has comment: http://stackoverflow.com/comment/43123735
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/17093862
tagged with: struts2
has body: I creating a Java web application with an action file which generates data from database to a JSON array. Now, I want this JSON array to be passed to jQuery? How is that possible? FYI. I applied Struts 2, Spring and Hibernate frameworks. I am not using PHP for this app. Update: This is my Struts 2 action method: public static String jsonData = null; public String generateJson() throws Exception { JSONObject json = null; JSONArray jsonArray = new JSONArray(); this.records = this.recordManager.getAllRecords(); for (RecordEntity record : records) { json = new JSONObject(); json.put("id", record.getId()); json.put("firstname", record.getFirstName()); json.put("lastname", record.getLastName()); json.put("due", record.getDue()); json.put("email", record.getEmail()); json.put("website", record.getWebsite()); jsonArray.put(json); } System.out.println(jsonArray.toString()); jsonData = jsonArray.toString(); // jsonData will be passed to jQuery return SUCCESS; } And this is my jQuery. I am using BootstrapTable so this is the structure, and I want the value of jsonData to be passed to this jQuery: $('#record').bootstrapTable({ method : 'get', data: jQuery.parseJSON(VALUE_OF_jsonData_HERE), cache : ... ... ... });
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43123724
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/43123971
has title: How to pass JSON array from Struts 2 action class to jQuery?
has comment: http://stackoverflow.com/comment/43123687
score: 1
tagged with: java
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43123744
type: Question

http://stackoverflow.com/comment/43362137
type: AnswerComment
comment on: http://stackoverflow.com/a/27462500
type: Comment
has text: I am beginner,this is the link to my complete html folder,you will get the html ,css & js in that.Please do check & if you have enough time ,let me know what went wrong :) https://www.dropbox.com/s/6td9lylk1vak5bz/i%27m.rar?dl=0 @ Roko C. Buljan
score: 0

http://stackoverflow.com/comment/43263738
has text: Yeah, stopping and restarting isn't any use as it's not a HTTPS site. I considered this, but it's not really plausible to have the user click "Allow" all the time. But thanks for your post :)
comment on: http://stackoverflow.com/a/27405283
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27421271
has comment: http://stackoverflow.com/comment/43285593
has comment: http://stackoverflow.com/comment/43285399
has comment: http://stackoverflow.com/comment/43285753
has comment: http://stackoverflow.com/comment/43287999
score: 0
has comment: http://stackoverflow.com/comment/43288656
type: Answer
has comment: http://stackoverflow.com/comment/43285233
has body: data: {jsonString:"jsonString", fd:"fd", fd1:"fd1"} in here you have to remove quotes from jsonString parameter value because you have setted your json object stringified. And add quotes to your first parameters. Here is your updated code. &lt;script type="text/javascript"&gt; function submitAllDetails(){ // Why usint [] brackets? not needed.. var jsonObj={ name:name, age:age, rollno:rollno, add:add, }; var jsonString=JSON.stringify(jsonObj); alert(jsonString); var fileInput=document.getElementById("Uploadfile"); var file=fileInput.files[0]; var fd = new FormData(); fd.append("fileUpload",file); var fileInput1=document.getElementById("Uploadfile2"); var file1=fileInput1.files[0]; var fd1 = new FormData(); fd1.append("fileUploadnew",file1); $.ajax({ url:contextPath +"/submitAllInfo", type:"POST", contentType: "application/json; charset=utf-8", data: {"jsonString":jsonString, "fd":fd, "fd1":fd1}, // you have setted json in jsonString varible async: false, cache: false, processData:false, success: function(response){ alert("in success***"); }, error: function(){ alert("error has occured"); } });
answers question: http://stackoverflow.com/q/27420992
has comment: http://stackoverflow.com/comment/43286560

http://stackoverflow.com/comment/43341850
has text: @BenjaminGruenbaum: Yes, it is in the sense that any selector will have a meaning anytime that you use it. However, it only has a value when you use it, in between it doesn't retain any value like a variable does. Also, it's not changeable and the value is only readable, depending on the state in the DOM, so in that sense it's more like a read-only property that gets its value from other members.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27451552

http://stackoverflow.com/q/27388402
has comment: http://stackoverflow.com/comment/43228269
has comment: http://stackoverflow.com/comment/43227584
accepted answer: http://stackoverflow.com/a/27390212
has comment: http://stackoverflow.com/comment/43226499
type: AnsweredQuestion
tagged with: cookies
linked to: http://stackoverflow.com/q/640938
has comment: http://stackoverflow.com/comment/43228034
has comment: http://stackoverflow.com/comment/43224842
type: Question
has comment: http://stackoverflow.com/comment/43225012
has comment: http://stackoverflow.com/comment/43227916
has comment: http://stackoverflow.com/comment/43228290
tagged with: javascript
has title: Saving FileList to $.cookies
has comment: http://stackoverflow.com/comment/43226950
tagged with: jquery-plugins
score: 0
has answer: http://stackoverflow.com/a/27390212
has body: I have a FileList like this: FileList {0: File, 1: File, 2: File, File…} I need to remember these files after pages has been refreshed. How can I save them to cookies? (or is there some better methods?) Right now I'm doing it like this $.cookie("result", files); files = $.cookie("result"); but this gets me [object FileList] which I can't parse. Turning files into JSON didn't work either. Any ideas how can I save the FileList so that I can loop it after page refresh? EDIT: Maybe I should note that I get the FileList from user input e.g. "Choose files". Assigning files: HTML part: &lt;input type="file" id="files" name="file" multiple /&gt; JS part: $('#files').on('change', readFiles); function readFiles(event) { var files = event.target.files; //has FileList {0: File, 1: File, 2: File, File…} $.cookie.json = true; //converts FileList to json (is correct). $.cookie("result", files); //cookie registering also works (atleas with strings) files = $.cookie("result"); //get undefined as a result for (var i = 0, f; f = files[i]; i++) { var reader = new FileReader(); reader.readAsText(f, 'utf-8'); } }
answer count: 1
has comment: http://stackoverflow.com/comment/43225116
tagged with: jquery
has comment: http://stackoverflow.com/comment/43224952

http://stackoverflow.com/a/27336987
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27336281
upvote count: 2
has body: The biggest problem is that you are adding the payload to the options, and the message to be posted to Facebook must be part of the Facebook URL. I updated your code at the bottom of the answer. Here is what I use: function fncPostSecurly_(argToPost) { //argToPost is the message to post to Facebook that is passed to this function. Logger.log("fncPostSecurly ran: " + argToPost); var sttsUpdate = argToPost + "your text to post here" + argToPost; var fromLogInTkn = cache.get('fbTkn'); // Get facebook token that was stored in cache Logger.log("cache FB token: " + fromLogInTkn); //This is added security https://developers.facebook.com/docs/graph-api/securing-requests/ var appsecret_sig = Utilities.computeHmacSha256Signature(fromLogInTkn, "YourAppSecret"); var optnPostFB = {"method" : "post"}; // var PostToFB_URL = "https://graph.facebook.com/FacebookPageOrGroupID/feed?message=" + sttsUpdate + "&amp;access_token=" + fromLogInTkn; //Make a post to the Page var whatHappened = UrlFetchApp.fetch(PostToFB_URL, optnPostFB ); //The return from facebook is an object. Has to be converted to a string. var strFrmFbObj = whatHappened.getContentText(); Logger.log("Return value of Post: " + strFrmFbObj); //When a post is successfully made to Facebook, a return object is passed back with an id value. var rtrnVerify = strFrmFbObj.indexOf('{\"id\":\"'); Logger.log("rtrnVerify: " + rtrnVerify); if (rtrnVerify != -1) { return true; } else { return false; }; }; I think you need a question mark after /feed, like this: var graphUrl="https://graph.facebook.com/"+myId+"/feed?"; Also, the content to get posted to Facebook is part of the URL. You are adding the content to be posted to the payload. That's the wrong place to put it. Fetch takes two parameters. The second parameter can only be: {"method" : "post"} You've got: {method:"post",payload:{ message:"foo\n"+theDate, access_token:myAppAccess_token }} Again, you can't add the payload to the options. The payload must be part of the URL. That's …
has comment: http://stackoverflow.com/comment/43132276

http://stackoverflow.com/comment/43271223
score: 3
has text: You haven't posted enough context here.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27413517

http://stackoverflow.com/comment/43205170
type: QuestionComment
has text: Why are you using two different versions of jQuery?
score: 4
comment on: http://stackoverflow.com/q/27377882
type: Comment

http://stackoverflow.com/q/27343757
tagged with: node.js
favorite count: 0
has answer: http://stackoverflow.com/a/27343829
accepted answer: http://stackoverflow.com/a/27343829
upvote count: 1
type: AnsweredQuestion
score: 1
has body: I use Node.js & express and for the view I use Jade template , What I want is that the Test text will be on the bottom under the black navigation bar and currently I was not able to do so(it's hiding under the black navbar how can I move it to the bottom ),what I miss here ? I put the div This is the code for jade -Layout.jade html head title= title link(rel="stylesheet", href="bootstrap.min.css") link(rel='stylesheet', href='//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap-theme.min.css') script(src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js') body nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation') .container .navbar-header button.navbar-toggle(data-toggle='collapse', data-target='#bs-example-navbar-collapse-1') spansronly span.icon-bar span.icon-bar span.icon-bar #bs-example-navbar-collapse-1.collapse.navbar-collapse ul.nav.navbar-nav li a(href='/recipes/bbq') Tab1 li a(href='/recipes/bbq') Tab2 div.container block content This is the content extends layout extends layout block content .jumbtroon h1= 'Test' I put the div.container in the same indetation of the first div this is the rendered HTML Arrivals Tab1 Tab2 test Here in the img you can see that the test is under the navbar
type: Question
tagged with: pug
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: express
has title: Jade template are not display page as expected
tagged with: css

http://stackoverflow.com/a/27327836
downvote count: 0
has body: The problem is that async.eachSeries only behaves asynchronously if the callback inside it is called asynchronously. In your case, your last two calls to next1a are not performing a query, so they occur synchronously, and thus extend the call stack. In this case, you are likely iterating enough that you hit max stack depth. The simplest fix is to always call next1a asynchronously. Replace each instance of next1a(); with setImmediate(next1a); except the one that is already async because of the query. Note that while process.nextTick(next1a) would also work, it has the potential to block the event loop from processing any other tasks. This is because process.nextTick queues the callback as a microtask, whereas setImmediate queues the callback as a macrotask.
has comment: http://stackoverflow.com/comment/43115201
has comment: http://stackoverflow.com/comment/43123677
has comment: http://stackoverflow.com/comment/43117450
score: 5
has comment: http://stackoverflow.com/comment/43114810
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43114670
has comment: http://stackoverflow.com/comment/43116663
has comment: http://stackoverflow.com/comment/43116584
accepted answer of: http://stackoverflow.com/q/27327042
type: Answer
answers question: http://stackoverflow.com/q/27327042
upvote count: 5

http://stackoverflow.com/q/27333518
tagged with: seo
score: -1
has answer: http://stackoverflow.com/a/27333628
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/26415090
tagged with: javascript
answer count: 2
has title: Is it possible to implement SEO with client-only Single Page Application?
duplicate of: http://stackoverflow.com/q/26415090
upvote count: 0
has answer: http://stackoverflow.com/a/27333698
tagged with: client-side
duplicate of: http://stackoverflow.com/q/7549306
favorite count: 0
has body: Question: is it possible to implement SEO with client-only Single Page Application? Topic: I'm implementing a REST application that is not based on a specific server architecture. So i've to implement a SEO without using techniques of "server side static rendering/snapshots"...is there a way to do it using only javascript+html5? summarizing: javascript & html5 - no server-side = is SEO possible? here you are a "concept code for this app" EDIT: i'm not asking if google crawlers can render js code, but: if is there a way to implement SEO for most search engines in my context. The answere , however, after some reasearch is that actually there are no techniques to do it ( except some pre-rendering enterprise services that creates html snapshots for you ). Seems that the only solution ATM is waiting a better js support for search engines crawlers in future.
tagged with: rest
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27347010
score: 2
has body: You can't just place an if statement anywhere in your code. If you need to get this functionality in that place you need to use a ternary if operator ?: html += ' '+ ' '+moment(x.date_at).format('MM/DD/YYYY') +' '+ ' '+x.transactionType+' '+ ' '+x.id+' '+ ' '+ (x.description!=null ? x.description : '')+' '+ ' '+x.ref_no+' '+ ' '+x.debit+' '+ ' '+x.credit+' '+ ' '+val+' '; If you want to use if anyway, you should introduce a variable that will hold the resulting value: var temp = ''; if (x.description != null) temp = x.description; html += ' '+ ' '+moment(x.date_at).format('MM/DD/YYYY') +' '+ ' '+x.transactionType+' '+ ' '+x.id+' '+ ' '+ temp +' '+ ' '+x.ref_no+' '+ ' '+x.debit+' '+ ' '+x.credit+' '+ ' '+val+' ';
accepted answer of: http://stackoverflow.com/q/27346958
answers question: http://stackoverflow.com/q/27346958
has comment: http://stackoverflow.com/comment/43148848
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/27329700
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/27329732
has title: sharing $scope.data between 2 different function
has body: getTopicContent.request().finally(function(){ $scope.loader= false; }).then(function(response){ $scope.threadContent = response.data; }) $scope.loadPages = function($scope) { console.log($scope.threadContent.totalPages); } It returned threadContent of undefined. getTopicContent is the service, but I expect $scope.threadContent can be shared with $scope.loadPages function?
type: Question
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/14220321

http://stackoverflow.com/comment/43097371
score: 0
type: Comment
type: QuestionComment
has text: I'll throw it in a JSFiddle when i'm home, JSFiddle refreshes the page and resets all the boxes upon saving on this machine.
comment on: http://stackoverflow.com/q/27317982

http://stackoverflow.com/a/27317245
accepted answer of: http://stackoverflow.com/q/27316802
type: AcceptedAnswer
has body: Backbone proxies a lot of Underscore functions into collections and notably _.filter that allows you to write any filtering function you can think of. For example, to get a list of all models that contain a given point x,y: var c = new Backbone.Collection([ {Xcoord:10, Ycoord:10, Width:10, Height:10}, {Xcoord:20, Ycoord:20, Width:10, Height:10} ]); var x = 15, y = 15; var found = c.filter(function(m) { return (m.get('Xcoord')&lt;x) &amp;&amp; ((m.get('Xcoord')+m.get('Width'))&gt;x) &amp;&amp; (m.get('Ycoord')&lt;y) &amp;&amp; ((m.get('Ycoord')+m.get('Height'))&gt;y); }); http://jsfiddle.net/nikoshr/wa5xshoa/
answers question: http://stackoverflow.com/q/27316802
type: Answer
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/27330331
has comment: http://stackoverflow.com/comment/43118707
has comment: http://stackoverflow.com/comment/43119769
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27330890
has comment: http://stackoverflow.com/comment/43118698
score: 12
type: Question
answer count: 2
upvote count: 12
tagged with: arrays
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43118793
has body: Let's say I have the following code: arr = [0.1,0.5,0.2,0.2]; //The percentages (or decimals) we want to distribute them over. value = 100; //The amount of things we have to distribute arr2 = [0,0,0,0] //Where we want how many of each value to go To find out how to equally distribute a hundred over the array is simple, it's a case of: 0.1 * 100 = 10 0.5 * 100 = 50 ... Or doing it using a for loop: for (var i = 0; j &lt; arr.length; i++) { arr2[i] = arr[i] * value; } However, let's say each counter is an object and thus has to be whole. How can I equally (as much as I can) distribute them on a different value. Let's say the value becomes 12. 0.1 * 12 = 1.2 0.5 * 12 = 6 ... How do I deal with the decimal when I need it to be whole? Rounding means that I could potentially not have the 12 pieces needed. A correct algorithm would - Take an input/iterate through an array of values (for this example we'll be using the array defined above. Turn it into a set of whole values, which added together equal the value (which will equal 100 for this) Output an array of values which, for this example it will look something like [10,50,20,20] (these add up to 100, which is what we need to add them up to and also are all whole). If any value is not whole, it should make it whole so the whole array still adds up to the value needed (100). TL;DR dealing with decimals when distributing values over an array and attempting to turn them into an integer Note - Should this be posted on a different stackoverflow website, my need is programming, but the actual question will likely be solved using a mathematics. Also, I had no idea how to word this question, which makes googling incredibly difficult. If I've missed something incredibly obvious, please tell me.
favorite count: 0
accepted answer: http://stackoverflow.com/a/27330890
possible better answer: http://stackoverflow.com/a/60912714
has comment: http://stackoverflow.com/comment/43118802
has title: How do I optimally distribute values over an array of percentages?
has answer: http://stackoverflow.com/a/60912714

http://stackoverflow.com/a/27413245
has comment: http://stackoverflow.com/comment/53154969
type: Answer
has comment: http://stackoverflow.com/comment/43288451
has comment: http://stackoverflow.com/comment/55181764
upvote count: 14
has body: Although you are using a reactive variable, it only gets set once - when the helper is first called. Therefore it doesn't run again. You need a function outside of the helper to set variable for you. Remember one important rule - helpers should never have side effects. Here's a complete working example of how to create a timer: html {{> timer}} Total Seconds: {{seconds}} js Template.timer.helpers({ seconds: function() { return Template.instance().seconds.get(); } }); Template.timer.created = function() { var self = this; this.seconds = new ReactiveVar(0); this.handle = Meteor.setInterval((function() { self.seconds.set(self.seconds.get() + 1); }), 1000); }; Template.timer.destroyed = function() { Meteor.clearInterval(this.handle); };
score: 14
has comment: http://stackoverflow.com/comment/53155158
accepted answer of: http://stackoverflow.com/q/27412743
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27412743
downvote count: 0

http://stackoverflow.com/q/27370728
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/27370847
has title: Remove (Click) Dropdown Functionality From Menu
has answer: http://stackoverflow.com/a/27370847
tagged with: menu
has body: I'm customizing a theme for a client and trying to find a way to remove the dropdown functionality of the main navigation links. When you click on a top-level link, the menu closes (or opens). I'm not sure why they built this into the theme as I think it's very confusing to the user, not to mention doesn't work properly on mobile. I really need the menus to open on hover but not onclick. I believe this is being done using a combination of CSS3 and Javascript (https://github.com/viljamis/responsive-nav.js). There's probably a simple solution by just editing the responsive-nav.js. But I'm not a javascript coder. Any help would be GREATLY appreciated. The site is here: http://www.gatewayfitnesscenter.com Code I believe controls this: http://gatewayfitnesscenter.com/wp-content/themes/westand/scripts/frontend/responsive-nav.js
tagged with: wordpress
accepted answer: http://stackoverflow.com/a/27372117
type: AnsweredQuestion
tagged with: onclick
has answer: http://stackoverflow.com/a/27372117
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/43298231
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27427303
has text: Try to include that line in your page just to see:
type: AnswerComment

http://stackoverflow.com/comment/43263533
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27409345
type: Comment
has text: I forgot that popup is on the same level as rest of the pages: http://jsfiddle.net/qy10y5bg/

http://stackoverflow.com/q/27360286
answer count: 2
tagged with: extjs4
score: 2
has comment: http://stackoverflow.com/comment/43237408
possible better answer: http://stackoverflow.com/a/44584112
has answer: http://stackoverflow.com/a/27364694
favorite count: 0
tagged with: store
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43172749
has title: ExtJS 4 pagination with local store
upvote count: 3
accepted answer: http://stackoverflow.com/a/27364694
linked to: http://stackoverflow.com/q/13778444
downvote count: 1
type: Question
has body: I have a grid which uses a local store, that is created with an array. I tried to use this solution: Paging toolbar on custom component querying local data store but it doesn't seem to work. My code: var myData = []; //... fill myData var store = Ext.create('Ext.data.ArrayStore', { fields: fields, data: myData, pageSize: 10, proxy: { type: 'pagingmemory' } }); // create the Grid var table = Ext.create('Ext.grid.Panel', { id: "reportTable", store: store, columnLines: true, columns: columns, viewConfig: { stripeRows: true }, dockedItems: [{ xtype: 'pagingtoolbar', store: store, dock: 'bottom', displayInfo: true }] }); Without this part of code the grid is showed but pagination doesn't work. With it the whole grid doesn't appear at all. proxy: { type: 'pagingmemory' } What could be the problem?
tagged with: pagination
has comment: http://stackoverflow.com/comment/43172647
tagged with: javascript
has answer: http://stackoverflow.com/a/44584112

http://stackoverflow.com/comment/43383479
has text: So I managed to figure out what was conflicting with the code and why it wasn't working. I had `overflow-x:hidden;` on my body and it was causing some issues. You're help was definitely appreciated Ed!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27472276
type: AnswerComment

http://stackoverflow.com/comment/43342746
score: 0
has text: @Ginden: Ah. Must be some new HTML5 voodoo ;)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27451887

http://stackoverflow.com/q/27345048
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/27345107
type: Question
has answer: http://stackoverflow.com/a/27345107
has title: How to turn an html string from an array into html using angularjs ng-repeat?
tagged with: javascript
has body: I have the following array where each item's value is a string that is html. How can I turn this string into executable html, so that it can be shown? [ {html:' name '}, {html:' # UserName Time Comments Reply 1,001 Lorem 2014-10-31 ipsum 1,002 amet 1,003 Integer nec odio 1,003 libero Sed cursus '}, {html:' myhtml '} ] See codepen here: http://codepen.io/chriscruz/pen/YPwVmb See below for HTML Email {{item.html}} Javascript and Angular JS var app = angular.module("app", ["firebase"]); app.factory("TestArray", ["$firebase", function($firebase) { lst = [ {html:' name '}, {html:' # UserName Time Comments Reply 1,001 Lorem 2014-10-31 ipsum 1,002 amet 1,003 Integer nec odio 1,003 libero Sed cursus '}, {html:' myhtml '} ] return lst; }]); app.controller("ctrl", ["$scope","TestArray", function($scope,TestArray) { $scope.data = TestArray; //$scope.data = Emails; }]); This is the desired result that I'd like to see: http://codepen.io/chriscruz/pen/pvgwzw?editors=101
upvote count: 1
answer count: 1
tagged with: arrays
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/27383587
type: Answer
has body: What you're describing is a browser specific setting (which allows users to override the website's stylesheets). You won't be able to detect or override these settings (that's the point of them -- give the user control over appearances). That checkbox in your snapshot which says "Allow pages to choose their own colors, instead of my selections above" -- if it is unchecked, then you're no longer in control. Its not under your jurisdiction, so to speak.
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/27382928

http://stackoverflow.com/q/27362077
tagged with: javascript
score: 4
favorite count: 0
tagged with: download
answer count: 0
type: UnansweredQuestion
has title: Pause video file download via JS?
has body: Is it possible to pause a video file download (I assume an http get request) and resume it at a later time? My website ajax requests all it's pages and I'd need to pause a video download if the user needs to download something else (to stop too much bandwidth being used). Scenario: - User visits webpage - Video starts downloading - User interacts with another part of the webpage - Video stops downloading - Another file starts downloading (initiated by the user) - Once file download complete, video download starts where it left off I already don't think this is possible due to the little amount I can find on this subject. My colleagues also suggest it's not possible.
tagged with: http
tagged with: video
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/81970818
downvote count: 0

http://stackoverflow.com/a/27374103
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: newDate()// wrong should be new Date(); counter.innerHTML = currenTime; should be counter.innerHTML = currentTime; use a setInterval http://jsfiddle.net/rkv0deqc/ $(document).ready(function() { var counter = document.getElementById('counter'); window.setInterval(function() { console.log(1); var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var currentTime = hours + ':' + minutes +':' + seconds; counter.innerHTML = currentTime; } ,'1000'); });
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27373938
answers question: http://stackoverflow.com/q/27373938

http://stackoverflow.com/a/27325377
has comment: http://stackoverflow.com/comment/43110177
answers question: http://stackoverflow.com/q/27324996
type: Answer
has comment: http://stackoverflow.com/comment/65339167
accepted answer of: http://stackoverflow.com/q/27324996
upvote count: 10
has comment: http://stackoverflow.com/comment/43110266
has comment: http://stackoverflow.com/comment/43110490
score: 10
has body: Unfortunately there is no support for links and other markup in HTML notifications. The only method to get a clickable link with a notification is to use onclick: function makeNotification() { var notification = new Notification('This is a clickable notification', {body: 'Click Me'}); notification.onclick = function () { window.open("http://stackoverflow.com/"); }; } function notifyMe() { // Let's check if the browser supports notifications if (!("Notification" in window)) { alert("This browser does not support desktop notification"); } // Let's check if the user is okay to get some notification else if (Notification.permission === "granted") { // If it's okay let's create a notification makeNotification(); } // Otherwise, we need to ask the user for permission // Note, Chrome does not implement the permission static property // So we have to check for NOT 'denied' instead of 'default' else if (Notification.permission !== 'denied') { Notification.requestPermission(function (permission) { // If the user is okay, let's create a notification if (permission === "granted") { makeNotification(); } }); } } Mozilla has further documentation at https://developer.mozilla.org/en-US/docs/Web/API/notification Firefox has a short duration for notifications compared to Chrome. There is no way to control how long a notification is visible in Firefox.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27446936
score: 3
has body: I have a simple script that toggles the visability of two divs: This is page 1 contents. This is page 2 contents. It works great but I can not figure out how to add more divs to the mix. http://jsfiddle.net/mxwv85px/1/ Any help is much appreciated...
accepted answer: http://stackoverflow.com/a/27447139
tagged with: javascript
answer count: 6
has comment: http://stackoverflow.com/comment/43332825
possible better answer: http://stackoverflow.com/a/27447008
upvote count: 3
has answer: http://stackoverflow.com/a/27447139
tagged with: jquery
has answer: http://stackoverflow.com/a/27447227
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27447119
has title: Toggle visibility of three or more divs
has comment: http://stackoverflow.com/comment/43333198
has answer: http://stackoverflow.com/a/27447008
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27447459
type: Question
has answer: http://stackoverflow.com/a/27447296

http://stackoverflow.com/comment/43254726
score: 0
type: AnswerComment
has text: By the way, Ward, you mentioned you're not using ASP.NET bundling any more, so what are you using for bundling and minification of your JavaScript resources? Our project is currently still an ASP.NET MVC app and we're using VS 2013, so we have been still using its bundling capabilities.
type: Comment
comment on: http://stackoverflow.com/a/27392346

http://stackoverflow.com/q/27362765
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27363034
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27363034
has body: I have a bunch of input fields with the same class name and a custom data variable assigned to each. The purpose of the custom variable is to be used to later identify and assign the input value in to another JS object. Code looks like something like this. function moveStepOnetoStepTwo(){ //Go thru each item id input field $('.inputfields').each(function(){ var attr_userid = $(this).data('userid'); //get item ID from custom data attr val var attr_final_bid = $(this).val(); //Let's do some error checks with input attr_final_bid = attr_final_bid.trim(); if(empty(attr_final_bid) == true){ $(this).css({"border-color": "red", "border-width":"2px", "border-style":"solid"}); //Alert the user alert("Please enter a valid value before proceeding to Step 2"); return false; } else{ //Go thru the master list $.each(item_checkout_master_list, function(){ if(this.itemID == attr_userid){ this.final_bid = attr_final_bid; } }); console.log(item_checkout_master_list); //if pass move to tab 2 $('#tab1_box').hide(); $('#tab3_box').hide(); $('#tab2_box').show(); $('#myTab li:eq(1) a').tab('show'); } }); } For some odd reason it only does the error check once, and if I call function moveStepOnetoStepTwo() again. Even if another input field is empty it still proceeds with the else actions. Any help on this would be greatly appreciated! Thank you.
has title: Error validation using jquery on all input field only checking once

http://stackoverflow.com/comment/43332951
has text: You probably want `if(numbers.length > 0)` not `x.value`.
score: 3
comment on: http://stackoverflow.com/q/27446961
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27333812
answer count: 1
has answer: http://stackoverflow.com/a/27333882
type: UnansweredQuestion
has body: I'm reading TIFF and PDF files off a network drive and returning each page as an image to the browser which get displayed as JPG. This part works fine. However I'm finding it inefficient because I first have to make a request to the server to determine how many pages the file has, which results in reading in the image on the server, getting the number of pages and returning that value. Once that value is returned to the browser, I then have to make a request for each page to be returned as an image, so the file on the network drive is read in again, and the requested page number is returned as a byte[] representing a BufferedImage of the page. What I'd ultimately like to do is make a request for the first page in the file, and then in the response to the browser, indicate the number of pages in the file so that each additional page can be requested. This would reduce the amount of requests as no initial request would be required just to determine the number of pages. I'm not sure if this is possible. I've spent some time researching to see if I could get response headers from images, but haven't found anything.
tagged with: spring
tagged with: metadata
has title: In Spring, is it possible to return an image to the browser and include metadata about the image in the same response?
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/109854597
type: Comment
comment on: http://stackoverflow.com/a/27333214
has text: @Dalius That's not correct. One thread write to the variable and another thread read from it is sufficient to create a race condition.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27444864
type: UnansweredQuestion
has body: I have been using sourcemaps generated via gulp to debug for a while without problems. I have recently updated my chrome and they stopped working. So, I know they should be working and I also can see the source maps inside of the js file generated. var bundler = browserify({ // Required watchify args cache: {}, packageCache: {}, fullPaths: true, // Specify the entry point of your app entries: ['./js/init.js'], // Add file extentions to make optional in your requires extensions: ['.js'], // Enable source maps! debug: true }); This is my bundler to generate my js file. //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlc1xcYnJvd3NlcmlmeVx ...... HVybiBfO1xuICAgIH0pO1xuICB9XG59LmNhbGwodGhpcykpO1xuIl19 Point being, I know that the source maps are currently being built... But for some reason chrome cannot interact them. I obviously want the sourcemaps to work. How can I get them working? Maybe a setting in chrome?
score: 2
tagged with: source-maps
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27464778
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43336370
tagged with: gulp
has comment: http://stackoverflow.com/comment/43337553
favorite count: 0
has title: javaScript Source maps not working
upvote count: 2

http://stackoverflow.com/a/27335571
upvote count: 1
has body: you could create an array of the required companies, and check for each li if the data is contained in that array: var companies = ["Microsoft", "Google"]; $(function() { var items = $('ul li').filter(function() { return $.inArray($(this).data("company"), companies) > -1; }); items.css({ "position": "relative", "margin-left": "25px" }); console.log(items); }); Steve Jobs Michael Richard Tim
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/27335449
answers question: http://stackoverflow.com/q/27335449

http://stackoverflow.com/q/27398260
tagged with: kendo-ui
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27399065
score: 6
has title: How to override default update event in KendoGrid inline edit mode
type: Question
tagged with: kendo-grid
has body: Is there a any way to capture update event which dynamically generate in inline edit mode. I tried with edit and cancel commands and it worked successfully. I went through this example and it worked with cancel command. Any help would be greatly appreciated.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27399065
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/27326585
has comment: http://stackoverflow.com/comment/43112840
type: Answer
has comment: http://stackoverflow.com/comment/43112234
upvote count: 3
answers question: http://stackoverflow.com/q/27326533
score: 3
has body: Try &amp;.error:focus{ border: none; border-color: transparent; } or also you could try document.getElementById(id).style.property=new style eg. &lt;script&gt; document.getElementById("error").style.border-color = "transparent"; &lt;/script&gt; and possibly implement using something like &lt;input type="text" id="fname" onfocus="myFunction(this.id)"&gt;
downvote count: 0

http://stackoverflow.com/q/27382705
score: 0
has comment: http://stackoverflow.com/comment/43214386
tagged with: javascript
has comment: http://stackoverflow.com/comment/43216478
favorite count: 0
has comment: http://stackoverflow.com/comment/43216601
has comment: http://stackoverflow.com/comment/43214273
tagged with: http://stackoverflow.com/tag/html
has title: Why do site seals use document.write?
has body: When including a site seal on a website, it seems like they always want to use an inline script that alters the DOM with document.write and holds up the page load until it is finished. Most of the time, these seals load quickly, but sometimes, and not always rarely, they take several seconds to load. In the meantime, everything else on the site politely sitting in document.ready methods don't run and the page looks odd and/or doesn't function correctly until then. These seals are buried in the footer because they should be seen only by people looking for them. They should always run last. I know there are ways to mitigate that (iframes or overwriting document.write if nothing else uses it), but my question is why do site seals do this at all? Isn't there a better way? Are they just trying to be incredibly simplistic in what people include, so they can't have an anchor tag wrapped around an image linked to a script? People just copy/paste the code given to them. Maybe it gives them more control to change the design/functionality of the seal's wrapper without having clients update their sites? It's just a usability headache that seems so prevalent and I don't understand why. Is there some security thing I'm overlooking? Like a script needs to be running natively to be able to verify the domain?
answer count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43215054
tagged with: dom
type: Question

http://stackoverflow.com/a/27463016
has body: When you set padding with css it actually gets parsed to 4 properties by browser padding-left, padding-top, padding-right &amp; padding-bottom In order to get the padding values you have to use those 4 sides. You won't get a return value for the top level padding
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27462937

http://stackoverflow.com/comment/43333421
type: Comment
type: QuestionComment
has text: FYI IDs **must** be unique.
comment on: http://stackoverflow.com/q/27446962
score: 0

http://stackoverflow.com/comment/43341351
has text: Does not allow for different element size nor does it actually move the elements around.
comment on: http://stackoverflow.com/a/27450575
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/a/27371381
has comment: http://stackoverflow.com/comment/43194706
answers question: http://stackoverflow.com/q/27371243
has comment: http://stackoverflow.com/comment/43203499
score: 0
has comment: http://stackoverflow.com/comment/43194528
type: Answer
has comment: http://stackoverflow.com/comment/43194433
has comment: http://stackoverflow.com/comment/43194686
has body: You could consider using jquery to set values of the hidden fields. Result one Result two Calculate save And the jquery $(document).on('click', '#calculate', function(){ //you could perform your calculations here or define a separate function $('#hidden1').val('calculated value1'); $('#hidden2').val('calculated value2'); return false; }); FIDDLE

http://stackoverflow.com/comment/43304490
type: QuestionComment
has text: @apsillers My real question is why. Why does this work without the Web Audio API, but fail when the Web Audio API is in place?
comment on: http://stackoverflow.com/q/27429123
score: 0
type: Comment

http://stackoverflow.com/comment/43275001
has text: To some, "current scope" means "current execution context", the use of "scope" might be misleading or confusing with the wider meaning of the scope chain.
type: Comment
comment on: http://stackoverflow.com/a/27414940
score: 0
type: AnswerComment

http://stackoverflow.com/a/27425235
has comment: http://stackoverflow.com/comment/43370433
type: Answer
score: 1
upvote count: 1
has body: I think the problem is related with this: The cross-thread usage of "HttpContext.Current" property and related things A workaround may be replacing the SyncDataTask signature for: public async Task SyncDataTask(WebSocketContext context, HttpSessionState session) And then replace this call: context.AcceptWebSocketRequest(SyncDataTask); for this one: context.AcceptWebSocketRequest(wsc => SyncDataTask(wsc, context.Session));
downvote count: 0
has comment: http://stackoverflow.com/comment/43292862
answers question: http://stackoverflow.com/q/27421450

http://stackoverflow.com/comment/43208603
has text: That being said, I'm sure it can be improved even more but I had to make assumptions about your API and data model, so it's not easy.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27379449

http://stackoverflow.com/comment/43244533
type: Comment
has text: Oh man you just solved my problem. Thanks! But what about this little +? Why isn't it moving?
type: AnswerComment
comment on: http://stackoverflow.com/a/27399376
score: 0

http://stackoverflow.com/q/27394419
tagged with: http://stackoverflow.com/tag/html
answer count: 5
has answer: http://stackoverflow.com/a/27394461
has body: I want to get the user's selected option value as a javaScript alert. But my alert is not working. Here is my HTML code. &lt;select id="formats_id" name="aformats" &gt; &lt;option value="&lt;?php echo $jrowa2['formats']; ?&gt;" onchange="showshowFormat(this.value)" &gt;&lt;?php echo $jrowa2['formats']; ?&gt;&lt;/option&gt; &lt;?php foreach($formats3 as $v3){ ?&gt; &lt;?php if($v3 !== $jrowa2['formats']) { ?&gt; &lt;option value="&lt;?php echo $v3; ?&gt;"&gt;&lt;?php echo $v3; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;?php } ?&gt; &lt;/select&gt; Here is my javaScript code. function showshowFormat(){ var $this = $(this); // assign $(this) to $this var formats_value = $this.val(); alert(formats_value); }
possible better answer: http://stackoverflow.com/a/27394446
has answer: http://stackoverflow.com/a/27394504
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27394446
has answer: http://stackoverflow.com/a/27394460
accepted answer: http://stackoverflow.com/a/27394460
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27394491
tagged with: jquery
score: 0
has title: How to call a HTML select value in javaScript?

http://stackoverflow.com/a/27384288
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43231919
has comment: http://stackoverflow.com/comment/43232180
answers question: http://stackoverflow.com/q/27383907
has body: In section 2, I think you just need to delegate click handling to the "#history_tracklist" container, as follows : $("#history_tracklist").on('click', "li a", function () { $("#track_info").attr("track_id", $(this).text()); }); Without delegation you have a rule saying : when any existing li a element within #history_tracklist is clicked execute my function With delegation, you have a rule saying : when any existing or future li a element within #history_tracklist is clicked execute my function
accepted answer of: http://stackoverflow.com/q/27383907
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/43302504
has text: I suspect the performance difference here is due to the performance cost global-scope variable access. It's costly to look up the `window` object and get a property on that object and then save a new value in it. If you use `var g` and `g++` instead of `window.g` and `window.g++`, the performance between the two is much closer: http://jsperf.com/automatic-memoization/2
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27430358

http://stackoverflow.com/q/27473855
has answer: http://stackoverflow.com/a/27475824
has title: Rails: Allow user to destroy votes
type: Question
has body: So I have a pretty simple vote system that allow users to vote a pin: app/views/pins/show.html.erb &lt;%= link_to upvote_pin_path(@pin), method: :put, remote: true do %&gt; Upvote &lt;% end %&gt; app/controller/pins_controller.rb def upvote @pin = Pin.friendly.find(params[:id]) @pin.votes.create(user_id: current_user.id) respond_to do |format| format.html { redirect_to @pin } format.js end end app/models/vote.rb class Vote &lt; ActiveRecord::Base belongs_to :user belongs_to :pin, counter_cache: true validates_uniqueness_of :pin_id, scope: :user_id end config/routes resources :pins do resources :comments member do put 'upvote' end end What I want is to allow users to destroy their votes if they want to. I tried several things using a :delete and destroy method but nothing is working. Any ideas to put me on track ? :-)
tagged with: destroy
tagged with: javascript
tagged with: controller
score: 0
answer count: 1
tagged with: model
type: UnansweredQuestion
tagged with: ruby-on-rails

http://stackoverflow.com/comment/43190746
has text: Well that was really good tip not using the array. It'll be usefull.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27369451

http://stackoverflow.com/comment/43197475
type: Comment
has text: @JayHarris i was working on jsfiddle when other post answer before me
comment on: http://stackoverflow.com/a/27373357
score: 0
type: AnswerComment

http://stackoverflow.com/q/27404102
has body: I'm working on an open-source Node.Js / express app, which visualizes text notes as a network to provide a visual summary of the connections between all the different notes to the user. It's quite heavy on the frontend, using a lot of functions to filter and process the notes, visualize them as a graph using sigma.js library and so on. At the moment, all my frontend code is inside one file: https://github.com/noduslabs/infranodus/blob/master/views/entries.ejs I want to make it more modular. I know the question is a bit broad, but could somebody give me an indication what strategy I should take to make that code more modular? For example, should I just separate all the functions and put them into the separate .js files? Or is there a framework I could use? Maybe something that people normally use with Node.Js? Any recommendation would be appreciated. I'm asking your help because I want to see what are the options out there. Thank you!
has comment: http://stackoverflow.com/comment/43253023
tagged with: javascript
has title: How to make my frontend Javascript code more modular?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43253239
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/27404467
tagged with: modularity
type: Question

http://stackoverflow.com/q/27453199
score: 0
linked to: http://stackoverflow.com/q/7022787
answer count: 1
has answer: http://stackoverflow.com/a/27453223
accepted answer: http://stackoverflow.com/a/27453223
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I am trying to create a button that will resize the browser window on clicking.From what I've seen this is definitely possible. Using JQuery I have written the following code: $('.resize').click(function(){ window.resizeTo("300px", "300px"); }); To affect the following html: click me But when clicked, the button does nothing. Any ideas?
type: Question
has title: Resizing window on button click?
tagged with: javascript

mysql
tags question: http://stackoverflow.com/q/27438595
tags question: http://stackoverflow.com/q/27416595
tags question: http://stackoverflow.com/q/27450130
tags question: http://stackoverflow.com/q/27337799
tags question: http://stackoverflow.com/q/27400404
tags question: http://stackoverflow.com/q/27447032
tag name: mysql
tags question: http://stackoverflow.com/q/27438358
tags question: http://stackoverflow.com/q/27419602
tags question: http://stackoverflow.com/q/27455101
tags question: http://stackoverflow.com/q/27329050
tags question: http://stackoverflow.com/q/27348589
tags question: http://stackoverflow.com/q/27391404
tags question: http://stackoverflow.com/q/27315799
tags question: http://stackoverflow.com/q/27396290
tags question: http://stackoverflow.com/q/27325984
tags question: http://stackoverflow.com/q/27436859
tags question: http://stackoverflow.com/q/27314416
tags question: http://stackoverflow.com/q/27425737
tags question: http://stackoverflow.com/q/27443398
tags question: http://stackoverflow.com/q/27413188
type: Tag
tags question: http://stackoverflow.com/q/27420743
tags question: http://stackoverflow.com/q/27446227
tags question: http://stackoverflow.com/q/27451723
tags question: http://stackoverflow.com/q/27333646
tags question: http://stackoverflow.com/q/27450339
tags question: http://stackoverflow.com/q/27469091
tags question: http://stackoverflow.com/q/27329562
tags question: http://stackoverflow.com/q/27458258
tags question: http://stackoverflow.com/q/27374937
tags question: http://stackoverflow.com/q/27397297
tags question: http://stackoverflow.com/q/27350367
tags question: http://stackoverflow.com/q/27331036
tags question: http://stackoverflow.com/q/27415939
tags question: http://stackoverflow.com/q/27395071
tags question: http://stackoverflow.com/q/27458558
tags question: http://stackoverflow.com/q/27472317
tags question: http://stackoverflow.com/q/27465248
tags question: http://stackoverflow.com/q/27464199
tags question: http://stackoverflow.com/q/27467040
tags question: http://stackoverflow.com/q/27338161
tags question: http://stackoverflow.com/q/27411022
tags question: http://stackoverflow.com/q/27315173
tags question: http://stackoverflow.com/q/27459027
tags question: http://stackoverflow.com/q/27469228
tags question: http://stackoverflow.com/q/27366848

http://stackoverflow.com/q/27417899
has body: //updates display function updateDisplay() { displayMessage(locations [loclocal].description); } I have no idea what happened but i opened up my code and i started getting this error Uncaught TypeError: Cannot read property 'description' of undefined. PLease help... I was checking to see if my game worked one last time before its due and now im nervous cause its due in 12 hours for class. the rest of the code is on my git https://github.com/rileyjgr/Games the two things to look at are gameworking.html and game.js PLease any help is appreciated idk what i did and im freaking out i cant find the error
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27418092
has comment: http://stackoverflow.com/comment/43279243
has title: Uncaught TypeError: Cannot read property 'description' of undefined
type: Question
answer count: 2
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/43279192
linked to: http://stackoverflow.com/q/988363
has comment: http://stackoverflow.com/comment/43279108
tagged with: javascript
has answer: http://stackoverflow.com/a/27420214
tagged with: typeerror

http://stackoverflow.com/q/27367653
type: Question
upvote count: 3
tagged with: java
has comment: http://stackoverflow.com/comment/92346479
has body: I might need some explaining of stuff I haven't found answers for - neither here nor in javadoc or in the spec... (at least until now) I am building an application which will have to execute Javascript code, with the help of JSR 223. I am interacting with the JS world through a couple of JS objects which are available to me through global variables. This is why I mainly use Invocable.invokeMethod for my calls to JS. (And I create these objects by calling JS constructors through Invocable.invokeFunction and set the returned object in a JS var with ScriptEngine.put(). The actual code I read in with ScriptEngine.eval()) Now this is a server application, so CPU footprint and execution speed are important. So I discovered Compilable. Which brings me to my first question: Why does this interface exist at all? Why don't the different script engines do this internally and transparently? Ok, but back to the assumption that I have to use Compilable. And instead of reading my JS sources with ScriptEngine.eval I would use Compilable.compile(). Which would return a CompiledScript to me. Which has an interface that only offers eval methods. But not anything which resembles the API of Invocable. So how do I get back from my CompiledScript to Invocable? I still want to use that, the API gives me a nice abstraction! :-) Anybody can help me out with that? (This is all happening on Java 7 with Rhino. But of course migration to Java 8 - meaning Nashorn - is coming soon so I will have to deal with both engines.) Thanks a lot, Torben Update: Ok, now I just discovered that I overlooked some sections in the spec, the ones about Invocable and Compilable. So it seems like I will already get the benefit of compilation when using Invocable (why didn't they mention this in the javadoc?!). But then I still have a question: How do I import my source code? Will Invocable do a quasi-compilation of my code if I import it with ScriptEngine.eval?
has comment: http://stackoverflow.com/comment/92347084
tagged with: javascript
type: UnansweredQuestion
tagged with: jsr223
score: 3
downvote count: 0
answer count: 0
favorite count: 0
has title: JSR 223 ScriptEngine, Invocable, Compilable/CompiledScript - do they supplement each other?

http://stackoverflow.com/q/27378827
has comment: http://stackoverflow.com/comment/43207465
tagged with: css
has comment: http://stackoverflow.com/comment/43207325
has answer: http://stackoverflow.com/a/27379041
has comment: http://stackoverflow.com/comment/43207317
has comment: http://stackoverflow.com/comment/43208465
type: Question
has comment: http://stackoverflow.com/comment/43207794
answer count: 2
tagged with: javascript
tagged with: jquery
has title: jQuery animated scroll to anchor not working?
score: 0
has comment: http://stackoverflow.com/comment/43210011
tagged with: http://stackoverflow.com/tag/html
has body: I thought I had resolved this issue but turns out i hadn't. Basically building a tumblr theme and something in my code is conflicting with the jquery animated scroll to top. I've tried removing things as I'm not entirely sure what it could be and thought it might be really obvious to somebody else? Here is a link to my theme http://minori-theme.tumblr.com/ and a jsfiddle that I was following in order to animate the smooth scroll http://jsfiddle.net/YtJcL/1008/ The code I'm using is below and I'm just using a standard a link and id which are linking fine as it goes to the correct point its just not smooth scrolling. $(document).ready(function() { var hashTagActive = ""; $(".scroll").click(function (event) { if(hashTagActive != this.hash) { //this will prevent if the user click several times the same link to freeze the scroll. event.preventDefault(); //calculate destination place var dest = 0; if ($(this.hash).offset().top &gt; $(document).height() - $(window).height()) { dest = $(document).height() - $(window).height(); } else { dest = $(this.hash).offset().top; } //go to destination $('html,body').animate({ scrollTop: dest }, 2000, 'swing'); hashTagActive = this.hash; } }); }); Edit: If anyone has a simpler alternative I'm open to suggestions?
has answer: http://stackoverflow.com/a/27379109
has comment: http://stackoverflow.com/comment/43207322
type: UnansweredQuestion
tagged with: animation

http://stackoverflow.com/comment/43251134
comment on: http://stackoverflow.com/q/27402598
score: 0
has text: Do you want to execute them all or fail on the first match/no-match? Are the regular expressions constant? If so what are they?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27355428
answers question: http://stackoverflow.com/q/27355397
has body: If you really want variable visibility between different scripts you can attach the variable on the window. e.g: script 1: window.page = 1; script 2: alert(page); Make sure you don't use very simple variable names (e.g such as page) to avoid possible collisions. A good practice is to attach an array of your application name on the window and work with that, being sure that you'll not affect anything on the "global scope". e.g: window.MY_APP = { page: 1, foo: 'bar', whatever: [1, 2, 3], example: { name: 'john', surname: 'smith' } };
score: 0
has comment: http://stackoverflow.com/comment/43163648
type: Answer
has comment: http://stackoverflow.com/comment/43163680

http://stackoverflow.com/a/27327820
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43114537
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27327768
answers question: http://stackoverflow.com/q/27327768
upvote count: 2
has body: Try this in your CSS: head { height:100%; } #map1 { position:absolute; height:100%; } Setting the height of the head element to 100% sets the definition for what the map height will be.

http://stackoverflow.com/comment/43273362
score: 1
has text: Your a god, thank you for the help! Egghead should pay you more!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27330953

http://stackoverflow.com/comment/43212295
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27381575
has text: It works just fine (once you fix the `:` typo): http://jsfiddle.net/b2xjoj3c/ The only problem is that keyboard changing of the value is not supported so `keyup` is pretty pointless.
type: Comment

http://stackoverflow.com/comment/43470539
has text: I tried out your version. But I get no result. When I execute it, there is only a blanc screen.
type: Comment
comment on: http://stackoverflow.com/a/27424525
score: 0
type: AnswerComment

http://stackoverflow.com/q/27348746
has body: I want to get apiUrl depending on a user's input &lt;form name="test"&gt; &lt;input type="text" name="Edit"&gt; &lt;input type="button" value="Test" onClick="gettext()"&gt; &lt;input type="text" name="Edit2" readonly style="border:1px solid white"&gt; &lt;/form&gt; Then i have a script which does not work, to form a url based on that &lt;script&gt; function gettext(Edit, Edit2) { document.test.Edit2.value=document.test.Edit.value;}; var apiKey = '07gh4c95ca7e23d41ghggf/'; var userWord = Edit2; var txtjson = '/json'; var apiUrl = 'http://words.bighugelabs.com/api/2/' + apiKey + userWord + txtjson; &lt;/script&gt; I need var userWord to be a string to insert its value in the apiUrl. Please help me with that. Thank you
has comment: http://stackoverflow.com/comment/43152155
has title: return string in javascript
score: -4
type: Question
has answer: http://stackoverflow.com/a/27348772
has comment: http://stackoverflow.com/comment/43152147
tagged with: javascript
has comment: http://stackoverflow.com/comment/43152185
downvote count: 4
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43152149
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27348772
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/43117644
has text: @Juhana Yep, I also realized that :)
comment on: http://stackoverflow.com/a/27329667
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43311817
score: 1
comment on: http://stackoverflow.com/q/27435418
type: Comment
type: QuestionComment
has text: Look at your console.log output. `1-17-2015` is not the same as `01-17-2015`.

http://stackoverflow.com/q/27441219
has body: I am working with openlayers 3 with a layer from mapbox or openstreetmap and I need to draw some circles on it. I am able to print the circles with a view with a projection EPSG:4326, but then I have no map. Changing the projection with a transform the map is displayed, but the points are all together. The only way I am made it work is using TileWMS as a source, but I am not able to use it in production environment Here is my code: version 1: working with TileWMS var source = new ol.source.GeoJSON({ url: 'geojson url' }); var pointsLayer = new ol.layer.Vector({ source: source, style: new ol.style.Style({ image: new ol.style.Circle({ radius: 15, fill: new ol.style.Fill({color: 'rgba(170,33,33, 0.8)'}), stroke: new ol.style.Stroke({color: 'rgba(170,33,33, 0.3)', width: 8}) }) }) }); var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ title: "Global Imagery", source: new ol.source.TileWMS({ url: 'http://maps.opengeo.org/geowebcache/service/wms', params: {LAYERS: 'bluemarble', VERSION: '1.1.1'} }) }), pointsSource ], view: new ol.View({ projection: 'EPSG:4326', center: [-82.3, -10.65], zoom: 3 }) }); This is the result Using mapbox or osm, failing: var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.XYZ({ url: 'http://api.tiles.mapbox.com/v4/XXXXX.kcp9cpdn/{z}/{x}/{y}.png?access_token=token' }) }), /* new ol.layer.Tile({ source: new ol.source.OSM() }),*/ pointsSource ], view: new ol.View({ projection: 'EPSG:4326', center: [-82.3, -10.65], zoom: 3 }) }); This is the result And finally, changing the view the map is displayed but the circles var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.XYZ({ url: 'http://api.tiles.mapbox.com/v4/XXXXX.kcp9cpdn/{z}/{x}/{y}.png?access_token=token' }) }), /* new ol.layer.Tile({ source: new ol.source.OSM() }),*/ pointsSource ], view: new ol.View({ center: ol.proj.transform([-82.3, -10.65], 'EPSG:4326', 'EPSG:3857'), zoom: 3 }) }); And the result I…
score: 0
accepted answer: http://stackoverflow.com/a/27441566
tagged with: map-projections
has title: Openlayers 3 circles from geojson not working with layer tile source different from TileWMS
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27441566
tagged with: openlayers-3
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/27410956
downvote count: 0
has comment: http://stackoverflow.com/comment/43267572
answers question: http://stackoverflow.com/q/27407710
type: Answer
has body: Alternative solution: Put the image as a normal image on your website add a canvas and use CSS positioning to place it right above the image Fill the canvas with the color you use as the page background have your paint tools erase the canvas when you draw. By the way, you can set context.globalCompositionOperation = 'destination-out' to turn all drawing operations into an eraser. Here is an example. As you can see, the alpha properties of your tools are respected. var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); //prepare canvas ctx.fillStyle = '#ffffff' ctx.fillRect(0, 0, 120, 120); //prepare a 30% opacity eraser ctx.globalCompositeOperation = 'destination-out'; ctx.lineWidth = 5; ctx.strokeStyle = 'rgba(0, 0, 0, 0.3)'; // make random strokes around cursor while mouse moves canvas.onmousemove = function(e) { var rect = this.getBoundingClientRect(); var x = e.clientX - rect.left; var y = e.clientY - rect.top; ctx.beginPath(); ctx.moveTo(x + Math.random() * 33 - 16, y + Math.random() * 33 - 16); ctx.lineTo(x + Math.random() * 33 - 16, y + Math.random() * 33 - 16); ctx.stroke(); } Move your mouse:
has comment: http://stackoverflow.com/comment/122355810
has comment: http://stackoverflow.com/comment/43267040
has comment: http://stackoverflow.com/comment/122356433
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/43267258

http://stackoverflow.com/comment/43250191
comment on: http://stackoverflow.com/q/27402698
has text: Set dragging flag on `mousedown`, remove on `mouseup`. On `mousemove` drag if flag is `on`. Than your condition would be `if(flag){ ...drag... }`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43287651
score: 0
type: Comment
type: QuestionComment
has text: Not able to perform the click on the row(which is not there) and populate form fields.Please help.
comment on: http://stackoverflow.com/q/27418140

http://stackoverflow.com/comment/43169448
type: Comment
has text: @abhitalks - If I make the change in JS, it [doesn't work](http://jsfiddle.net/chipChocolate/m4dyxo38/).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27358311

http://stackoverflow.com/comment/43247333
comment on: http://stackoverflow.com/a/27400925
type: Comment
has text: @AleemAhmad, Please put this code only for test that page tracks or not..with only single text `"hello"` in your page `body` just for tracking.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43266856
comment on: http://stackoverflow.com/a/27411194
type: Comment
score: 0
has text: Maybe I don't understand your question. `maleWidth` is a variable that is set to a function. (Bottom line: copy and paste this code into your console and it gives the intended result.)
type: AnswerComment

http://stackoverflow.com/a/27399040
has body: I'm ignoring the standardAddiions line, mostly because I used it and it returned an error when trying a basic beep(). Also note that I had to write out the full url for it to work! chrome = Application("Google Chrome"); //chrome.includeStandardAdditions = true; win = chrome.Window().make(); chrome.windows[0].tabs[0].url = "http://www.crgreen.com/index2.html"; tab = win.tabs.push(new chrome.Tab()); chrome.windows[0].tabs[1].url = "http://www.crgreen.com/boethos/"; (p.s. I edited a junky version out, then saw you originally wanted 2 tabs, so here you go)
score: 5
has comment: http://stackoverflow.com/comment/43266042
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27391033
has comment: http://stackoverflow.com/comment/43262642
type: Answer
accepted answer of: http://stackoverflow.com/q/27391033
upvote count: 5

http://stackoverflow.com/q/27465474
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43368689
has comment: http://stackoverflow.com/comment/43367143
downvote count: 1
answer count: 1
linked to: http://stackoverflow.com/q/14220321
has title: Getting value from a function which is a parameter for a function
favorite count: 0
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27465495
accepted answer: http://stackoverflow.com/a/27465495
has body: I was wondering whether there is a method that can let me print out value like this? socket.emit('location', "Hostel"); socket.on('resultOfLocation', function(msg){ console.log(msg); //This can print out value successfully }); console.log(msg); //Result is undefined. How can print out value at here?

http://stackoverflow.com/comment/43104751
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27317519
has text: `"AUTHENTICATE-ENTER-CODE": "blah blah blah"` doesn't work?
type: Comment

http://stackoverflow.com/q/27383224
accepted answer: http://stackoverflow.com/a/39974691
possible better answer: http://stackoverflow.com/a/74335957
has comment: http://stackoverflow.com/comment/43216421
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/39974691
score: 6
tagged with: google-chrome
type: Question
has title: Chrome extension long-lived message connection - how to use callback functions?
upvote count: 6
has answer: http://stackoverflow.com/a/74335957
has body: For a while I've been using chrome.runtime.sendMessage(message, callback) for messages from my content script that need to run a callback function after receiving a response from the background. I've also got a long-lived connection that is used for sending messages from the background to the content script (without it being a response to a message initiated by the content script): backgroundPort = chrome.runtime.connect({ name: "contentScript" }); backgroundPort.onMessage.addListener(function(message){ if (message["action"] == "something"){ // Do stuff } }); As far as I can tell, backgroundPort.postMessage() does not support callback messages which means messages that have a callback need to use chrome.runtime.sendMessage(). The problem with this approach is that there is a lot of overhead in setting up a new connection between content script/background for each message, so I'm trying to get callback functionality into the existing long-lived connection through backgroundPort, but it gets kind of messy. Anyone who's been able to come up with an elegant solution?
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/43216014
favorite count: 0
tagged with: google-chrome-extension

http://stackoverflow.com/a/27381386
answers question: http://stackoverflow.com/q/27381195
has comment: http://stackoverflow.com/comment/43211886
has comment: http://stackoverflow.com/comment/43211651
has comment: http://stackoverflow.com/comment/43212221
type: AcceptedAnswer
downvote count: 0
has body: You have to wait for the device ready event before trying to use a plugin document.addEventListener("deviceready", authUser, false); function authUser(){ gamecenter.auth(successCallback, failureCallback); }
has comment: http://stackoverflow.com/comment/43212329
has comment: http://stackoverflow.com/comment/43212015
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27381195

http://stackoverflow.com/comment/43261857
score: 0
type: Comment
has text: Isn't that just the out of the box tooltip?
comment on: http://stackoverflow.com/a/27399372
type: AnswerComment

http://stackoverflow.com/a/27336756
upvote count: 1
score: 1
downvote count: 0
type: Answer
has body: Use quotes: entry += 'Like'; post.id must be a string if it contains the underscore.
answers question: http://stackoverflow.com/q/27336719

http://stackoverflow.com/a/27417057
type: Answer
score: 2
has body: You can do the same thing as you would do in ECMAScript 5. Using either eval: var arr = eval(str); or new Function: var arr = new Function('return' + str)();
has comment: http://stackoverflow.com/comment/43279748
answers question: http://stackoverflow.com/q/27416866
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/43094729
type: Comment
has text: couple of things: make `codeValue`and `data` global variable and dont forget `var codeValue = document.getElementById('#Code').value;` By the way which `Value` is `undefined`?
comment on: http://stackoverflow.com/a/27315960
type: AnswerComment
score: 0

http://stackoverflow.com/q/27397529
accepted answer: http://stackoverflow.com/a/27398648
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19355791
score: 0
has comment: http://stackoverflow.com/comment/43241580
type: Question
has title: Jquery, listeners to links/buttons and document ready issue
has comment: http://stackoverflow.com/comment/43241570
has comment: http://stackoverflow.com/comment/43241174
tagged with: javascript
answer count: 3
possible better answer: http://stackoverflow.com/a/27399396
has answer: http://stackoverflow.com/a/27397623
has comment: http://stackoverflow.com/comment/43241191
has answer: http://stackoverflow.com/a/27399396
tagged with: jquery
has comment: http://stackoverflow.com/comment/43241193
has comment: http://stackoverflow.com/comment/43241460
has answer: http://stackoverflow.com/a/27398648
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43241821
has body: I'm sorry, if my question is very simple, but can't understand it. As I understand it's good practice to attach links/buttons listeners via js but not html. I mean this is bad practice: &lt;a href="javascript:" onclick="temp();"&gt; And this is good &lt;a href="javascript:" id="mylink"&gt; in js code $("#mylink").on... As I understand the main idea is that html page mustn't contain any javascript code, and all js code must be in js file. Ok, I like this idea. The problem I see, implementing such approach is when to attach such listeners. All I found - is that listeners can be attach only when document is ready (otherwise we can't add listeners to elements that are not ready). However, if I have a page that shows for example 100 rows from database, then its loading is not fast (at comparison to short pages). And if we wait until document is ready, the user can't work with site. Please correct me if I'm wrong or say how can we make it to work with long pages without such things as timeouts.

http://stackoverflow.com/comment/43398624
type: Comment
comment on: http://stackoverflow.com/a/27442312
has text: can you please explain URL line. url: '/Department/DeleteConformed/'
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43380030
has text: Have you tried to remove double quotes `'RGB(255,'+val+',0)'`.
type: Comment
type: QuestionComment
score: 4
comment on: http://stackoverflow.com/q/27472745

http://stackoverflow.com/a/27669400
has body: To make the resources function for remove work properly "this" needed to be used, dont forget that the promise is in another namespace so "that=this" is needed. var that=this; Incomes.get({ incomeId: $stateParams.incomeId }).$promise.then(function(income){ income.date= new Date(income.date); var recurringVar; if(income.monthly===true){ recurringVar = 'monthly'; } else if( income.yearly===true){ recurringVar = 'yearly'; } income.recurring=recurringVar; that.income=income; });
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/27344775
answers question: http://stackoverflow.com/q/27344775
type: AcceptedAnswer

http://stackoverflow.com/q/27442828
accepted answer: http://stackoverflow.com/a/27443336
downvote count: 1
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27443336
favorite count: 0
has body: When a user add the markers on the Google Map, I'm saving it as a JSON string on my MySQL database like this: [{"k":52.908902047770255,"D":-3.427734375},{"k":56.31653672211301,"D":7.03125}] "k" is the latitude and "B" the longitude of the added marker. I also save the polylines between the markers like this: [[52.908902047770255,-3.427734375],[56.31653672211301,7.03125]] I have a function witch fetch all the markers and polylines from the database, to display it back to the screen, here is my query: function getMarkersByTripId($tripId) { if ($bdd = mysqli_connect(_BDD_HOST_, _BDD_USERNAME_, _BDD_PASSWORD_, _BDD_NAME_)) { $sql = 'SELECT DISTINCT `markers`, `polylines` FROM `trip` WHERE `trip_id` = "'.$tripId.'"'; $req = mysqli_query($bdd, $sql); if ($req) { while ($row = mysqli_fetch_row($req)) { $jsonData= array('markers'=&gt;$row[0], 'polylines'=&gt;$row[1]); } echo json_encode($jsonData); } else { echo json_encode(array('status' =&gt; 'failure')); } } if ($bdd) { mysqli_close($bdd); } } a var_dump of $jsonData looks like this: array(2) { ["markers"]=&gt; string(79) "[{"k":52.908902047770255,"D":-3.427734375},{"k":56.31653672211301,"D":7.03125}]" ["polylines"]=&gt; string(63) "[[52.908902047770255,-3.427734375],[56.31653672211301,7.03125]]" } In my JavaScript, when I'm doing: console.log(jsonText); It's formed like: "{"markers":"[{\"k\":52.908902047770255,\"D\":-3.427734375},{\"k\":56.31653672211301,\"D\":7.03125}]","polylines":"[[52.908902047770255,-3.427734375],[56.31653672211301,7.03125]]"}" As you can see, it's a simple string containing the JSON result returned by the function getMarkerByTripId() function. Now, I want to convert my JSON string to an object like this: var jsonData = JSON.parse(jsonText); console.log(jsonData); It seems working and it display something like: Object { markers: "[{"k":52.908902047770255,"D":-3.427734375},{"k":56.31653672211301,"D":7.03125}]", polylines: "[[52.908902047770255,-3.427734375],[56.31653672211301,7.03125]]" } The proble…
has title: Fetch JSON object is undefined
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27442910
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27442910

http://stackoverflow.com/q/27398113
type: AnsweredQuestion
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27398423
score: 1
has answer: http://stackoverflow.com/a/27398330
has answer: http://stackoverflow.com/a/27398423
answer count: 2
has comment: http://stackoverflow.com/comment/43242166
has title: Javascript Slideshow sliding
downvote count: 0
has comment: http://stackoverflow.com/comment/43242241
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: slide
possible better answer: http://stackoverflow.com/a/27398330
has body: Today I am trying to create an image slideshow in which there are several effects of interest taking place. What I am trying to achieve can be found at this link: http://themes.jozoor.com/invention/white/index.html. Notice when you cycle through the slideshow on the homepage, the picture and other elements slide into place.

http://stackoverflow.com/q/27327042
accepted answer: http://stackoverflow.com/a/27327836
score: 3
tagged with: asynchronous
upvote count: 3
answer count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/43113909
has answer: http://stackoverflow.com/a/27327836
has body: At last, an actual stack overflow error reported on stackoverflow! I get the following error in the code below: var m = pathA.substr(-(pathB.length)); // var ^ RangeError: Maximum call stack size exceeded I'm fairly sure the answer is reported here, towards the bottom: https://github.com/caolan/async/issues/75 However, I don't understand how to fix my code. I am not calling sync functions inside async functions, as far as I know. Can anyone clarify what I have to do to fix my code? I'm iterating over the cross-product of a result-set to concatenate the path strings where one is the substring of the other. var i = 0; async.eachSeries(results.rows, function (r, next2a) { var pathA = results.rows[i].id_path; var j = 0; async.eachSeries(results.rows, function (r2, next1a) { var pathB = results.rows[j].id_path; //check i=j if (!(i == j)) { var m = pathA.substr(-(pathB.length)); // var m = (pathA || '').substr(-((pathB) ? pathB.length : 0)); if ((m == pathB) &amp;&amp; (pathA.length &gt; pathB.length)) { logger.log('DEBUG', (pathB + ' =&gt; ' + pathA)); conn.query("UPDATE user_token_details SET id_l1=$1, id_l2=$2, id_l3=$3, id_l4=$4,id_l5=$5,id_path2=$9, id_path=$6 WHERE token_uuid=$7 AND user_uuid=$8", [results.rows[i].id_l1, results.rows[i].id_l2, results.rows[i].id_l3, results.rows[i].id_l4, results.rows[i].id_l5, results.rows[i].id_path, results.rows[j].token_uuid, user_uuid, results.rows[j].id_path], function (error, result) { if (error) { throw error; } j++; next1a(); }) } else { j++; next1a(); } } else { j++; next1a(); } }, function () { i++; next2a(); }); }, function (err) { }); Here is the form of this spaghetti: var A = [0, 1, 2, 3, 4...300]; async.eachSeries(A, function (a, next_a) { async.eachSeries(A, function (b, next_b) { // "Range Error: Maximum call stack size exceeded" doSomethingAsync(a,b, function () { next_a(); }); }, function (err) { next_b(); }) }, function (err) { // resume })
has title: RangeError: call stack exceed on async .eachSeries
has comment: http://stackoverflow.com/comment/43114339
has comment: http://stackoverflow.com/comment/43114194
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question

http://stackoverflow.com/comment/43305332
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27431994
type: Comment
has text: In trying to simplify my example I may have misled you. I'm not simply fading in and out, but rather changing a CSS value on the .child element. Therefore I do need to define the functions separately for the two events.

http://stackoverflow.com/a/27377140
has comment: http://stackoverflow.com/comment/43203950
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27377084
has comment: http://stackoverflow.com/comment/43204292
answers question: http://stackoverflow.com/q/27377084
has comment: http://stackoverflow.com/comment/43204470
has body: You should use literal . as just . means "any character" Also you could improve it a bit using global and ignoreCase flags. Also use anchors ^ and $ var pattern= /^[a-z]+\.(([1-9]\.))+[1-9]$/ig; DEMO
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43203974
has comment: http://stackoverflow.com/comment/43204095

http://stackoverflow.com/comment/43222760
type: QuestionComment
comment on: http://stackoverflow.com/q/27387359
score: 1
has text: your code only executes **ONCE** when the page loads, then never again. you'd need to attach that code to an event handler, so it get executed on-demand in response to events - e.g. resizing the window.
type: Comment

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/27407015

http://stackoverflow.com/comment/61686660
type: Comment
has text: yes, but this only works when you use `require` instead `import .. as ..`syntax
type: AnswerComment
comment on: http://stackoverflow.com/a/36130142
score: 0

http://stackoverflow.com/q/27441037
accepted answer: http://stackoverflow.com/a/27441074
downvote count: 1
type: AnsweredQuestion
type: Question
has title: Bootstrap dropdown expanded at pageload
tagged with: javascript
has body: I have a Bootstrap dropdown list. After the page has loaded, the menu is expanded. How can I fix this? Here's a screenshot and code: Dropdown Action Another action Something else here Separated link
has answer: http://stackoverflow.com/a/27441074
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
tagged with: twitter-bootstrap
upvote count: 1

http://stackoverflow.com/comment/43252385
comment on: http://stackoverflow.com/a/27387991
score: 0
type: AnswerComment
type: Comment
has text: This solution would require that you have jQuery. Are there any errors thrown when you click the button?

http://stackoverflow.com/comment/43309524
type: Comment
type: QuestionComment
has text: Added the fiddle in the question.
score: 0
comment on: http://stackoverflow.com/q/27433097

http://stackoverflow.com/comment/43259832
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27407575
has text: I have exactly the same behavior with IE, Mozilla, Chrome, you don't want the target to be showed when you hover over the link?
score: 0

http://stackoverflow.com/comment/43120571
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27331256
has text: Thanks for the andswer, the only thing is, it always returns false... I'm testing it with a name that does exist for sure in the db, and it alway says 'name doesn't exist'

http://stackoverflow.com/comment/43217770
score: 0
type: Comment
has text: By the way you didn't use AngularJS, although you have `ng-app`, my bad.
type: AnswerComment
comment on: http://stackoverflow.com/a/27384034

http://stackoverflow.com/comment/43273200
comment on: http://stackoverflow.com/q/27414614
score: 1
type: Comment
type: QuestionComment
has text: Where do you set `salt`? And what is `num` used for?

http://stackoverflow.com/q/27426609
has comment: http://stackoverflow.com/comment/43295267
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43294920
score: 0
answer count: 1
has body: Im displaying notifications each time i change a value using a slider, the first change creates one notification but then after that it creates multiple notification instead of one. Any ideas how i can stop this? Thank you for any help i have included my code below. Each time the slider is moved this event fires. $("#single-slider").on({ change: function () { $("#single-slider").Link('lower').to(Notification); } }); It is bound to my notification function which lets me pass values in and display a message as seen below. function Notification(value, type) { console.log(value); var tFormat = value; $.jGrowl(' Refresh rate for ' + type + ' changed to ' + tFormat, { life: 10000, header: '&lt;i class="fa fa-comment-o fa-2x"&gt;&lt;/i&gt;' }); } However instead of creating one notification it is creating multiple notifications.
accepted answer: http://stackoverflow.com/a/27427084
tagged with: jgrowl
has comment: http://stackoverflow.com/comment/43295582
has answer: http://stackoverflow.com/a/27427084
has title: NoUiSlider On Event firing multiple times
tagged with: nouislider
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27437727
possible better answer: http://stackoverflow.com/a/27437762
favorite count: 0
has body: I have two buttons(save, publish) defined in my form. If i Click 'save' and then 'publish' , publish button is not working. The issue here is, save function works fine as expected. But when clicking 'publish', what happens is it tries to submit the form and rather to validate the form which defines under 'publish' function, it goes to 'save' function's validate function and further process.I would like to know why it skips that and jump to 'save' function's validate process? The sample code; Form: save <% if (outputs.isPermitted) { %> Publish <% } %> Jquery // cache var to eliminate unnecessary re-querying var $manageForm = $('#manage_form'); $('#save').click(function (e) { var v = $("#manage_form").validate({ submitHandler: function(form) { if(!validate_tiers()){ return false; } var designer = APIDesigner(); $('#swagger').val(JSON.stringify(designer.api_doc)); $('#saveMessage').show(); $('#saveButtons').hide(); $(form).ajaxSubmit({ success:function(responseText, statusText, xhr, $form) { //............ }); $("#manage_form").submit(); }); $('#publish').click(function(e){ alert('xxx'); e.preventDefault(); var v = $("#manage_form").validate({ submitHandler: function(form) { if(!validate_tiers()){ return false; } var designer = APIDesigner(); $('#swagger').val(JSON.stringify(designer.api_doc)); $('#saveMessage').show(); $('#saveButtons').hide(); $(form).ajaxSubmit({ success:function(responseText, statusText, xhr, $form) { $('#saveMessage').hide(); $('#saveButtons').show(); if (!responseText.error) { $( "body" ).trigger( "api_saved" ); } else { if (responseText.message == "timeout") { if (ssoEnabled) { var currentLoc = window.location.pathname; if (currentLoc.indexOf(".jag") >= 0) { location.href = "index.jag"; } else { location.href = 'site/pages/index.jag'; } } else { jagg.showLogin(); } } else { jagg.message({content:responseText.message,type:"error"}); } } }, dataType: 'json' }); } }); alert('zzz'); $manageForm.submit(); });
accepted answer: http://stackoverflow.com/a/27437773
has comment: http://stackoverflow.com/comment/43315809
has comment: http://stackoverflow.com/comment/43315764
has comment: http://stackoverflow.com/comment/43318293
has comment: http://stackoverflow.com/comment/43315745
has comment: http://stackoverflow.com/comment/43316411
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27437773
tagged with: javascript
score: -1
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/27437762
has title: $("#form").submit(); is not working as expected
answer count: 2
upvote count: 0
tagged with: jquery

http://stackoverflow.com/a/27428523
has body: Use this instead: var id = $(e.target).attr('id');
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27428416

http://stackoverflow.com/comment/43109927
comment on: http://stackoverflow.com/q/27322407
has text: I don't see how that's a duplicate. The other questions asks how to test whether the file downloaded correctly.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43109135
type: AnswerComment
has text: @user1840267 for eval(), it always makes sense to print the actual string you evaluate, then copy-paste it in the editor of your choice in empty .js file and see if it is syntactically correct.
type: Comment
comment on: http://stackoverflow.com/a/27324849
score: 0

http://stackoverflow.com/comment/43299165
type: Comment
type: QuestionComment
has text: When I use alert(true) instead of return statement, it works. How can I make it return boolean?
comment on: http://stackoverflow.com/q/27426390
score: 0

http://stackoverflow.com/q/27393206
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27393309
has answer: http://stackoverflow.com/a/27393879
has body: I started learning node.js by reading Node JS in Action book recently. This is probably a newbie question, but after reading several posts of callback functions and javascript scope of variables, I still have problem understand the idea behind this code in chapter 5 of the book. function loadOrInitializeTaskArray(file, cb) { fs.exists(file, function(exists) { var tasks = []; if (exists) { fs.readFile(file, 'utf8', function(err, data) { if (err) throw err; var data = data.toString(); var tasks = JSON.parse(data || '[]'); cb(tasks); }); } else { cb([]); } }); } function listTasks(file) { loadOrInitializeTaskArray(file, function(tasks) { for(var i in tasks) { console.log(tasks[i]); } }); } It includes three callback functions divided in two functions. listTasks(..) is called first and it calls loadorInitializeTaskArray(.. ) later. My problem starts here, how is this call handle by node? loadOrInitializeTaskArray takes two arguments and the second one is the callback function which shouldn't accept any parameters according to is signature but it does!! when does cb(..) get called in loadorInitializeTaskArray and what is that (the same function that calls helper function)? "tasks" is an array declared inside function loadOrInitializeTaskArray, how do we have access to it in listTasks(..) function? I know in Javascript, scope of a variable is inside the function it define and all nested functions. But I have a hard time understanding it here. So can someone explain what is going on here? Thank you
score: 0
possible better answer: http://stackoverflow.com/a/27393309
answer count: 3
tagged with: javascript
tagged with: callback
has title: Node.js calling a callback function inside a callback
accepted answer: http://stackoverflow.com/a/27393879
has answer: http://stackoverflow.com/a/27393312
tagged with: node.js

http://stackoverflow.com/q/27390253
has body: Why in wkhtmltopdf Javascript not working when it's included in footer file? cmd: wkhtmltopdf --footer-html footer.html --zoom 1.2 out.html out.pdf footer.html content: wkhtmtopdf 0.12.1 (with patched qt) system: win 8.1 x64
has comment: http://stackoverflow.com/comment/43655550
type: UnansweredQuestion
tagged with: wkhtmltopdf
type: Question
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27685728
tagged with: http://stackoverflow.com/tag/pdf
has title: wkhtmltopdf not working when it's included in footer file
tagged with: pdf-generation

http://stackoverflow.com/q/27423353
has title: validation on JSP page does not work
has comment: http://stackoverflow.com/comment/43291106
tagged with: validation
accepted answer: http://stackoverflow.com/a/27503635
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/43288834
has comment: http://stackoverflow.com/comment/43289407
has comment: http://stackoverflow.com/comment/43289868
has comment: http://stackoverflow.com/comment/43289602
has comment: http://stackoverflow.com/comment/43290303
has comment: http://stackoverflow.com/comment/43437309
possible better answer: http://stackoverflow.com/a/27424751
has comment: http://stackoverflow.com/comment/43290007
has comment: http://stackoverflow.com/comment/43290227
has comment: http://stackoverflow.com/comment/43293070
has answer: http://stackoverflow.com/a/27424751
has comment: http://stackoverflow.com/comment/43290823
has comment: http://stackoverflow.com/comment/43290651
has answer: http://stackoverflow.com/a/27503635
has comment: http://stackoverflow.com/comment/43290323
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43289940
has comment: http://stackoverflow.com/comment/43289324
tagged with: java
tagged with: servlets
type: Question
score: 0
has body: I have the following jsp page with one input textbox, upon entering the number, the page is redirected to a servlet where I retrieve that number and let's say display it on a page. I'm trying to do the validation in JavaScript but in spite of it, it's still executing the servlet even though validation returns false and I get java.lang.NumberFormatException: For input string: "" in the doGet method on the servlet on the following line: int max = Integer.parseInt(request.getParameter("lengthTxt"));. Why does it seem to bypass validation and still execute the servlet ? How to fix it ? thanks for help ! <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Length calc enter length
answer count: 2

http://stackoverflow.com/comment/43176273
type: Comment
has text: They may use code like `getElementById("voltage")` instead of the jQuery way, so test for any occurrence of "voltage" or 'voltage' (i.e. with double or single quotes).
score: 0
comment on: http://stackoverflow.com/q/27361915
type: QuestionComment

http://stackoverflow.com/comment/74470825
type: Comment
has text: Just for the record, the solution indeed was to save the original html to a variable before it was added to the page, rather than grabbing it off the page.
type: AnswerComment
comment on: http://stackoverflow.com/a/27463840
score: 0

http://stackoverflow.com/comment/43147130
comment on: http://stackoverflow.com/q/27345977
type: Comment
type: QuestionComment
has text: first of all complete quotes at Friesland", like this "Friesland",
score: 1

http://stackoverflow.com/q/27397962
upvote count: 0
accepted answer: http://stackoverflow.com/a/27398195
type: Question
tagged with: google-maps
has body: My code for the initialization of the API looks like so: jQuery(function($) { // Asynchronously Load the map API var script = document.createElement('script'); script.src = "http://maps.googleapis.com/maps/api/js?sensor=false&amp;callback=initialize"; document.body.appendChild(script); }); function initialize() { var bounds = new google.maps.LatLngBounds(); var mapOptions = { mapTypeId: 'roadmap' }; // Display a map on the page map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); map.setTilt(45); // Multiple Markers var markers = [ //php code to get markers from DB ]; // Info Window Content var infoWindowContent = ['some text here']; // Display multiple markers on a map var infoWindow = new google.maps.InfoWindow(), marker, i; // Loop through our array of markers &amp; place each one on the map for( i = 0; i &lt; markers.length; i++ ) { var position = new google.maps.LatLng(markers[i][1], markers[i][2]); bounds.extend(position); marker = new google.maps.Marker({ position: position, map: map, title: markers[i][0] }); //push markers to mapMarkers array. mapMarkers.push(marker); // Allow each marker to have an info window google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infoWindow.setContent(infoWindowContent[i][0]); infoWindow.open(map, marker); } })(marker, i)); // Automatically center the map fitting all markers on the screen map.fitBounds(bounds); } } Problem is I dont want the map to be centered around my markers I get from the database anymore. But if I delete map.fitBounds(bounds); and try to use map.setCenter({lat: -34, lng: 151}); I get a blank screen. If I even touch anything in this code I get a blank screen instead of my map!
has answer: http://stackoverflow.com/a/27398195
tagged with: javascript
tagged with: jquery
score: -1
tagged with: google-maps-api-3
downvote count: 1
has title: Google maps API recenter my map
answer count: 1
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/43167105
type: Comment
type: QuestionComment
has text: The problem is drawImage not works in firefox. but why?!
comment on: http://stackoverflow.com/q/27352528
score: 0

http://stackoverflow.com/a/27452009
type: Answer
answers question: http://stackoverflow.com/q/27451887
score: 0
has body: If you have a &lt;style&gt; tag inside the &lt;table&gt; you need to do like: $('#container table &gt; style').remove(); Check this example http://jsfiddle.net/a4b5gfg5/ In case you need to clear style attribute: $('selector').attr('style', null);

http://stackoverflow.com/a/27427808
has comment: http://stackoverflow.com/comment/43304084
answers question: http://stackoverflow.com/q/27427434
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27427434
has body: Here you go: $(document).ready(function () { var slowTwinkler = $('.slow'); //play with the delay time to modify the twinkle order $('#star1').delay(5); function twinkleSlow() { slowTwinkler.animate({ opacity: '+=0.5' , deg: '+=180' }, { duration: 1000, step: function(now) { slowTwinkler.css({ '-moz-transform': 'rotate('+now+'deg)', '-webkit-transform': 'rotate('+now+'deg)', '-o-transform': 'rotate('+now+'deg)', '-ms-transform': 'rotate('+now+'deg)', transform: 'rotate('+now+'deg)' }); } }); slowTwinkler.animate({ opacity: '=0.5' }, 3000); slowTwinkler.animate({ opacity: '-=0.8', deg: '+=180' }, { duration: 1000, step: function(now) { slowTwinkler.css({ '-moz-transform': 'rotate('+now+'deg)', '-webkit-transform': 'rotate('+now+'deg)', '-o-transform': 'rotate('+now+'deg)', '-ms-transform': 'rotate('+now+'deg)', transform: 'rotate('+now+'deg)' }); }, complete: twinkleSlow }); } twinkleSlow(); }); Link to jsFiddle here.

http://stackoverflow.com/comment/43148566
score: 0
type: Comment
has text: The buttons are disabled. I did that myself by adding an attribute to the html, as I said in the question.
type: AnswerComment
comment on: http://stackoverflow.com/a/27342741

http://stackoverflow.com/comment/43360061
comment on: http://stackoverflow.com/q/27461635
type: QuestionComment
has text: @A.B http://jsfiddle.net/5xLpp5zg/ not possible? really?
score: 1
type: Comment

http://stackoverflow.com/q/27346755
has comment: http://stackoverflow.com/comment/43148985
type: Question
has comment: http://stackoverflow.com/comment/43148540
has comment: http://stackoverflow.com/comment/43148704
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43148638
has answer: http://stackoverflow.com/a/35666360
score: 0
has title: Can't figure out this svg animation
answer count: 1
has comment: http://stackoverflow.com/comment/43149370
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
has body: I have been trying to get the circles in my stage to move around the ellipses, I even copied code from someone that had a very similar setup, but no dice. Heres the codepen and the markup below. http://codepen.io/alcoven/pen/XJXMNW <!--<g> <circle fill="#F26451" cx="17.6" cy="3.3" r="1.4"/> </g> <g> <circle fill="#F26451" cx="6.4" cy="23.1" r="1.4"/> </g>--> <line class="line" stroke-width="1.3" stroke-miterlimit="10" x1="3.7" y1="26.1" x2="26.2" y2="3.6"/> <path class="vertical" d="M9.9,14.9a5,14 0 1,0 10,0a5,14 0 1,0 -10,0"/> <ellipse class="_x34_5deg" transform="matrix(0.5037 0.8639 -0.8639 0.5037 20.2917 -5.4991)" stroke-width="1.3" stroke-miterlimit="10" cx="14.9" cy="14.9" rx="5" ry="14"/> <ellipse class="_x2D_45deg" transform="matrix(-0.5037 0.8639 -0.8639 -0.5037 35.3327 9.5202)" stroke-width="1.3" stroke-miterlimit="10" cx="14.9" cy="14.9" rx="5" ry="14"/> <path class="circlet" d="M16.4,3.2a1.3,1.3 0 1,0 2.6,0a1.3,1.3 0 1,0 -2.6,0"/> <path class="circleb" d="M5,23.2a1.4,1.4 0 1,0 2.8,0a1.4,1.4 0 1,0 -2.8,0"/> CSS #wrapper { top:0; left:0; position:absolute; width:100%; height:100%; background:#F26451; } .container { width:100%; position:fixed; top:30%; bottom:70%; } svg { width:100px; height:auto; margin:10% auto; display:block; } line, .vertical, ellipse._x34_5deg, ellipse._x2D_45deg { stroke:#fff; fill:none; stroke-width:1.3; stroke-miterlimit:10; } .circlet, .circleb { stroke:#fff; fill:#F26451; stroke-width:1.3; stroke-miterlimit:10; } .line { display:none; } JS (function($){ $('[class^="circle-"]').animate({opacity:1},500); // get the animation path node var $path = $('.vertical'), path = $path[0]; var $path2 = $('.vertical'), path2 = $path2[0]; // get the animation object node var $obj = $('.circlet'); var $obj2 = $('.cirlceb'); // get path's length var pathLength = path.getTotalLength(); var pathLength2 = path2.getTotalLength(); // create new tween by initializing TWEEN.Tween object from 0 var tween = new TWEEN.Tween({ length: 0 }) // to path length …
tagged with: animation
has comment: http://stackoverflow.com/comment/43149141
has comment: http://stackoverflow.com/comment/43148563
has comment: http://stackoverflow.com/comment/43148960

http://stackoverflow.com/comment/43092677
comment on: http://stackoverflow.com/q/27316337
has text: Can you provide a fiddle?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27466436
tagged with: javascript
linked to: http://stackoverflow.com/q/26087765
has comment: http://stackoverflow.com/comment/43381921
has comment: http://stackoverflow.com/comment/43368788
tagged with: createjs
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/43376165
type: UnansweredQuestion
has body: Hi I've been looking at cannonball physics and how to implement them in a game. I'd like to apply gravity to the cannonball and x and y velocity relative to the mouse cursor position. So that the cannonball travels toward your mouse position. Further away the mouse cursor (from the cannon) the higher the velocity. The angle should match the position of the cursor on the canvas. I've hunted this out for quite a few days now, so now I'm asking. Who knows of a nice cannonball physics using javascript and canvas? units = 10, pixelsPerMeter = stage.width / units, startlaunch = Math.PI/4, launchAngle = startlaunch; bang = { lastTime: 0, gravity: 9.81, applyGravity: function (elapsed) { bullet1.velocityY = (this.gravity * elapsed) - (launchVelocity * Math.sin(launchAngle)); }, updateBulletPosition: function (updateDelta) { bullet1.left += bullet1.velocityX * (updateDelta) * pixelsPerMeter; bullet1.top += bullet1.velocityY * (updateDelta) * pixelsPerMeter; }, execute: function (bullet1, time) { var updateDelta, elapsedFlightTime; if(bulletInFlight){ elapsedFrameTime = (time - this.lastTime)/1000; elapsedFlightTime = (time - launchTime)/1000; this.applyGravity(elapsedFlightTime); this.updateBulletPosition(elapsedFrameTime); } this.lastTime = time; } } cannon.rotation = cannon.on("tick", function(event) { var angle = Math.atan2(stage.mouseY - cannon.y, stage.mouseX - cannon.x ); angle = angle * (180/Math.PI); // The following if statement is optional and converts our angle from being // -180 to +180 degrees to 0-360 degrees. It is completely optional if(angle &lt; 0){ angle = 360 - (-angle);} // Atan2 results have 0 degrees point down the positive X axis, while our image is pointed up. // Therefore we simply add 90 degrees to the rotation to orient our image // If 0 degrees is to the right on your image, you do not need to add 90 cannon.rotation = 90 + angle; }); var fire = false, gravity = 6, vy = 3, vx = 3; oneback.on("click", function(e) { bullet1.x = cannon.x; bullet1.y =…
tagged with: physics
has comment: http://stackoverflow.com/comment/43421038
has comment: http://stackoverflow.com/comment/43393080
type: Question
has title: An arc in javascript

http://stackoverflow.com/q/27385442
tagged with: javascript
has body: In the admin web application site, Any way to make me use the same namespace javascript object in different page?for example, the first page is login page,if I create the javascript object, like below: var App = { username:"Tom", password:"1234", initLoginUI:function(){ ...... }, initPageUI:function(){ ...... } } After I login, I direct to index.html page, I want to call App.initPageUI() in index.html, is it impossible? How should I do that, could javascript expert give me some suggestion? Many Thanks! Update: I find one way is very close what I mean: http://dotnetslackers.com/Community/blogs/bmains/archive/2009/05/30/ajax-and-type-registernamespace-how-it-works.aspx It is Asp.Net Ajax, but if I don't know Asp.net, I only want to use javascript, maybe..... node.js??? But how to use node.js in my case?I want to some example.....I don't know too much about node.js...but I want to learn!!Or any popular(fancy) framework I can use? Please give me any good suggestion, Many Thanks:)
score: 0
tagged with: asp.net
tagged with: ajax
type: UnansweredQuestion
tagged with: node.js
has title: Have can I call the property(function) of the specified namespace with javascript cross different page?Asp.net Ajax or node.js is good solution?
has comment: http://stackoverflow.com/comment/43219647
answer count: 0
has comment: http://stackoverflow.com/comment/43219379
tagged with: namespaces
type: Question
has comment: http://stackoverflow.com/comment/43222546
has comment: http://stackoverflow.com/comment/43220404

http://stackoverflow.com/a/27366849
answers question: http://stackoverflow.com/q/27366699
has comment: http://stackoverflow.com/comment/43189093
accepted answer of: http://stackoverflow.com/q/27366699
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43185834
has body: The way this works is the selector (a[href^="#target"]) matches every tag whose href begins with #target. $('a[href^="#target"').click(function(){ alert('You targeted something.'); }); a { padding: 20px; } div { background: yellow; margin: 600px 0; } link 1 link 2 link 3 link 4 link 5 I'm the target 1! I'm the target 2! I'm the target 3! I'm the target 4! I'm the target 5!
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27413305
score: 0
answer count: 3
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27413372
has title: How to split multiple string using jQuery or javascript?
has answer: http://stackoverflow.com/a/27413371
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27413372
type: AnsweredQuestion
has body: I know this been posted here: how to split the string using jquery or javascript but in my case have multiple strings. It's working in a single line of string but if it's in a multiple lines it repeats the day after year. and for some reason it display's only the first 'li' value. Is it possible to display it this way: 23 05 2013 25 07 2014 01 05 2014 here is my code: html 23-05-2013 25-07-2014 01-05-2014 css: .day{color:#ccc;} .month{color:#ff0000;} .year{color:green;} script: var data =$('.date').text(); var arr = data.split('-'); $(".date").html(" "+arr[0]+" "+" "+arr[1]+" "+" "+arr[2]+" "); jsfiddle: demo thanks Bon
has answer: http://stackoverflow.com/a/27413757
type: Question
linked to: http://stackoverflow.com/q/16711504
possible better answer: http://stackoverflow.com/a/27413371
tagged with: javascript

http://stackoverflow.com/q/27441957
type: UnansweredQuestion
has title: Responsive columns and the columnizer plugin - How can I stop the text from wrapping/stopping at the certain point?
tagged with: css
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27442496
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I'm working on a little project to learn html/CSS and use the Columnizer plugin. The problem: The project is a responsive table. If I resize the window the layout changes and adapts to the new window size. I want to prevent the "category titles" from being at the end of a column. For example like this. Ideally I'd set manual rules. For example make the title stick to the first two rows of the table (and let it only break/split anywhere after that) and make it impossible that the last two lines are alone at the top of a column. What I've tried: Columnizer includes two CSS classes called "dontsplit" & "dontend" (both apply javascript) that I'm trying to use. According to the documentation it does that: Any node that has the CSS class “dontsplit” won’t be split into multiple columns. This is handy to make sure that tables, etc, aren’t chopped in half if they land at the bottom of a column. & Any node that has the CSS class “dontend” will never be put at the end of a column. The problem is that I can't seem to make it work. For example adding the "dontend" to the Category Title will not change anything. And the dontsplit (I use it in a ) always automatically applies "dontsplit" to everything as if the wouldn't have a closing tag. Didn't work: Category Title Title Here Description Title Here Description Title Here Description How can I use them correctly? Or is there another simple way to do this? Thanks http://jsfiddle.net/vqsd8x16/

http://stackoverflow.com/comment/43098923
score: 0
type: Comment
type: QuestionComment
has text: It's possible that not all of your CSS is supported in SVG.
comment on: http://stackoverflow.com/q/27314557

http://stackoverflow.com/q/27382165
answer count: 1
tagged with: javascript
score: 0
has body: We are using Lazy.js. If I have selected one field, I know I can use the uniq(fieldName) function to get distinct results. For example: var uniqueValues = Lazy(someArray) .map(function (e) { return e.fieldName }) .uniq() .value(); How do you do the same operation on two fields? This is what I tried: var uniqueValues = Lazy(someArray) .map(function (e) return { FieldName1 : e.fieldName1, FieldName2 : e.fieldName2 }) .uniq(); .value(); But it's not making it distinct by both fields.
type: UnansweredQuestion
has title: Lazy.js how to select distinct (uniq) by two fields
type: Question
has answer: http://stackoverflow.com/a/27382536

http://stackoverflow.com/a/27419386
answers question: http://stackoverflow.com/q/27419166
type: Answer
has body: The reason for this is that you do two JSON.stringify var FinalResult = JSON.stringify(result); makes the string ["How are you?"] when you then make a object with the {"result": FinalResult} you just put the string in result property and when you then JSON.stringify({"result": FinalResult}); it will escape the string that is FinalResult. if you just do JSON.stringify({"result": result}); you vill get {"result":["How are you?"]} which u can then simply parse back to object and with a property result which contains an array, otherwise as u have it now you will need to parse it twice to restore the old data.
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27419166

http://stackoverflow.com/q/27417815
downvote count: 0
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27427936
has title: Getting page location in ColdFusion
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43281191
tagged with: coldfusion
has answer: http://stackoverflow.com/a/27418038
upvote count: 1
has comment: http://stackoverflow.com/comment/43322749
has body: When I am using iframes or frames (older sites), as a extra security precaution I use the JavaScript function: &lt;SCRIPT LANGUAGE="JavaScript1.1"&gt; if (top == self) self.location.href = "../index.cfm"; &lt;/SCRIPT&gt; then another hidden check to see if the page is being called correctly.... &lt;cfif (HTTP_REFERER DOES NOT CONTAIN "referer_page.cfm") &lt;cfabort&gt; &lt;/cfif&gt; It works great to keep visitors (hackers?) from opening and/or trying to post to the page. The problem is that the JavaScript displays in source code and the less they know... I know the JS is client side but is there anyway to create the function in the server side CF or otherwise hide from prying eyes? I a running cf9 on my and most of my client sites. Thank in advance
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43280142
has answer: http://stackoverflow.com/a/27428370
has comment: http://stackoverflow.com/comment/43297720
answer count: 3

http://stackoverflow.com/q/27349990
accepted answer: http://stackoverflow.com/a/27350390
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27350390
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/43171818
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/43154813
has body: I am developing a blog app with fiddle here for self teaching. I am facing with problems and gradually overcoming them. I currently managed to render my initial view. Bur I want another view to populate the body entirely. From the first view to that second view and later to others I try to go with anchors preventedDefault and trigger the event method in the current view that hits a Backbone router route. And from there to the router method to construct my second view finally. Up to now I get the error on js console: [Error] TypeError: undefined is not a function (evaluating 'Backbone.navigate( this.hrefOfPostForm , {trigger: true})') toPostFormRoute (app.js, line 45) (anonymous function) ([native code], line 0) dispatch (jquery.min.js, line 3) handle (jquery.min.js, line 3) What can be the problem be with my navigation code?
has title: Cannot route across the Backbone views

http://stackoverflow.com/comment/43118905
score: 0
type: Comment
type: QuestionComment
has text: So , how i can solve it ? this div create by user ...
comment on: http://stackoverflow.com/q/27329757

http://stackoverflow.com/a/27400295
type: Answer
has comment: http://stackoverflow.com/comment/43246501
has comment: http://stackoverflow.com/comment/43245773
has comment: http://stackoverflow.com/comment/43246389
has comment: http://stackoverflow.com/comment/43246270
score: 6
has comment: http://stackoverflow.com/comment/43247005
has comment: http://stackoverflow.com/comment/43245707
has comment: http://stackoverflow.com/comment/43246102
has comment: http://stackoverflow.com/comment/43246939
answers question: http://stackoverflow.com/q/27400235
has comment: http://stackoverflow.com/comment/43246301
has comment: http://stackoverflow.com/comment/43245797
has comment: http://stackoverflow.com/comment/43246240
accepted answer of: http://stackoverflow.com/q/27400235
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43246314
upvote count: 6
has comment: http://stackoverflow.com/comment/43246673
has body: Go for option 3: var x = { a: 10, b: 20, // etc }; Don't declare x as a empty object, only to replace it with an object with an a property. When you need to set a large amount of properties on a object, using a object literal like that is more efficient than adding every single property separately. However, the difference will be negligible. The disadvantage of option #1 is: 1 operation for every single property to add to the object, which will have an effect when larger amounts of properties are required. The disadvantage of option #2 is: You're declaring the object, then replacing it completely. My suggestion simply adds all required properties to the object in one go, without replacing the variable.

http://stackoverflow.com/q/27435418
tagged with: jquery-ui
has title: jQuery UI Datepicker won't render second month in restricted selection
tagged with: javascript
tagged with: date
score: 0
answer count: 1
tagged with: jquery
has body: I have a fiddle: http://jsfiddle.net/4w846rf3/ Where I am passing an array of dates to jQuery UI's datepicker. With those dates, I want to restrict the current calendar so that ONLY the dates provided can be selected. After much research I have found that the beforeShowDay function will help with restricting days, but what I'm experiencing is not correct. The current month's days will render the correct restricted days, but the next month will not. var availableDates = [ "12-22-2014", "12-13-2014", "12-27-2014", "01-17-2015", "01-24-2015" ]; function available(date) { dmy = (date.getMonth()+1) + "-" + date.getDate() + "-" + date.getFullYear(); console.log(dmy+' : '+($.inArray(dmy, availableDates))); if ($.inArray(dmy, availableDates) != -1) { return [true, "","Available"]; } else { return [false,"","unAvailable"]; } } $('input').datepicker({beforeShowDay: available}) Renders December correctly: and January incorrectly:
has comment: http://stackoverflow.com/comment/43311817
tagged with: datepicker
has answer: http://stackoverflow.com/a/27439425
accepted answer: http://stackoverflow.com/a/27439425
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43311839
type: Question

http://stackoverflow.com/comment/43298636
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27428047
score: 0
has text: Because that's what `Object.toString()` prints.

http://stackoverflow.com/q/27430959
has answer: http://stackoverflow.com/a/27431181
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43303270
has body: I have downloaded a free HTML template from web and i'm trying to edit this HTML theme. In my theme i changed background photo, it's good on my computer and my resolution (1366x768) but on mobile and other resolutions it's not working well. Background image is crushing. please visit that website with your computer and your mobile phone for understanding clearly. Theme link and please help me to edit mobile version of this website. I couldn't find anything. Here's the list of my javascript files in theme folder. image of files
has title: How to edit a HTML theme's mobile version?
type: Question
answer count: 2
tagged with: mobile
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27431097
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27431590
accepted answer: http://stackoverflow.com/a/27431711
type: AnsweredQuestion
has body: I have been trying to solve my issue of creating a dropdown menu within a javascript, but using PHP data. I know that you can't "run" PHP within a javascript, but have not been able to solve my issue. My goal is to give the ability to add more items to a form on the fly. I have it working just fine without the dropdown menu, so below is all the code that I think it needed. This is what I started with and I have tried multiple fixes, without any luck. Thank you for your input! newdiv.innerHTML = " "; newdiv.innerHTML .= " Select one "; <?php if ($Total_Rows != 0) { $Run_Cnt = 0; while ($Run_Cnt < $Total_Rows): ?> newdiv.innerHTML .= "<option value=\""+<?=$Room_Type_List[$Run_Cnt]['ID']; ?>+"\">"+<?= stripslashes($Room_Type_List[$Run_Cnt]['Type_Name']); ?>+" ";<?php $Run_Cnt++; endwhile; } ?> newdiv.innerHTML .= " ";
score: 0
type: Question
has comment: http://stackoverflow.com/comment/43304369
tagged with: javascript
has answer: http://stackoverflow.com/a/27431711
answer count: 1
has comment: http://stackoverflow.com/comment/43307603
has title: PHP within javascript for dropdown menu
tagged with: php

http://stackoverflow.com/comment/43260190
comment on: http://stackoverflow.com/q/27405344
score: 0
type: Comment
type: QuestionComment
has text: Ok, i changed to json and also noticed you wrote ttp instead of http and i copied it.. hh now i changed to http and it works without the error but still prints foo

partial-application
type: Tag
tag name: partial-application
tags question: http://stackoverflow.com/q/27411310

http://stackoverflow.com/q/27344529
tagged with: methods
has title: Object prototype method.submethod = function() get this of main class
type: Question
tagged with: function
tagged with: javascript
tagged with: jquery
tagged with: prototype
has comment: http://stackoverflow.com/comment/43144347
upvote count: 1
has body: I'm having trouble accessing the parent this of the javascript class. Slider.prototype.method.submethod = function(){ var self = this; } How can I access the this of the parent, Slider class? I want method to only describe the target, and not make it an object itself. Is there any way of doing this without passing it as a parameter?
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43144442
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/43144363
score: 1

http://stackoverflow.com/a/27411014
answers question: http://stackoverflow.com/q/27343173
score: 0
has body: In the end I found a different solution making a Transform function rendering the data on the width and height variables from the canvas. http://jsfiddle.net/16t735wr/ var transx = makeTransform([minlogP0, maxlogP0], [mingraphx, maxgraphx]); var transy = makeTransform([minlogP1, maxlogP1], [maxgraphy, mingraphy]); // function to create the needed linear transforms // note from and to are two element arrays (see below): function makeTransform(from, to){ // determine a and b in terms of from[0], from[1], to[0] and to[1] var x1 = from[0]; var x2 = from[1]; var y1 = to[0]; var y2 = to[1]; var a = (y1 - y2) / (x1 - x2); var b = y1 - a * x1; return function(x){return a * x + b;}; }
type: Answer

http://stackoverflow.com/q/27339198
has answer: http://stackoverflow.com/a/27339331
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/27339331
downvote count: 0
tagged with: javascript
score: 4
has body: I was asked this question on distributed computing at an interview. Interviewer: "Sam ran a certain code on a client's computer to get its output. But the client modifies the code and hence the code returned a different output. Now Sam wants to know if its possible to detect whether the code had been changed or the return value is modified. Is this possible?" I thought it was impossible to prevent the client from modifying the code since its on their computer. Or am i wrong? If not, can we detect whether the code has been changed or do something to make it difficult for the client to manipulate the code and output?
answer count: 1
tagged with: distributed-computing
favorite count: 0
tagged with: encryption
type: AnsweredQuestion
has title: Execute code securely on client side
has comment: http://stackoverflow.com/comment/43135171

http://stackoverflow.com/q/27327509
score: 0
has body: In javascript I can do this: var show = function(w) { alert(w); }; var words = ['a', 'b', 'c']; words.forEach(show); Note that I don't need to pass the array item as a parameter. Is there a way to the same in ruby? Like: def show(w) puts w end words = ['a', 'b', 'c'] words.each(show) PS: I know that I can do it by doing: words.each { |w| show(w) }. The question is if I can do it like in javascript, without passing the item as a parameter.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27327525
answer count: 1
has title: Call function for all array elements without passing item as parameter
tagged with: ruby
accepted answer: http://stackoverflow.com/a/27327525
type: AnsweredQuestion

http://stackoverflow.com/a/27336534
has comment: http://stackoverflow.com/comment/43152068
score: 4
accepted answer of: http://stackoverflow.com/q/27336503
answers question: http://stackoverflow.com/q/27336503
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/43130591
has body: You can do something like this $(document).ready(function(){ //calcualte fee on page load calculateFee(); $('#amount').on('keyup change', function(){ calculateFee(); }); function calculateFee(){ $('#fees').text($('#amount').val()*(5/100)); $('#net').text($('#amount').val() - ($('#amount').val()*5/100)); } });
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/q/27371810
answer count: 1
accepted answer: http://stackoverflow.com/a/27372087
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27372087
linked to: http://stackoverflow.com/q/18798375
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43195231
type: Question
tagged with: javascript
tagged with: angularjs-scope
has title: How to submit form after validation in angularjs?
has body: var app = angular.module('formExample', []); app.controller('FormCtrl', function ($scope, $http) { $scope.data = {}; $scope.submitForm = function() { formData = $scope.regform; console.log("posting data...."); $http({ url: '/',data: $scope.regform, method: 'post' }).success(); console.log(formData); }; $scope.reset = function(form) { if (form) { form.$setPristine(); form.$setUntouched(); } $scope.user = angular.copy($scope.data); }; $scope.reset(); }); This is my JavaScript code. It submit form along with validation. I need only submit form after validation done. And the reset button not working properly. Click here plnkr example
upvote count: 1

http://stackoverflow.com/q/27473650
tagged with: attributes
has answer: http://stackoverflow.com/a/27473707
type: UnansweredQuestion
has body: Add Item In this form, a user can create a simple list, which can be used, e.g. for a custom select input. Every item have a unique id customfield[data][option][id]. To add a item, the user can click the button. My problem is, that I have to change the name attribute for every new added item. How can I only change the id of the name-attribte? var sortele = $('.js-sortable-option'), additem = $('.js-add-item'); additem.on('click',function(){ ele = sortele.first(); /** code to change name attr (e.g. to customfield[data][option][newid])*/ sortele.append(ele); });
has title: JQuery: Handling name attribute
type: Question
has answer: http://stackoverflow.com/a/27473722
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/a/27335102
has comment: http://stackoverflow.com/comment/43127154
has body: For older jquery versions you can use live function if html is changed dynamically (I saw you using an older jquery version in the fiddle) $('.add').live( 'click', function () { $('.add').append(' Hello ') });
answers question: http://stackoverflow.com/q/27334980
downvote count: 0
has comment: http://stackoverflow.com/comment/43127116
type: Answer
upvote count: 1
score: 1

object
tags question: http://stackoverflow.com/q/27356144
tags question: http://stackoverflow.com/q/27411081
tag name: object
tags question: http://stackoverflow.com/q/27350405
tags question: http://stackoverflow.com/q/27436036
tags question: http://stackoverflow.com/q/27325508
tags question: http://stackoverflow.com/q/27445705
tags question: http://stackoverflow.com/q/27359057
tags question: http://stackoverflow.com/q/27365009
tags question: http://stackoverflow.com/q/27372457
tags question: http://stackoverflow.com/q/27428531
tags question: http://stackoverflow.com/q/27388077
tags question: http://stackoverflow.com/q/27412827
tags question: http://stackoverflow.com/q/27342297
tags question: http://stackoverflow.com/q/27373116
tags question: http://stackoverflow.com/q/27465574
tags question: http://stackoverflow.com/q/27367667
tags question: http://stackoverflow.com/q/27432868
tags question: http://stackoverflow.com/q/27471287
tags question: http://stackoverflow.com/q/27447728
tags question: http://stackoverflow.com/q/27343187
tags question: http://stackoverflow.com/q/27463771
tags question: http://stackoverflow.com/q/27463653
tags question: http://stackoverflow.com/q/27393454
tags question: http://stackoverflow.com/q/27350704
tags question: http://stackoverflow.com/q/27318669
tags question: http://stackoverflow.com/q/27349458
tags question: http://stackoverflow.com/q/27391478
tags question: http://stackoverflow.com/q/27386128
tags question: http://stackoverflow.com/q/27362589
tags question: http://stackoverflow.com/q/27314145
tags question: http://stackoverflow.com/q/27352068
tags question: http://stackoverflow.com/q/27400235
tags question: http://stackoverflow.com/q/27431998
tags question: http://stackoverflow.com/q/27380353
tags question: http://stackoverflow.com/q/27435610
tags question: http://stackoverflow.com/q/27349921
type: Tag
tags question: http://stackoverflow.com/q/27348998
tags question: http://stackoverflow.com/q/27471845
tags question: http://stackoverflow.com/q/27335186
tags question: http://stackoverflow.com/q/27392669
tags question: http://stackoverflow.com/q/27334072

http://stackoverflow.com/comment/46619318
score: 0
comment on: http://stackoverflow.com/a/27455758
type: Comment
has text: Couldn't accept it at the time -- it was too soon to when I asked it.
type: AnswerComment

http://stackoverflow.com/a/27437712
answers question: http://stackoverflow.com/q/27437577
has body: This sounds like a job for table-layout: fixed. Your browser computes the width of each "column" (element) in the first "table-row" based on the number of columns in the "table". .table { display: table; table-layout: fixed; width: 100%; } .table > span { display: table-cell; text-align: center; } 1 2 3 4 5 6 7 8 9 1 2 3 4 5
score: 0
type: Answer

http://stackoverflow.com/comment/43383028
has text: '10px' + '10px' is equal to '10px10px'. Use `parseInt`
type: QuestionComment
score: 6
type: Comment
comment on: http://stackoverflow.com/q/27474340

http://stackoverflow.com/q/27407782
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27407997
has title: How to execute angular directive on $scope.$apply
has body: I have a directive that controls an image displayed in the DOM: summariesApp.directive('changePlus', function () { return function changePlus(scope, element, attr) { if (scope.$parent.Tab == "MultiVariant") if (scope.$parent.multis[parseInt(attr.a)].show) { element[0].src = 'Images/hide.png'; } else { element[0].src = 'Images/show.png'; } } else { element[0].src = 'Images/show.png'; } element.on('mousedown', function (event) { var imgName = event.target.src.split("/"); if (imgName[imgName.length - 1] == 'show.png') { event.target.src = 'Images/hide.png' } else { event.target.src = 'Images/show.png' } }); } }); The issue is that when I call a service I would like for this directive to run. I thought that by using $scope.$apply, and having the digest cycle fire, this directive would be evaluated but it is not. Is there any way for me to have the view reevaluate with the directives on $scope.$apply?
type: Question

http://stackoverflow.com/a/27511518
has comment: http://stackoverflow.com/comment/43600985
has body: There isn't a perfect solution to listen the KeyCode across browsers and OS... Simply because javascript uses the same Key Codes that are reported by the Operating System where it runs. You will be better off using the input event instead of keyDown According to this site the input event occurs when the text content of an element is changed through the user interface, which is what you want, because in some mobile browsers/OS events don't fire until the user enters the input and the change event fires. $(document).ready(function () { var inputEvent = 'oninput' in window ? 'input' : 'keyup'; $('#listen').on(inputEvent, function (event) { $('#show').val($('#show').val() + '\n' + event.type); console.log('--- input event ----'); for (var v in event.originalEvent) { if (event.hasOwnProperty(v)) { console.log(v + ' |---&gt; ' + event[v]); } } }) //just added to see what Silk listens for on the keyup event $('#listen').on('keyup', function (event) { $('#show').val($('#show').val() + '\n' + event.type + ' | which --&gt; ' + event.which); console.log('--- keyup event ----'); for (var v in event.originalEvent) { if (event.hasOwnProperty(v)) { console.log(v + ' |-.-&gt; ' + event[v]); } } }) }); input { font-size: 22px } input, textarea { width:300px; } textarea { height:300px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt; &lt;div&gt; &lt;input type='text' id="listen" /&gt; &lt;br/&gt; &lt;br/&gt; &lt;textarea type='text' id="show"&gt;&lt;/textarea&gt; &lt;/div&gt;
downvote count: 0
has comment: http://stackoverflow.com/comment/43453594
has comment: http://stackoverflow.com/comment/43644204
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27333570
upvote count: 2
has comment: http://stackoverflow.com/comment/43457671
has comment: http://stackoverflow.com/comment/43454024

http://stackoverflow.com/comment/43289940
comment on: http://stackoverflow.com/q/27423353
score: 0
type: QuestionComment
type: Comment
has text: yes the same error, same thing

http://stackoverflow.com/q/27358775
has answer: http://stackoverflow.com/a/27359200
has body: Before you answer "they don't support input type date", please read the question ;) I have this (simplified): &lt;input type="date" /&gt; and with JS and/or jQuery I want to be able to do something with it, so I look for something like: var input = el.querySelector("input")[0]; // returns the input var inputType = input.type; // returns "date" in Chrome, "text" in IE, FF So I tried to be smarter than that and did this: var inputType = $("input")[0].attr("type"); but it still returns "text".. Any ideas/hacks that can force it to return date? I would prefer not to use class/id selectors as it's for a generic system, where I don't necessarily control those. Thanks!
has answer: http://stackoverflow.com/a/27359071
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43169925
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4
accepted answer: http://stackoverflow.com/a/27359071
tagged with: input
upvote count: 1
downvote count: 1
has title: Why won't IE and FF return the correct attribute or type for input type date
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27359216
possible better answer: http://stackoverflow.com/a/27358946
tagged with: date
has answer: http://stackoverflow.com/a/27358946
type: Question
has comment: http://stackoverflow.com/comment/43169910

http://stackoverflow.com/comment/43291249
comment on: http://stackoverflow.com/q/27424572
type: Comment
type: QuestionComment
score: 0
has text: position:fixed is good, but not suitable for all situations. e.g. Jira uses something similar for topbars which change from static to fixed: https://www.atlassian.com/software/jira

http://stackoverflow.com/comment/43252562
score: 0
type: Comment
type: QuestionComment
has text: @Pointy Actually it does make sense. I "reset" all the time when I'm doing HTML5 game development. For example when a player dies and they ran out of life's you can *reset* the game, but you don't want to reload the entire page and have the user wait.
comment on: http://stackoverflow.com/q/27403827

http://stackoverflow.com/a/27383581
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27383120
answers question: http://stackoverflow.com/q/27383120
has body: You placed the modals on the wrong place. Put them at the end of your content, near to the end of the body.
upvote count: 1

http://stackoverflow.com/q/27461292
linked to: http://stackoverflow.com/q/9329446
type: Question
has body: I'm makin an AJAX request like this: $.ajax({ url: baseurl, dataType: 'json', data: { "id": id }, type: "POST", success: function(data) { console.log(data) } }); The variable data appears in console as: Object {ids: Array[2], values: Array[2], name: "Test"…} Expanding it gives: ids: Array[2] 0: "1417509840" 1: "1419964200" length: 2 I'm unable to access the ids array. I can access the name variable by data.name, but I cannot access the array elements.
tagged with: javascript
tagged with: jquery
tagged with: ajax
downvote count: 3
has comment: http://stackoverflow.com/comment/43358890
answer count: 1
favorite count: 0
type: UnansweredQuestion
score: -3
has title: Access JSON object in javascript
upvote count: 0
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27461304

http://stackoverflow.com/a/27359339
has comment: http://stackoverflow.com/comment/43170929
has comment: http://stackoverflow.com/comment/43170817
accepted answer of: http://stackoverflow.com/q/27359214
has comment: http://stackoverflow.com/comment/43174354
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27359214
score: 0
has body: You need to add a length AND i&lt;5 in the loop. for (var i = 0; i&lt;files.length &amp;&amp; i&lt;5; i++) { var f = files[i]; If you think the file type will be an issue, you can always have a second counter in play var imgCount = 0; for (var i = 0; i&lt;files.length &amp;&amp; imgCount&lt;5; i++) { var f = files[i]; if (!f.type.match('image.*')) { continue; } imgCount++; And for your other issue, uou need to clear the output area when you start to add images. document.getElementById('list').innerHTML = ""; for (var i = 0; i&lt;files.length &amp;&amp; i&lt;5; i++) { var f = files[i]; function handleFileSelect(evt) { var files = evt.target.files; var listOut = document.getElementById('list'); listOut.innerHTML = ""; for (var i = 0; i &lt; files.length &amp;&amp; i &lt; 5; i++) { var f = files[i]; if (!f.type.match('image.*')) { continue; } var reader = new FileReader(); reader.onload = (function (theFile) { return function (e) { var span = document.createElement('span'); var img = document.createElement('img'); img.className = "thumb"; img.src = e.target.result; img.title = theFile.name; span.appendChild(img); listOut.appendChild(span); }; })(f); reader.readAsDataURL(f); } } document.getElementById('files').addEventListener('change', handleFileSelect, false);
type: Answer
has comment: http://stackoverflow.com/comment/43174095
has comment: http://stackoverflow.com/comment/43174076
has comment: http://stackoverflow.com/comment/43171206

http://stackoverflow.com/comment/43189089
type: QuestionComment
comment on: http://stackoverflow.com/q/27368213
has text: @BaconJuice take a look: [Is there a good Javascript BigDecimal library?](http://stackoverflow.com/questions/744099/is-there-a-good-javascript-bigdecimal-library)
score: 0
type: Comment

http://stackoverflow.com/comment/43199074
comment on: http://stackoverflow.com/q/27374293
score: 0
type: Comment
type: QuestionComment
has text: What is inside `$scope.captchaImage` ? Can you post the contents of this variable ?

http://stackoverflow.com/comment/43339401
score: 0
has text: Try `JSON.parse(data.toString());`. That said, you shouldn't need to do that. It looks like something is wrong with your `decryptQuery` function, so we'll need to see that.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27450382

http://stackoverflow.com/q/27393489
tagged with: jquery
has answer: http://stackoverflow.com/a/27394167
favorite count: 0
has body: I'm trying to use one of bpopup examples in my xhtml page, and I have tried everything I can think of but it's not working. bpopup (jQuery plugin),code example here is my try so far.. HTML: <h:head> Calendar </h:head> <h:body> POP IT UP Content of popup </h:body> js: // Semicolon (;) to ensure closing of earlier scripting // Encapsulation // $ is assigned to jQuery ;(function($) { // DOM Ready $(function() { // Binding a click event // From jQuery v.1.7.0 use .on() instead of .bind() $('#my-button').bind('click', function(e) { // Prevents the default action to be triggered. e.preventDefault(); // Triggering bPopup when click event is fired $('#element_to_pop_up').bPopup({ content:'iframe', //'ajax', 'iframe' or 'image' contentContainer:'.content', loadUrl:'http://dinbror.dk/search' //Uses jQuery.load() }); }); }); })(jQuery); Any help will be appreciated!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43235243
downvote count: 0
has comment: http://stackoverflow.com/comment/43234425
has title: bpopup jQuery is not working
type: Question
score: 3
tagged with: http://stackoverflow.com/tag/xhtml
accepted answer: http://stackoverflow.com/a/27394167
upvote count: 3
has comment: http://stackoverflow.com/comment/43234895
has comment: http://stackoverflow.com/comment/43234798
has comment: http://stackoverflow.com/comment/43234439
answer count: 1
tagged with: bpopup
tagged with: javascript

http://stackoverflow.com/comment/43250721
type: AnswerComment
comment on: http://stackoverflow.com/a/27402856
type: Comment
has text: Looks like a good solution, except that this also does not work in IE11... :-S
score: 1

http://stackoverflow.com/comment/43231088
type: Comment
type: QuestionComment
has text: https://www.dropbox.com/developers just read the API
score: 0
comment on: http://stackoverflow.com/q/27391602

http://stackoverflow.com/comment/43143320
type: Comment
has text: Not entirely sure what you guys mean here. @Lucas your answer does indeed suit me very much. If there is a less ugly way of doing it (while still applying all my needs) I would be happy to hear it! Thanks for the effort
type: AnswerComment
comment on: http://stackoverflow.com/a/27343333
score: 0

http://stackoverflow.com/comment/43346657
score: 0
comment on: http://stackoverflow.com/q/27454291
type: Comment
type: QuestionComment
has text: var list = @Html.Raw(Json.Encode(ViewBag.CourierList)); OUTPUT var list = [{"Disabled":false,"Group":null,"Selected":false,"Text":" Bob-Ann169$ ","Value":null},{"Disabled":false,"Group":null,"Selected":false,"Text":" Brian-Pam4$ ","Value":null},{"Disabled":false,"Group":null,"Selected":false,"Text":" Ken-Greer126$ ","Value":null}];

http://stackoverflow.com/q/27430250
has title: Google App Engine Python -> configure yaml and websockets
type: Question
has answer: http://stackoverflow.com/a/27432437
score: 0
tagged with: yaml
answer count: 1
tagged with: websocket
tagged with: javascript
type: UnansweredQuestion
tagged with: google-app-engine
tagged with: python
has body: I`m beginning programmist with google API working in python. I have pycharm 3.4.1 version. I 'm trying to make a project (backend) of game bomberman. It is like i have to use content of already written game in javascript. I have my project folder and there i have this content: ![link at the bottom][1] I don't understand how exactly i should modify my yaml file to use content of web folder. I need handlers to java script, css and etc. using content of web. If someone could show me example of javascript import then I think I would be able to do analogically the same with others handlers. What's more. I ve been searching information about implementation websockets in python using google API but I just cant find anything useful or I just don't understand the info. I would appreciate if somebody could show me how to implement websockets and add short explanation. Please be easygoing on me because it's my first approach to google API and i don't know much about it. Thanks for help and sorry for mistakes if I did any in the text:) [1]https://i.sstatic.net/aNJCz.png

http://stackoverflow.com/comment/43121460
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27325399
has text: No I'm not using the row editor plugin, I'm supporting an (old) ExtJS 3 editable grid. There is no findPlugin() method in ExtJS 3

http://stackoverflow.com/comment/43173373
comment on: http://stackoverflow.com/q/27324807
score: 0
type: QuestionComment
type: Comment
has text: @SoEzPz I'm using v 1.2.13

http://stackoverflow.com/q/27413199
accepted answer: http://stackoverflow.com/a/27413345
score: 0
answer count: 1
tagged with: jquery
has body: Hi everybody! I use this plugin: PageSlide and this is the code of jquery.pageslide.js: (function($) { var $body = $("body"), $pageslide = $("#pageslide"); var _sliding = false, _lastCaller; if ($pageslide.length == 0) { $pageslide = $("&lt;div /&gt;").attr("id", "pageslide").css("display", "none").appendTo($("body")); } function _load(url, useIframe) { if (url.indexOf("#") === 0) { $(url).clone(true).appendTo($pageslide.empty()).show(); } else { if (useIframe) { var iframe = $("&lt;iframe /&gt;").attr({ src: url, frameborder: 0, hspace: 0 }).css({ width: "100%", height: "100%" }); $pageslide.html(iframe); } else { $pageslide.load(url); } $pageslide.data("localEl", false); } } function _start(direction, speed) { var slideWidth = $pageslide.outerWidth(true), bodyAnimateIn = {}, slideAnimateIn = {}; if ($pageslide.is(":visible") || _sliding) { return; } _sliding = true; switch (direction) { case "left": $pageslide.css({ left: "auto", right: "-" + slideWidth + "px" }); bodyAnimateIn["margin-left"] = "-=" + slideWidth; slideAnimateIn["right"] = "+=" + slideWidth; break; default: $pageslide.css({ left: "-" + slideWidth + "px", right: "auto" }); bodyAnimateIn["margin-left"] = "+=" + slideWidth; slideAnimateIn["left"] = "+=" + slideWidth; break; } $body.animate(bodyAnimateIn, speed); $pageslide.show().animate(slideAnimateIn, speed, function() { _sliding = false; }); } $.fn.pageslide = function(options) { var $elements = this; $elements.click(function(e) { var $self = $(this), settings = $.extend({ href: $self.attr("href") }, options); e.preventDefault(); e.stopPropagation(); if ($pageslide.is(":visible") &amp;&amp; $self[0] == _lastCaller) { $.pageslide.close(); } else { $.pageslide(settings); _lastCaller = $self[0]; } }); }; $.fn.pageslide.defaults = { speed: 200, direction: "right", modal: false, iframe: true, href: null }; $.pageslide = function(options) { var settings = $.extend({}, $.fn.pageslide.defaults, options); if ($pageslide.is(":visible") &amp;&amp; $pageslide.…
tagged with: http://stackoverflow.com/tag/html
tagged with: slide
has title: jQuery PageSlide: .css function on click
has answer: http://stackoverflow.com/a/27413345
type: AnsweredQuestion
type: Question
tagged with: javascript

http://stackoverflow.com/a/39974691
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27383224
downvote count: 0
answers question: http://stackoverflow.com/q/27383224
upvote count: 5
type: Answer
has body: If you look at your background script as socket server (Port object is basically simulating sockets), you could use something called "acknowledgments" that is used in Nodejs, socket.io library. Basically you store your callbacks functions inside object by giving them unique identifier that you pass to the other side. // on the sending side // this variable will store callbacks var acknowledgments = {}; var port = chrome.runtime.connect(); // this variable will be unique callback idetifier var address = Math.random().toString(36); // You create acknowledgment by identifying callback acknowledgments[address] = function (data) { // callback function // do what you like with result data }; port.postMessage({ acknowledgment: address, data: messageData }) port.onMessage.addListener(function (message) { var callback = acknowledgments[message.acknowledgment]; if (callback) { callback(message.data); // don't forget to unset acknowledgment, because it's // supposed to exists only until it's been called. delete acknowledgments[message.acknowledgment]; return; } // other message types handling }); Other side passes result with that unique identifier returned, by which you an identify what to do. // on the listening side chrome.runtime.onConnect.addListener(function (port) { port.onMessage.addListener(function (message) { if (message.acknowledgment) { // do stuff you need to do // then return result port.postMessage({ acknowledgment: message.acknowledgment data: stuffYouHaveDoneResult }); } }); }); chrome.runtime.sendMessage works using "Port" object at lower level so the actual implementation of sendMessage callback should be similar to this in principle.
has comment: http://stackoverflow.com/comment/67229071
score: 5

http://stackoverflow.com/q/27456554
score: 1
tagged with: windows-phone-8
type: Question
tagged with: polymer
has title: Using polymer for apache cordova windows app
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29390364
has comment: http://stackoverflow.com/comment/44861444
tagged with: windows-8.1
favorite count: 0
tagged with: cordova
has body: I was playing around with building an apache cordova app for windows but also using the new polymer that google built. I have no problem running the basic app that is created for windows by cordova in the emulator. I also have no problem running a simple polymer version on my localhost in chrome. However, when I try to run that simple polymer version in the emulator, I run into problems. Here is the first error I run into at this line originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode); in the webcomponents.js file: "Unhandled exception at line 1801, column 15 in ms-appx://com.test.testing/www/bower_components/webcomponentsjs/webcomponents.js 0x800c001c - JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement. For more information, see http://go.microsoft.com/fwlink/?LinkID=247104". Now I googled this and saw that MS had put in that loading in dynamic content was not allowed but that apparently there was a fix which is the below: MSApp.execUnsafeLocalFunction(function () { originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode); }); This results in getting past that first error but instead results in this: "Unhandled exception at line 293, column 7 in ms-appx://com.asquared.packinglist/www/bower_components/webcomponentsjs/webcomponents.js 0x800a138f - JavaScript runtime error: Unable to get property 'impl4cf1e782hg' of undefined or null reference" at this line: function unsafeUnwrap(wrapper) { return wrapper.__impl4cf1e782hg__; } I don't actually have much experience with windows apps, so I'm not really certain about the difference between windows 8.1 apps vs windows 8.1 p…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/44875308
upvote count: 1

http://stackoverflow.com/q/27398561
has answer: http://stackoverflow.com/a/28972062
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27414526
has comment: http://stackoverflow.com/comment/43243028
has comment: http://stackoverflow.com/comment/43244387
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/43242850
has comment: http://stackoverflow.com/comment/43243009
has comment: http://stackoverflow.com/comment/43242985
has comment: http://stackoverflow.com/comment/43243380
has title: Can't select item with jQuery .select2
has comment: http://stackoverflow.com/comment/43243237
favorite count: 0
has body: I'm new to jQuery and Javascript so maybe someone can help me out? I used .select2 to get this result but I'm not able to select and item. Here is the code JAVASCRIPT $("#namesCombobox").select2({ placeholder: "Search for a name", minimumInputLength: 3, ajax: { url: "/api/machineparkcustomers/getnamescontaining", dataType: 'json', quietMillis: 250, data: function (term, page) { return { query: term, }; }, results: function (data, page) { return { results: data }; }, cache: true }, formatResult: function (state) { return state; } }); HTML: &lt;input type="text" id="namesCombobox" class="col-sm-12" /&gt;
accepted answer: http://stackoverflow.com/a/27414526
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43243193
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43243207
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28972062

http://stackoverflow.com/comment/43343187
comment on: http://stackoverflow.com/q/27452279
type: QuestionComment
type: Comment
has text: id is numeric? if true, why you write uppercase?
score: 0

http://stackoverflow.com/q/27330789
score: 2
has comment: http://stackoverflow.com/comment/43120015
tagged with: math
has title: How to remove wireframe diagonals?
type: Question
tagged with: 3d
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43119853
has comment: http://stackoverflow.com/comment/43123546
has comment: http://stackoverflow.com/comment/43119717
has body: I wrote a custom exporter for CAD software to export geometry data to ThreeJS editor. Now, of course in ThreeJS I wrote a correct loader which is loading all the geometry correctly. There is just one problem; In wireframe view in ThreeJS I have triangles from each vertex. With what technique can I remove the triangulation and diagonals ? How can I show wireframe without diagonals ? Source 3D: ThreeJS 3D: (see the triangles and diagonales)
favorite count: 0
has answer: http://stackoverflow.com/a/27341195
upvote count: 2
type: UnansweredQuestion
tagged with: three.js

http://stackoverflow.com/comment/43231452
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27391576
has text: And you win the medal for fixing it!. thanks so much!, i can't belive it was something that simple. Is there anything i can do on this site to give you merit or something?.

http://stackoverflow.com/comment/43249479
type: Comment
comment on: http://stackoverflow.com/q/27402033
type: QuestionComment
has text: for better understanding add related code
score: 0

http://stackoverflow.com/a/27391447
has comment: http://stackoverflow.com/comment/73366794
has comment: http://stackoverflow.com/comment/69069300
score: 22
has body: The purpose of private channels is to restrict who can subscribe to that channel. So, you can either: Use it to ensure only a users friends can subscribe to updates Use it for notifications only for that user In one-to-one chat I'd suggest you choose the latter (No.2). With this in mind I'd set out achieving one-to-one chat as follows: The Forum When users join the chat application they all subscribe to two channels: private-notifications-&lt;user_id&gt; where user_id is their unique user ID e.g. leggetter in my case. This channel is utilised for user-specific notifications. presence-forum for all users in that forum. The question called this presence-global. This is achieved as follows: var notifications = pusher.subscribe( 'private-notifications-user_one' ); var forum = pusher.subscribe( 'presence-forum' ); Upon subscription to each channel the channel authentication process will take place. Within the forum you could have a general public chat on the presence-forum/presence-global presence channel by sending and receiving messages. Starting one-to-one chat When one user (user_one) wants to have a private chat with another user (user_two) you obviously need something in the UI to trigger this. Say user_one clicks on something next to user_two that indicates they want a one-to-one chat. When this happens a request should be made to the server (the authority) to indicate that user_one wants to initiate the private chat with user_two†. Note: † if you chose a channel naming convention for one-to-one chat the private channel authentication could actually be used as the private one-to-one chat initiation When the server receives this request it can generate a unique private channel name for this one-to-one chat. A really simple way of doing this is by concatenating the user IDs e.g. private-chat-&lt;initiating_user&gt;-&lt;receiving_user&gt; (there are other considerations e.g. maybe you want to ensure the channel name is always the same between the two users). In our s…
has comment: http://stackoverflow.com/comment/70388556
upvote count: 22
answers question: http://stackoverflow.com/q/27375125
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/51312307
has comment: http://stackoverflow.com/comment/51326460
has comment: http://stackoverflow.com/comment/51348799
has comment: http://stackoverflow.com/comment/51346748
type: Answer
has comment: http://stackoverflow.com/comment/51405174
has comment: http://stackoverflow.com/comment/43237277
accepted answer of: http://stackoverflow.com/q/27375125
has comment: http://stackoverflow.com/comment/51317290
has comment: http://stackoverflow.com/comment/51344307
has comment: http://stackoverflow.com/comment/97096253

http://stackoverflow.com/comment/43109228
has text: @JonathanM - No, not necessarily. See the example.
score: 0
comment on: http://stackoverflow.com/q/27324709
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27432481
accepted answer of: http://stackoverflow.com/q/27432271
answers question: http://stackoverflow.com/q/27432271
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Let me start of by saying that your declaration of the MainCtrl controller is incorrect app.controller('MainCtrl',['$scope','InvoiceFactory', function ($scope, $http, socket, InvoiceFactory) { Should be app.controller('MainCtrl',['$scope','$http', 'socket', 'InvoiceFactory', function ($scope, $http, socket, InvoiceFactory) { Otherwise the variable $http would store an InvoiceFactory singleton. Anywhere you inject the InvoiceFactory you can alter its invoices like so InvoiceFactory.invoices.push("Hello World"); InvoiceFactory.invoices.push("Goodbye Cruel World"); InvoiceFactory.invoices.splice(0, 1); Or you can alter the scoped variable $scope.invoices = InvoiceFactory.invoices; $scope.invoices.push("Hello World"); $scope.invoices.push("Goodbye Cruel World"); $scope.invoices.splice(0, 1); Keep in mind that you are actually not creating a factory here but a service. Note that angular.factory == angular.service evaluates to true. So you can replace your call to factory with service and it will work exactly the same but be a bit more readable. Here is a simple filddle demonstrating this http://jsfiddle.net/m3grjo9t/
score: 1
upvote count: 1

http://stackoverflow.com/comment/43217947
comment on: http://stackoverflow.com/q/27384477
score: 0
type: QuestionComment
has text: [**same question as last week**](http://stackoverflow.com/questions/27321776/google-maps-tiles-with-no-image-dimensions-and-cache-validator), same comment: **So what's the issue? As long as the ressources(maps-API and images) are not under your control you can't do anything(except of sending a feature-request to google)**
type: Comment

http://stackoverflow.com/q/27411336
tagged with: web
tagged with: jquery
tagged with: file-upload
tagged with: dropzone.js
has answer: http://stackoverflow.com/a/27411445
type: UnansweredQuestion
has title: init file upload with information from session
has body: How can I implement the following scenario: on page A I have a form with a file upload and I select a few files to upload then I click Next which submits the form and I upload the files to the controller and save them in a session and redirect to the page B. on page B I press Back and want to display the files that I uploaded previously with the ability to delete them or add new ones. Can you pls tell if it is possible?
type: Question
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/43096537
type: QuestionComment
has text: post your code and JSON
comment on: http://stackoverflow.com/q/27318475
score: 0
type: Comment

http://stackoverflow.com/comment/43127996
has text: This just broke the request send altogether... :(
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27335181

http://stackoverflow.com/comment/43133154
type: Comment
type: QuestionComment
has text: User location based on IP is not something reliable, and if your application is time-based well work with your server time and transform in the client supposed time stamp format on the client side
score: 0
comment on: http://stackoverflow.com/q/27338161

http://stackoverflow.com/a/27369031
has comment: http://stackoverflow.com/comment/43190023
has body: here is code that works Nej and function confirm_alert(next) { var msg="confirmation for redirecting?"; if(confirm(msg)) { location.href=next; } } here is a stand-alone page that works (i tested it), just save it to test.html and try it out. If this works, you can start building on it. if it does not, you have a separate issue that i cannot help with Nej
type: Answer
answers question: http://stackoverflow.com/q/27368467
has comment: http://stackoverflow.com/comment/43190232
score: 0

http://stackoverflow.com/q/27415272
tagged with: underscore.js
linked to: http://stackoverflow.com/q/8396051
tagged with: ruby-on-rails
type: Question
has comment: http://stackoverflow.com/comment/43274514
tagged with: javascript
has comment: http://stackoverflow.com/comment/43274906
has title: Uncaught ReferenceError: JST is not defined in Backbone using Jade templates
score: 0
has comment: http://stackoverflow.com/comment/43274803
tagged with: pug
answer count: 1
tagged with: backbone.js
type: UnansweredQuestion
has body: I've just set up a skeleton Rails 4 app and have added the backbone-on-rails gem with some basic scaffolding. In the process of trying to get everything set up, I keep running into the following error: Uncaught ReferenceError: JST is not defined (anonymous function) when trying to call the template index.jst.jade from the backbone view. I've added one route with an alert just to make sure the scaffolding was wired together, but I can't get past this error to properly render views. I have included the jade gem, made sure the template path is correct in the js view, and updated the manifest files accordingly. Do I have to define JST somewhere? What am I doing wrong here? Thanks Gem Versions: jade (0.1.1) backbone-on-rails (1.1.1.0) underscore-rails (1.7.0) Rails 4.1.6 Ruby 2.1.0 Router: Task.Routers.Tasks = Backbone.Router.extend({ routes: { '': 'index', }, index: function() { alert('index router hit'); }, }); View: Task.Views.TasksIndex = Backbone.View.extend({ template: JST['tasks/index'] }); Application.js: //= require jquery //= require lodash //= require jquery_ujs //= require backbone //= require jade/runtime //= require task //= require_tree ../templates //= require_tree ./models //= require_tree ./collections //= require_tree ./views //= require_tree ./routers //= require_tree . App structure tree: |____javascripts | |____application.js | |____collections | | |____tasks.js | |____models | | |____task.js | |____routers | | |____tasks_router.js | |____task.js | |____views | | |____tasks | | | |____tasks_index.js |____templates | |____tasks | | |____index.jst.jade
has answer: http://stackoverflow.com/a/27417904

deserialization
type: Tag
tags question: http://stackoverflow.com/q/27419285
tag name: deserialization

http://stackoverflow.com/q/27392200
type: Question
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/16963111
tagged with: inheritance
has body: I'm trying to understand JavaScript's prototypical inheritance. In the following code snippet, I attempt to call a function from within an inheriting object's function with the same name. (Essentially, I'm trying to mimic calling a "super" method). function Base() { } Base.prototype.hello = function() { return "hello"; } function Sub() { Base.call(this); } Sub.prototype.hello = function() { return this.prototype.hello() + " world"; } Sub.prototype = Object.create(Base.prototype); Sub.prototype.constructor = Sub; var sub = new Sub(); alert(sub.hello()); The result is not what I expected... sub.hello() returns "hello", but I expected it to return "hello world". What's going wrong?
accepted answer: http://stackoverflow.com/a/27392312
duplicate of: http://stackoverflow.com/q/16963111
has title: Call Prototype's Method from Inheriting Object's Function
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27392312
tagged with: javascript

http://stackoverflow.com/q/27377881
type: Question
linked to: http://stackoverflow.com/q/12822225
has title: highstock 2.0.4 not working on IE and Firefox
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27379562
answer count: 1
tagged with: highcharts
has body: I have the data as below: {"01.12.10 00:00":-1.5821800231934,"01.12.10 00:05":-1.5570800304413,"01.12.10 00:10":-1.5885699987411,"01.12.10 00:15":-1.6257599592209,"01.12.10 00:20":-1.6307400465012,"01.12.10 00:25":-1.6432000398636,"01.12.10 00:30":-1.655179977417,"01.12.10 00:35":-1.646919965744,"01.12.10 00:40":-1.6347700357437,"01.12.10 00:45":-1.6490000486374,"01.12.10 00:50":-1.6404999494553,"01.12.10 00:55":-1.6160600185394,"01.12.10 01:00":-1.6089400053024,"01.12.10 01:05":-1.6082600355148,"01.12.10 01:10":-1.6159199476242,"01.12.10 01:15":-1.5781999826431,"01.12.10 01:20":-1.6013100147247,"01.12.10 01:25":-1.636440038681,"01.12.10 01:30":-1.6679799556732,"01.12.10 01:35":-1.6709300279617,"01.12.10 01:40":-1.7158499956131,"01.12.10 01:45":-1.7515499591827,"01.12.10 01:50":-1.7836400270462,"01.12.10 01:55":-1.7883299589157,"01.12.10 02:00":-1.8029299974442,"01.12.10 02:05":-1.8306200504303,"01.12.10 02:10":-1.8690099716187,"01.12.10 02:15":-1.8802800178528,"01.12.10 02:20":-1.890319943428,"01.12.10 02:25":-1.9045300483704,"01.12.10 02:30":-1.9173899888992,"01.12.10 02:35":-1.9262299537659,"01.12.10 02:40":-1.9494600296021,"01.12.10 02:45":-1.9754300117493,"01.12.10 02:50":-2.0177900791168,"01.12.10 02:55":-2.1353900432587,"01.12.10 03:00":-2.2930901050568,"01.12.10 03:05":-2.4463000297546,"01.12.10 03:10":-2.4375700950623,"01.12.10 03:15":-2.4210600852966,"01.12.10 03:20":-2.4662098884583} And my script to initialize the graph is as follows: getGraphData: function(params){ var self = this; $.ajax({ url: '_someUrl' + params, type: 'GET', success:function(result){ self.renderBarChart(self.formatData(result)); }, error: function(req, status, error){ console.log(error); } }); }, formatData: function(rawData){ var self = this; var result = $.parseJSON(rawData); var formattedData = _.map(result, function(value, date){ var formattedDate =self.formatDate(date); return [formattedDate, value];; }); return formattedData; }, formatDate: function(rawDate){ var dateTimeArray…
has answer: http://stackoverflow.com/a/27379562
tagged with: cross-browser
type: AnsweredQuestion

http://stackoverflow.com/comment/43151944
comment on: http://stackoverflow.com/q/27340341
has text: @AndrewMcCombs Your PHP page that receive the ajax request isn't able to call the function that create a token?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27391632
has comment: http://stackoverflow.com/comment/43231158
has comment: http://stackoverflow.com/comment/43231077
has comment: http://stackoverflow.com/comment/43230913
has comment: http://stackoverflow.com/comment/43231045
has body: Use findall(), which is similar to String.prototype.match(). import re regex = r"[a-z]+" matches = re.findall(regex, strToScan)
has comment: http://stackoverflow.com/comment/43231129
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43231017
upvote count: 6
answers question: http://stackoverflow.com/q/27391607
has comment: http://stackoverflow.com/comment/43231171
score: 6
accepted answer of: http://stackoverflow.com/q/27391607

http://stackoverflow.com/a/27430384
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Not anymore. The white option that provided this check was removed; consider using JSCS for more style-focused validation. Specifically, I believe you want requireSpaceBeforeBinaryOperators and its counterpart requireSpaceAfterBinaryOperators.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27429800
answers question: http://stackoverflow.com/q/27429800
has comment: http://stackoverflow.com/comment/43321996

http://stackoverflow.com/q/27373026
has comment: http://stackoverflow.com/comment/43197089
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43197230
has answer: http://stackoverflow.com/a/27373171
has answer: http://stackoverflow.com/a/27373083
has comment: http://stackoverflow.com/comment/43196856
type: Question
answer count: 2
has body: My JSON text is [{ "album_name" : "marriage", "album_image" : "images/abc.jpg" }, { "album_name" : "holiday", "album_image" : "images/holi.jpg" } ] In that i need to get index value of each object. I fetched above values using for loop and appended dynamically. My requirement is when i click on each item i need to pass that index value of that object in onclick function.
tagged with: javascript
tagged with: jquery
score: 0
has title: how get JSON response of object index value using javascript

http://stackoverflow.com/q/27455922
favorite count: 0
upvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/27479824
has body: Hey guys am new to javascript actually..i am trying to find the download time of a file.So i have dind the size of the file and divided it with the current time ..but its not giving me the correct result. The code i have tried function get_filesize(url, callback) { var xhr = new XMLHttpRequest(); xhr.open("HEAD", url, true); // Notice "HEAD" instead of "GET", // to get only the header xhr.onreadystatechange = function() { if (this.readyState == this.DONE) { callback(parseInt(xhr.getResponseHeader("Content-Length"))); } }; xhr.send(); } get_filesize("http://upload.wikimedia.org/wikipedia/commons/9/96/Google_web_search.png", function(size) { var estimatedtime = (new Date().getTime())/size; console.log(estimatedtime); }); when i done do this i get output as 32245538.389347337. What am expecting is to get the time in hh:mm:ss in the console. How can i acheive this ??..Any help would be great Thanks
linked to: http://stackoverflow.com/q/2779600
has answer: http://stackoverflow.com/a/27456098
type: Question
has comment: http://stackoverflow.com/comment/43349741
tagged with: javascript
has title: Calculating download time with javascript
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27456098
answer count: 1
downvote count: 0
score: 1

http://stackoverflow.com/comment/43150956
type: QuestionComment
has text: so try rename your _app.js_ with client code and add empty _app.js_
score: 0
comment on: http://stackoverflow.com/q/27347978
type: Comment

http://stackoverflow.com/q/27327001
tagged with: jquery
has comment: http://stackoverflow.com/comment/43112966
tagged with: angularjs
type: Question
tagged with: pass-by-reference
has answer: http://stackoverflow.com/a/27327920
has comment: http://stackoverflow.com/comment/43113011
score: 0
accepted answer: http://stackoverflow.com/a/27327920
answer count: 1
has comment: http://stackoverflow.com/comment/43113005
has body: My Data Object: var data = { foo: { bar: 42 }, baz: true, x: 1, y: 2 }; Now I'd like like to send this object as JSON String. But before sending, I'd like to modify my object and still keeping the original one. var json = data; json.foo = json.foo.bar; json.id = json.baz; delete json.baz; Of course this will modify my data object, too. Is it possible to create a second object with the same structure as the first one, which allows to rename / delete some properties without changing the first object? I know I could do this: var json = { foo: data.foo.bar, id: data.baz, x: data.x, y: data.y }; But imagine the data object contains 50 properties and I only want to change two of them. And I don't want to use jQuery.copy or angular.copy because of performance reasons (they create real copies - that shouldn't be necessary). Maybe there's something like this ? var json = { foo: data.foo.bar, id: data.baz }; json = merge(json, data); delete json.baz; Thank you! :)
tagged with: javascript
has comment: http://stackoverflow.com/comment/43113016
has comment: http://stackoverflow.com/comment/43113034
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43113060
has title: Clone object's properties by reference

http://stackoverflow.com/q/27392963
type: AnsweredQuestion
downvote count: 0
tagged with: coffeescript
has answer: http://stackoverflow.com/a/27413056
type: Question
has body: I'm trying to get the selected value of a typeahead input and I get this error every time: Uncaught TypeError: Cannot assign to read only property 'highlight' of. It never tells me what object it's referring to and it originates from within the TypeAhead.min.js file, so I can't say exactly what line of my code is causing it. Here's the code I use to set up and capture the value of the input: $(".articles.new").ready -&gt; engine = new Bloodhound { datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), queryTokenizer: Bloodhound.tokenizers.whitespace, local: autocomplete_items } engine.initialize() $('#auto_complete').typeahead { hint: true, highlight: true, minLength: 1 }, { name: "names", displayKey: "name", source: engine.ttAdapter()} $('#auto_complete').on 'typeahead:selected', (event, selection) -&gt; alert selection.name $('#auto_complete').typeahead 'setQuery', '' event.stopPropagation() return return For context: auto_complete items is an array of objects from my controller with name property. I'm working in Ruby on Rails 4.1.4. What can I do to fix this error? What is causing it?
tagged with: javascript
tagged with: jquery
upvote count: 2
tagged with: typeahead.js
tagged with: typeahead
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27413056
has title: TypeAhead.js Highlight TypeError
score: 2

http://stackoverflow.com/q/27420227
tagged with: jquery
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: This is my code, it works for the desktop view, but on mobile the nav is there for a second then disappears. Any ideas? I've made a nave that you can scroll left to right with your finger on touch screens, but it's not very obvious that that is how it works so I wanted to animate it in from the side of the screen when the page loads. This is as far as I have got. (I am very new to javascript) All theatre dance music exhibitions talks student events .whatson_nav { background-color: #6e6e6e; display: block; overflow-x: scroll; white-space: nowrap; -webkit-overflow-scrolling: touch; } .categories { overflow-y: hidden; display: inline-block; padding: 40px 0px 0 20px; height: 60px; width: 100%; text-align: center; } $(function(){ $(".whatson_nav .categories").hide(0).delay(0).toggle('slide', { direction: 'left' }, 1000); }); I'm a junior front end and very new to jQuery, the jQuery I have chosen may well be completely wrong so please offer any help or guidance you may have!
has title: Have made an IOS style swipe mobile nav, trying to slide it in from the side but it disappears
score: 1
type: Question
tagged with: mobile
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43376018
type: AnswerComment
has text: Thanks Invexity, but would it actually be possible to "simply put a copy of their exe or .jar into your startup folder." with Windows 7 and newer? I do remember seeing this type of thing on a friends computer in 2001 (result of porn surfing activity) but would it still be possible in today's systems without somehow asking the user to accept the download?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27466709

http://stackoverflow.com/q/27462148
tagged with: ruby-on-rails
accepted answer: http://stackoverflow.com/a/27462217
has title: JavaScript If/Else Statement Based On Current Controller
tagged with: model-view-controller
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43360595
score: 1
type: Question
answer count: 2
has body: In my rails app I would like to perform a certain block of JS when in my 'events' controller, and another block while in my 'movie_interests' controller. I am aware that this condition can be checked using 'params[:controller] == ...', but this is ruby code. How can I accomplish this from a javascript file? $(".search-results").on('click', ".movie-click", function(){ if (params[:controller] == "events") { //This is incorrect syntax, but shows more or less what I want to accomplish $('#event_rt_id').val($(this).data("id")); $('#movie-poster').html('&lt;img id="selected-poster" src="' + $(this).data("poster") + '" /&gt;' ); } });
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27462219
has answer: http://stackoverflow.com/a/27462219
has answer: http://stackoverflow.com/a/27462217
favorite count: 0
tagged with: ruby
upvote count: 1

http://stackoverflow.com/a/27464778
upvote count: 2
score: 2
downvote count: 0
has body: Took me a while and I hate answering my own questions. But who knows somebody else might have the same problem... My script include had async this little guy was the cause of all evil!! Wrong Correct
type: Answer
answers question: http://stackoverflow.com/q/27444864

http://stackoverflow.com/comment/43244342
comment on: http://stackoverflow.com/a/27399499
type: AnswerComment
type: Comment
has text: A bit of clarification for the filesystem tip: do not bundle resources, but offer to download them after the app is installed.
score: 1

http://stackoverflow.com/a/31768278
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/27378103
type: Answer
has body: onresize doesn't fire with attachEvent or addEventListener. you must attach your callback directly to window.onresize. syntax window.onresize = funcRef; example window.onresize = resize; function resize() { alert("resize event detected!"); }
upvote count: 4
answers question: http://stackoverflow.com/q/27378103
type: AcceptedAnswer

http://stackoverflow.com/q/27360449
downvote count: 0
score: 1
type: Question
has title: AngularJS : How to test a promise resolved in a callback function
upvote count: 1
tagged with: javascript
answer count: 1
tagged with: jasmine
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: angular-promise
has body: I have written a function which opens an indexedDB. I'm using a promise, because I think it is the cleanest way to handle this. this.$get = function($q, $rootScope, $window) { return { finalize: function() { var deferred = $q.defer(); var dbRequest = $window.indexedDB.open(dbName, dbVersion); dbRequest.onupgradeneeded = function(event) { // XXX do something here. }; dbRequest.onsuccess = function(event) { db = event.target.result; console.log('Success!'); deferred.resolve(event); }; dbRequest.onerror = deferred.reject; return deferred.promise; } }; }; In order to test this, I have created the following test function: describe('finalize', function() { it('should initialize the database', function(done) { var promise = resource.finalize(); promise.then(function() { console.log('resolved'); var transaction = resource.db.transaction(['Component']); expect(transaction).toBeDefined(); done(); }); $rootScope.$apply(); }); }); This prints 'Success!' in the console, but the promise is never resolved. If I move $rootScope.$apply() to the end of the onsuccess function, the promise is resolved, but only for one test. Other tests then throw an error Error: [$rootScope:inprog] $digest already in progress. How should I resolve this promise? Is a callback function better?
has answer: http://stackoverflow.com/a/27361459

http://stackoverflow.com/q/27386410
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27389504
accepted answer: http://stackoverflow.com/a/27389504
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: audio
tagged with: stream
type: Question
has body: Is there a library or technique out there that will let me embed a streamed audio source in a webpage? I've seen other SO answers recommending audio.js for similar requests, but it looks like that will only let you pick a single audio file. While I guess I could put a bunch of effort into making a file-like audio stream, I feel like there has to be a better way to go about this.
has title: Streaming audio via html5/js (a la radio)?

http://stackoverflow.com/comment/43304844
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27431572
has text: The error message in your console should be accompanied by a stack trace(often times hidden behind a down arrow, or sitting on the right side of the console). Can you include that in your question?
score: 0

http://stackoverflow.com/comment/43158421
comment on: http://stackoverflow.com/a/27351928
has text: Yeah, makes sense since handleFileSelect is not expecting jquery objects. You should stick with: document.querySelector. However I just realized that document.querySelector only returns 1 item. You need to use document.querySelectorAll() to return all items that match your selector.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27339929
answer count: 1
downvote count: 0
favorite count: 0
tagged with: node.js
type: AnsweredQuestion
score: 1
tagged with: coffeescript
upvote count: 1
has answer: http://stackoverflow.com/a/27339943
type: Question
accepted answer: http://stackoverflow.com/a/27339943
has title: Coffeescript require module with arguments, browserify
tagged with: javascript
has body: Without checking my previous code in javascript I can require modules in a nodejs application like so: app = require('./foo')('argstring') I haven't yet, check any of my code bases, but I certainly remember I can pass arguments right after the require. But I am doing client side application right now and decided to use browserify to have the advantage of using require in an client-side js application. (I am using coffeescript this time) I have a class like so: class Foo constructor: (@argstring) -&gt; bar: () -&gt; console.log @argstring module.exports = Foo Now I have to use it in my primary coffee file: fap = require('./foo')('some string') console.log fap // returns undefined Whilst if I do: Foo = require('./foo') fap = new Foo 'some string' console.log fap // returns the object correctly While I can, obviously choose to use the instantiation, I prefer not, because it is 1 code more.
tagged with: browserify

http://stackoverflow.com/comment/43510741
score: 0
comment on: http://stackoverflow.com/a/27520989
type: Comment
has text: you welcome! in the future maybe I will find a way in javascript only!
type: AnswerComment

http://stackoverflow.com/q/27433215
has title: Give Document proper URL or location
has answer: http://stackoverflow.com/a/27433314
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43307622
has comment: http://stackoverflow.com/comment/43307670
has comment: http://stackoverflow.com/comment/43308257
score: 0
has comment: http://stackoverflow.com/comment/43307894
answer count: 1
has comment: http://stackoverflow.com/comment/43307877
has comment: http://stackoverflow.com/comment/43307950
tagged with: domdocument
has comment: http://stackoverflow.com/comment/43307896
has comment: http://stackoverflow.com/comment/43307764
has comment: http://stackoverflow.com/comment/43308178
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43309347
has comment: http://stackoverflow.com/comment/43308028
has comment: http://stackoverflow.com/comment/43308302
has body: I download HTML code using Ajax and then parse it: var req = new XMLHttpRequest(); //Request for the current URL (such as http://example.org or http://stackoverflow.com/questions/27433215/give-document-proper-url-or-location) req.open("GET", window.location.href); req.onload = function() { //Returns Document object with `about:blank` in URL var doc = document.implementation.createHTMLDocument(); //Put the code from request to the Document (all relative URL's are now lost) doc.documentElement.innerHTML = this.responseText; window.loadedDoc = doc; } req.send(); The problem is that the document's URL is about:blank. This causes any relative URL lead to wrong path. Most importantly, picking href from &lt;a&gt; gives you /path/ instead of http://example.com/path/. Can I, at certain point, set the proper Document.URL? The url should be the same as current window.location - so there's no security risk! If browser implementations didn't ever thing about this case, is it at least possible to replace link URL's properly?

http://stackoverflow.com/comment/43149290
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27347132
has text: @Johan Quotes are optional if attribute value does not contain spaces, or `"`, `'`, `=`, `>`, `<`, or `\``, characters. http://www.w3.org/TR/html-markup/syntax.html#syntax-attr-unquoted

http://stackoverflow.com/q/27444921
has body: I want to know how to insert a specific character when pressing, for example, ctrl + alt + 1. The characters i want to insert is an upsidedown exclamation mark and an upsidedown question mark.
score: -2
possible better answer: http://stackoverflow.com/a/27445081
has comment: http://stackoverflow.com/comment/43329094
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Print specific character when pressing specific keys
has answer: http://stackoverflow.com/a/27445081
type: AnsweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27445369
accepted answer: http://stackoverflow.com/a/27445369
type: Question

http://stackoverflow.com/q/27362905
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/27362988
has comment: http://stackoverflow.com/comment/43177836
type: AnsweredQuestion
downvote count: 1
has body: This is a little strange. I've got this segmenty of ASP in my code: &lt;td style="line-height: 230%;"&gt; &lt;asp:TextBox ID="txtePro" runat="server" CssClass="textbox" Font-Size="Small" Height="18px" Width="100px" Visible="False" Wrap="False" OnTextChanged="txtEPro_OnLeave" OnFocus="txtEPro_OnFocus()" AutoPostBack="true"&gt;&lt;/asp:TextBox&gt; &lt;asp:MaskedEditExtender ID="MeeePro" runat="server" Mask="9999999" MaskType="None" TargetControlID="txtePro" PromptCharacter="_" /&gt; &lt;asp:MaskedEditExtender ID="MeePRD" runat="server" Mask="999999" MaskType="None" TargetControlID="txtePro" PromptCharacter="_" /&gt; I also have the following function in the same ASP file: &lt;script type = "text/javascript"&gt; function txtEPro_OnFocus() { var elem = document.getElementById('txtePro'); elem.value = ""; alert("Hello there"); } &lt;/script&gt; If I comment out the first 2 lines of the Javascript function, I get prompted with a box that says, "Hello there". So, I know the function is firing in the OnFocus event. However, when I put those first 2 lines back into the function, it says it can't find "txtePro". It errors on the elem.value = ""; line and says, Unhandled exception at line 176, column 13 in Default.aspx 0x800a138f - Microsoft JScript runtime error: Unable to set value of the property 'value': object is null or undefined If I hover my mouse over "elem", it shows the value as "NULL". Any ideas?
type: Question
tagged with: c#
has title: Javascript function to change the value of an ASP Textbox?
has answer: http://stackoverflow.com/a/27362988
linked to: http://stackoverflow.com/q/2177337
score: -1
duplicate of: http://stackoverflow.com/q/2177337
upvote count: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27357489
tagged with: kendo-ui
has body: I'm trying to insert more than one value into dataTextField attribute after selected item (template works fine but is affecting only what is displayed to the user in dropdown menu). I tried solve id using parse functionl: schema: { parse: function(response) { $.each(response, function(idx, elem) { elem.fullName = elem.name + " " + elem.surname; }); return response; } }, But this is not working. Is it standalone autocomplete in form not in datagrid. How can i solve it please? Thanks for any help. Here is the code of the whole method: $scope.$watch("workerDetail.newSuperiorName", function () { console.log($scope.workerDetail.superior); $scope.customOptionsSuperior = { dataSource: { type: "json", serverFiltering: true, transport: { read: function (options) { console.log("List"); console.log(options.data); console.log(options.data.filter.filters[0].value); requestParams = { "entityName": "worker", "data": { "page": 1, "pageSize": 20, "filter": { "logic": "or", "filters": [ { "value": $scope.workerDetail.newSuperiorName, "operator": "contains", "field": "name", "ignoreCase": true }, { "value": $scope.workerDetail.newSuperiorName, "operator": "contains", "field": "surname", "ignoreCase": true } ] }, "sort": [ { "field": "name", "dir": "asc" } ] } }; ApiService.doHttpRequest( "POST", $rootScope.apiBaseUrl + "worker/search", requestParams ) .success(function (data, status, headers, config) { // successful data retrieval console.log("request success, checking state"); console.log(data); // sent status to global HTTP status service var jsonResponse = ApiService.processReturnedHttpState(status); console.log("Status response is " + jsonResponse.result); // do something with data switch (jsonResponse.result) { case true: if (data.results == null) { growlNotifications.add($translate.instant('NO_ITEM_FOUND'), 'error', $rootScope.notificationLifetime); options.success([]); } else { options.success(data.results); } break; case false: growlNotifications.add($translate.instant('LIST_L…
score: 0
type: UnansweredQuestion
has title: Kendo autocomplete, how to insert more than one value into dataTextField
type: Question
tagged with: autocomplete
has answer: http://stackoverflow.com/a/27360415
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43338552
comment on: http://stackoverflow.com/q/27449886
score: 0
type: Comment
type: QuestionComment
has text: Wouldn't it be easier to fix the date formatting code that generated this text?

http://stackoverflow.com/a/27331903
answers question: http://stackoverflow.com/q/27331555
type: Answer
has body: As already pointed out, the two event listeners are interfering with each other. One way of fixing this is to remove the listener on labelLink when the hidden box is shown, and restore the listener with a slight pause after the hidden box is hidden again. JSFiddle var labelLink = document.getElementById('labelLink'), hiddenBox = document.getElementById('hiddenBox'); labelLink.addEventListener('click', showBox); hiddenBox.addEventListener('blur', hideBox); function showBox(){ hiddenBox.style.display = 'block'; hiddenBox.focus(); labelLink.removeEventListener('click', showBox); } function hideBox() { hiddenBox.style.display = 'none'; labelLink.focus(); window.setTimeout(function() { labelLink.addEventListener('click', showBox); }, 500); } Click Me I was hidden
upvote count: 2
score: 1
downvote count: 1

http://stackoverflow.com/comment/43239999
type: Comment
comment on: http://stackoverflow.com/a/27315890
has text: I was mistaken about Java (see question update). So it turns out that running through the loop 6 trillion times, with each iteration taking, say, 10 processor cycles, would take ~15000 seconds, which is slightly more than 4 hours, on 4GHz processor. Taking into account that I ran the code on slower processors, everything looks clear now. Thank you.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27435696
has answer: http://stackoverflow.com/a/28442983
linked to: http://stackoverflow.com/q/12150624
accepted answer: http://stackoverflow.com/a/28442983
score: 0
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27461798
tagged with: ember.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27461798
type: Question
has title: EmberJS: Multiple templates, one page
has body: I have a website that is largely rendered by Ruby on Rails, with several sections the page using Ember. Up until now, we have been using separate ember apps to manage each section, but that's starting to create too much multi-app overhead. Is there a way to attach the Ember app to the body (as the rootElement) and have each section build as independent components or views, without having to wrap the body in a script tag? The current modules we have: * Shopping cart summary * Account details &amp; menu in the header * And a few others There's now a requirement to duplicate the account details section in another part of the page. The only way to do this today would be to attach the account app to an element that wraps both sections...but then this would also wrap the cart summary area and cause that app to fail. Ideally I'd like to be able to combine all these apps and just tell Ember where to put the views on the page. Is this possible?

http://stackoverflow.com/q/27410367
has comment: http://stackoverflow.com/comment/43265116
tagged with: asp.net-mvc
tagged with: partialviews
score: 1
has comment: http://stackoverflow.com/comment/43266803
has answer: http://stackoverflow.com/a/27410780
has answer: http://stackoverflow.com/a/27411357
has comment: http://stackoverflow.com/comment/43267413
has comment: http://stackoverflow.com/comment/43266747
has title: MVC Partial View Javascript
has comment: http://stackoverflow.com/comment/43269299
answer count: 2
possible better answer: http://stackoverflow.com/a/27411357
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43268371
tagged with: partial-views
has comment: http://stackoverflow.com/comment/43335587
has comment: http://stackoverflow.com/comment/43268830
accepted answer: http://stackoverflow.com/a/27410780
has comment: http://stackoverflow.com/comment/43279915
has body: I have a partial view created for re-use purposes. This partial view has a dropdownlist which uses Chosen plugin. Therefore, on the partial view I reference the chosen js/css file along with some javascript code to for document ready. It works as intended. However, now I have a page which I render the partial view upon a button click event. Users can click as many times as they want. My concern is that duplicate js will load each time they click the button. This, perhaps, is the reason why people don't recommend adding js to Partial View directly. In my case, it needs to be there for the plug-in and manipulation within the Partial View itself. Is there a good way to check for loaded js and prevent it from loading it again in subsequent click event?
tagged with: asp.net-mvc-partialview
upvote count: 1
has comment: http://stackoverflow.com/comment/43267943
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/43264085
type: QuestionComment
has text: `ROUND( SUM(purchase_value) )` ?
comment on: http://stackoverflow.com/q/27409882
score: 0
type: Comment

http://stackoverflow.com/comment/43300805
score: 0
type: Comment
has text: Number of Rows and Columns is not fixed... That number is input values from fields...
type: AnswerComment
comment on: http://stackoverflow.com/a/27429086

http://stackoverflow.com/q/27435021
has body: I am trying to create a Date object in JavaScript, passing a string like this: 2014-11-30T00:00:00.0000000 However, the value of the Date object is: Sat Nov 29 2014 17:00:00 GMT-0700 (Mountain Standard Time) It changed it to 11/29 when I want 11/30. Is there any way I can make the date 2014-11-30, regardless of what time zone the browser is in? Note: One possible workaround is to use the Date(year, month, day) constructor; however, I am constructing the data in a JSON string, which doesn't appear to support this. EDIT: Actually, I just did a test and created a date using Date(2015, 1, 1) and it gives me: Mon Feb 02 2015 00:00:00 GMT-0700 (Mountain Standard Time) So I can't even create a date that way and have it be the date I want. I don't understand why this is so difficult.
has comment: http://stackoverflow.com/comment/43311169
type: Question
has title: JavaScript Changes My Date Based on Browser Time Zone
has comment: http://stackoverflow.com/comment/43311084
has comment: http://stackoverflow.com/comment/43311252
tagged with: date
has comment: http://stackoverflow.com/comment/43311013
answer count: 1
has comment: http://stackoverflow.com/comment/43311216
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43311066
score: 0
has answer: http://stackoverflow.com/a/27435072
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27435072
tagged with: timezone
has comment: http://stackoverflow.com/comment/43311134
has comment: http://stackoverflow.com/comment/43311283

http://stackoverflow.com/comment/43268069
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27411785
has text: I agree. Browser support is so bad for styling select boxes that if you really need a styled box you should use a third party script that creates a select box out of styleable divs and whatnot.

http://stackoverflow.com/a/27438736
type: Answer
has body: http://api.jqueryui.com/datepicker/#method-setDate implies this should work: $('#datetimepicker2').datepicker('setDate', booking_from.getDate()).datepicker('setDate','+'+days); After comment "doesn't work": Uh, yeah .. the "+/-days" approach is relative to TODAY anyway ;-P This is what works for me: $( "#datepicker" ).datepicker({dateFormat: "@"}); var day_2014dec01 = new Date(2014,11,1,12,34,56); $('#datepicker').datepicker('setDate', ""+day_2014dec01.getTime() ); The "dateFormat @" is for unix time - see http://api.jqueryui.com/datepicker/#utility-formatDate .. keeps the example simple. You can switch to that for the calculation and then back again to whatever format you like for human or database readability, if required.
answers question: http://stackoverflow.com/q/27371446
has comment: http://stackoverflow.com/comment/43317470
score: 0

http://stackoverflow.com/comment/43248478
comment on: http://stackoverflow.com/a/27391741
has text: Thank you. I need to set it to "direct" and not "preview" link
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43291018
comment on: http://stackoverflow.com/q/27423950
type: Comment
has text: @NimChimpsky I think you are talking about ADM not RDM. I mean http://www.martinfowler.com/bliki/AnemicDomainModel.html
score: 0
type: QuestionComment

http://stackoverflow.com/q/27315788
possible better answer: http://stackoverflow.com/a/27315832
has title: Validate text input to match Canadian postal code (e.g. "A1S2S3")
has answer: http://stackoverflow.com/a/27315832
downvote count: 3
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27316446
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -3
favorite count: 0
has body: here error is can't enter any character : $(document).ready(function() { $('#t').keypress(function(e){ var txt = String.fromCharCode(e.which); console.log(txt + ' : ' + e.which); if(!txt.match(/^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$/)){ return false; } }) });
has answer: http://stackoverflow.com/a/27316446
tagged with: regex
type: AnsweredQuestion

http://stackoverflow.com/comment/43350769
type: AnswerComment
comment on: http://stackoverflow.com/a/27455350
type: Comment
has text: Thanks, this seems the best solution. And thanks for the links. :-)
score: 0

http://stackoverflow.com/a/27430832
downvote count: 0
answers question: http://stackoverflow.com/q/27425544
type: Answer
score: 2
upvote count: 2
has body: A quick answer would be to use something like Template.analysisChart.rendered = function(){ Tracker.autorun(function(){ var data = Questions_Users.find(); drawChart(); }) } Or look into observeChanges, something like: Template.analysisChart.rendered = function(){ Questions_Users.find().observeChanges({ added:function(id, fields){ //update Chart.datasets Chart.update() } }) }

http://stackoverflow.com/comment/43376543
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27470667
has text: try return this in the module

http://stackoverflow.com/a/27428047
has comment: http://stackoverflow.com/comment/43298772
score: 1
has comment: http://stackoverflow.com/comment/43299580
has comment: http://stackoverflow.com/comment/43298636
has comment: http://stackoverflow.com/comment/43300769
has comment: http://stackoverflow.com/comment/43298090
has body: You're getting the default Object.toString() because array (and array is an Object) doesn't override toString(). You could use Arrays.toString(Object[]) like value="&lt;%=java.util.Arrays.toString(fibSequence)%&gt;" Or add the import for java.util.Arrays to your JSP.
downvote count: 0
has comment: http://stackoverflow.com/comment/43300665
has comment: http://stackoverflow.com/comment/43298544
answers question: http://stackoverflow.com/q/27427981
type: Answer
has comment: http://stackoverflow.com/comment/43299601
has comment: http://stackoverflow.com/comment/43298860
has comment: http://stackoverflow.com/comment/43298057
has comment: http://stackoverflow.com/comment/43300842
upvote count: 1

http://stackoverflow.com/q/27384744
score: 0
has answer: http://stackoverflow.com/a/27398506
answer count: 1
accepted answer: http://stackoverflow.com/a/27398506
has title: Mulitple data points at single point of time highcharts
type: AnsweredQuestion
type: Question
tagged with: highcharts
has body: The scenario is represented in the fiddle below. I am using a column chart to represent the data. When there is multiple data only the highest is being displayed in the graph. I am expecting it to stack. http://jsfiddle.net/7pccz1j4/ $(function () { $('#container').highcharts({ chart: { type: 'column' }, xAxis: { type: 'datetime', }, yAxis: { min: 0, minTickInterval: 1 }, series: [{ name: 'series1', data: [ [1418075700000, 2], [1418076000000, 2], [1418076300000, 2], [1418076600000, 2], [1418076900000, 2], [1418077200000, 2], [1418077500000, 2], [1418077800000, 2], [1418078100000, 2], [1418078100000, 3], [1418078400000, 2], [1418078700000, 2], [1418079000000, 2] ] }] }); }); The same scenario with a line chart is this fiddle. http://jsfiddle.net/RKVgx/253/
tagged with: javascript

http://stackoverflow.com/q/27408047
has answer: http://stackoverflow.com/a/27408206
possible better answer: http://stackoverflow.com/a/27408192
has body: I have a html table inside a html table. I want to apply different css style (padding and margin) for the particular td which contains the child table alone. I want padding: 5px; for all td's except the one which contains child table. I cant explicitly give the styling to td's as the table is generated dynamically. Sometimes the parent table will have child table and sometimes not. I have tried the same with jQuery but not able to resolve the issue. The parent table is generated as a part of GridView (asp.net) and am using EmptyDataTemplate to create a child table look alike the same GridView for inserting values if no data exists. Please help me to get rid of this problem.
has answer: http://stackoverflow.com/a/27408249
tagged with: javascript
tagged with: jquery
tagged with: asp.net
favorite count: 0
answer count: 5
has comment: http://stackoverflow.com/comment/43260802
has comment: http://stackoverflow.com/comment/43260617
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27408188
downvote count: 2
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43261393
score: -1
has answer: http://stackoverflow.com/a/27408192
has title: Different CSS for td which contains another table
accepted answer: http://stackoverflow.com/a/27408188
has answer: http://stackoverflow.com/a/27408232

http://stackoverflow.com/comment/43207932
has text: Have you changed it within the function too - `$('input.ParticipantNumber').val();` ?
comment on: http://stackoverflow.com/a/27379272
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43253731
comment on: http://stackoverflow.com/a/27404481
type: Comment
has text: header elements may contain some other DOM elements.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43094057
has text: Result and what you want are same ?
score: 0
comment on: http://stackoverflow.com/q/27317193
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27447098
has comment: http://stackoverflow.com/comment/43333550
has comment: http://stackoverflow.com/comment/43339794
has comment: http://stackoverflow.com/comment/43339647
has body: If you want an up-to-date tally of all completed tasks, you can add a then to the point where you save the task: $scope.listWithTotal.$save(task).then(function() { $scope.tallyCount = $scope.listWithTotal.getTotal(); }); The then block executes after the task has saved and adds the tally of completed tasks to the current scope.
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/27363130
score: 6
has comment: http://stackoverflow.com/comment/43335898
has comment: http://stackoverflow.com/comment/43339339
downvote count: 0

http://stackoverflow.com/comment/43238642
type: Comment
comment on: http://stackoverflow.com/q/27396158
type: QuestionComment
has text: Are you trying to show a install app Link where you want to do this? Then Sorry but HTML page wont have access to the system files and binaries. This is done by the Play Store or the App Store
score: 0

http://stackoverflow.com/comment/43307551
type: Comment
score: 1
has text: Well, the String `replace()` method technically does accept patterns formatted as strings. However, such patterns are not treated as regular expressions, and only the first matching instance is replaced. My advice: always use regular expression literals for the `replace()` method in JS.
type: AnswerComment
comment on: http://stackoverflow.com/a/27433095

http://stackoverflow.com/comment/43176134
has text: Do you want the class's to change for that one user or for all users of the page?
comment on: http://stackoverflow.com/q/27361635
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27357894
linked to: http://stackoverflow.com/q/10193085
has title: How to create JSONP(script) to make Netsuite Request to other server for response?
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/10193085
answer count: 0
has comment: http://stackoverflow.com/comment/43168238
type: Question
tagged with: jsonp
has comment: http://stackoverflow.com/comment/43168389
has comment: http://stackoverflow.com/comment/43168515
tagged with: javascript
has body: I just created an portlet in net suite interface. In that portlet currently i'm showing details of the logged in user. Now i need to make an ajax call to my server. Where i can check that the current user is logged in my domain also or not. If not i need to make him log in. Its kind of auto log in when he logs in into net suite interface. Possible choices. Ajax call(But it will only work in server inside pages, except jsonp) request. iFrame to do it (Note: Its a bad idea anyway i think). Need help on it. Thanks in advance Vivek Keviv
score: 0
has comment: http://stackoverflow.com/comment/43168207
tagged with: netsuite
has comment: http://stackoverflow.com/comment/43168564

http://stackoverflow.com/a/27398738
has body: The problem I was having here was that I was creating a raw piece of HTML without attaching it to a Backbone model. It needed to be attached to a JS model and assigned all the relevant listeners manually. This is also why moving elements from one list to another did not create the same issue, as they were already attached to the other JS class. In another part of the code, there was a createChildViews method, so I separated it out and passed the new piece of HTML through this method: createChildViews: function () { var $els = this.$('#active-users li, #deactivated-users li'); _.each($els, function (element) { this.createChildView(element); }, this); }, createChildView: function(element){ var user = new User({ // the other JS class el: element }); this.listenTo(user, 'user-created-event', function (view) { this.onUserCreate(view); }, this); }, onUserCreate: function ($el) { var targetList = '#active-users'; window.alert("User created"); this.createChildView($el); this.insertIntoList(targetList, $el); }, This meant that all of the relevant listeners were attached to the HTML.
accepted answer of: http://stackoverflow.com/q/27379935
answers question: http://stackoverflow.com/q/27379935
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27418925
score: 0
has comment: http://stackoverflow.com/comment/43281631
has comment: http://stackoverflow.com/comment/43281061
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27419169
has comment: http://stackoverflow.com/comment/43281066
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43281332
has comment: http://stackoverflow.com/comment/43281017
has title: angularJS failed to load module
has comment: http://stackoverflow.com/comment/43281027
type: Question
has body: Is there anyone know why I got the following issue: Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.6/$injector/modulerr?p0=helloKinveyApp&p1=E…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.6%2Fangular.min.js%3A17%3A350)angular.min.js:6 (anonymous function)angular.min.js:36 (anonymous function)angular.min.js:7 rangular.min.js:35 gangular.min.js:38 Obangular.min.js:17 dangular.min.js:18 scangular.min.js:16 Hdangular.min.js:249 (anonymous function)angular.min.js:163 aangular.min.js:32 c var app = angular.module("helloKinveyApp", ["ngRoute", "kinvey"]); app.run(["$kinvey", function($kinvey) { var promise = $kinvey.init({ appKey: clientParams.appKey , appSecret: clientParams.appSecret }); promise.then(function() { console.log("Kinvey init with success"); }, function(errorCallback) { console.log("Kinvey init with error: " + JSON.stringify(errorCallback)); }); }]); Hello Kinvey Lesson 1
tagged with: kinvey
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43280967

http://stackoverflow.com/comment/43313839
comment on: http://stackoverflow.com/a/27435992
score: 0
has text: hi then, what about actually passing in the value returned from ajax into the dialog's text
type: AnswerComment
type: Comment

ng-bind-html
tags question: http://stackoverflow.com/q/27395306
type: Tag
tags question: http://stackoverflow.com/q/27441009
tags question: http://stackoverflow.com/q/27408244
tag name: ng-bind-html
tags question: http://stackoverflow.com/q/27365352

http://stackoverflow.com/a/27426228
has comment: http://stackoverflow.com/comment/43310887
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43305837
score: 1
has comment: http://stackoverflow.com/comment/43301961
upvote count: 1
answers question: http://stackoverflow.com/q/27421648
has body: Putting the code in an autoexecuted function is very good practice, except that you did a small mistake. Move the last () outside of the function and other braces. (function () { 'use strict'; var app= angular.module('vApp'); app.controller('Hello', ['$scope', function ($scope) { $scope.id = 'ID'; $scope.content = 'some stuff'; }]); })(); Otherwise the function is never called and your code doesn't "exist" for the browser.

http://stackoverflow.com/comment/43246047
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27400370
type: Comment
has text: Check the fiddle link. The formats of the inputs has been switched to show. You need to use the conversion technique linked above to convert the date from UK format.

visual-studio-2013
tags question: http://stackoverflow.com/q/27343654
tags question: http://stackoverflow.com/q/27408668
type: Tag
tag name: visual-studio-2013
tags question: http://stackoverflow.com/q/27376630

http://stackoverflow.com/a/27559825
has body: always use these for js and ui part.
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27418140
accepted answer of: http://stackoverflow.com/q/27418140
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/27342589
has comment: http://stackoverflow.com/comment/43140867
answer count: 0
has comment: http://stackoverflow.com/comment/43140830
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/12912935
score: 1
has comment: http://stackoverflow.com/comment/43141219
duplicate of: http://stackoverflow.com/q/12912935
type: Question
tagged with: url-masking
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43141187
tagged with: jquery
has body: I know this question has been asked several times but I am still struggling and fail to comprehend the answers provided already. I have a side bar with a category "abc". On clicking a pop up div loads asking the user to login or register. Once the user logs in it loads the page "xyz.php" through ajax: { var dataString1 = 'emaillogin=' + emaillogin + '&amp;submitted=1'; $.ajax({ type: "POST", url: "xyz-login.php", data: dataString1, beforeSend: function() { //Show loading image }, success: function(response) { //Check to see if the message is sent or not window.location='http://www.123.com/xyz.php'; $("#emaillogin").val('Email'); } }); } Hence on success I load the URL. However, I want to prevent users from directly accessing the URL which would make them bypass login. How do I prevent this? Do I block this inside the ajax call?Should I add it to the xyz.php page and check there whether XmlHttpRequest is in the header of the request. Can somebody explain how and where does can the check be applied to?
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43141238
has title: Block direct access to php file called by ajax function
tagged with: php

http://stackoverflow.com/comment/43127310
has text: Or just leave it out. `if (font_is_small) { ... }` and `if (!font_is_small) { ... }` are actually much more readable.
type: QuestionComment
comment on: http://stackoverflow.com/q/27335199
score: 0
type: Comment

http://stackoverflow.com/q/27465691
has comment: http://stackoverflow.com/comment/43367496
tagged with: javascript
has comment: http://stackoverflow.com/comment/43367490
duplicate of: http://stackoverflow.com/q/784929
score: 0
has answer: http://stackoverflow.com/a/27465709
has answer: http://stackoverflow.com/a/27465700
has comment: http://stackoverflow.com/comment/43367941
has comment: http://stackoverflow.com/comment/43367507
favorite count: 0
has comment: http://stackoverflow.com/comment/43367531
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/784929
has answer: http://stackoverflow.com/a/27467438
linked to: http://stackoverflow.com/q/19839952
answer count: 4
has body: Recently - learning and working with angularjs api. Looked at the source code for angular.isElement(). I understand foundationally what "!!" does to the return value of the expression when using it, but not understanding why use it - is it not redundant? Searched for !! not much info. Link to api page. function isElement(node) { return !!(node &amp;&amp; (node.nodeName // we are a direct element || (node.prop &amp;&amp; node.attr &amp;&amp; node.find))); // we have an on and find method part of jQuery API } Update: regarding being marked as a duplicate — Thx. Weird that i did not see that question on original search. Though many long answers- reading them - they don't really answer where I am confused. Is it not redundant in this case? Wouldn't it return true without !!. thx
has answer: http://stackoverflow.com/a/27465725
upvote count: 1
downvote count: 1
has title: Why would you use !! in an expression in this case? angularjs api
type: Question
has comment: http://stackoverflow.com/comment/43367498
has comment: http://stackoverflow.com/comment/43368468

http://stackoverflow.com/comment/43321198
has text: By definition, an id *must be* **unique**
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27440757
score: 3

http://stackoverflow.com/q/27430358
tagged with: memoization
has comment: http://stackoverflow.com/comment/43302504
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: pure-function
type: Question
has body: While advocating pure functions I'd like to also mention performance as an advantage and while I know that traditional functional languages heavily optimize them (I assume everything in haskell is magically memoized) I don't know what the case is for JS. I have written a small jsperf which does prove that a non-trivial pure function is way faster than a side-effect-y one but the benchmark may be completely broken. (http://jsperf.com/automatic-memoization)
has comment: http://stackoverflow.com/comment/43301947
has title: Do modern JavaScript engines perform optimizations targeting pure functions?
has comment: http://stackoverflow.com/comment/48509974
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: optimization

http://stackoverflow.com/comment/43317786
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27437773
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/66721/discussion-between-manwal-and-ratha).

http://stackoverflow.com/q/27383120
has comment: http://stackoverflow.com/comment/43215365
type: AnsweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/43215402
type: Question
tagged with: css
accepted answer: http://stackoverflow.com/a/27383581
has title: Twitter bootstrap modal appearing in wrong location, not centered and the buttons are not clickable
has comment: http://stackoverflow.com/comment/43226061
tagged with: twitter-bootstrap
score: 0
has body: I'm using Twitter Bootstrap 3 to create modals on my page; however, the modals are appearing in a odd way (not centered, and the buttons are covered by the overlay hence not clickable). Anybody know what the issue is? Here is a link to the live page. (click on any physician's image) TITLE POSITION ×Close TITLE SOME CONTENT Close Thanks
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27383581

http://stackoverflow.com/q/27318051
downvote count: 0
favorite count: 0
tagged with: requirejs
has title: Basic setup for React with react-router and requirejs
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27322891
type: Question
tagged with: reactjs
tagged with: javascript
has body: I'm trying to get the react-router up and running, but somehow React is not defined within react-router and because of that fails with the error Uncaught TypeError: Cannot read property 'createClass' of undefined I'm also getting this error later: Uncaught Error: Load timeout for modules: jsx!testapp_unnormalized2,jsx!testapp Any idea of what I'm doing wrong here? I simply want to get the router working without concatenating all the files. This is how the app looks: index.html init.js require.config({ paths: { react: "/resources/bower_components/react/react-with-addons", JSXTransformer: "/resources/bower_components/jsx-requirejs-plugin/js/JSXTransformer", jsx: "/resources/bower_components/jsx-requirejs-plugin/js/jsx", jquery : "/resources/bower_components/jquery/dist/jquery", 'react-router' : "/resources/bower_components/react-router/dist/react-router", 'react-router-shim': 'react-router-shim' }, shim : { 'react-router': { deps: ['react'], exports: 'Router' } }, }); require(['jsx!testapp'], function(App){ var app = new App(); app.init(); }); react-router-shim.js define(['react'], function(React) { "use strict"; window.React = React; }); testapp.js define(function(require){ var React = require('react'); var Router = require('react-router'); var Route = Router.Route; var NotFoundRoute = Router.NotFoundRoute; var DefaultRoute = Router.DefaultRoute; var Link = Router.Link; var RouteHandler = Router.RouteHandler; var routes = ( <DefaultRoute handler={Home} /> ); var Home = React.createClass({ render: function() { return( This is the mathias page ); } }); var App; App.init = function () { Router.run(routes, Router.HistoryLocation, function (Handler) { React.render(<Handler/>, document.getElementById('content')); }); }; return App; });
accepted answer: http://stackoverflow.com/a/27322891
answer count: 1

http://stackoverflow.com/q/27386068
downvote count: 1
has comment: http://stackoverflow.com/comment/43221549
type: Question
accepted answer: http://stackoverflow.com/a/27386415
has comment: http://stackoverflow.com/comment/43223546
has comment: http://stackoverflow.com/comment/43220389
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43220521
has answer: http://stackoverflow.com/a/27386415
tagged with: function
has comment: http://stackoverflow.com/comment/43220667
answer count: 1
has comment: http://stackoverflow.com/comment/43220833
tagged with: jquery
favorite count: 0
has title: All the functions defined for onClick of button are getting called
tagged with: http://stackoverflow.com/tag/html
has body: I have below code in jsp and js. What's happening is irrespective of what button I am clicking both the javascript functions are getting called. I am not sure what am i missing here? HTML: Offset Msg JS: $(document).on("click","#scrollOffsetDiv", setTimeout(scrollOffsetDiv,3000)); function scrollOffsetDiv() { var scrollTop = $(window).scrollTop(), elementOffset = $('#offset').offset().top, scrollDistance = (scrollTop-elementOffset); alert("2222222222"); $('html, body').animate({ scrollTop: scrollDistance }, 200); } $(document).on("click","#scrollMsgDiv", setTimeout(scrollMsgDiv,3000)); function scrollMsgDiv() { var scrollTop = $(window).scrollTop(), elementOffset = $('#msgsbytesinpersec').offset().top, scrollDistance = (scrollTop-elementOffset); alert("33333333"); $('html, body').animate({ scrollTop: scrollDistance }, 200); } Adding jsfiddle link.
has comment: http://stackoverflow.com/comment/43220553
has comment: http://stackoverflow.com/comment/43221617
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/43220485
tagged with: onclick
has comment: http://stackoverflow.com/comment/43221784

http://stackoverflow.com/q/27365313
type: UnansweredQuestion
has title: Is it ok to build a logo quiz app with Phonegap using multiple pages?
tagged with: css
has comment: http://stackoverflow.com/comment/43182498
has comment: http://stackoverflow.com/comment/43184327
has comment: http://stackoverflow.com/comment/43197021
type: Question
has comment: http://stackoverflow.com/comment/43222053
tagged with: javascript
has body: I want to create an app that runs on iOS and Android using Phonegap. I have the web app working properly on my desktop browser, my only concern is regarding the page where user has to guess the logo and submits his answer. Actually, I've made separate page for each logo, so I ended up having more than 200 pages. Will I encounter any issue with phonegap while "compiling the app", or should I use a template page, to load data dynamically based on questions ID's ? Also, I am storing the user's answers with localStorage, will the data be saved forever when the app will be running on a mobile device ? Or should I do it differently ?
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: cordova
has comment: http://stackoverflow.com/comment/43183569
answer count: 0

http://stackoverflow.com/a/27449342
has comment: http://stackoverflow.com/comment/43338794
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27449273
type: Answer
answers question: http://stackoverflow.com/q/27449273
score: 3
has body: document.getElementById('textInput1').addEventListener('keypress', function (e) { if (e.which === 13) { e.stopPropagation(); e.preventDefault(); alert('Enter pressed'); } }); Demo : http://jsfiddle.net/p7twLf0v/
has comment: http://stackoverflow.com/comment/43338493

http://stackoverflow.com/comment/43381053
has text: The second statement example is parsed incorrectly (outer operator should be `&&`, because of the brackets).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27473149
score: 0

http://stackoverflow.com/comment/43295408
score: 0
has text: What if for example i want to make a grid menu and from selecting one of the items it would then bring me to another interface. Also not all but some desktop applications do change the interface based on user input. Due to the lack of examples on the internet for changing the interface in different ways it would be helpful if the final answer represents a good tutorial on how a user may use multiple good methods to interface changes and modifications. That way others can use the information provided on this post.
type: AnswerComment
comment on: http://stackoverflow.com/a/27415224
type: Comment

http://stackoverflow.com/comment/43174928
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27361233
has text: @EmmanuelDelay Thanks for the comment! I've places the listener after the drop function call and also inside the addMarker function to no avail. The listener doesn't seem to be hooking.

http://stackoverflow.com/comment/43396589
type: Comment
comment on: http://stackoverflow.com/a/27475406
score: 0
type: AnswerComment
has text: I should have given the *full* list of things I tried before posting this question. changing the **Content-Type** to `'application/json'` was one of the. sadly it does not fix it. :-(

http://stackoverflow.com/comment/43225032
type: QuestionComment
comment on: http://stackoverflow.com/q/27388413
has text: Then use the debugger to see what it is or isn't doing.
score: 0
type: Comment

http://stackoverflow.com/q/27399541
answer count: 2
has body: i have this menu that i only want to show if the user scrolls the site up or when no scrolling happens. So when the site is scrolled up or no scroll happens i want to show it. when scroll down i want to hide it. My current code is: var lastScrollTop = 0; $(window).on("scroll touchmove", function () { var st = $(this).scrollTop(); if (st &gt; lastScrollTop){ $('.mobile-nav').css('top',-65); } else { $('.mobile-nav').css('top',0); } lastScrollTop = st; $('.mobile-nav').toggleClass('tiny', $(document).scrollTop() &gt; 0); });
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27399824
has comment: http://stackoverflow.com/comment/43245909
favorite count: 0
has comment: http://stackoverflow.com/comment/43244462
has title: Detect scrolling event using JavaScript
has answer: http://stackoverflow.com/a/27399660
accepted answer: http://stackoverflow.com/a/27399660
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27399824
type: Question
upvote count: 2

http://stackoverflow.com/a/27409075
has body: Could you build the chart inside the callback function instead of defining all the options first? Maybe try something like this: $.getJSON('values.php', function (json) { $('#container').highcharts({ series: [{ data: json ]}, title: { text: 'Some Title' }, subtitle: ... I can't demo the ajax request but if you put that json straight in the data option, the charts renders like this: jsfiddle
accepted answer of: http://stackoverflow.com/q/27408197
upvote count: 2
type: Answer
score: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27408197
downvote count: 0

http://stackoverflow.com/a/27431994
score: 1
has comment: http://stackoverflow.com/comment/43305342
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27431911
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43305332
has comment: http://stackoverflow.com/comment/43305742
type: Answer
has body: You can use this way to delegate both events: jQuery(document).on("mouseenter mouseleave", ".element", function(e){ jQuery(this).find('.child').fadeToggle(); // you can check for e.type for more complex logic }); The syntax to delegate with different handlers is: jQuery(document).on({ mouseenter: function () { //... }, mouseleave: function () { //... } }, ".element");
answers question: http://stackoverflow.com/q/27431911

http://stackoverflow.com/a/27375216
upvote count: 4
has comment: http://stackoverflow.com/comment/84474602
accepted answer of: http://stackoverflow.com/q/27374481
has body: There are different ways to solve your problem: Either you use addClassRules: // using the class name instead of field name jQuery.validator.addClassRules("input_txt_l", { required: true }); Or you handle each field separately, because in fact they are named different: jQuery("#test_form").validate({ rules: { 'floor[abc]':{ required:true }, 'floor[cde]':{ required:true }, } }); Or you rename your fields: HTML: &lt;input name="floor[][abc]" type="text" class="input_txt_l " value="" /&gt; &lt;input name="floor[][cde]" type="text" class="input_txt_l " value="" /&gt; JavaScript: jQuery("#test_form").validate({ rules: { 'floor[]':{ required:true }}, }); fiddle is here.
answers question: http://stackoverflow.com/q/27374481
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/65092543
has comment: http://stackoverflow.com/comment/65147518
type: Answer

http://stackoverflow.com/q/27411179
type: Question
upvote count: 1
tagged with: modal-dialog
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm attempting to launch a form from the header of a website I'm designing, using a Bootstrap 3 modal window. Here's the link; the modal should launch from 'email signup': http://pamaphilly.wpengine.com/ The issue is that the 'fixed logo ribbon' should be a persistent and fixed element at the top of the page. When I use fixed positioning, though, the modal doesn't work correctly. However, if I removed fixed positioning, it functions as expected. See this video: http://screencast.com/t/LeFCDXuf0GrE The CSS class I'm changing is: .fixed-logo-ribbon { background-color: #e41535; height: 4.75em; width: 100%; min-height: 5em; top: 0; border: 0; } Also, the html is just the standard modal demo: &lt;div class="fixed-logo-ribbon"&gt; &lt;div class="container logo-container"&gt; &lt;a href="http://pamaphilly.wpengine.com/"&gt; &lt;img class=logo-PAMA type="image/svg+xml" src="&lt;?php bloginfo('template_url'); ?&gt;/img/PAMA-logo-2014-masthead.svg" height="40" width="360" alt="PAMA-logo"&gt; &lt;/a&gt;&lt;!-- end logo div --&gt; &lt;div class="social-media-icons pull-right"&gt; &lt;div class="join-us less-margin"&gt; &lt;a data-toggle="tooltip" data-placement="bottom" title="Join the AMA Now" class="join-link" target="_blank" href="http://www.jointheama.com/"&gt;join now&lt;/a&gt; &lt;/div&gt; &lt;!-- Button trigger modal --&gt; &lt;button type="button" class="btn btn-primary btn-lg join-us" data-toggle="modal" data-target="#myModal"&gt; Launch demo modal &lt;/button&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt; &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt; &lt;span class="sr-only"&gt;Close&lt;/span&gt; &lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;…
has answer: http://stackoverflow.com/a/27411873
tagged with: css
downvote count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: Bootstrap 3 modal not working correctly when placed inside a fixed parent
score: 1

http://stackoverflow.com/comment/43171951
type: Comment
type: QuestionComment
score: 3
has text: There are no closures here.
comment on: http://stackoverflow.com/q/27359918

http://stackoverflow.com/comment/43157528
comment on: http://stackoverflow.com/a/27350824
has text: I will have to revise to show the whole code then. I thought you needed just the adding and setting session code.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43121506
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27331896
has text: Thank you this seems to be what I was looking for I have to run outside will be testing in in about 5-6 minutes and will return let you know how it goes. Thank you.

http://stackoverflow.com/comment/43102128
type: Comment
comment on: http://stackoverflow.com/a/27321159
score: 0
type: AnswerComment
has text: POST might make it a bit more difficult to use the api but its still pretty easy for someone to start using it. Users won't need to log in on my site so authentication plugins might not be the solution.

http://stackoverflow.com/comment/43285848
score: 0
type: Comment
type: QuestionComment
has text: @AlokBhat I'm trying to display the customized label on each series of bar chart. No idea on how to do this.. Please help me. Label should be displayed inside each bar
comment on: http://stackoverflow.com/q/27421437

http://stackoverflow.com/comment/43216098
comment on: http://stackoverflow.com/q/27377518
score: 1
has text: Not sure but this may be related to: http://stackoverflow.com/questions/17033631/node-js-maxing-out-at-1000-concurrent-connections
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43239321
type: QuestionComment
has text: @KashamaShinn You need to use two img elements then, search for crossfade images. As a side note this CSS rule `#bg > div` doesn't target anything in your posted HTML markup
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27396504

http://stackoverflow.com/q/27391992
favorite count: 0
has comment: http://stackoverflow.com/comment/43234358
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/27393851
has title: Why doesn't the button respond in the first click, and Why the menu disappear when it scale back to desktop
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27393695
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43231562
has comment: http://stackoverflow.com/comment/43233026
has comment: http://stackoverflow.com/comment/43231822
answer count: 2
upvote count: 0
has body: I have ran into a bit of problem with my mobile naviagtion. First, the dropdown menu wouldn't respond to the first click but it starts respond on the 2nd click and every click after. Second, When I scale the browser back to desktop version, the navigation will disappear. here is how my code set up in Codepen: http://bit.ly/1Bxskho HTML Mobile Menus Home Architectures Nature's Phenomenons CSS #main-nav{ float: right; } #mobile-btn{ display: none; text-indent: 0; margin: 20px; background: url(../images/sprite.png) no-repeat -25px 0; } #main-nav ul{ margin: 25px 0 0 0; } #main-nav ul li{ display: inline-block; padding-left: 20px; } #main-nav ul li a{ display: block; color: #29abe1; font-family: 'Muli', san-serif; font-weight: 300; font-size: 1.1em; } #main-nav ul li a:hover, #main-nav ul li a.visited{ color: #21b573; } @media screen and (max-width: 780px) { /* #main-nav & #mobile-btn */ #mobile-btn{ display: block; background: url(../images/sprite@2x.png) no-repeat -25px 0; background-size: 200px 200px; width: 30px; height: 20px; } #main-nav:hover #mobile-btn, #mobile-btn:hover{ cursor: pointer; } #main-nav ul, #main-nav ul li, #main-nav ul li a{ width: 100%; } #main-nav ul{ background-color: #fff; position: absolute; top: 60px; left: 0; margin: 0; display: none; -webkit-box-shadow: 0 2px 3px #21b573; -moz-box-shadow: 0 2px 3px #21b573; -ms-box-shadow: 0 2px 3px #21b573; -o-box-shadow: 0 2px 3px #21b573; box-shadow: 0 2px 3px #21b573; } #main-nav ul li{ padding: 0; border-top: 1px solid #21b573; } #main-nav ul li a{ text-align: center; padding: 20px 0; } } Javascript $('#mobile-btn').toggle(function(e){ e.preventDefault(); $(this).click(function(){ $('#main-nav ul').stop().slideDown(); $('#main-nav').css({"background-color": "#21b573"}); $('#mobile-btn').css({"background-position": "-65px 0"}); }) }, function(){ $(this).click(function(){ $('#main-nav ul').stop().slideUp(); $('#main-nav').css({"background-color": "#fff"}); $('#mobile-btn').css({"background-position": "-…
tagged with: jquery

http://stackoverflow.com/comment/58856642
has text: @aboutqx See the math links in http://stackoverflow.com/questions/11966779/learning-webgl-and-three-js/11970687#11970687
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27412386
type: Comment

http://stackoverflow.com/q/27369534
answer count: 0
has title: What is the proper method to reuse handlers/callbacks in Socket.io events, and does it even matter?
has comment: http://stackoverflow.com/comment/43190907
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43191859
tagged with: sockets
tagged with: socket.io
tagged with: node.js
has comment: http://stackoverflow.com/comment/43190898
has body: I am trying to factor out the anonymous callback functions from my socket.on() events for two reasons: It makes the code slightly easier to read and document. I believe it can be more memory efficient. Since the first reason is more of a personal preference, I will not address it--although I am definitely interested in seeing style guides and/or general recommendations. The second reason is because the only way I have seen socket.io used is like this: var io = require('socketio'); io.on('connection', function(socket) { socket.on('event', function(data) { // logic goes here socket.emit('different event', differentData); }); }); This can work quite well, but I believe the anonymous functions are instantiated for each and every incoming connection. I would factor this out through the following: io.on('connection', function(socket) { socket.on('event', eventHandler); function eventHandler(data) { // logic goes here socket.emit('different event', differentData); }); }); Still, that appears to still create an instance of 'eventHandler' for every new connection. My current attempt at factoring this out looks like this: var sockets = {} io.on('connection', function(socket) { socket.on('login', login.bind(socket)); socket.on('get information', getInformation); }); function login(data) { // logic goes here // Save the socket to a persistent object sockets[data.userId] = this; this.emit('logged in', loginData); }); function getInformation(data) { // authentication, db access logic goes here // Avoid binding by using previously stored socket sockets[data.userId].emit('got information', infoData); }); This works, but I am believe that bind() just creates another function, anyway, subverting any real benefit of not including the login callback in the connection callback. As for the other handlers, it seems that a persistent object is necessary, as evidenced by EtherPad's method (SocketIORouter.js:62). Since I plan to be listening to a sizable number of events, it seems like pulli…
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43193665

http://stackoverflow.com/a/27442253
has comment: http://stackoverflow.com/comment/43323822
has comment: http://stackoverflow.com/comment/43323987
type: Answer
has comment: http://stackoverflow.com/comment/43323789
has body: As I understand, you use GET and need a pdf file in a new tab. Soo...Why don't you just open this url in a new window like this var fullUrl = urll + parameter; window.open(fullUrl);
answers question: http://stackoverflow.com/q/27442120
score: 0

http://stackoverflow.com/a/36130142
has comment: http://stackoverflow.com/comment/61686660
upvote count: 7
answers question: http://stackoverflow.com/q/27323031
has comment: http://stackoverflow.com/comment/101240436
type: Answer
has body: If you are using Webpack another option that has a little more flexibility than rewire is inject-loader. For example, in a test that is bundled with Webpack: describe('when an alert is dismissed', () =&gt; { // Override Alert as we need to mock dependencies for these tests let Alert, mockPubSub beforeEach(() =&gt; { mockPubSub = {} Alert = require('inject!./alert')({ 'pubsub-js': mockPubSub }).Alert }) it('should publish \'app.clearalerts\'', () =&gt; { mockPubSub.publish = jasmine.createSpy() [...] expect(mockPubSub.publish).toHaveBeenCalled() }) }) inject-loader, in a similar manner to proxyquire at least allows one to inject dependencies before importing whereas in rewire you must import first and then rewire which makes mocking some components (e.g. those that have some initialization) impossible.
has comment: http://stackoverflow.com/comment/63416158
downvote count: 0
has comment: http://stackoverflow.com/comment/61687642
score: 7
has comment: http://stackoverflow.com/comment/63417414

http://stackoverflow.com/comment/43297815
type: Comment
has text: @Grice where to add `hidden` attribute ?? `$('#loader').css('display', 'none');` this place???
score: 0
comment on: http://stackoverflow.com/q/27427978
type: QuestionComment

http://stackoverflow.com/comment/43164189
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27355568
has text: Sorry, I did read your entire question, then went to fiddle and forgot that part. My bad. It looks like you are going to have to insert the tooltip outside of the rows so they are at the .routetimeline level.
type: AnswerComment

http://stackoverflow.com/q/27472285
type: AnsweredQuestion
has title: Math.E equals 0.99.... ^ max int
tagged with: floating-point
has answer: http://stackoverflow.com/a/27483931
type: Question
has comment: http://stackoverflow.com/comment/43379190
has comment: http://stackoverflow.com/comment/43379366
answer count: 2
has comment: http://stackoverflow.com/comment/43379330
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27472603
upvote count: 8
has comment: http://stackoverflow.com/comment/43379523
has answer: http://stackoverflow.com/a/27472603
has comment: http://stackoverflow.com/comment/43379252
has body: A friend showed me that (at least, in the google chrome console) the following statement prints true: 1/Math.pow(0.9999999999999999, Number.MAX_SAFE_INTEGER) === Math.E And indeed, 1/Math.pow(0.9999999999999999, Number.MAX_SAFE_INTEGER) is 2.718281828459045. This can't be a coincidence?! Could someone explain what is going on behind the scenes to make this work? According to wolfram alpha, the correct value should be approximately 1/0.40628 which is approximately 2.4613566998129373 -- very far off from Math.E. (I am assuming that wolframalpha is more precise in its calculations than javascript, but I may be wrong). Any explanation would be appreciated. Bonus: What is the true approximate mathematical value of that expression, I wonder? I found this: n = 0.0000000000000001 (1 - n)^MAX_INT = 1 + (MAX_INT choose 2) * n + (MAX_INT choose 3) * n^2 + ... + n^MAX_INT but I have no idea how to approximate that. I tested the above expression in wolfram alpha and got 2.46 as well.
accepted answer: http://stackoverflow.com/a/27483931
favorite count: 0
has comment: http://stackoverflow.com/comment/43379391
has comment: http://stackoverflow.com/comment/43379612
downvote count: 2
score: 6

http://stackoverflow.com/comment/47097652
has text: Hey Appartement Dupleix, did you get this to work? I was trying to do something similar, and I was able to get it to work by copying the entire file that apneadiving references (marker.coffee) and using that as the infoboxbuilder class, and then I commented out the offending line.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27458649
type: QuestionComment

http://stackoverflow.com/comment/43271960
type: Comment
comment on: http://stackoverflow.com/q/27413848
score: 0
type: QuestionComment
has text: @PSL i have this click on button called `save`. It juts gets list from Scope variables and then post to server. I tried `preventdefault1 even at the beginning of function but still my data gets posted

http://stackoverflow.com/comment/43180660
score: 0
has text: Can you create a jsfiddle or plunker?
comment on: http://stackoverflow.com/q/27364420
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43177708
type: Comment
comment on: http://stackoverflow.com/a/27362592
has text: Thank you. I do receive the right object when running `console.log($scope.customers[0]);` which returns `Object {*_data: Object}*_data: Object__proto__: Object` Perhaps the problem is because "*_data" is an object and not an array?
score: 0
type: AnswerComment

http://stackoverflow.com/q/27351068
has body: I have this code that when the word Level 2 is clicked the tab page changes. Level 2 I am desperately trying to get the same thing to happen from an image map area. area shape="circle" coords="75,101,24" href="#t2" class="wlt_tab_object" - doesn't work. Can anybody suggest how I may be able to get this to work? Rerards Leigh. The page in question is at http://krplaza.com.au/ Basically what I am trying to achieve is to get the Lift Buttons to behave like the Level 1, Level 2, Level 3 links. I hope that makes sense.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43156996
type: Question
score: 0
tagged with: wordpress
has comment: http://stackoverflow.com/comment/43156896
has title: Attach class to map area
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43156320

http://stackoverflow.com/comment/43099358
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27319866
has text: the javascript - d3.v3.min.js (line 1, col 3091)
score: 0

http://stackoverflow.com/a/27384335
has comment: http://stackoverflow.com/comment/43217902
downvote count: 0
answers question: http://stackoverflow.com/q/27384198
has body: you have \s which is anyspace if you want to prevent from using spaces use \S instead. to be sure that you have no spaces and not test anything else you can do : /^\S+$/ ^ = From the begining + = one or more $ = To the end
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43217680

http://stackoverflow.com/q/27387620
tagged with: web-applications
has comment: http://stackoverflow.com/comment/43229974
tagged with: node.js
has comment: http://stackoverflow.com/comment/43229920
answer count: 0
has comment: http://stackoverflow.com/comment/43229999
type: Question
tagged with: javascript
has body: Consider the following simple autocomplete form: &lt;html&gt; ... &lt;body&gt; ... &lt;div class='container-fluid' ng-controller="TypeaheadCtrl"&gt; &lt;input type="text" ng-model="selected" typeahead="name for name in names | filter:{name: $viewValue} | limitTo:8" typeahead-on-select='onSelect($item, $model, $label)' class="form-control"&gt; You made this selection {{selection_made}}. &lt;!-- Run "run_me.sh {{selection_made}} on the server--&gt; &lt;!-- Render the image that run_me.sh saves to disk on the server --!&gt; &lt;img ng-src=image.png/&gt; &lt;/div&gt; &lt;body&gt; &lt;/html&gt; Where the controller is defined elsewhere and is in charge of populating names and the definition of onSelect. I would like to invoke a shell script on the server: run_me.sh with arguments {{selection_made}} and render the image that the server generates on the client. How can I do this from angular + PHP ? Is there a lightweight approach to this?
has comment: http://stackoverflow.com/comment/43229943
score: 0
tagged with: angularjs-bootstrap
tagged with: angularjs
type: UnansweredQuestion
has title: AngularJS + Server-Side PHP image serving

http://stackoverflow.com/comment/43097084
comment on: http://stackoverflow.com/q/27318094
type: Comment
type: QuestionComment
has text: I am not trying to find the length. when i simply use ´console.log($("."+vehicleId+"_popupAddressCell"));´ to test inside and outside success - only the inside has successfully selected that element.
score: 0

keypress
tags question: http://stackoverflow.com/q/27425990
tags question: http://stackoverflow.com/q/27389086
tags question: http://stackoverflow.com/q/27446520
type: Tag
tag name: keypress
tags question: http://stackoverflow.com/q/27389014

http://stackoverflow.com/a/27405283
downvote count: 0
has comment: http://stackoverflow.com/comment/43263738
type: Answer
answers question: http://stackoverflow.com/q/27402001
score: 2
has body: It seems that the results are held in a SpeechRecognitionList, but I couldn't find any api for manipulating the list itself. What does work is stopping and restarting the recognition, but that's problematic if you're not using a https-site (on a plain http site the browser always asks for permission when restarting recognition). Here's an example: voice api test voice api test
upvote count: 2

http://stackoverflow.com/comment/43202129
type: AnswerComment
type: Comment
has text: Actually yes, you can, but why? The jQuery syntax is so much shorter.
comment on: http://stackoverflow.com/a/27376164
score: 0

http://stackoverflow.com/a/27394425
has comment: http://stackoverflow.com/comment/43236830
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27393991
type: Answer
has comment: http://stackoverflow.com/comment/43236677
has body: Thanks to @tkausl and @Darren, I've realized that no where in my code actually selects the row I want. I also learned that WHERE 1 does literally nothing. This is the revised php and it works perfectly but I also doubt it's optimized. Any ideas on what I could do to make the code better? Such as removing $stmt -&gt; fetch(); if it's unnecessary &lt;?php define('DB_SERVER', "localhost"); define('DB_USER', "XXX"); define('DB_PASSWORD', "XXX"); define('DB_DATABASE', "XXX"); $amount = $_POST["amount"]; $mysqli = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE); // Check connection if(mysqli_connect_errno()) { echo "Connection Failed: " . mysqli_connect_errno(); exit(); } /* create a prepared statement */ if ($stmt = $mysqli-&gt;prepare("UPDATE freetexts SET amount = amount - ?")) { /* Bind parameters: s - string, b - blob, i - int, etc */ $stmt -&gt; bind_param("s", $amount); /* Execute it */ $stmt -&gt; execute(); /* Bind results */ $stmt -&gt; bind_result($result); /* Fetch the value */ $stmt -&gt; fetch(); /* Close statement */ $stmt -&gt; close(); } $query = "SELECT `amount` FROM `freetexts`"; $result = $mysqli-&gt;query($query); if ($result-&gt;num_rows &gt; 0) { // output data of each row while($row = $result-&gt;fetch_assoc()) { echo json_encode($row["amount"]); } } else { echo "0 results"; } $mysqli-&gt;close(); ?&gt;
has comment: http://stackoverflow.com/comment/43236385
accepted answer of: http://stackoverflow.com/q/27393991
score: 0

http://stackoverflow.com/q/27327016
tagged with: ajax
has title: Sticky boxes with option to close
has comment: http://stackoverflow.com/comment/43136019
tagged with: http://stackoverflow.com/tag/html
has body: I'm very new to web development and might not be using the right terminology, so hopefully I am making sense. I am trying to have sticky boxes that would contain the words a user submitted into a form by pressing Enter. I couldn't find a better example of what I'm trying to achieve than the picture for Plug-In 8 in the link I attached. The boxes I want are in the background, behind the calendar pop-up window. I want to also have an option in the box to close that box (e.g. little "x" icon). The final submission would be when a user clicks a Submit button. Thanks a lot for any tips http://tutorialzine.com/2013/04/50-amazing-jquery-plugins/
tagged with: css
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43113171
has comment: http://stackoverflow.com/comment/43113017
type: Question
score: 0
has answer: http://stackoverflow.com/a/27339807
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43161264
type: Comment
comment on: http://stackoverflow.com/a/27350593
type: AnswerComment
score: 0
has text: That's rather heavy on memory/performance unless you specifically need the feature that updating the master updates all the references.

http://stackoverflow.com/comment/43260963
has text: Hi Austin, thanks for your answer. I also tried the same, but the problem is, on the right side of the child table there is almost 10px of empty space with respect to parent table. Even if I give width as 100% its not changing.
comment on: http://stackoverflow.com/a/27408188
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43318083
type: QuestionComment
comment on: http://stackoverflow.com/q/27438976
has text: its working , please check http://plnkr.co/edit/qDwTkHYmdu24fTQtVWuO?p=preview
score: 0
type: Comment

http://stackoverflow.com/comment/43216673
comment on: http://stackoverflow.com/a/27383728
has text: Don't use `splice`! The nodelist will throw an error upon attempts to modify it!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43295008
type: Comment
type: QuestionComment
has text: @apsillers "Tue Jan 01 2008 23:58:00 GMT+0300 (Russia TZ 2 Standard Time)"
comment on: http://stackoverflow.com/q/27423633
score: 0

http://stackoverflow.com/a/27404487
type: Answer
has comment: http://stackoverflow.com/comment/43254251
score: 0
accepted answer of: http://stackoverflow.com/q/27404421
answers question: http://stackoverflow.com/q/27404421
type: AcceptedAnswer
has body: This is what CSS media queries are for. Add this at the end of (or after) your existing CSS: @media screen and (max-width: 999px) { #Hagin { font-family: Sans; } } or, if you want it applied to all h1 tags: @media screen and (max-width: 999px) { h1 { font-family: Sans; } }
has comment: http://stackoverflow.com/comment/43254170

http://stackoverflow.com/a/27373336
score: 0
type: Answer
has body: function cutCamelCase(str) { return str.split(/(?=[A-Z])/).map(function (s) { return s.toLowerCase(); }); }`
answers question: http://stackoverflow.com/q/27373138

http://stackoverflow.com/comment/43201741
type: QuestionComment
has text: no not getting any errors
comment on: http://stackoverflow.com/q/27375928
score: 0
type: Comment

pageload
tags question: http://stackoverflow.com/q/27429673
tags question: http://stackoverflow.com/q/27423403
type: Tag
tag name: pageload

http://stackoverflow.com/a/27365683
answers question: http://stackoverflow.com/q/27361233
has body: The problem is you are trying to add the listener to the marker array which is a collection of markers. you should add the listener to each individual marker and then push the marker to the array. Try this : //initializing my variables var marker = []; //final markers that wil go on the map //this function loads the map on to the page. function initialize() { var mapOptions = { center: { lat: 0, lng: 0 }, zoom: 2 }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); //listener that listens for the map to load before calling the drop function google.maps.event.addListenerOnce(map, 'tilesloaded', function() { //this part runs when the mapobject is created and rendered google.maps.event.addListenerOnce(map, 'idle', function() { //this part runs when the mapobject shown for the first time drop(); }); }); } //drop function function drop() { for (var i = 0; i &lt; pictureLocations.length; i++) { setTimeout(function() { addMarker(); }, i * 200); } } // define markerClick wich was not defined in your code function markerClick(){ alert('click in the marker'): } //add marker function function addMarker() { var _marker = new google.maps.Marker({ position: pictureLocations[iterator], map: map, draggable: false, animation: google.maps.Animation.DROP, id: iterator }); //listener for clicks on markers google.maps.event.addListener(_marker, 'click', markerClick); marker.push(_marker); iterator++; } Besides that, you could consider to read more about the google.maps.event applying to the google.maps.Map object you will find that the idle event is not what you're thinking it is.
accepted answer of: http://stackoverflow.com/q/27361233
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43185392
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/43357903
type: Comment
has text: My point is whether or not there is any difference between an event handler that is an anonymous function having a named function in it and an event handler that itself is a named function.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27460586

http://stackoverflow.com/a/27320862
accepted answer of: http://stackoverflow.com/q/27320636
answers question: http://stackoverflow.com/q/27320636
type: AcceptedAnswer
type: Answer
has body: I briefly saw an initial answer on this to use this code: `document.getElementById('&lt;%=statusLabel1.ClientID%&gt;').innerHTML = numChecked` This solution worked. thanks
score: 0

http://stackoverflow.com/comment/100185612
comment on: http://stackoverflow.com/a/45512190
score: 0
type: AnswerComment
type: Comment
has text: Actually I am referring to the fact that if I put something inside an onClick listener, maybe I want it to be executed when I click it. That doesn't have any sense

http://stackoverflow.com/comment/43307916
type: Comment
has text: `var ageDale = ageD();` while named interestingly, is assigned the returned value of calling `ageD` which is a function. This allows `ageDale(ageDate);` to be used because you are calling the returned function. There is nothing wrong with that aspect of the code above. The problem, as pointed out by others, is that the returned function doesn't return a value, and as a result undefined is alerted.
type: AnswerComment
comment on: http://stackoverflow.com/a/27433334
score: 0

http://stackoverflow.com/q/27446961
score: -1
type: Question
has title: Regex Nan error number only
upvote count: 0
has body: I have an HTML form with input = "text". I need this to be text and not number. On the javascript side, I try to remove the nonnumerical character which works only if the first thing I type is a number. If I type a letter first, I will get a NaN error. And yes I need the parseInt as another script launches after this one. Thanks function numberonly(id) { var x = document.getElementById(id); var numbers = x.value.replace(/[^\d]/g,''); if (x.value.length&gt;0) { x.value = parseInt(numbers, 10); } } If possible, i would avoid using the "event" option as seen here. http://webcheatsheet.com/javascript/disable_enter_key.php
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43333297
has answer: http://stackoverflow.com/a/27447747
tagged with: regex
tagged with: nan
has comment: http://stackoverflow.com/comment/43332999
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43333985
has comment: http://stackoverflow.com/comment/43332951
downvote count: 1

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/27324033
tag name: google-oauth

http://stackoverflow.com/a/27326702
accepted answer of: http://stackoverflow.com/q/27326367
has body: I managed to fix the issue by changing this: to this: Thanks for all the suggestions though.
answers question: http://stackoverflow.com/q/27326367
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27343431
type: UnansweredQuestion
score: 5
tagged with: http://stackoverflow.com/tag/html
has body: I have a little problem in the collisions while using Phaser API. I have this code: game.physics.arcade.collide(sprite1, sprite2, this.collision, null, this); collsion: function(){ //Play a sound; } The problem here is when the two sprites collide the sound keeps playing. It only stops when they are not colliding. But I want to play the sound just the one time.
has title: Phaser collision: execute function one time
type: Question
tagged with: phaser-framework
upvote count: 5
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27356076
favorite count: 0

http://stackoverflow.com/a/74860092
has body: In my case I mistakenly read route file without using require:|
score: 0
has comment: http://stackoverflow.com/comment/132190556
type: Answer
answers question: http://stackoverflow.com/q/27465850

http://stackoverflow.com/q/27431196
has comment: http://stackoverflow.com/comment/43305712
has title: Can an eval access external functions?
possible better answer: http://stackoverflow.com/a/27475237
accepted answer: http://stackoverflow.com/a/27516453
has answer: http://stackoverflow.com/a/27475237
downvote count: 1
linked to: http://stackoverflow.com/q/86513
type: Question
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/43384265
has comment: http://stackoverflow.com/comment/43305348
has comment: http://stackoverflow.com/comment/43384365
has comment: http://stackoverflow.com/comment/43384115
upvote count: 4
has comment: http://stackoverflow.com/comment/43384140
has comment: http://stackoverflow.com/comment/43384095
has answer: http://stackoverflow.com/a/27516453
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27484533
linked to: http://stackoverflow.com/q/15605519
favorite count: 0
has comment: http://stackoverflow.com/comment/43384159
has comment: http://stackoverflow.com/comment/43306391
has answer: http://stackoverflow.com/a/27514968
tagged with: eval
linked to: http://stackoverflow.com/q/5235321
has comment: http://stackoverflow.com/comment/43384194
has body: My company allows us to write code in a javascript editor online. Other libraries are preloaded, so the code we write has access to these libraries. Specifically, we can use Underscore.js and jQuery.js functions in our code. We can also use our very own library Graphie.js. In an effort to save myself time, I have slowly built up my own personal set of functions which I copy and paste into every code I write. That set of functions is now so long that I want to fetch it externally (in order to save space, etc). $.getScript( 'url/to/myfunctions.js' ) I tried the above code, but it was too good to be true. This jQuery function getScript seems to run myfunctions as their own independent unit. This fails because myfunctions use our Graphie.js functions within them. $.get( 'url/to/myfunctions', eval ) This above code fetches and successfully evals my code (i configured my server to do so). Also too good to be true. Any jQuery and Underscode functions in my code actually work. But any Graphie functions in my code cause an error.
answer count: 4
has comment: http://stackoverflow.com/comment/43303895

http://stackoverflow.com/comment/43161203
type: QuestionComment
has text: what is your output/response?
score: 0
comment on: http://stackoverflow.com/q/27352222
type: Comment

http://stackoverflow.com/q/27345600
has answer: http://stackoverflow.com/a/59789605
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/27345718
type: Question
possible better answer: http://stackoverflow.com/a/27345905
tagged with: arrays
has answer: http://stackoverflow.com/a/27345905
tagged with: javascript
has body: how do I count the frequency of the elements in the array, I'm new to Javascript and completely lost, I have looked at other answers here but can't get them to work for me. Any help is much appreciated. function getText() { var userText; userText = document.InputForm.MyTextBox.value; //get text as string alphaOnly(userText); } function alphaOnly(userText) { var nuText = userText; //result = nuText.split(""); var alphaCheck = /[a-zA-Z]/g; //using RegExp create variable to have only alphabetic characters var alphaResult = nuText.match(alphaCheck); //get object with only alphabetic matches from original string alphaResult.sort(); var result = freqLet(alphaResult); document.write(countlist); } function freqLet(alphaResult) { count = 0; countlist = { alphaResult: count }; for (i = 0; i &lt; alphaResult.length; i++) { if (alphaResult[i] in alphaResult) count[i] ++; } return countlist; }
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27345718
tagged with: frequency
has title: Counting the frequency of elements in an array in JavaScript

http://stackoverflow.com/a/27401665
type: Answer
has body: overflow-y: scroll could be the solution http://jsfiddle.net/ds3nqbkz/2/ Many divs and content here ! Many divs and content here ! Many divs and content here !
answers question: http://stackoverflow.com/q/27401617
score: 0

http://stackoverflow.com/comment/43149529
score: 0
has text: If you want a loading icon to show, it's much easier to just show the loading icon, then use `setTimeout(func, 1);` to run your function. No need for webWorkers. You just need to let the browser to a repaint and `setTimeout()` will do that.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27347227

http://stackoverflow.com/comment/43173431
type: Comment
comment on: http://stackoverflow.com/q/27352291
score: 0
type: QuestionComment
has text: Yes, `development` environment can make trouble on a production server: It doesn't use precompiled templates, and performance can be quite poor. You can compare the configurations by looking at the configuration in the kraken-js config directory.

http://stackoverflow.com/comment/43159790
comment on: http://stackoverflow.com/q/27352088
type: Comment
type: QuestionComment
has text: @icktoofay I'm getting the object using session attribute. The object looks like this when I see it in alert. { 1= Apple , 2= Orange }.
score: 0

http://stackoverflow.com/comment/43237408
type: QuestionComment
has text: can you post the code on jsfiddle.net?
score: 0
comment on: http://stackoverflow.com/q/27360286
type: Comment

http://stackoverflow.com/q/27396228
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27397224
tagged with: javascript
tagged with: jquery
has title: jquery tabs access from urls
score: 0
has body: hello i have jquery tabs and want to access them from url using # but know know how can I full fill with it requirement is mywebsite.com/#show_page1 will show the page 1 content and if access from mywebsite.com/#show_page2 will show the page 2 content here is the my js code $(window).load(function(){ $(document).ready(function(){ $("#nav_tabbed a").click(function(){ var id = $(this).attr('id'); id = id.split('_'); $("#menu_container div").hide(); $("#menu_container #show_"+id[1]).fadeIn(); // remove classes from all $("a").removeAttr("style"); // add class to the one we clicked $(this).css("background-color","#1aaede"); // stop the page from jumping to the top return false; }); $("#menu_container #show_page1").show(); }); }); and html i have is Page 1 Page 2
possible better answer: http://stackoverflow.com/a/27397224
has answer: http://stackoverflow.com/a/27396490
accepted answer: http://stackoverflow.com/a/27396490

http://stackoverflow.com/q/27373620
type: Question
tagged with: audio
score: 3
tagged with: blob
has comment: http://stackoverflow.com/comment/43204485
downvote count: 0
answer count: 1
tagged with: javascript
has title: Saving an audio blob as a file in a rails app
has comment: http://stackoverflow.com/comment/43276612
favorite count: 0
has answer: http://stackoverflow.com/a/31199666
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43197959
has body: I am using recorder.js and have successfully gotten to the point where I can record an audio snippet and play it back over and over again to my heart's content. But now I am trying to make a post of this "blob" (which I know contains proper data since it's playing back correctly) as an audio wav file in my /public folder. My issue is that I am not sure how to deal with the blob and actually post its content. This is my code: function sendWaveToPost1() { console.log(savedWAVBlob); $.ajax({ url: '/worm/save', type: 'POST', beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))}, data: 'someData=' + savedWAVBlob, success: function(response) { console.log("success"); } }); } Controller: class WormController &lt; ApplicationController def create end def save audio = params[:someData] p audio save_path = Rails.root.join("public/audioFiles") # Open and write the file to file system. File.open(save_path, 'wb') do |f| f.write audio.read end render :text=&gt; 'hi' end end That code was based on this post: Save audio file in rails. But although I am posting something, it seems to be a string instead of the actual bytes of the audio file. This is the rails console error I receive: NoMethodError (undefined method `read' for "[object Blob]":String): Any ideas? I feel like I must be missing some encoding step, or maybe I'm just completely misunderstanding what a blob is. Why can't I just post it directly like this?
linked to: http://stackoverflow.com/q/5392344
upvote count: 3
tagged with: ruby-on-rails
linked to: http://stackoverflow.com/q/18801268

http://stackoverflow.com/comment/43260891
type: Comment
has text: don't understand why use a object if you have to list your array with numbers "8", "9" and go on. Sometimes using numbers instead of letters for property name can cause multiple issues.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27408079

http://stackoverflow.com/a/27343226
score: 0
has comment: http://stackoverflow.com/comment/43141993
type: Answer
has body: it's correct because obj2.dataset2[4] is this object {"p1" : "5.6446E-16 "}
answers question: http://stackoverflow.com/q/27343173
has comment: http://stackoverflow.com/comment/43142342
has comment: http://stackoverflow.com/comment/43142370

http://stackoverflow.com/a/56772114
downvote count: 1
answers question: http://stackoverflow.com/q/27358966
has body: And if nothing helps and you still want to present that website in an iframe, consider using X Frame Bypass Component which will use a proxy.
upvote count: 8
type: Answer
score: 7

http://stackoverflow.com/comment/43310677
score: 1
comment on: http://stackoverflow.com/q/27431618
has text: Good question, as you have two technologies colliding. Both are capable and neither in and of themselves violates MVVM concepts. Question is do you want to control view state by data or by JQUERY UI? Maybe you currently have a lot of JQUERY UI in the site, in that case it could be better to stick with it. If it's a new site, then maybe KO is more preferable as you move to true data binding technique for everything! KO falls short; however, in animation, for that JQuery UI is better. (IMO)
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27365900
type: Question
has answer: http://stackoverflow.com/a/27366105
upvote count: 1
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27365974
has body: So I'm trying to make a page display different paragraphs for each button pressed. However I keep getting some errors where the button will not run the function correctly. Ex function examplefunction() { document.getElemtentById("paragraphtobechanged").innerHTML = "When I put more "" it fails in other words it will not write this part." } Change Paragraph
favorite count: 0
answer count: 3
has title: Javascript Errors when changing paragraphs
has answer: http://stackoverflow.com/a/27365944
accepted answer: http://stackoverflow.com/a/27365944
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/27365974

http://stackoverflow.com/a/27460798
has body: My suggestion - using jQuery since it seems you do not mind that based on your accepted answer: You will need to change toggleTable to take an idx to toggle. You also likely want to make the container div of the links clickable instead of having the link. You will need to add a cursor:ponter to the CSS $(function() { $(".select").on("click",function(e){ e.preventDefault(); // only needed if .select are links var idx = $.trim($(this).text()); $(".hideaway").hide(); $("#hideaway"+idx).show(); toggleTable(idx); }); }); HTML: 1 2 3 1 2 3
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27445613

http://stackoverflow.com/a/27332966
accepted answer of: http://stackoverflow.com/q/27332909
has comment: http://stackoverflow.com/comment/43123328
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43123445
type: Answer
answers question: http://stackoverflow.com/q/27332909
upvote count: 2
score: 1
has comment: http://stackoverflow.com/comment/43123344
downvote count: 1
has body: var innerstyle = '#container{width:800px;background:silver;margin:20px auto;padding:10px;color:gray;border-radius:5px}input{padding:3px}input[name="jsvar"]{width:250px;font-family:courier}#display{border:2px gray solid;border-radius:5px;color:white;margin:10px 0}#display #dtitle{background:gray;border-radius:2px 0;padding:10px 5px}#display #dmsg{min-height:20px}#clear{float:right;cursor:pointer;text-decoration:none;color:white;background:red;padding:2px 10px;border-radius:5px}#clear:hover{background:gold}.rtitle{padding:8px;background:pink;text-align:center}.rtitle input{border:1px solid red;float:right}.rtext{max-height:200px;overflow:auto;margin-bottom:5px}.rtext td{min-width:100px}.secfilter{margin-left:5px}'; var styletag = document.createElement('style'); var inst = document.createTextNode(innerstyle); styletag.appendChild(inst); //var headref = document.getElementsByName('head'); // Wrong! var headref = document.getElementsByTagName('head')[0]; headref.appendChild(styletag); HTML DOM getElementsByName returns a collection of all elements in the document with the specified name (the value of the name attribute) ("name" attribute deprecated in HTML5 and replaced by "id" attribute for many elements. You should use getElementById thanks @t.niese) like &lt;input name="somename" /&gt; document.getElementsByName("somename"); instead you could use the ID of the tag like &lt;input name="somename" id="theId" /&gt; and query the element with: document.getElementById('theId') getElementById returns the element that has the ID attribute with the specified value HTML DOM getElementsByTagName(tag) find all elements with the tag name "tag" and return an array, if you find by the tag name 'head' the first position in the array, would be the head element.

http://stackoverflow.com/q/27400766
type: UnansweredQuestion
tagged with: datetime
tagged with: telerik
has comment: http://stackoverflow.com/comment/43246709
answer count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has body: I'm using a RadGrid (but I think the problem is not with the grid itself) with client binding to a service with Type = Odata, ResponseType = JSON. With Fiddler, when I see the Raw Detail of the call to my service I can see: "LogDate": "/Date(1417796043643)/" Correct me if I'm wrong, this number is the DateTime converted to the milliseconds from 01/01/1970. All the algorithm I found googling around (and the telerik grid too) are converting this number to: 05 December 2014 17:14:03. But in my DB the value of 'LogDate' field of the table where the service is reading from, is 16:14:03!! As far as I understood the "Date" javascript object takes in input an UTC Date and automatically adds the 'offset' of my timezone ( I'm GMT+1 ) and this is where the +1 hour comes from! (maybe? :D) Hoping I explained myself well. Any solution? Maybe an event where i can intercept the JSON response (OnRowCreating?) and manupulate myself? Thanks!
has comment: http://stackoverflow.com/comment/43249558
tagged with: javascript
tagged with: odata
has title: Wrong DateTime field (+1 hour) in a Telerik RadGrid with Odata client binding
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/43181628
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27364891
has text: I think you may find this helpful: http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example

http://stackoverflow.com/q/27428585
tagged with: edges
has title: Arbor.js edges length
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: arbor.js
has body: I'm working with arbor.js to build networks of controversies. The issue is that when I have just a few nodes with long labels, the borders of the canvas are not respected. How can I change the length of my edges ? Or how can I make arbor respect the limits of the canvas ? My code : My renderer.js : (function(){ Renderer = function(canvas){ var canvas = $(canvas).get(0) var ctx = canvas.getContext("2d"); var gfx = arbor.Graphics(canvas) var particleSystem = null var dom = $(canvas) var that = { init:function(system){ particleSystem = system particleSystem.screenSize(canvas.width, canvas.height) particleSystem.screenPadding(40) that.initMouseHandling() }, redraw:function(){ if (!particleSystem) return gfx.clear() // convenience ƒ: clears the whole canvas rect // draw the nodes & save their bounds for edge drawing var nodeBoxes = {} particleSystem.eachNode(function(node, pt){ // node: {mass:#, p:{x,y}, name:"", data:{}} // pt: {x:#, y:#} node position in screen coords // determine the box size and round off the coords if we'll be // drawing a text label (awful alignment jitter otherwise...) var label = node.data.label||"" var w = ctx.measureText(""+label).width + 10 if (!(""+label).match(/^[ \t]*$/)){ pt.x = Math.floor(pt.x) pt.y = Math.floor(pt.y) }else{ label = null } // draw a rectangle centered at pt if (node.data.color) ctx.fillStyle = node.data.color else ctx.fillStyle = "rgba(0,0,0,.2)" if (node.data.color=='none') ctx.fillStyle = "white" if (node.data.shape=='dot'){ gfx.oval(pt.x-w/2, pt.y-w/2, w,w, {fill:ctx.fillStyle}) nodeBoxes[node.name] = [pt.x-w/2, pt.y-w/2, w,w] }else{ gfx.rect(pt.x-w/2, pt.y-10, w,20, 4, {fill:ctx.fillStyle}) nodeBoxes[node.name] = [pt.x-w/2, pt.y-11, w, 22] } // draw the text if (label){ ctx.font = "12px Helvetica" ctx.textAlign = "center" ctx.fillStyle = "white" if (node.data.color=='none') ctx.fillStyle = '#333333' ctx.fillText(label||"", pt.x, pt.y+4) ctx.fillText(label||"", pt.x, pt.y+4) } }) // draw the edges particleSystem.eachEd…
has answer: http://stackoverflow.com/a/30614242
type: AnsweredQuestion
tagged with: nodes
type: Question
accepted answer: http://stackoverflow.com/a/30614242

http://stackoverflow.com/q/27316888
linked to: http://stackoverflow.com/q/23260390
tagged with: node.js
has answer: http://stackoverflow.com/a/47515234
has answer: http://stackoverflow.com/a/27317140
has comment: http://stackoverflow.com/comment/47088335
has comment: http://stackoverflow.com/comment/43094150
tagged with: stack-trace
has title: node.js and Segmentation fault
type: Question
tagged with: debugging
upvote count: 9
tagged with: javascript
score: 9
has comment: http://stackoverflow.com/comment/64901483
answer count: 2
downvote count: 0
tagged with: segmentation-fault
has comment: http://stackoverflow.com/comment/43093848
favorite count: 0
has comment: http://stackoverflow.com/comment/47079785
type: UnansweredQuestion
has body: is it possible to inspect the javascript stack trace when node.js goes in Segmentation fault? The current situation is the following: I am running a script which has a few nested async.eachSeries, which caused for some weird reason a RangeError: Maximum call stack size exceeded. Hence, I have increased the stack size via node --stack-size=1000000 and I am left with the Segmentation fault. Here is the source code of the script: http://nopaste.info/ca0c118591.html Update I also tried segfault-handler, but for some inscrutable reason it is not catching my segfault.

http://stackoverflow.com/a/29242592
has comment: http://stackoverflow.com/comment/46691680
type: Answer
answers question: http://stackoverflow.com/q/27449905
has body: Add .gesture to your ev.distance/deltaX/direction console log commands: $('#wrapper').hammer().on("panstart panend", "#footer", function(ev){ console.log(ev.type); if(ev.type=='panend') { console.log('distance: ' + ev.gesture.distance); console.log('delta x: ' + ev.gesture.deltaX); console.log('direction: ' + ev.gesture.direction); } });
score: 0

http://stackoverflow.com/q/27379367
has comment: http://stackoverflow.com/comment/43208248
tagged with: javascript
has comment: http://stackoverflow.com/comment/43208059
tagged with: jquery
has answer: http://stackoverflow.com/a/27379880
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27379880
has body: I have one select box Client Management User Management Store Management Task Management on click of any of the options of the select box another select box has to be created with different options this is the current code ive written $("#combo_main").on( { "focus": function() { //console.log('clicked!', this, this.value); this.selectedIndex = -1; } , "change": function() { choice = $(this).val(); //console.log('changed!', this, choice); this.blur(); setTimeout(function() { alert('Chose '+ choice); var newCB= document.createElement("select"); newCB.id = 'txtT'; var myOptions = { "Value 1" : "Text 1", "Value 2" : "Text 2", "Value 3" : "Text 3" } $("#txtT").addOption(myOptions, false); $("body").append(newCB); }, 0); } }); I am getting the error Uncaught TypeError: undefined is not a functionadd_user.html:50 (anonymous function) at this line $("#txtT").addOption(myOptions, false);
score: 0
linked to: http://stackoverflow.com/q/19358385
has comment: http://stackoverflow.com/comment/43208160
has title: Dynamically add html select onClick of another select box option
answer count: 1
has comment: http://stackoverflow.com/comment/43208035
has comment: http://stackoverflow.com/comment/43208281
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10578619

http://stackoverflow.com/a/27414635
score: 0
type: Answer
has body: Hippydog's answer got me past the first part. I then realized I had to add another variable to keep the div from spazing out at the bottom of the first run. I just wanted to post what worked for anyone else looking at this for reference: Fun with animations dude If any more experienced coders find some unforseen problem with this script, feel free to let me know.
answers question: http://stackoverflow.com/q/27414145

http://stackoverflow.com/q/27427507
downvote count: 0
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/43297140
has title: Download file from express node.js with JWT authorization
accepted answer: http://stackoverflow.com/a/27428122
answer count: 1
has comment: http://stackoverflow.com/comment/43297242
favorite count: 0
has body: I'm using the express-jwt module on my node.js server to authorize users access to different requests. One of the request will ultimately be a file download with express res.download(file). The problem is that I can't do the request as I would usually do via AJAX (angular $http.get), as this will not trigger the required file download popup in the browser. Without AJAX though (window.open), I can't provide the necessary authorization header for express-jwt. Any hint on how I can achieve my authorized file download from node.js with express and jwt-express?
has comment: http://stackoverflow.com/comment/43297476
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43297042
linked to: http://stackoverflow.com/q/10516463
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43297645
score: 1
has answer: http://stackoverflow.com/a/27428122
upvote count: 1
type: Question

http://stackoverflow.com/q/27418430
has body: I am kind of confused why isnt the size of the array or object not being counted when the Smith is added to the list...? var a = []; a[0] = 12; a[5] = "Lou"; a["Sue"] = "Smith"; console.log("a: ", a); console.log("length: ", a.length);
has answer: http://stackoverflow.com/a/27418540
has title: Why isn't the size of the array 7?
answer count: 2
has comment: http://stackoverflow.com/comment/43280770
favorite count: 0
has answer: http://stackoverflow.com/a/27418582
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43280143
upvote count: 2
score: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43280129
tagged with: javascript

http://stackoverflow.com/comment/43160969
comment on: http://stackoverflow.com/q/27345520
score: 5
has text: The number 1 reason programmers don't want others to look into their code is a lack of self-confidence. Be proud of what you create! As @PeterOlson says; normal users won't dig through, and if they did, they would understand the logics of Spaghetti better then your code. And other programmers will have de-obfuscated your code in seconds...
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43254335
has text: I'm using an Alcatel OTF. I took a look at the bug (which basically renders push notifications useless despite the problem I am having, am I right?) but in my case the phone is not idle. I close the app, send a notification with curl from my computer immediately after, and nothing happens.
comment on: http://stackoverflow.com/q/27348997
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27383410
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27383383
score: 2
has body: just point it to defaults app.MyNamespace = { defaults: { myOption: 1 }, myFunction(param1, param2, options){ options = $.extend(options, app.MyNamespace.defaults); } }
downvote count: 0

http://stackoverflow.com/comment/43373039
score: 0
type: Comment
type: QuestionComment
has text: I followed this sample http://stackoverflow.com/questions/13943471/angularjs-ng-include
comment on: http://stackoverflow.com/q/27468886

relative-path
type: Tag
tags question: http://stackoverflow.com/q/27420292
tag name: relative-path

http://stackoverflow.com/comment/43420048
type: QuestionComment
score: 0
has text: @crockz sorry for all the comments, but i made a mistake in my code and now everything works now. Thank you so much for your help. How do I give you credit for the answer?
comment on: http://stackoverflow.com/q/27411927
type: Comment

http://stackoverflow.com/q/27367573
has comment: http://stackoverflow.com/comment/43188145
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43187787
possible better answer: http://stackoverflow.com/a/27368055
tagged with: knockout.js
has answer: http://stackoverflow.com/a/27368055
has answer: http://stackoverflow.com/a/27368015
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has body: The problem when my viewModel has observableArray (self.images) and I want when one item property (mm) is changed to be reflected on UI in the real code the images is loaded from server and mapped to object DOcImage here is the code note that i have been trying few things based on other questions answers but no luck yet here is fiddle http://jsfiddle.net/mosta/jt6bbeq4/21/ when click "change" it should display first item = 2, according to line in upate function var DocImage = function () { var self = this; self.mm = ko.observable('1'); self.nn = ko.observable('1'); }; var viewModel = function () { var self = this; self.images = ko.observableArray([DocImage]); self.update = function () { self.images()[0].mm = '2'; } }; var vm = new viewModel(); vm.images = [{ mm: ko.observable('1') ,nn: ko.observable('2') }, {mm:ko.observable('3'), nn:ko.observable('4')}]; ko.applyBindings(vm); Appreciate your help , thanks
has title: Knockout update observableArray item does not reflect in UI?
has comment: http://stackoverflow.com/comment/43187816
accepted answer: http://stackoverflow.com/a/27368015

http://stackoverflow.com/q/27337364
has comment: http://stackoverflow.com/comment/43134163
tagged with: angularjs
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43131369
has body: I am just starting out with AngulasJS, and when I run this code, I am getting the error "Argument 'teacherCtrl' is not a function, got undefined", but it is clearly defined. Please help. Name: {{search}} {{ property }}
has answer: http://stackoverflow.com/a/27337430
type: UnansweredQuestion
has title: Angular JS controller not working
linked to: http://stackoverflow.com/q/25111831
tagged with: javascript
tagged with: controller
type: Question

http://stackoverflow.com/q/27344645
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: css-animations
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43144635
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27344703
tagged with: css
has body: There is a delay in my CSS animation. I would like the animation start without delay. Tried to change some values below but couldn't archieve the result. .wpb_start_animation.wpb_appear { animation: 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s normal none 1 running wpb_appear; } Page: www.globalig.com Thanks.
has comment: http://stackoverflow.com/comment/43144602
has comment: http://stackoverflow.com/comment/43144666
has title: css3 animation - trouble understanding css property

http://stackoverflow.com/comment/43201180
score: 1
has text: Thank you very much. It worked!. I added more select box with different features. It work seamlessly. Thanks again.
comment on: http://stackoverflow.com/a/27375088
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43366340
type: QuestionComment
comment on: http://stackoverflow.com/q/27459583
score: 0
has text: I write console, but no let me choice log function try to write in function(data) { HERE }
type: Comment

http://stackoverflow.com/comment/95195500
has text: Works like a charm. Couldnt we even set this to 999999 for both?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/48546227
score: 3

http://stackoverflow.com/comment/43279366
type: Comment
has text: You can't have ` ` as direct descendant of ` `.
type: QuestionComment
comment on: http://stackoverflow.com/q/27417756
score: 0

http://stackoverflow.com/comment/43256687
has text: Excuse me but i don't know by you vote my down. You didn't specify that.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27403277
type: Comment

http://stackoverflow.com/q/27315114
type: UnansweredQuestion
score: -1
tagged with: ibm-mobilefirst
has title: IBM Worklight: Get page loading time
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27315350
linked to: http://stackoverflow.com/q/26623225
answer count: 1
favorite count: 0
has body: Suppose I'm loading an external webpage: http://stackoverflow.com How can I calculate how long Worklight takes to load the webpage?

http://stackoverflow.com/comment/43360260
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27461635
has text: but pretty good, i appreciate. every day i learn something new.
score: 0

http://stackoverflow.com/comment/43141745
score: 0
comment on: http://stackoverflow.com/q/27342877
has text: @chipChocolate.py Man, that's clever, simple and smart I needed that code to work with words, I changed some stuff according to chip, now my problem is that the initial frame is empty... I mean, words start appearing after one second, why?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43127290
type: QuestionComment
has text: Also see this SO post : http://stackoverflow.com/questions/359494/does-it-matter-which-equals-operator-vs-i-use-in-javascript-comparisons
comment on: http://stackoverflow.com/q/27335199
score: 0
type: Comment

http://stackoverflow.com/comment/43140499
has text: The problem is that for the entire thing there are a lot of resources to upload, sounds, etc... I'll work on a simplified version, focusing on the animation matter, but it's not easy.
comment on: http://stackoverflow.com/q/27342260
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/123474371
comment on: http://stackoverflow.com/a/27372039
type: Comment
score: 0
type: AnswerComment
has text: @Pre101 Hi, the jsfiddle is not working anymore... do you maybe have a working example? I know it is from a few years ago, but I can't manage to make signals work now....

http://stackoverflow.com/a/27422468
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43292284
has body: You can create a custom filter for this, just convert the desired date without the timezone, for example: myApp.filter('ignoreTimeZone', function(){ return function(val) { var newDate = new Date(val.replace('T', ' ').slice(0, -6)); return newDate; }; }); Check this fiddle: http://jsfiddle.net/ghxd6nom/ You can also use a library for this, like moment.js
downvote count: 0
answers question: http://stackoverflow.com/q/27421821

http://stackoverflow.com/q/27338825
has body: this is the code i use for a menu in a webpage im building, and in some case the page i want to request have javascript in it, but when the requested page is loaded in to the actual page the script isnt runned. //Ajax menu permite uma ligação de cada vez var ajaxIsOcup = false; function ajaxDo(file,divdoID,appendDiv,thinkinotherdiv,reqTyp ,datastring) { if(ajaxIsOcup == false) { // Variáveis com default if (appendDiv === undefined || appendDiv === '') appendDiv = false; if (reqTyp === undefined || reqTyp === '') reqTyp = "POST"; if (datastring === undefined || datastring === '') datastring = null; if(thinkinotherdiv === undefined || thinkinotherdiv === '') thinkinotherdiv = null; // End Variáveis com default ajaxIsOcup = true; // Ocupar função ajax // Verifica em qual elemento insere a imagem de processo e insere-a var divtoThink = ""; if(thinkinotherdiv == null) divtoThink = document.getElementById(divdoID); else divtoThink = document.getElementById(thinkinotherdiv); deleteElementById("ajaxDoErrThinking"); divtoThink.innerHTML += " "; // End Verifica em qual element insere a imagem de processo e insere-a var xmlhttp = null; // Construção do objeto XMLHttpRequest segundo o tipo de navegador if (window.ActiveXObject && !window.XMLHttpRequest){ window.XMLHttpRequest = function(){ progIds=new Array("Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP", "Microsoft.XMLHTTP"); for(i in progIds){ try{ return new ActiveXObject(progIds[i]); }catch(ex){ console.log(progIds[i]); } } return null; }; }else if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); else { // XMLHttpRequest não é suportado pelo navegador alert("Seu navegador não suporta os objetos XMLHTTPRequest..."); ajaxIsOcup = false; // Desocupar função ajax deleteElementById("ajaxDoThinking"); deleteElementById("ajaxDoErrThinking"); return; } // End Construção do objeto XMLHttpRequest segundo o tipo de navegador function ErrShowing() { deleteElementById("ajaxDoTh…
tagged with: javascript
has answer: http://stackoverflow.com/a/27342890
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: xmlhttprequest
tagged with: menu
has title: I use XMLHttpRequest for a menu and when i request a page HTML that contains javascript inside it nothing happens,why?
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/27396253
has comment: http://stackoverflow.com/comment/43239237
has body: I have following script include page part: <![endif]--> <script src="<c:url value ='/resources/js/jquery-1.8.2.min.js'/>"> <script type="text/javascript" src="<c:url value='/resources/js/underscore.js'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/jquery.mousewheel.js'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/popup.js'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/jquery.jscrollpane.min.js'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/scroll-startstop.events.jquery.js'/>"> <script src="<c:url value ='/resources/js/jquery.ikSelect.js'/>" type="text/javascript"> <script type="text/javascript" src="<c:url value ='/resources/js/jquery-ui-1.10.0.custom.min.js'/>"> <script src="<c:url value ='/resources/js/jquery.uniform.js'/>" type="text/javascript"> <script type="text/javascript" src="<c:url value ='/resources/js/script-ini.js'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/addImage.js'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/source/jquery.fancybox.js?v=2.1.5'/>"> <link rel="stylesheet" type="text/css" href="<c:url value ='/resources/js/source/jquery.fancybox.css?v=2.1.5'/>" media="screen" /> <link rel="stylesheet" type="text/css" href="<c:url value ='/resources/js/source/helpers/jquery.fancybox-buttons.css?v=1.0.5'/>" /> <script type="text/javascript" src="<c:url value ='/resources/js/source/helpers/jquery.fancybox-buttons.js?v=1.0.5'/>"> <link rel="stylesheet" type="text/css" href="<c:url value ='/resources/js/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7'/>" /> <script type="text/javascript" src="<c:url value ='/resources/js/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7'/>"> <script type="text/javascript" src="<c:url value ='/resources/js/source/helpers/jquery.fancybox-media.js?v=1.0.6'/>"> following js: $(".image").fancybox({ helpers: { title : { type : 'float' } } }); and following html: When I load page I see e…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43323532
linked to: http://stackoverflow.com/q/17554068
has comment: http://stackoverflow.com/comment/43322096
score: 0
tagged with: fancybox
has comment: http://stackoverflow.com/comment/43241457
type: UnansweredQuestion
answer count: 0
duplicate of: http://stackoverflow.com/q/17554068
has comment: http://stackoverflow.com/comment/43265335
tagged with: fancybox-2
has title: fancybox undefined is not a function
type: Question

http://stackoverflow.com/comment/43313218
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27436222
score: 0
has text: Is that your full code? Also, `"but does not do what I need"`... we don't know what you need.

http://stackoverflow.com/comment/43268975
type: Comment
has text: It's an array, not an object. The keys will just be array indexes `0`, `1`, etc.
comment on: http://stackoverflow.com/a/27412320
score: 3
type: AnswerComment

http://stackoverflow.com/q/27398092
possible better answer: http://stackoverflow.com/a/27398238
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27398133
has comment: http://stackoverflow.com/comment/43242475
has title: Is my code vulnerable to XSS?
has answer: http://stackoverflow.com/a/27398238
type: Question
has answer: http://stackoverflow.com/a/27398133
tagged with: browser
score: 0
answer count: 2
has body: I have my website https://xx.com/guides When i scan my website i get this: Issue detail: The application may be vulnerable to DOM-based cross-site scripting. Data is read from window.location.href and written to $() via the following statement: $('.page-sidebar a[href="' + window.location.href + '"]') .addClass('selected') Maybe it's caused by this code: &lt;script&gt; $(function() { $('.page-sidebar a[href="' + window.location.href + '"]').addClass('selected') }) &lt;/script&gt; I tried to generate a POC https://xx.com/guides?"]);alert(2) but still no luck My browser has disabled XSS filtering I am cetrtain that DOM xss is possible I need help generating POC! Full code : http://pastebin.com/Bs4vuUH3
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: xss
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43242089
upvote count: 1

http://stackoverflow.com/q/27415876
has comment: http://stackoverflow.com/comment/43275720
score: 0
has answer: http://stackoverflow.com/a/27415981
has comment: http://stackoverflow.com/comment/43275857
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43275845
has comment: http://stackoverflow.com/comment/43275877
has answer: http://stackoverflow.com/a/27416084
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43275768
has title: how to set this Jquery code into body onload
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27415933
accepted answer: http://stackoverflow.com/a/27415933
has body: Hi guys im new to jquery/ javascript. i found some code in w3schools and i want to use it in my website. but i want the animation to trigger ever time i load the page. please help me how to do this Demonstrate fadeToggle() with different speed parameters. Click to fade in/out boxes i want to do something like this Hello World!
type: Question
possible better answer: http://stackoverflow.com/a/27415947
has comment: http://stackoverflow.com/comment/43275781
has comment: http://stackoverflow.com/comment/43275749
has comment: http://stackoverflow.com/comment/43275802
has answer: http://stackoverflow.com/a/27415947

http://stackoverflow.com/comment/43181006
type: Comment
has text: you can do : `<ng-message when="required" ng-if="!searchForm.searchQuery.$touched" `
type: QuestionComment
comment on: http://stackoverflow.com/q/27318420
score: 0

http://stackoverflow.com/a/27439714
type: Answer
accepted answer of: http://stackoverflow.com/q/27439321
answers question: http://stackoverflow.com/q/27439321
score: 2
downvote count: 0
upvote count: 2
has body: The order of your execution is: 1) The en2per function and the underscore template need to be declared (any order should work) 2) The jQuery needs to use the template 3) The underscore template needs to use the en2per function This is all solved by making sure the en2per function is not in a $(document).ready() handler, and making sure the jQuery using the template (so the template will need to have been loaded) is: &lt;script type="text/template" id="order_template"&gt; .... &lt;/script&gt; &lt;script&gt; function en2per(str) { .... } $(document).ready(function() { var order_temp = _.template($("#order_template").html()); var order_json = {orders:data.orders}; $('#full .pages').append(order_temp(order_json)); }); &lt;/script&gt; Here's a JSFiddle
type: AcceptedAnswer

http://stackoverflow.com/q/27457406
tagged with: javascript
tagged with: jquery
tagged with: ajax
upvote count: 1
tagged with: validation
favorite count: 0
type: UnansweredQuestion
has body: The below is my modal code: &lt;div class="modal fade" id="offline-payment"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;#215;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Offline Payment&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;form class="form-horizontal" role="form" id="offlinepaymentform"&gt; &lt;div class="form-group"&gt; &lt;label class="col-sm-3 control-label"&gt;Payment Due Amount&lt;/label&gt; &lt;label class="col-sm-6 control-label text-left" &gt;$ &lt;xsl:value-of select="payload/responseBody/com.alacriti.eippmodel.vo.InvoiceDetailsVO/paymentDueAmount"&gt;&lt;/xsl:value-of&gt;&lt;/label&gt; &lt;input name="paymentDueAmount" type="hidden" class="form-control" value="{payload/responseBody/com.alacriti.eippmodel.vo.InvoiceDetailsVO/paymentDueAmount}" /&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label class="col-sm-3 control-label"&gt;Payment Date&lt;/label&gt; &lt;div class="col-sm-6 validation-parsley"&gt; &lt;div class="col-sm-12 input-group date dp1" data-date="" data-date-format="dd-mm-yyyy"&gt; &lt;input name="paymentDate" class="form-control" size="16" readonly="true" type="text" data-parsley-required-message="Select date" required="true"/&gt; &lt;div class="add-on input-group-addon"&gt;&lt;span class="glyphicon glyphicon-calendar"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group"&gt; &lt;label class="col-sm-3 control-label"&gt;Payment Method&lt;/label&gt; &lt;div class="col-sm-6 validation-parsley"&gt; &lt;select name="fundingSourceTypeId" class="form-control" data-parsley-required-message="Select payemnet method" required="true" &gt; &lt;option value=""&gt;Select Payment Method&lt;/option&gt; &lt;xsl:for-each select="payload/responseBody/fundingSourceTypeVOList/com.…
has title: Submit form with jquery ajax + parsley validation in modal
answer count: 0
downvote count: 0
score: 1
type: Question
tagged with: modal-dialog

http://stackoverflow.com/q/27361635
has comment: http://stackoverflow.com/comment/43185490
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43175413
has title: javascript to add second class to element on click event
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43176134
favorite count: 0
type: UnansweredQuestion
has body: I am trying to add a second class to my element on click Before Text After Text here are my javascript codes; both of them work: either this one (thanks to @Shomz) var elements = document.getElementsByClassName('class1 '); for (var i = 0; i < elements.length; i++) { var element = elements[i]; element.className += ' class2'; } or this one (thanks to @t-j-crowder) [].forEach.call(document.querySelectorAll(".class1 "), function(element) { element.className += " class2"; }); Question The site allows the users to click on class1 and change it to class1 class2 . However, by running these codes, the class1 only temporarily changes to class1 class2, I mean the clicking event is not implemented, it has only visually changed. When the site is reloaded, it is back to the previous state. How to apply a fix to change permanently the class by clicking on it? How to achieve the class changing through a click event and to record this permanently? How can these js codes record this click and change it permanently?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27384445
has comment: http://stackoverflow.com/comment/43175938
downvote count: 1
type: Question

http://stackoverflow.com/comment/43292541
comment on: http://stackoverflow.com/a/27413024
score: 0
type: AnswerComment
has text: You're welcome! You also might want to consider cleaning the previous script tags from the DOM when you append a new one (just to make it cleaner).
type: Comment

http://stackoverflow.com/q/27426684
has answer: http://stackoverflow.com/a/27426982
type: UnansweredQuestion
upvote count: 1
tagged with: vb.net
has title: Update Panel in my aspx Page is not working when form.action is used
has comment: http://stackoverflow.com/comment/43295259
score: 1
has body: I will start from the scratch. I am converting this page which is an inline code. It submits form values to next page through form.action. This page have 4 buttons. I only want one button to do form.action. For that, I tried button's usesubmitbehaviour = "False". That didn't work. So I tried using update panel. It does work without form.action. But when I put action = "someurl" in form tag, buttons inside update panel doesn't work. I am not sure if I explained it well but summary is this, buttons inside doesn't work when I place action property inside form tag or even programmatically. Note: I want to trigger Form.Action from the single button outside the update panel. And buttons inside update panel should work anything else but Form.Action. I really appreciate any suggestion and solution.
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27427726
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: updatepanel
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/q/27473260
has comment: http://stackoverflow.com/comment/43383051
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43382925
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43383490
has body: I'm trying to fetch a JSON file using an AJAX call but the promise.done() isn't being run despite readyState going up to 4. I get no errors so I have no idea why this is happening. The getTemplate() function works since I'm able to console log the promise, but from there nothing is working. I've tried removing the dataType from the AJAX call but it did nothing. Other than that I don't know what to change because I have used the same code for another project and it worked fine there. Does anyone have any idea on how I should proceed here? EDIT: I have narrowed it down to it being the JSON file where the problem lies. What's wrong with my JSON file? http://jsfiddle.net/ym3z8aqh/2/ surveyView: { getTemplate: function() { var promise = $.ajax({ url: 'json/templateqa.json', type: 'POST', dataType: 'json' //Removing this changes nothing, async: false //Need false here so that readyState goes to 4 }); return promise; }, spawnQuestions: function() { var promise = surveyView.getTemplate(); promise.done(function(data) { alert('working'); }); console.log(promise); } }
has comment: http://stackoverflow.com/comment/43383506
has answer: http://stackoverflow.com/a/27475012
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43382634
tagged with: ajax
has comment: http://stackoverflow.com/comment/43382703
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43383626
accepted answer: http://stackoverflow.com/a/27475012
type: AnsweredQuestion
has title: .done() function not being run on returned promise from AJAX call when grabbing local JSON file

http://stackoverflow.com/q/27450515
has answer: http://stackoverflow.com/a/27451336
has comment: http://stackoverflow.com/comment/43398468
tagged with: extjs
answer count: 1
favorite count: 0
tagged with: extjs4.2
type: UnansweredQuestion
upvote count: 1
tagged with: oop
has comment: http://stackoverflow.com/comment/43398298
score: 1
linked to: http://stackoverflow.com/q/24410667
type: Question
has title: Concatenating child items to parent items
downvote count: 0
has body: I cannot find any documentation on Sencha's site that deals with the following scenario: Cube (Base class) Ext.define('example.ext.Cube', { sides: [ 'one', 'two', 'three', 'four', 'five', 'six'] }); Which of the two versions below is the standard way of concatenating new properties to existing ones? Both work the same way, but I feel as though Version A makes more sense Dodecahedron (Child class) Version A Ext.define('example.ext.Dodecahedron', { extend: 'example.ext.Cube', sides: [ 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'], constructor: function () { var me = this; // Alternatively: Ext.apply(me.sides, me.superclass.sides); me.sides = me.superclass.sides.concat(me.sides); me.callParent(arguments); } }); Version B Ext.define('example.ext.Dodecahedron', { extend: 'example.ext.Cube', constructor: function () { var me = this; Ext.apply(me.sides, [ 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve']); me.callParent(arguments); } }); Working Example Ext.onReady(function() { Ext.ns('example.ext'); Ext.define('example.ext.Cube', { sides: [ 'one', 'two', 'three', 'four', 'five', 'six' ], roll: function() { return this.sides[Math.floor(Math.random() * this.sides.length)]; } }); Ext.define('example.ext.Dodecahedron', { extend: 'example.ext.Cube', sides: [ 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve' ], constructor: function() { var me = this; me.sides = me.superclass.sides.concat(me.sides); me.callParent(arguments); } }); var die12 = Ext.create('example.ext.Dodecahedron'); window.roll = function() { var side = die12.roll(); var indefiniteArticle = side.match(/^[aeiou](?![n])/) ? 'an' : 'a'; document.getElementById('result').innerHTML = Ext.String.format('You rolled {0} {1}.', indefiniteArticle, side); } }); .vertical { position: absolute; top: 50%; left: 0; width: 100%; } #dice { background: url('https://cdn4.iconfinder.com/data/icons/48x48-free-object-icons/48/Dice.png') 0 0 no-repeat; height: 48px; width: 48px; padding: 0; border: none; outline: none; } #…
tagged with: javascript

http://stackoverflow.com/q/27345608
linked to: http://stackoverflow.com/q/890221
tagged with: javascript
has comment: http://stackoverflow.com/comment/43148004
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
score: 1
has title: Page size in kb with Javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43146565
type: UnansweredQuestion
tagged with: size
upvote count: 1
has body: Is there any way to read with javascript the total page size (with resources loaded) in kb of a html document? Edit: Please read carefully. It's not a duplicate. I want to get the total loaded page size, including all resources, like css, images and scripts. Come on stack overflow ;)
has answer: http://stackoverflow.com/a/27347684
has comment: http://stackoverflow.com/comment/43149440
type: Question

http://stackoverflow.com/comment/43146566
type: Comment
type: QuestionComment
has text: Is there something missing from my answer? You have not commented, voted or accepted it, but it seems to answer your question.
comment on: http://stackoverflow.com/q/27337971
score: 0

http://stackoverflow.com/q/27357991
has title: Find the point where the perpendicular lines of two lines meet
tagged with: 2d
has comment: http://stackoverflow.com/comment/43168307
has comment: http://stackoverflow.com/comment/43168903
has comment: http://stackoverflow.com/comment/43168593
tagged with: math
has comment: http://stackoverflow.com/comment/43235220
has comment: http://stackoverflow.com/comment/43169390
has body: I have two lines A and B whose co-ordinates are known. I have to draw perpendiculars to each line, when the lines do not meet inside the green box. Here, I am assuming that the green box is a canvas. I need to find the points (x5,y5) where the perpendiculars of line A and line B meets. Also, from which point should I draw perpendicular so that they meet the earliest.
has comment: http://stackoverflow.com/comment/43174042
upvote count: 0
has comment: http://stackoverflow.com/comment/43169054
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27368817
score: -1
tagged with: geometry
has comment: http://stackoverflow.com/comment/43168377
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43168523
downvote count: 1
tagged with: line
type: Question

http://stackoverflow.com/a/27398540
downvote count: 0
score: 4
type: AcceptedAnswer
has body: Because you're using a component, you don't have the usual button methods. You would need to do previewEl.getEl().dom.value = 'New Text';
answers question: http://stackoverflow.com/q/27395588
accepted answer of: http://stackoverflow.com/q/27395588
type: Answer
upvote count: 4

http://stackoverflow.com/comment/43263002
has text: http://jsfiddle.net/6bk5hfga/2/
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27397295

http://stackoverflow.com/comment/51612362
comment on: http://stackoverflow.com/a/27327083
type: Comment
score: 1
has text: What do you mean, "close enough"? It's exactly the right behavior. If you want isOnOrAfter, just add a function to the Moment prototype.
type: AnswerComment

http://stackoverflow.com/comment/43247374
comment on: http://stackoverflow.com/a/27401011
has text: thanks for the reply, i have already done that, the question im asking is the button isnt working it meant to load index.php when user have right info and echo invalid but when i remove ajax from it, it works but echo invalid displays on new page.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27328343
score: 0
type: AcceptedAnswer
has body: If you use localStorage on a given page you can probably store whether or not to substitute words. I think refreshing a page is similar to opening a new tab, so your script gets reinjected/reloaded rather than staying open and receiving an onupdate message.
type: Answer
accepted answer of: http://stackoverflow.com/q/27327329
answers question: http://stackoverflow.com/q/27327329

http://stackoverflow.com/a/27463197
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27462949
downvote count: 0
has body: You can map your game values into canvas coordinates like this: // fit map game values into canvas coordinates // value is a game coordinate to be translated into a canvas coordinate // gameLow &amp; gameHigh are the min &amp; max out of all the game values // canvasLow &amp; canvasHigh are the available canvas coordinates // to use the entire canvas canvasLow==0 &amp; canvasHigh==the canvas width in pixels function mapRange(value, gameLow, gameHigh, canvasLow, canvasHigh) { return ( canvasLow + (canvasHigh - canvasLow) * (value - gameLow) / (gameHigh - gameLow) ); } Example Usage: Given an array of game X values find the minimum and maximum values of X. // Given an array of X values var gameValuesX=[-2159.968750, -2159.968750, -2026.847167]; // Find the min &amp; max X var rangeX=calcgameMinMax(gameValues); function calcgameMinMax(a){ var min=100000000; var max=-100000000; for(var i=0;i&lt;a.length;i++){ var value=a[i]; if(value&lt;min){min=value;} if(value&gt;max){max=value;} } return({min:min,max:max}); } For each game X, call mapRange() supplying the game's max-X &amp; min-X game coordinate values and the canvas min-X &amp; max-X coordinate values. for(var i=0;i&lt;gameValuesX.length;i++){ // where canvas.width is the width of the canvas in pixels console.log( mapRange( gameValuesX[i], rangeX.min, rangeX.max, 0, canvas.width ) ); } And do the same for the game Y values... Good luck with your project!
type: Answer

http://stackoverflow.com/comment/81124689
has text: This seems like a pretty good solution, but I'm getting 1280x900 for Motorola G2 and Motorola G3, and their max video resolution is 1280x720
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/43148358

http://stackoverflow.com/q/27377473
has answer: http://stackoverflow.com/a/27377801
has comment: http://stackoverflow.com/comment/43204552
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43204407
has title: Alert after 11th comma in an input
has answer: http://stackoverflow.com/a/27377532
score: 0
answer count: 2
has body: I want to alert when user enter comma (,) 11th time. How can I do this with jQuery or js? &lt;input class='myprofiletags' name='my_profile_tags' value='&lt;?php echo $my_profile_tags; ?&gt;' placeholder="" /&gt; What I am doing: jQuery('.myprofiletags').keyup(function() { if( jQuery(this).val().indexOf(',') !== -1 ) { alert('No more text allowed'); } } This script above always alerts, even when I press and character after one comma. Any help would be appreciated.
possible better answer: http://stackoverflow.com/a/27377532
accepted answer: http://stackoverflow.com/a/27377801
has comment: http://stackoverflow.com/comment/43204533
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43204505
has comment: http://stackoverflow.com/comment/43204484
type: Question

http://stackoverflow.com/comment/43226896
has text: @Fresheyeball I see now what you were trying to say. The following question actually got me there, so I will attach it for future reference http://stackoverflow.com/questions/15083511/how-to-execute-jquery-inside-a-modal-window
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27388919
score: 0

http://stackoverflow.com/comment/43136489
type: Comment
type: AnswerComment
has text: ok, as you say `onload` event is not working with heavy images, then did you see `onerror` event.. with same images???? if both events are not working to you then close question
comment on: http://stackoverflow.com/a/27339802
score: 0

http://stackoverflow.com/comment/43139652
has text: **exact** duplicate of [What does “var FOO = FOO || {}” mean in Javascript?](http://stackoverflow.com/questions/6439579/what-does-var-foo-foo-mean-in-javascript)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27341885

http://stackoverflow.com/q/27401843
has title: Custom Confirmation dialog doesn't work properly
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27401944
tagged with: bootstrap-modal
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: Question
has body: I have created custom dialogs like Alert and ConfirmDialog with Bootstrap and Jquery. Here is sample : http://jsfiddle.net/eb71eaya/ Problem - in the callback I make an ajax call, and if it returns true - I show an alert with status success else - error. But this alert doesn't show while request makes delete. (In the example I don't make an ajax request, just show alert, but that also doesn't work.) function getEsrbAlertDialog(title, msg, callBack, obj) { var esrbAlertDialog = $('#esrb-dialog'); if (esrbAlertDialog.length == 0) { esrbAlertDialog = getEsrbDialog(title, msg); } else { $('.modal-title', esrbAlertDialog).html(title); $('.modal-body', esrbAlertDialog).html(msg); } $('.modal-footer div', esrbAlertDialog).empty(); $('.modal-footer div', esrbAlertDialog).append(' Close '); $('.close-btn', esrbAlertDialog).unbind('click').click(function () { if (typeof callBack === "function") { todo = callBack(obj); } esrbAlertDialog.modal('hide'); }); return esrbAlertDialog; }; I want to execute callback when confirmation dialog become closed. UPDATE : I understand logic like this : When user click on "Ok"-button, dialog must be closed. And when it is already closed then fire event 'hidden.bs.modal' which must execute callBack. But CallBack executes before confirm dialog finish hiding.
tagged with: twitter-bootstrap
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27402857
possible better answer: http://stackoverflow.com/a/27402857
has answer: http://stackoverflow.com/a/27401944

http://stackoverflow.com/comment/43112395
type: AnswerComment
has text: How does that account for the wildcarded value that merely contains 'example' which would work for something like 'http://example.com'?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27326490

http://stackoverflow.com/a/27338645
answers question: http://stackoverflow.com/q/27338562
has body: You are having trouble with jQuery because you're including it several times, once in the body, once in the header. When entering your site, the console shows: Uncaught TypeError: undefined is not a function Twice, once for $(document).ready(function(){ and a second time for $("#hide-auto1").hide(); Which means that basically jQuery is not being loaded properly. Consider including it just once, on the footer of the theme, inside the body, and from a CDN: &lt;script src="https://code.jquery.com/jquery-2.1.1.min.js"&gt;&lt;/script&gt; This is for version 2.1.1, which doesn't support IE &lt;9, but is the newest available. &lt;script src="https://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt; This is for the latest 1.x version. 1.7.1, the one you're using, is too old.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43193646
has comment: http://stackoverflow.com/comment/43651572
has comment: http://stackoverflow.com/comment/43134158

http://stackoverflow.com/a/27380448
has body: Thanks for the answers Danyal Sandeelo and Jeeva Jsb. I was able to get the date in yyyymmdd format using the code given below. var date = '09-Dec-2014'.split("-"); var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; for(var j=0;j&lt;months.length;j++){ if(date[1]==months[j]){ date[1]=months.indexOf(months[j])+1; } } if(date[1]&lt;10){ date[1]='0'+date[1]; } var formattedDate = date[2]+date[1]+date[0];
downvote count: 1
answers question: http://stackoverflow.com/q/27379243
upvote count: 5
score: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27379243
type: Answer
has comment: http://stackoverflow.com/comment/60592531

http://stackoverflow.com/q/27469091
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/43373487
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43374768
answer count: 1
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/27469160
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43373438
has body: I'm currently redesigning my site - it is a game arcade with over 2,000 flash games. I had the site designed/created for me years ago and I've taken it upon myself to modernise it. I've come upon a particular problem that I'm concerned about, in the past the site has been attacked by hackers and at one point it was vulnerable to mysql injection, but it's since been fixed. Here's the problem though - the current site uses excessive PHP. I don't like this so I thought I'd try and reduce a lot of server strain by using javascript where necessary. For instance, it often needs to retrieve a list of games from the database. I'm using Jquery's post() function to deliver an array of ids to a php called 'get-games.php' a bit like this: $.post( "ajax/get-games.php", { ids:ids } , function( data ) { //create games list with response data }); What's to stop someone maliciously calling this function with 500 ids repeatedly? There's an obvious answer - in the get-games.php add something like: if (ids.length &gt; 100) throw an error But occasionally I might want to retrieve a list of >100 games, perhaps on the admin panel. It just seems a bit limiting and I wonder if there's a better way of approaching this kind of spammable functionality.
tagged with: php
has comment: http://stackoverflow.com/comment/43373765
score: 2
has title: AJAX - how do I protect my ajax/php functions from being spammed?

http://stackoverflow.com/a/27333628
type: Answer
has comment: http://stackoverflow.com/comment/43124713
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27333518
has body: The fact that there is no specific server script doesn't really matter. A search engine crawler is a client, and all that matters is the content that it gets, regardless whether that content is static or dynamically generated. That said, if your page is completely built with JavaScript, that sure does matter. If it's one big page that is presented as different pages through JavaScript, a search engine might still index it as a single page, or not at all. Google supports JavaScript nowadays, but it is still experimental, and most other crawlers still don't support it. Generally it's a good idea to disable JavaScript in your browser and load the page, then you'll see what the crawler sees.
downvote count: 0
has comment: http://stackoverflow.com/comment/43125092
has comment: http://stackoverflow.com/comment/43124671

http://stackoverflow.com/comment/43187346
type: Comment
has text: I guess this only can be used at run time, and I cannot use it in the init function. Am I right?
comment on: http://stackoverflow.com/a/27367152
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43250687
score: 2
comment on: http://stackoverflow.com/q/27403020
has text: by setting the position to fixed, you are removing it from the flow of the page and 100% in a container is not the same as 100% of the page. So if you want it to remain the same size, you need to give it a fixed width (px), which you can do in CSS or via JS.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43185113
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27366569
type: Comment
has text: I am deferring, not sure if this is a duplicate or not. http://stackoverflow.com/questions/1459676/prevent-scroll-bubbling-from-element-to-window

rest
tags question: http://stackoverflow.com/q/27429174
tags question: http://stackoverflow.com/q/27314067
tags question: http://stackoverflow.com/q/27473960
tags question: http://stackoverflow.com/q/27333518
tags question: http://stackoverflow.com/q/27410336
tags question: http://stackoverflow.com/q/27433383
type: Tag
tag name: rest
tags question: http://stackoverflow.com/q/27364805
tags question: http://stackoverflow.com/q/27459705

http://stackoverflow.com/comment/43482627
type: Comment
type: QuestionComment
score: 0
has text: None of the previous answers work for me. Not in ios8 at least.
comment on: http://stackoverflow.com/q/27433928

http://stackoverflow.com/comment/43269789
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27404800
has text: Just FYI (you might already know) class expressions are coming in TS next which will allow them in IIFE. Also for OP this video (I made) on module patterns in TypeScript might be useful for you : https://www.youtube.com/watch?v=KDrWLMUY0R0&hd=1
score: 1

http://stackoverflow.com/a/27364125
type: Answer
has comment: http://stackoverflow.com/comment/43333560
accepted answer of: http://stackoverflow.com/q/27324807
answers question: http://stackoverflow.com/q/27324807
upvote count: 3
has body: EDIT: To answer your question, yes angular does store a boolean value in the $error object that is accessible to your via the key(s) that are set in the object. In the case of the code I provided below and in th jsFiddle, we are setting the key for angular, and the value of either true or false. Be mindful when setting the value as it is reversed. ex. $setValidity( true ), flips the $error to false. Ok, here is what I think you were looking for... In Angularjs v1.2.13 you will not have access to ng-message or the $validator pipeline, which is why are are using $formatters and $parsers. In this case, I am using named inputs, but perhaps in your case you need dynamic input names? Plus, if you are using inputs but no form, then getting the error message to display would have to be done with a separate custom directive. If so, then please look here for dynamically named input fields for some help. dynamic input name in Angularjs link Let me know if this works; I'll make changes as needed to HOOK YOU UP! In case you don't know, you can write over Angular's maxlength for each individual input. If you changed 'maxlength' in the updateValidity() function in the directive below, to something like 'butter', then $scope.form.inputname.$error would be something like $scope.formname.inputname.$error { butter: true } if you also used ng-maxlength="true", then it would be $scope.formname.inputname.$error { butter: true, maxlength: true } Another example if you used ng-maxlength, and capitalized the 'maxlength' in the directive to 'Maxlength' Then you would get $scope.formname.inputname.$error { maxlength: true(angular maxlength), Maxlength: true(your maxlength) And of course if you name it the same, then yours writes over angulars $scope.formname.inputname.$error { maxlength: true }; The point is YOU can add your own names to the angular $error object; you can write over Angular's; and you can just use what Angular gives you when you use Angular's directives: like ng-required="tru…
score: 3
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43334797

http://stackoverflow.com/comment/43247007
type: Comment
score: 0
type: AnswerComment
has text: Not sure I understand what you are after. Can you add more details?
comment on: http://stackoverflow.com/a/27400042

http://stackoverflow.com/comment/43266734
type: AnswerComment
comment on: http://stackoverflow.com/a/27411177
score: 0
type: Comment
has text: That doesn't fix the problem, though it was a contributor

http://stackoverflow.com/comment/43226429
type: AnswerComment
type: Comment
has text: I would expect to see a clone(). When you access the same object, it is just moved around
score: 0
comment on: http://stackoverflow.com/a/27389168

http://stackoverflow.com/q/27345329
has answer: http://stackoverflow.com/a/27345401
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27345563
accepted answer: http://stackoverflow.com/a/27345563
type: Question
has comment: http://stackoverflow.com/comment/43145990
answer count: 2
has title: jQuery: display a text inside the parent div with an animation
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm on basic jQuery. I'd like to display a text inside a div with some kind of animation and give a white background to the same div. This is a starting code I made: some text ..the style.. .square { width:100px; height:100px; } .toggle { display:none; width:100px; height:100px; } ..and the simple js. $('.square1').click(function(){ $('.toggle').slideToggle(300).addClass('white'); }); The problem is that I'm sure this is not the right way to display a text inside a container. The div is 'jumping' when the text is toggled. Also, is there some jQuery animation to display a content with a 'nicer' movement? Toggle is so rude! On fiddle: http://jsfiddle.net/2pnxf4go/9/
has comment: http://stackoverflow.com/comment/43145946
possible better answer: http://stackoverflow.com/a/27345401

http://stackoverflow.com/comment/43133086
type: Comment
has text: @DamianSilva You should not get in the habit of using `eval` often, because it's slow, and because unless you are the only one who can affect what string gets passed into `eval`, it's a potential security problem. And if you're in a situation where you _do_ have complete control of what string gets passed into `eval`, you probably don't need `eval` to begin with.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27338140

http://stackoverflow.com/q/27413924
has title: Take range slider value and convert to binary
type: Question
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27414171
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27414171
tagged with: range
tagged with: css
has body: I have the below function that turns a letter or number to hex, decimal and binary when placed in an input...it works great but I want to have a range slider from 0 to 9 and the value from that slider to be placed inside the input and converted as well... I Kinda managed that...but it doesn't convert it... JSfiddle SCRIPT $(document).ready(function(){ $('#ch').keypress(function(e){ var ch = String.fromCharCode(e.which); $('#hex').html(Convert.toHex(ch)); $('#dec').html(Convert.toDec(ch)); $('#bin').html(Convert.toBin(ch)); $('#ch').val(ch); return false; }); }); var Convert = { chars: " !\"#$%&amp;amp;'()*+'-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", hex: '0123456789ABCDEF', bin: ['0000', '0001', '0010', '0011', '0100', '0101', '0110', '0111', '1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111'], decToHex: function(d){ return (this.hex.charAt((d - d % 16)/16) + this.hex.charAt(d % 16)); }, toBin: function(ch){ var d = this.toDec(ch); var l = this.hex.charAt(d % 16); var h = this.hex.charAt((d - d % 16)/16); var hhex = "ABCDEF"; var lown = l &lt; 10 ? l : (10 + hhex.indexOf(l)); var highn = h &lt; 10 ? h : (10 + hhex.indexOf(h)); return this.bin[highn] + ' ' + this.bin[lown]; }, toHex: function(ch){ return this.decToHex(this.toDec(ch)); }, toDec: function(ch){ var p = this.chars.indexOf(ch); return (p &lt;= -1) ? 0 : (p + 32); } }; HTML &lt;script&gt; function updateTextInput(val) { document.getElementById('ch').value=val; } &lt;/script&gt; &lt;input type="range" name="rangeInput" id="rangeInput" value="0" min="0" max="9" onchange="updateTextInput(this.value);" /&gt; &lt;input class="convert" maxlength="1" name="ch" id="ch" /&gt; &lt;ul class="output"&gt; &lt;li&gt;&lt;span id="hex"&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span id="dec"&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span id="bin"&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;
type: AnsweredQuestion

http://stackoverflow.com/comment/43314123
type: Comment
comment on: http://stackoverflow.com/a/27436567
type: AnswerComment
has text: Then the above should work, given that the server side is set up properly.
score: 0

http://stackoverflow.com/comment/43295342
has text: @JamesThorpe yes it does. Chrome and firefox work as expected. For the sake of the argument, I've tried calling window.open('http://stackoverflow.com/questions/27426401/window-open-is-throwing-invalid-argument-error-in-ie', '', 'width=500px') from the console and it work. So I guess something wrong with the server settings, I'm not sure
comment on: http://stackoverflow.com/q/27426401
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27453906
answers question: http://stackoverflow.com/q/27453822
type: Answer
has comment: http://stackoverflow.com/comment/43347118
has body: You could store the variables as an object, or array. var memory = { var1: 123, var2: 123 } or var memory = [var1, var2]; then you can grab either one when you need it.
score: 0
has comment: http://stackoverflow.com/comment/43346227
has comment: http://stackoverflow.com/comment/43346027
has comment: http://stackoverflow.com/comment/43346054

http://stackoverflow.com/comment/43367522
has text: I can't use a real ` ` because putting the focus there will cause the page to hide the element the extension is modifying. I'm trying to hack around something I can't control directly. Matching the default UA styles would be enough, as I don't think the page changes the defaults.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27454211
score: 0

http://stackoverflow.com/q/27431563
tagged with: javascript
has answer: http://stackoverflow.com/a/27431873
tagged with: canvas
type: AnsweredQuestion
has body: I have a page composed of multiple layered canvases, which I would like to turn into one image (and then print). So for one canvas it's simple: capture-html-canvas-as-gif-jpg-png-pdf. So what to do with multiple layers of canvases? The only idea I came up with so far is to create another canvas and paint all the layered canvases into this one with ascending z-order. Will work, but taking a snapshot of the original canvases would be more helpful.
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27431873
linked to: http://stackoverflow.com/q/923885
has title: Print layered html5 canvases
score: 0
answer count: 1

http://stackoverflow.com/q/27422409
tagged with: angularjs
has body: I have been trying to figure out how to programmatically "uncheck" a checkbox on an ng-grid for days, and I am beginning to lose my mind. It can't possibly be this hard to solve this problem. I have tried everything that I can possibly think of, and I have tried every example that I have been able to find on the internet. Please, someone have mercy on me. The grids display fine, but I cannot figure out how to get uncheck the checkbox when this condition occurs: "if(!daysvalidfor || daysvalidfor < 0 || daysvalidfor > 100000)". The situation should occur when the "daysvalidfor" field is empty when someone checks the checkbox for that given row; and when this occurs, I want to "undo" the checkbox to make it empty again. That's it! All I want to do is conditionally uncheck the checkbox. Simple, right? Here are the respective grids in the HTML: You will see code that probably does not make sense or was commented out while I was exhaustively trying to solve this problem. managementApp.controller('managementController', function ($scope, $timeout, $http) { $scope.locationName; $scope.myLocation; $scope.locations = {}; $scope.trainingTemplates = {}; $scope.meetingTemplates = {}; $scope.getLocations = function(homeId) { var data = contentClient.GetLocations(homeId); $scope.locations = data; return data; //locations = data; }; $scope.selectedGrid = 'training'; // this is the default value of the grid to display. $scope.setSelectedGrid = function(selectedGrid){ $scope.selectedGrid = selectedGrid} $scope.isTrainingSelected = function() { if($scope.selectedGrid == "training") { return true; } }; $scope.isLocationSelected = false; $scope.removeLocalTemplate = function(locationTemplateId, documentType){ var result = contentClient.RemoveLocationTemplate(locationTemplateId, documentType); } $scope.getLocationTemplates = function(type) { var locationId = $scope.myLocation.Id; if(locationId) { var data = {}; if(type == "training"){ data = contentClient.GetLocationTrainingTemplates(loc…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27429802
type: Question
has title: How do I conditionally uncheck a checkbox in Angular ng-grid? (Revert/undo cell value onChange or onClick.)
tagged with: javascript
tagged with: angularjs-scope
score: 0
answer count: 1
tagged with: jquery
tagged with: ng-grid

modularity
tags question: http://stackoverflow.com/q/27404102
type: Tag
tag name: modularity

iframe
tags question: http://stackoverflow.com/q/27430492
tags question: http://stackoverflow.com/q/27332452
tags question: http://stackoverflow.com/q/27342595
tags question: http://stackoverflow.com/q/27332339
tags question: http://stackoverflow.com/q/27373712
tags question: http://stackoverflow.com/q/27432444
tags question: http://stackoverflow.com/q/27445114
tags question: http://stackoverflow.com/q/27399832
tags question: http://stackoverflow.com/q/27351786
tags question: http://stackoverflow.com/q/27350231
tags question: http://stackoverflow.com/q/27393328
tags question: http://stackoverflow.com/q/27341136
tags question: http://stackoverflow.com/q/27385311
tag name: iframe
tags question: http://stackoverflow.com/q/27451499
tags question: http://stackoverflow.com/q/27393070
tags question: http://stackoverflow.com/q/27461695
tags question: http://stackoverflow.com/q/27358966
tags question: http://stackoverflow.com/q/27404477
tags question: http://stackoverflow.com/q/27411562
tags question: http://stackoverflow.com/q/27360275
tags question: http://stackoverflow.com/q/27379947
tags question: http://stackoverflow.com/q/27388173
tags question: http://stackoverflow.com/q/27337270
tags question: http://stackoverflow.com/q/27378947
tags question: http://stackoverflow.com/q/27390889
tags question: http://stackoverflow.com/q/27440011
tags question: http://stackoverflow.com/q/27445559
tags question: http://stackoverflow.com/q/27414199
tags question: http://stackoverflow.com/q/27376144
tags question: http://stackoverflow.com/q/27378413
type: Tag
tags question: http://stackoverflow.com/q/27423605
tags question: http://stackoverflow.com/q/27403211
tags question: http://stackoverflow.com/q/27345426
tags question: http://stackoverflow.com/q/27404578
tags question: http://stackoverflow.com/q/27365663
tags question: http://stackoverflow.com/q/27351466
tags question: http://stackoverflow.com/q/27321576
tags question: http://stackoverflow.com/q/27428481
tags question: http://stackoverflow.com/q/27374773
tags question: http://stackoverflow.com/q/27429479
tags question: http://stackoverflow.com/q/27320563
tags question: http://stackoverflow.com/q/27442008
tags question: http://stackoverflow.com/q/27333798
tags question: http://stackoverflow.com/q/27368329

http://stackoverflow.com/a/32028523
answers question: http://stackoverflow.com/q/27335128
score: 1
upvote count: 1
downvote count: 0
has body: You don't need setTimeout to achieve hard binding. function foo() { console.log(this.bar); } var obj1 = {bar:10}; var obj2 = {bar:5}; var originalFoo = foo; OriginalFoo now has the reference to foo Now override foo function and use originalFoo.call to set the this context to always be that of obj1 foo = function() { originalFoo.call(obj1); } foo(); // returns 10 foo.call(obj2); //returns 10 even when obj2 passed as arg
type: Answer

http://stackoverflow.com/comment/43500177
type: AnswerComment
score: 0
type: Comment
has text: Thanks, still gives error in ie8, but no problem, works on mobile and desktop firefox,chrome. I can drop support for ie8, it was for documentation of my project. Thanks again it works great!
comment on: http://stackoverflow.com/a/27452638

http://stackoverflow.com/a/27401639
accepted answer of: http://stackoverflow.com/q/27355732
answers question: http://stackoverflow.com/q/27355732
has body: I had some problems with jQuery before (I had a plugin that worked only with older versions of jQuery). The UI version your're using is probably incompatible with jQuery 1.11, check the UI site, now it's on version 1.11.12 I think. For now ignore QuickSearch plugin, update the UI and jQuery and just try to make the DatePicker work again. In case QuickSearch doesn't work with jQuery 1.11 you can try these options: First, you can try to add the jQuery Migrate plugin and test this again Case the above doesn't work, you can use the jQuery.noConflict option. First you put the older version of jQuery and the call for its plugin: And then you call the jQuery supposed to be used in the entire project. So after doing this, when you need to use the older version of jQuery you're going to use jqQuick instead of $ and in the rest of the project you can use $ which is going to use jQuery 1.11 instead of 1.6. Edit: After talking at the chat with Rahul we could check that even while using jQuery 1.11 he was still using jQuery UI for jQuery 1.6. We updated the UI to 1.11.12 and it worked fine.
has comment: http://stackoverflow.com/comment/43248679
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43249068
has comment: http://stackoverflow.com/comment/43248631
type: Answer
has comment: http://stackoverflow.com/comment/43249217
has comment: http://stackoverflow.com/comment/43248827
has comment: http://stackoverflow.com/comment/43248908
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43286793

http://stackoverflow.com/comment/43277681
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27417064
has text: `so what i want is to upgrade this simple script by javascript ` Do you want the same code in JavaScript?? Is that you question?
type: QuestionComment

http://stackoverflow.com/comment/43345014
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27425221
has text: @AnthonyPotts My point was the answer you accepted produces the same result simply from running in debug mode, which you were already doing. You haven't explained how simply turning off bundling fixed your problem (running in debug mode means bundling is turned off in almost all implementations).
score: 0

http://stackoverflow.com/q/27420168
tagged with: jquery
has comment: http://stackoverflow.com/comment/43284204
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: please check the plugin http://ashleydw.github.io/lightbox/#image-gallery HTML : @gregfoster @gregfoster JS : $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) { event.preventDefault(); $(this).ekkoLightbox(); }); Working fiddle : http://jsfiddle.net/52VtD/8900/ In the above code i had implemented image slider with bootstrap modal with previous and next buttons as you can see.so now what my problem is when i click image the modal popup opens with a image but at background the sliding of images must be stopped temporarily untill the popup is closed..but it is not happening...so anyone throw some light on it.
downvote count: 0
favorite count: 0
tagged with: twitter-bootstrap
has title: maximizing images scroll in background is observed?
tagged with: css
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27420951
type: Question
accepted answer: http://stackoverflow.com/a/27420951
tagged with: javascript

http://stackoverflow.com/q/27418647
tagged with: php
has comment: http://stackoverflow.com/comment/43280434
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43280544
has answer: http://stackoverflow.com/a/27418787
type: Question
has comment: http://stackoverflow.com/comment/43280452
upvote count: 0
has title: How to compress dynamic code in html?
has body: Hello guys can anyone help me with compressing of dynamic code in html5, css3 and php ?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43280409
downvote count: 4
possible better answer: http://stackoverflow.com/a/27418852
answer count: 3
has comment: http://stackoverflow.com/comment/43280436
accepted answer: http://stackoverflow.com/a/27418787
has answer: http://stackoverflow.com/a/27418852
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43280374
has answer: http://stackoverflow.com/a/27419450
favorite count: 0
score: -4
has comment: http://stackoverflow.com/comment/43280340

http://stackoverflow.com/q/27336608
has answer: http://stackoverflow.com/a/27341836
favorite count: 0
tagged with: xpath
tagged with: casperjs
type: UnansweredQuestion
has title: Continue test if a click error occurs
tagged with: phantomjs
score: 1
tagged with: error-handling
upvote count: 1
type: Question
tagged with: javascript
has body: I'm running CasperJS with PhantomJS. I have it going to a url and clicking on an element based on XPath. This could happen several times without a problem, until, I suspect there is a delay in the page loading, it can't find the XPath, it throws an error and stops the test. I would like it to continue through the error. I don't want to wait+click any longer than I already am, as there are many clicks going on, and an error can be at a random click, waiting on every click is counter productive. I have tried putting the whole test into a try catch, it wouldn't catch. The only handling I could find just gave out more information on the error, still stopped the test.
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27342493

http://stackoverflow.com/a/27322570
answers question: http://stackoverflow.com/q/27321392
score: 0
has comment: http://stackoverflow.com/comment/43104545
type: Answer
has body: This really depends on your server resources and the number of nodes you need to spin up. As a rule of thumb: Try reusing running children as much as possible - this will save you 30ms start up time Do not start unlimited number of children (1 per request for instance) - you will not run out of RAM The messaging itself it relatively fast i believe. Would be great to see some metrics though. Also, note that if you have single CPU or running a cluster (using all available cores) it doesn't make much sense. You still have limited CPU capacity and switching context is more expensive than running single process.

http://stackoverflow.com/q/27446655
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27526150
accepted answer: http://stackoverflow.com/a/27526150
downvote count: 0
possible better answer: http://stackoverflow.com/a/27470983
type: Question
has answer: http://stackoverflow.com/a/27470983
has body: I'm trying to implement an NVD3 line chart using AJAX to load JSON data for 3 series. I am using .NET MVC to expose my formatted JSON at /Home/GetJsonMovingAverages. If I copy and paste this data, it all loads correctly on the graph, but by loading it via Ajax causes it to break without apparent error. I've tried alerting the datato prove its loaded, using callbacks to enforce waiting, disabling async in the .ajax method, and a plethora of other checks, none of which have helped me identify or expose the problem. It's simply beyond me. The below code grabs the JSON using d3, and then tries to render it on the graph. This is as close to the demo code as I can possibly make it. I also render the JSON data to the page to indicate when it's loaded and that it's correct. (it takes ~5-10 seconds) When the JSON appears on the page it's properly formatted and correct, but no chart appears. EDIT : JSFIDDLE NOTE: Now found it gives error: TypeError: data.map is not a function on nv.d3.js (line 5476, col 23) but only when using ajax. (m.map in nv.d3.min.js) (function ($) { 'use strict'; $(document).ready(function () { // Load chart data d3.json('/Home/GetJsonMovingAverages', function (data) { // Renders a line chart (function () { nv.addGraph(function () { //This adds the chart to a global rendering queue. var chart = nv.models.lineChart(); //Create instance of nvd3 lineChart $("p.jsonData").html(data); // What's going on here?! chart.xAxis .axisLabel("Date") //Set X-axis attributes .tickFormat(function (d) { return d3.time.format('%d/%m/%Y')(new Date(d)); });; chart.yAxis .axisLabel("Moving Average(s)"); //Set Y-Axis attributes. //.tickFormat(d3.format("d")); //Set Y-Axis label formatting. d3.select("svg") //Select the document's &lt;svg&gt; element .datum(data) //Attach data to the &lt;svg&gt; element. .transition().duration(500).call(chart); //Define transition and pass the d3.selection to our lineChart. nv.utils.windowResize( //Updates the window resize event callback. fun…
has answer: http://stackoverflow.com/a/27524551
tagged with: javascript
tagged with: jquery
tagged with: ajax
upvote count: 2
answer count: 3
favorite count: 0
tagged with: nvd3.js
tagged with: d3.js
has title: NVD3 Line Chart doesn't display when data passed using ajax - data.map is not a function

http://stackoverflow.com/comment/43341130
comment on: http://stackoverflow.com/a/27450258
type: Comment
has text: @user2989731 if answer was helpful and solved your issue you can accept it.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27384312
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I use the following code to load an external HTML file containing code for a slideshow script called Flexisel: // ==UserScript== // @run-at document-start // ==/UserScript== $.ajax({ type: "GET", url: "/JS/jquery.flexisel.js.html", success: function(){}, dataType: "script", cache: false }); $(window).load(function() { $("#flexisel").flexisel({ visibleItems: 5, animationSpeed: 1000, autoPlay: true, autoPlaySpeed: 2000, pauseOnHover: true, enableResponsiveBreakpoints: true, responsiveBreakpoints: { portrait: { changePoint:480, visibleItems: 1 }, landscape: { changePoint:640, visibleItems: 2 }, tablet: { changePoint:768, visibleItems: 3 } } }); }); This code works great when the user first visits the site or visits a page they haven't visited before. Unfortunately there are instances when the slideshow fails to load e.g. when the user clicks the back button in the browser. Is there a more reliable solution to ensure that this code is always loaded correctly? I have the following limitations: I have to use this approach because I am using a custom ecommerce solution which is very limited in features. I can upload files for instance using Tiny MCE (but only limited file types). This is why I am using an HTML file containing the JS code and not a JS file. I have no direct control over the layout or template used for the page. I can create custom CSS and JavaScript scripts but I have no control over the sequence of when these are loaded (i.e. I can't position them on the page). JQuery is installed by default so I do have access to some features (I'm not entirely sure which version). Any suggestions of a more reliable way to load this code given these limitations would be welcome...
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27384440
has answer: http://stackoverflow.com/a/27384471
accepted answer: http://stackoverflow.com/a/27384471
type: Question
type: AnsweredQuestion
has title: Script fails to load each and every time
has comment: http://stackoverflow.com/comment/43244930
answer count: 2
possible better answer: http://stackoverflow.com/a/27384440
has comment: http://stackoverflow.com/comment/43217231

http://stackoverflow.com/a/27439501
accepted answer of: http://stackoverflow.com/q/27423110
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 3
has body: I recommend looking into a constructor property: return declare([_WidgetBase, _TemplatedMixin], { label: "Default text for label", templateString: template, // other stuff of your declare here constructor: function(override_arguments_here) { // your init code here to override the label from your arguments } });
answers question: http://stackoverflow.com/q/27423110
upvote count: 3

http://stackoverflow.com/a/76122389
answers question: http://stackoverflow.com/q/27334365
score: 0
type: Answer
has body: To answer the 1st question you could simply use the customElements.get() method as follow : function isRegistered( name ) { return ( customElements.get( name ) != undefined ) ? true : false; } Simply call that method with your custom element name as a string it will return : true if that name is alreay used false if the name is available (no custom element registered with that name). For the 2nd question it looks like that the answers that consist in retrieving page elements and filtering them to only have the custom elements will not work as they will not return registered custom elements that have not been used yet. You could test that with this function : function getRegisteredCustomElements() { // This is a failing approach !! let registered = []; Array.from(document.getElementsByTagName('*')) .forEach( (tag) =&gt; { let tagName = tag.tagName.toLowerCase(); // current tag name in lower case if ( registered.findIndex( tag =&gt; tag == tagName ) == -1 // avoid duplicates &amp;&amp; tagName.includes('-') ) { // a custom element name must use at least one '-' registered.push( tagName ); } }); return registered; } This function retrieves all the tagNames in the page before filtering them to return an array that contains as unique entries the different custom elements names found in the page. While it may seems to work if a custom element is already registered but is not instantiated it will not return it's name so it is failing.

http://stackoverflow.com/q/27391682
has comment: http://stackoverflow.com/comment/43231177
tagged with: javascript-objects
has body: I'd like to be able to pass parameters to an anonymous callback, is this possible? See below, thus far its not looking so. var chain = { do: function(){ console.log('blah'); return this; }, then: function(cb, param){ cb.apply(param); } } chain.do().then(function(params){ console.log(params); // undefined, expecting [1,2] console.log(arguments); // [], expecting [1,2] }, [1,2]);
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27391690
type: Question
tagged with: function
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27391690
answer count: 1
tagged with: callback
has title: Is is possible to pass parameter to a chained anonymous function callback?

http://stackoverflow.com/q/27362028
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43213089
has title: Sharepoint Jquery attr returning undefined for populated column
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/43207639
tagged with: javascript
tagged with: sharepoint
score: 0
has comment: http://stackoverflow.com/comment/43176406
has body: I have a script running in a SharePoint list that updates the value of the URL of a Hyperlink or Image column depending on a field called TD Status, I then need to read this updated field again for verification purposes. For now i'm testing to see if the updates go through with a test field called CurrentStageImg, the field updates fine when I call UpdateListItems, but after its value is set and the script runs again, the call $(this).attr("ows_CurrentStageImg"); keeps returning 'undefined' on a test alert even though I can clearly see the column is populated on the SharePoint list. I am extremely frustrated by now and help would be much appreciated. My code below: $().SPServices({ operation: "GetListItems", async: false, listName: "Software Request", CAMLQuery: query, completefunc: function (xData, Status) { $(xData.responseXML).SPFilterNode("z:row").each(function() { var tdStatus = $(this).attr("ows_TD_x0020_Status0"); var currItemImg = $(this).attr("ows_CurrentStageImg"); var itemId = $(this).attr("ows_ID"); alert(itemId + " " + currItemImg); in the code above, the value of currItemImg should be the same as tdStatus since that is what im using for test purposes, as I said, the field CurrentStageImg is populated on the list and that is the field's internal name so I have no idea what i'm doing wrong.... here's the update call code: (both TD Status and CurrentStageImg are drop downs with the same values... not sure if that is a factor... updateListItem(itemId,'CurrentStageImg', tdStatus); function updateListItem(updateItemId, field2, newValue2) { var list = "Software Request"; //perform actual update $().SPServices({ operation:"UpdateListItems", listName: list, ID: updateItemId, valuepairs: field2, newValue2 }); }
has comment: http://stackoverflow.com/comment/43187669
tagged with: sharepoint-2010

http://stackoverflow.com/comment/43212329
comment on: http://stackoverflow.com/a/27381386
has text: yes, everything should be called after the device ready event
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43189513
has text: @Hey that's because `onerror` is a browser tool, the node equivalent would be to use `process.on("uncaughtException", function(e){ ...`
comment on: http://stackoverflow.com/a/27368864
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27389798
score: 0
has body: I am trying to post to a local son file which is saved within the same folder as all my code. I have done the following: function test(){ var xmlhttp = new XMLHttpRequest(); // new HttpRequest instance xmlhttp.open("POST", "data/people.json"); xmlhttp.setRequestHeader("Content-Type", "application/json;"); xmlhttp.send(JSON.stringify({name:"John Rambo"})); } The above function is run when I click on a button in my html: &lt;input type="button" onclick="test()"&gt; And my son file looks like this: { "People": [ {"name": "tony stark"}, {"name": "iron man"} ] } but I keep getting a 404 not found error. is there anything that I am doing wrong? Apologies if I missed something out if you require more information to answer the question please let me know. Thanks in advance.
has comment: http://stackoverflow.com/comment/43227576
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27394483
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/43228332
answer count: 2
has answer: http://stackoverflow.com/a/27390661
has comment: http://stackoverflow.com/comment/43227714
has title: POST to a JSON file using AJAX and only javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/43227622
has comment: http://stackoverflow.com/comment/43227571
tagged with: ajax

http://stackoverflow.com/comment/43171084
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27359487
score: 3
has text: You don't have any element that satisfies this selector: `document.getElementById('class1')`.

http://stackoverflow.com/q/27324630
has title: JQuery- Change the id of an element and call a function on click
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43108468
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43108498
has body: I have an element with some id, I changed its ID and when I click on that element (with new ID now), it still calls the function with previous ID $('#1st').click(function(){ $('#1st').attr('id','2nd'); alert("id changed to 2nd"); }); $('#2nd').click(function(){ alert("clicked on second"); }); Click Example is here
answer count: 2
linked to: http://stackoverflow.com/q/9122078
has comment: http://stackoverflow.com/comment/43108569
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27324658
possible better answer: http://stackoverflow.com/a/27324711
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27324711
accepted answer: http://stackoverflow.com/a/27324658
favorite count: 0

http://stackoverflow.com/q/27389425
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43226885
has body: I have a simple form where I want to input something and store it. The addEventListener() method will not work when the button is inside of the form. Here is the code, html first, then JavaScript Enter words to display Add word Javascript: var wordInput = document.getElementById("wordName"); var addWord = document.getElementById("addWord"); addWord.addEventListener("click", fillArray); function fillArray() { console.log("do something"); } I find that the fillArray() method isnt being called. Why is this? I works when I put the button right below the , but not from within the
has comment: http://stackoverflow.com/comment/43226837
has title: addEventListener for an element that is inside of a form
has answer: http://stackoverflow.com/a/27389618
has comment: http://stackoverflow.com/comment/43226977
has comment: http://stackoverflow.com/comment/43226854
has comment: http://stackoverflow.com/comment/43226839
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43226744
has answer: http://stackoverflow.com/a/27389788
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43226998

http://stackoverflow.com/q/27407205
upvote count: 1
has body: Seemingly-easy problem here: I'm trying to create a streamlined way to hide/show a collection of DOM elements using some jQuery/vanilla JS. This was from a refactor where several fragmented functions were re-done as better encapsulated versions of their former selves. What these functions are trying to do take elements from an array (by ID), use map to convert them to jQuery objects, and then hide or show them. Using jQuery 1.11 in an Angular project, but the angular aspect doesn't seem to interfere with this case, since it won't work in a jsFiddle either. main problem: When I run the function (usually using a click event), I don't get any sort of error from console and I don't get any sort of result in the DOM either. Any ideas? I'm sure it's a simple thing I'm missing, but I need other eyes on it. Here's a jsFiddle with the below code loaded in, ready for fixin'. Thanks! http://jsfiddle.net/sLgqvdku/ function showItem(item) { return item.show(); } function hideItem(item) { return item.hide(); } function showItemsWithIDs(ids) { ids.map($).forEach(showItem); } function hideItemsWithIDs(ids) { ids.map($).forEach(hideItem); } var itemsHiddenToFocusTribute = ['#form', '#ask', "#submitButton", "#sidebar", "#AmountCtrl", "#giftbutton"];
type: AnsweredQuestion
score: 1
tagged with: dom
has comment: http://stackoverflow.com/comment/43259556
has title: Hide Collection of jQuery elements in Array Using Hide()/Show()
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27407502
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27407360
has answer: http://stackoverflow.com/a/27407360
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27407502
has comment: http://stackoverflow.com/comment/43259709

http://stackoverflow.com/comment/43297668
comment on: http://stackoverflow.com/q/27428078
has text: Can you post your HTML too?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27359411
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: meteor
has title: Dynamic Route Map in meteorjs with iron-router
favorite count: 0
tagged with: iron-router
accepted answer: http://stackoverflow.com/a/27540129
upvote count: 1
has body: I'm trying to map routes dynamically. I have a document in the database with the categories: lie this. { name : "menu" , content : [ {name : "Category-1", permalink : "cat-1", order : 0}, {name : "Category-2", permalink : "cat-2", order : 0}, {name : "Category-3", permalink : "cat-3", order : 0}, {name : "Category-4", permalink : "cat-4", order : 0}, {name : "Category-5", permalink : "cat-5", order : 0}, ] } What i tired to do: client side: Template.navBar.helpers({ menu : function () { return Elements.findOne({name : "menu"}).content; }, path : function () { permalink = this.permalink; Router.map(function () { this.route(permalink, { path: "/" + permalink + "/", template: 'listParent', data: function () { currentSubs(permalink, 'none', 0); } }) }); return "/" + permalink + "/"; } }); Serverside startup: //add menu to the router var menu = Elements.findOne({name : "menu"}).content; for (var i = 0; i &lt; menu.length; i++) { console.log(menu[i].permalink); Router.map(function () { this.route(menu[i].permalink, { path: "/" + menu[i].permalink + "/", template: 'listParent' }) }); } In the client side when I click in every route(on 5 of them) the results are like what i waite for Category-5. Any idea on how can i achieve this without having to use: this.route('list', { path: '/:list/', template: 'listParent', data: function () { list = this.params.list currentSubs(list, 'none', 0); } }); I want a special route for every category that i have in menu document in database.
type: AnsweredQuestion
tagged with: dynamic
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43178566
has comment: http://stackoverflow.com/comment/43178215
has answer: http://stackoverflow.com/a/27540129

http://stackoverflow.com/comment/43228856
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27389866
has text: i would make it so that if ajax calls overlap, the closing first one won't hide the indicator before the 2nd one is done.
score: 0

http://stackoverflow.com/comment/43305393
type: Comment
score: 0
has text: But that is not the question you asked. What do you mean exactly by "stick" to the edges? Reach or stick? Please update the question.
comment on: http://stackoverflow.com/a/27432034
type: AnswerComment

http://stackoverflow.com/comment/43352443
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27457304
has text: Yes, it is. See here for more information: http://security.stackexchange.com/questions/2335/should-rsa-public-exponent-be-only-in-3-5-17-257-or-65537-due-to-security-c note that 0x10001 is 65537

http://stackoverflow.com/comment/43330871
comment on: http://stackoverflow.com/a/27445402
score: 0
has text: Thank you! What, if not only the class is added dynamically, but even the div element?
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27473610
tagged with: positioning
tagged with: css
has title: place a relative div under an absolute divs generated height by window
type: AnsweredQuestion
upvote count: 1
tagged with: absolute
type: Question
tagged with: fullscreen
tagged with: javascript
has body: Hey there :) I'm trying to make a video fit the browser window size plus adding an image at the bottom of the browser window height. So you get the video and the image to be the only thing that is showed when you load the page. When you scroll dowm the content of the website should appear. I've made something to illustrate the idea: http://instagib.dk/JS-test/ The problem is when I start adding the content of the site, it appears under video and image. The problem seems to be I've made it absolute and out of the documents context. Is there any JS, Jquery solution that reads the height of the absolute content and places content after the video? Cheers:) &lt;body&gt; &lt;!-- Header --&gt; &lt;header class="header"&gt; &lt;div class="header-bg"&gt; &lt;div class="logo-top"&gt;&lt;/div&gt; &lt;/div&gt; &lt;nav&gt; &lt;div class="menu"&gt; &lt;div class="hamburger"&gt;&lt;/div&gt; &lt;div class="hamburger"&gt;&lt;/div&gt; &lt;div class="hamburger"&gt;&lt;/div&gt; &lt;ul class="nav-list"&gt; &lt;li&gt;&lt;a href="#"&gt;Projects&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Services&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Advantages&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Who are we&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Work with us&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/nav&gt; &lt;/header&gt; &lt;video class="intro" autoplay loop&gt; &lt;source src="video/black_clouds.mp4" type="video/mp4"&gt; &lt;source src="video/black_clouds.webm" type="video/webm"&gt; Your browser does not support the video tag. &lt;/video&gt; &lt;div class="intro-seperator"&gt;&lt;/div&gt; &lt;!-- Main content --&gt; &lt;main class="content"&gt; &lt;/main&gt; &lt;!-- Footer --&gt; &lt;footer&gt; &lt;small&gt;&amp;copy; Crafthouse 2014&lt;/small&gt; &lt;/footer&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function() { divFade = $(".header-bg"); var toggleHeader = function(noAnimat…
downvote count: 0
answer count: 1
score: 1
has answer: http://stackoverflow.com/a/27473720
favorite count: 0
accepted answer: http://stackoverflow.com/a/27473720

http://stackoverflow.com/comment/43101839
type: QuestionComment
has text: Doesn't really matter where the data came from.
comment on: http://stackoverflow.com/q/27320331
score: 0
type: Comment

http://stackoverflow.com/comment/43146168
comment on: http://stackoverflow.com/q/27345437
has text: Execute a console.log that returns `data` ... sometimes it doesn't look exactly like we expect. This might give you the information to move forward.
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/comment/83390805
score: 5
type: AnswerComment
has text: @Olegzandr, what's the problem with window? Just replace `myObj` with `window`. However, note that with this you _also_ would listen to some non-existing events, e.g. if there was a global variable `onetwothree` the code code above would add a listener to event `'etwothree'`. ( ͡° ͜ʖ ͡°)
type: Comment
comment on: http://stackoverflow.com/a/27322253

http://stackoverflow.com/q/27343402
has comment: http://stackoverflow.com/comment/43142380
tagged with: javascript
score: 0
tagged with: asynchronous
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has title: D3 zoomable treemap - loading new levels async?
type: Question
has body: In this Treemap example, the whole JSON tree exists from the start: http://jsfiddle.net/6p1gayrp/ As I have a very big dataset, I would like to load each level on click: Clicking "International relations" in the example should instead load the children array from a remote datasource and then layout the rectangles. So starting out with one level: var json = { "name": "Sitemap", "children": [{ "name": "International Relations", "value" : 700 }] } And then adding more data to the tree before recalculating layout: var json = { "name": "Sitemap", "children": [{ "name": "International Relations", "children": [{ "name": "Systemic Theory", "children": [{ "name": "Great Powers", "value": 400, }, { "name": "Systemic Politics", "value": 300, }] }] }] } How can I load data async while keeping the rest of the functionality intact? (Ideally this would also work in the other direction: For example if a user navigates straight to a particular level of the treemap and then starts going up the hierarchy.)
has comment: http://stackoverflow.com/comment/43142468
tagged with: treemap

http://stackoverflow.com/a/27411525
has body: You need add the Jquery script. If you select the latest version works good.
answers question: http://stackoverflow.com/q/27411287
score: 0
type: Answer

less
tags question: http://stackoverflow.com/q/27411000
type: Tag
tags question: http://stackoverflow.com/q/27363444
tag name: less

http://stackoverflow.com/q/27453915
favorite count: 0
has body: Hi every one I am trying to sign up users in my app using facebook connect botton. That is when the user click the button I check if it is first time i store some of his informatios if it is not his first time i just ligged into the app .Now I can logged the user when he click the botton get his information as showing bellow. My problem is to save those informations in my Firebase App but it is not working. Please any help will be great //Here is the snapshot of my controller var app = angular.module("yopi", ["firebase"]); app.controller("EventCtrl", function($scope, $firebase, $window) { var ref = new Firebase("https://yopi.firebaseio.com/"); window.fbAsyncInit = function() { FB.init({ appId : 'MY API', // Set YOUR APP ID/ status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.Event.subscribe('auth.authResponseChange', function(response) { if (response.status === 'connected') { document.getElementById("message").innerHTML += " Connected to Facebook"; //SUCCESS } else if (response.status === 'not_authorized') { document.getElementById("message").innerHTML += " Failed to Connect"; //FAILED } else { document.getElementById("message").innerHTML += " Logged Out"; //UNKNOWN ERROR } }); }; $scope.Login = function() { FB.login(function(response) { if (response.authResponse) { getUserInfo(); getPhoto(); $window.location.href = "https://yopevent.firebaseapp.com/events.html"; } else { console.log('User cancelled login or did not fully authorize.'); } },{scope: 'email,user_photos,user_videos'}); } function getUserInfo() { FB.api('/me', function(response) { UserId = response.id; UserName = response.name; UserEmail = response.email; }); } function getPhoto() { FB.api('/me/picture?type=normal', function(response) { $scope.Id = UserId; $scope.Name = UserName; $scope.Email = UserEmail; $scope.PicUrl = response.data.url; var newUser = { UserId: $scope.Id, UserName: $scope.Name, UserEmail: $sc…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43366406
has comment: http://stackoverflow.com/comment/43365654
tagged with: firebase
has comment: http://stackoverflow.com/comment/43351475
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43346502
has comment: http://stackoverflow.com/comment/43355286
type: Question
has comment: http://stackoverflow.com/comment/43366069
tagged with: javascript
has title: Sign Up user with facebook in firebase
upvote count: 1
has comment: http://stackoverflow.com/comment/43357407
tagged with: facebook-graph-api

http://stackoverflow.com/comment/43117169
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27329400
has text: Are you familiar with jQuery? http://jquery.com/ jQuery makes it very easy to manipulate HTML

http://stackoverflow.com/comment/43250778
type: Comment
has text: sorry they should change also to `_user_id` & `event_id`
comment on: http://stackoverflow.com/a/27396425
score: 0
type: AnswerComment

http://stackoverflow.com/a/27336522
has body: Something like this: $(document).ready(function(){ function calculate() { $('#fees').text($('#amount').val()*(5/100)); $('#net').text($('#amount').val() - ($('#amount').val()*5/100)); } $('#amount').on('keyup change', function(){ calculate(); }); calculate(); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27336503

http://stackoverflow.com/q/27387102
type: Question
has answer: http://stackoverflow.com/a/27387169
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/2594578
has body: In my code I load an image: var img = new Image(); img.src= 'image.png'; And then I append this image to a div like this: $('#divname').append(img); So far everything works fine, but when I try to append the same image to another div, for example: $('#divname2').append(img); The image no longer exists. What I mean is when I open the page the first div contains the image but the second div does not. Respectively if I change the order of appends the #divname2 will contain the image. Is this a normal javascript behavior or am I doing something wrong? Is it possible to fix this issue?
possible better answer: http://stackoverflow.com/a/27387169
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2594578
accepted answer: http://stackoverflow.com/a/27387274
score: 0
has answer: http://stackoverflow.com/a/27387187
has answer: http://stackoverflow.com/a/27387176
has answer: http://stackoverflow.com/a/27387274
answer count: 4
has title: javascript image load works only one time

http://stackoverflow.com/comment/43331479
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27433641
has text: I am looking to get the number included in each class name. .reward1, .reward2, .reward3. .reward'uniquenumberhere'

http://stackoverflow.com/a/27435091
type: Answer
has body: Using javascript / Vanilla JS, you can achieve it like this: var a = document.getElementById('buyorderprice'); a.addEventListener('click',setValueNow); function setValueNow(e) { e.preventDefault(); var b = document.getElementById('sellprice').value = document.getElementById('buyorderprice').getAttribute('href'); } Here's a DEMO
score: 0
answers question: http://stackoverflow.com/q/27435042

http://stackoverflow.com/a/27424902
has comment: http://stackoverflow.com/comment/43292217
has comment: http://stackoverflow.com/comment/43292058
has comment: http://stackoverflow.com/comment/43291829
has comment: http://stackoverflow.com/comment/43292174
downvote count: 0
has comment: http://stackoverflow.com/comment/43292461
has comment: http://stackoverflow.com/comment/43292189
has comment: http://stackoverflow.com/comment/43291899
type: Answer
has comment: http://stackoverflow.com/comment/43291941
has comment: http://stackoverflow.com/comment/43292214
answers question: http://stackoverflow.com/q/27424777
has comment: http://stackoverflow.com/comment/43292414
score: 3
has body: There is a cross browser difference in implementation. IE used (and still uses) window.event object, while Firefox never implemented it this way. Instead Firefox supported passing event object into event handler. Try this: function test(event) { console.log(event); } and in HTML: Test As the another possibility, since you have to support IE8, you could go with registering event as a property by directly assigning onclick function: buttonObject.onclick = test; where buttonObject is a reference to button HTMLElement obtained with some DOM method (document.getElementById, document.querySelector, etc). Note, that in this case test function needs to use event fallback for window.event object (to make IE8 happy): function test(event) { event = event || window.event; console.log(event); } || operator makes sure event will be populated properly: in Firefox and IE9+ event argument will be available, and in IE<9 event parameter will be undefined and window.event will be used.
upvote count: 3
has comment: http://stackoverflow.com/comment/43292278
has comment: http://stackoverflow.com/comment/43292372

http://stackoverflow.com/a/27389576
answers question: http://stackoverflow.com/q/27389521
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43227103
has body: You can easily access the items by number as if it were a multi-dimensional array: var row = 2, // 3rd row - JS arrays are 0-indexed item = 3, // 4th item x = arrayAll[row][item]; alert(x); // "p"
has comment: http://stackoverflow.com/comment/43227158
accepted answer of: http://stackoverflow.com/q/27389521
upvote count: 1

http://stackoverflow.com/q/27396029
has comment: http://stackoverflow.com/comment/43238622
tagged with: cron
has answer: http://stackoverflow.com/a/27740439
has comment: http://stackoverflow.com/comment/43238533
has comment: http://stackoverflow.com/comment/43238543
tagged with: node.js
has comment: http://stackoverflow.com/comment/43239783
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27740439
has comment: http://stackoverflow.com/comment/43238707
type: Question
has comment: http://stackoverflow.com/comment/43240050
has comment: http://stackoverflow.com/comment/43240150
has body: Hello I would like to add a nodejs script to cronjob and I can't seem to get it working.. I am using shell to call the node script. I have tried making another nodejs script to test if its working, I mean if I had the paths wrong but that one is working. runScript #!/bin/sh echo `date +%s` &gt;&gt; /path/cron.log /usr/bin/node /path/main.js &gt;&gt; /path/cron.log runScript1 #!/bin/sh echo `date +%s` &gt;&gt; /path/cron.log /usr/bin/node /path/test.js &gt;&gt; /path/cron.log and in cron: 0 * * * * /path/runScript 0 * * * * /path/runScript1 So to recap I get both dates printed in the cron.log but only the test.js file runs after, the main.js is not running. When I tried to run manually like this ./runScript it worked.
has comment: http://stackoverflow.com/comment/43238513
tagged with: javascript
score: 0
tagged with: bash
has comment: http://stackoverflow.com/comment/43238551
has title: nodejs script not running in crontjob
answer count: 1
has comment: http://stackoverflow.com/comment/43239446
has comment: http://stackoverflow.com/comment/43239969

http://stackoverflow.com/comment/43113269
type: QuestionComment
type: Comment
has text: you need to persist the ones used in localStorage to work between reloads.
comment on: http://stackoverflow.com/q/27327122
score: 0

http://stackoverflow.com/q/27356644
has title: $(this) confusion within click event
has answer: http://stackoverflow.com/a/27356722
upvote count: 2
score: 0
downvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/27356740
has comment: http://stackoverflow.com/comment/43166033
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27356707
has comment: http://stackoverflow.com/comment/43165865
has comment: http://stackoverflow.com/comment/43165916
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: For some reason I have to use pure js with jquery. I have tags like this Click content and this is my js function openClose(){ $('.spoilertop').next('.spoilermain').toggle(); } The problem is if there is more than one spoilertop then all will be toggled. How to use $(this) in this case? I know I can select the a then use $(this) but for some reason I must fired the openClose().
linked to: http://stackoverflow.com/q/6071095
type: Question
has comment: http://stackoverflow.com/comment/43165867
has comment: http://stackoverflow.com/comment/43165860

http://stackoverflow.com/q/27373583
type: Question
has comment: http://stackoverflow.com/comment/43197786
answer count: 2
has title: How to disable button in javascript
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43197863
has answer: http://stackoverflow.com/a/27373758
tagged with: asp.net
score: -1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27373763
has body: Onclick of button,(In clientclick event)I show confrmation box having ok and cancel button.Onclick of ok button,buttonclick event fire.I want to disable button and show to message(Pls wait) to user.I am trying but not working.Unable to disable the button and set text to label. function validate() { var response = confirm(Proceed) if(response) { document.getElementById('btnSave').disabled = true; document.getElementById('lblMessage').innerText = 'Please Wait'; return true; } else { return false; } } I am getting error.Error is JavaScript runtime error: Unable to get property 'innerText' of undefined or null reference in asp.net
has comment: http://stackoverflow.com/comment/43197808
downvote count: 1

http://stackoverflow.com/a/54760196
has body: I have tried "^^ *$" and it worked for me.
answers question: http://stackoverflow.com/q/27443044
score: 0
type: Answer

http://stackoverflow.com/q/27374915
has title: Javascript - Returning values from checkboxes
tagged with: jquery
has answer: http://stackoverflow.com/a/27375073
score: 0
has answer: http://stackoverflow.com/a/27374976
accepted answer: http://stackoverflow.com/a/27374976
has body: I have some checkboxes which feature days of the week. I simply want to loop through, and display all those selected within an append. HTML &lt;div class="col-lg-8"&gt; &lt;input type="checkbox" value="Mon" class="dayname" name="days[]"&gt; M &lt;input type="checkbox" value="Tues" class="dayname" name="days[]"&gt; T &lt;input type="checkbox" value="Wed" class="dayname" name="days[]"&gt;W &lt;input type="checkbox" value="Thurs" class="dayname" name="days[]"&gt;T &lt;input type="checkbox" value="Fri" class="dayname" name="days[]"&gt;F &lt;input type="checkbox" value="Sat" class="dayname" name="days[]"&gt;S &lt;input type="checkbox" value="Sun" class="dayname" name="days[]"&gt;S &lt;/div&gt; Javascript $(".dayname").click(function() { alert( $(this).attr("name") ); $('.dayname').val(); });
answer count: 4
possible better answer: http://stackoverflow.com/a/27375032
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27375032
has answer: http://stackoverflow.com/a/27374995
tagged with: javascript

http://stackoverflow.com/q/27436545
has answer: http://stackoverflow.com/a/27436583
has answer: http://stackoverflow.com/a/27436574
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: How do I capture which button is clicked to change images in pure JavaScript?
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27436602
has body: I want to figure out which button is clicked in my function. The 'next' button is working fine but I do not want to make a different function for the 'previous' button just to decrease the imageIndex so the images can reverse. Beginner here. Constructive comments welcomed. JS: HTML: Next Previous

http://stackoverflow.com/comment/43150817
comment on: http://stackoverflow.com/q/27348048
type: Comment
score: 0
has text: `currentHour > 5 && currentHour < 6` will always be false. Same as `currentHour > 6 && currentHour < 7` and `currentHour > 13 && currentHour < 14`
type: QuestionComment

http://stackoverflow.com/comment/43165903
has text: this is not possible, because they are in different blocks
comment on: http://stackoverflow.com/q/27331993
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43223402
has text: Thanks @edgar-martinez , good question to help clear up for those needing to understand the Transform.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27387593
type: Comment

http://stackoverflow.com/comment/43175277
comment on: http://stackoverflow.com/q/27361489
has text: I don't know for sure but I work in this company as intern but i have DirectAdmin
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43204779
type: Comment
score: 2
has text: I also notice you do not have a closing tag.
type: QuestionComment
comment on: http://stackoverflow.com/q/27377668

http://stackoverflow.com/q/27393221
accepted answer: http://stackoverflow.com/a/27393271
type: AnsweredQuestion
score: 1
has title: How to exclude children of selected parent
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I want to create a HUD display on the bottom of my game. To the right of the HUD bar will be a nested minimap. When I hover over the HUD, it will increase opacity of the When I click on the minimap (child of HUD), it will expand a larger map. When I click on the HUD (parent element), it will apply the opacity rule with toggleClass(). I don't want this opacity rule to be applied when I click on the child minimap though, only when I click on the parent HUD. Right now it's being applied when I click on parent and child. See DEMO HTML &lt;div id="HUD"&gt; &lt;div id="map"&gt;&lt;/div&gt; &lt;/div&gt; JS $("#HUD").click(function(){ $(this).toggleClass("HUDactive"); }); CSS #HUD { position: absolute; overflow: hidden; height: 15%; bottom: 0px; width: 100%; border-top: thin solid darkgray; opacity: 0.3; background-color: black; transition: opacity .25s ease-in-out; -moz-transition: opacity .25s ease-in-out; -webkit-transition: opacity .25s ease-in-out; } #HUD:hover { border-top: thin solid snow; opacity: 0.8; } .HUDactive { opacity: 0.8 !important; } #map { color: red; font-size: 18px; font-family: "Trebuchet MS", Helvetica, sans-serif; background-color: gray; height: 100%; width: 15%; float:right; }
answer count: 2
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/27393271
possible better answer: http://stackoverflow.com/a/27393243
has answer: http://stackoverflow.com/a/27393243
tagged with: css

http://stackoverflow.com/comment/43324155
score: 1
comment on: http://stackoverflow.com/q/27442464
type: Comment
type: QuestionComment
has text: Load the image already when the document is being called. The blink you see if probably from loading the image. So if you "download" the image before it is shown it will not blink anymore :)

http://stackoverflow.com/comment/43329193
comment on: http://stackoverflow.com/q/27445114
score: 0
type: Comment
type: QuestionComment
has text: you can use css to do what you expect : http://www.w3schools.com/xml/xml_display.asp

http://stackoverflow.com/comment/43137451
type: QuestionComment
comment on: http://stackoverflow.com/q/27340447
type: Comment
has text: Yes I do http://217.17.237.165:85/HRM
score: 0

marker
tag name: marker
tags question: http://stackoverflow.com/q/27379655
type: Tag

http://stackoverflow.com/q/27346124
favorite count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27346321
upvote count: 1
has comment: http://stackoverflow.com/comment/43147393
type: Question
has body: I was looking at the polyfill of Function.prototype.bind method. if (!Function.prototype.bind) { Function.prototype.bind = function(oThis) { if (typeof this !== 'function') { // closest thing possible to the ECMAScript 5 // internal IsCallable function throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); } var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function() {}, fBound = function() { return fToBind.apply(this instanceof fNOP &amp;&amp; oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); }; fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; }; } Can anyone explain me why do we do this? If i am not invoking my fn with new operator, i see this steps as un-necessary. Why does the returned fn need to be a constructor if not invoked via new operator?. fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); return fBound; Can we do something like this below instead of creating a new constructor? fBound.prototype = Object.create(this.prototype); return fBound
has title: Why does Function.prototype.bind return a constructor?
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27434815
has comment: http://stackoverflow.com/comment/43310888
has comment: http://stackoverflow.com/comment/43334250
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27431618
has body: I would add an isSelected observable to the menu item and then toggle that when the menu item is clicked (using the click binding). Then you can use the css binding in the view which will use isSelected. As you can see when you are using knockout it's best to just interact with the view model instead of interacting with the dom as you would if you were using jQuery. var ViewModel = function () { var self = this; self.menuItems = [ new MenuItem('Text1'), new MenuItem('Text2'), new MenuItem('Text3'), new MenuItem('Text4') ]; self.toggleMenuItem = function (menuItem) { for (var i = 0; i &lt; self.menuItems.length; i++) { self.menuItems[i].isSelected(false); } menuItem.isSelected(true); }; }; var MenuItem = function (menuText) { var self = this; self.menuText = menuText; self.isSelected = ko.observable(false); }; &lt;ul id="menu" data-bind="foreach: menuItems"&gt; &lt;li&gt; &lt;a data-bind="text: menuText, click: $parent.toggleMenuItem, css: { active: isSelected }"&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; http://jsfiddle.net/d625vaad/1/
type: Answer
has comment: http://stackoverflow.com/comment/43310702
accepted answer of: http://stackoverflow.com/q/27431618
upvote count: 1

http://stackoverflow.com/q/27372671
has body: Hi I have tried below code to reset number of "adults" dropdown field on onclick of reset button but the dropdown field is not getting reset please suggest Code for adult dropdown : - {section name=adult loop=10 start=1 step=1} {$smarty.section.adult.index} </option {/section} Javascript code for reseting fields onclick of reset button : function reset_frm(){ $("#adults_pkg").val(''); //$("select[name='adults_pkg[0]']").val(''); }
has comment: http://stackoverflow.com/comment/43196299
has answer: http://stackoverflow.com/a/27372720
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/27372720
type: Question
tagged with: javascript
has title: How to reset dropdown field using javascript
has answer: http://stackoverflow.com/a/27372725
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27372711
accepted answer: http://stackoverflow.com/a/27372711
favorite count: 0
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/a/27323299
upvote count: 3
has body: Here's a contrieved sample showing how it can be different: var obj = {}; function anotherFn(fn){ obj["name"] = fn.apply(fn, []); } function anotherFn2(fn){ obj["name"] = fn(fn, []) } function google() { console.log(this.world); } google.world = "yay!" anotherFn(google); anotherFn2(google); The output is: yay! undefined jsFiddle: http://jsfiddle.net/c56ja3jL/ Depending on the context, this might be useful. The basic idea is that you always have this equal to the function itself, instead of the global context.
downvote count: 0
answers question: http://stackoverflow.com/q/27323168
type: Answer
score: 3

http://stackoverflow.com/comment/43119717
type: Comment
comment on: http://stackoverflow.com/q/27330789
score: 1
has text: far as i know you'd have to create a new shader. the wireframe shows all lines along the faces, and a quad is made of 2 faces, always resulting in a diagonal line. and i honestly wish i could help with that, but my GLSL is crappy at best.
type: QuestionComment

http://stackoverflow.com/comment/43268910
score: 1
has text: Use `split(':')` to split the value into a property name and value.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27412260

http://stackoverflow.com/comment/43302025
type: AnswerComment
comment on: http://stackoverflow.com/a/27430009
type: Comment
has text: i need to onClick give only the clicked link some kind of visited attribute so only that one changes color (and the color stays even when going back and forth through pages)
score: 0

http://stackoverflow.com/q/27319228
has comment: http://stackoverflow.com/comment/43097841
type: AnsweredQuestion
has title: Angular directive for simulating a mouseenter?
type: Question
tagged with: angularjs-directive
tagged with: javascript
has comment: http://stackoverflow.com/comment/43097783
score: 0
has comment: http://stackoverflow.com/comment/43097886
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43098236
has answer: http://stackoverflow.com/a/27320231
has body: Is there a directive for simulating a mouseenter event ? I've tried searching for one but all I've found is the directive which binds a function to the mouse over or karma tests for simulating mouse over. My use case is that I all ready have a event binded to mouse over but I'm looking for a directive in the form of simulate-mouse ="shouldBeMouseOver" such that when $scope.shouldBeMouseOver is true the element I place the directive on reacts as if it has mouseenter event.
accepted answer: http://stackoverflow.com/a/27320231
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43098135
has comment: http://stackoverflow.com/comment/43098030

http://stackoverflow.com/a/27336481
has body: Sure, you could use a function to reduce the repeated code: function checkAnswer(id, correctResponse) { var answer = document.getElementById(id).value.toLowerCase(); if(answer === correctResponse) { alert("Correct"); } else { alert("Incorrect"); } } checkAnswer("ans1", "hola"); checkAnswer("ans2", "llamas"); checkAnswer("ans3", "me"); You could also create an object associating the elements to the answers: var correctAnswers = { "ans1": "hola", "ans2": "llamas", "ans3": "me" }; for(var id in correctAnswers) { var answer = document.getElementById(id).value.toLowerCase(); if(answer === correctAnswers[id]) { alert("Correct"); } else { alert("Incorrect"); } }
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27336424
answers question: http://stackoverflow.com/q/27336424
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27393601
has answer: http://stackoverflow.com/a/27393702
accepted answer: http://stackoverflow.com/a/27393653
has answer: http://stackoverflow.com/a/27393698
has comment: http://stackoverflow.com/comment/43234337
has title: Counting occurrences of Javascript array indexes
has comment: http://stackoverflow.com/comment/43234360
possible better answer: http://stackoverflow.com/a/27394332
has comment: http://stackoverflow.com/comment/43234840
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27394332
has answer: http://stackoverflow.com/a/27393653
type: Question
score: 0
has answer: http://stackoverflow.com/a/27393738
has body: I have the following array. "APP-A": { "active": true }, "APP-B": { "active": true }, "APP-C": { "active": true }, "BOOL-A": { "active": true }, "BOOL-B": { "active": true }, "BOOL-C": { "active": true }, I need to get the total count of the APP-*'s in the array. Am trying to implement in angular JS. Solutions in plain JS will also be helpful. TIA
tagged with: arrays
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/27393673
has comment: http://stackoverflow.com/comment/43234477
tagged with: angularjs

http://stackoverflow.com/a/27340379
accepted answer of: http://stackoverflow.com/q/27340268
answers question: http://stackoverflow.com/q/27340268
score: 0
has body: First of all, you don't have to alias this to self to use instance properties. You can just write innerFunc like so: innerFunc: function(){ console.log("name "+this.name); }, You've probably seeing var self = this in other code examples, and it is a common way to get around the fact that this changes as you descend into function scopes. It's not a technique I care for...it's usually more clear to use a meaningful variable name. In your case, however, it's not necessary to alias this to self at all. To answer your second question, it's important to understand the difference between function definition and function invocation. When you define a function, it is not being executed -- no matter where it's defined. Consider the following example: function f() { console.log('f'); } var o = { m: function() { console.log('m'); } } In that example, there are two function definitions, but no function invocations. In other words, if you run this script, the function f will exist, and the method o.m will exist, but neither will have been executed, so there will be nothing printed on the command line. In general, if you see the keyword function, you're dealing with a function definition, not an invocation. The following code now invokes both of these functions in turn: f(); o.m(); In this case, the two calls to console.log will happen. In your example, you're defining the property outerFunc by invoking the function abc (which I suspect is not what you want to do). How do I know you're invoking it? Because there are parentheses and no function keyword: var module = { //... outterFunc: abc("run from module") } What's happening here is abc is getting invoked and its return value is getting assigned to outerFunc. Since abc returns nothing, outerFunc will get the value undefined. Which is why I'm guessing that is not what you want. If you want m.outerFunc to be an alias of abc, you would do that this way: var module = { //... outerFunc: abc } Note there are no parentheses...so abc is …
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27434771
has answer: http://stackoverflow.com/a/27434810
score: 0
accepted answer: http://stackoverflow.com/a/27434797
answer count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/27434797
has comment: http://stackoverflow.com/comment/43310456
upvote count: 1
possible better answer: http://stackoverflow.com/a/27434810
has answer: http://stackoverflow.com/a/27434834
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43310442
tagged with: if-statement
has title: Changing multiple variables with if-statement
downvote count: 1
type: Question
has body: I just started learning Javascript. For a beginners project I'm making a quiz-guide to find out which South Park character you are. But I have some problems making it work. Here are some pieces of my code: In my HTML-document the code looks like this: What kind of food do you like to eat? Pizza Chips and snacks Health foods Kosher Powdered donut pancake surprise Anything, as long as it's cheap In my script-document I begin by creating my variables and use if-statements to change them, like this: function start(){ if(document.characterform.radio11.checked) cartman += 5; kyle += 5; stan += 5; kenny += 5; butters += 5; Finally I use if-statements to get a result: if(cartman > kyle && cartman > stan && cartman > kenny && cartman > butters) alert("Cartman! " + "\n" + cartman + "\n" + kyle + "\n" + stan + "\n" + kenny + "\n" + butters); else if(kyle > cartman && kyle > stan && kyle > kenny && kyle > butters) alert("Kyle! " + "\n" + cartman + "\n" + kyle + "\n" + stan + "\n" + kenny + "\n" + butters); else if(stan > cartman && stan > kyle && stan > kenny && stan > butters) alert("Stan! " + "\n" + cartman + "\n" + kyle + "\n" + stan + "\n" + kenny + "\n" + butters); else if(kenny > cartman && kenny > stan && kenny > kyle && kenny > butters) alert("Kenny! " + "\n" + cartman + "\n" + kyle + "\n" + stan + "\n" + kenny + "\n" + butters); else alert("Error"); I've done this with all my radio-buttons. The problem is that no matter which radio button is selected, the result is always the same: kyle. In fact, when looking at the print-out of the numbers it seems that Cartman is the only variable that changes. The other four variales are exactly the same, no matter what, with kyle getting the most points. All of the script-code is in the start() function, except the creating of the variables. I've searched alot for an answer, but I haven't found anyone with the same problem - so I'm guessing there's an easy solution to my problem. I hope someone here can help me understand this.
tagged with: javascript

http://stackoverflow.com/q/27415712
tagged with: express
tagged with: mongodb
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27416158
has title: Express.js collection.find() return Object
tagged with: node.js
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43275364
type: Question
has body: I am wanted to display every documents stored in my mongodb. I tried following code which simply get collection.find() and display through res.send() router.get('/index', function(req,res){ var db = req.db var collection = db.get('usercollection') var display = util.inspect(collection.find())); res.send(display); }); I expected it to display the actual document stored in mongodb. But instead, it displayed this object format: {cold:{manager:{driver:[Object], helper:[Object], collection:[Object]..... Is there any other steps needed to display raw mongodb document?
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript

http://stackoverflow.com/a/27328143
downvote count: 0
type: Answer
has body: You're using a degenerate polygon for testing. If you draw it in the xz-plane, with the vertices numbered from 0 to 3, it looks like this: 2 ---- 3 \ / \ / \/ /\ / \ / \ 0 ---- 1 This polygon does not have a well defined normal, since it changes orientation in the middle, and folds over itself. If you swap the last two vertices: p = [[0, 0, 0] [1, 0, 0] [1, 0, 1] [0, 0, 1]] It will look like this, and you should get much more meaningful results: 3 ---- 2 | | | | | | 0 ---- 1
answers question: http://stackoverflow.com/q/27326636
score: 5
accepted answer of: http://stackoverflow.com/q/27326636
upvote count: 5
type: AcceptedAnswer

http://stackoverflow.com/a/48388878
answers question: http://stackoverflow.com/q/27321672
has body: A more modern rewrite of @roman-bekkiev's answer: Object.keys(window).forEach(key =&gt; { if (/^on/.test(key)) { window.addEventListener(key.slice(2), event =&gt; { console.log(event); }); } }); Here is an example to further customize event filtering: /^on(key|mouse)/.test(key)
has comment: http://stackoverflow.com/comment/135186285
score: 104
upvote count: 105
has comment: http://stackoverflow.com/comment/105674745
type: Answer
has comment: http://stackoverflow.com/comment/131343949
has comment: http://stackoverflow.com/comment/103432177
has comment: http://stackoverflow.com/comment/131766404
has comment: http://stackoverflow.com/comment/139702605
downvote count: 1

http://stackoverflow.com/a/27369125
has body: The device was indeed lost due to an unexpected timeout internal to the device firmware. Please disregard.
answers question: http://stackoverflow.com/q/27368384
accepted answer of: http://stackoverflow.com/q/27368384
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/43151086
has text: Iam afraid thats not possible . Fiddle cannot imitate most of functions and simple execution seems to work on simple html like above .
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27347549
type: AnswerComment

http://stackoverflow.com/comment/43216924
comment on: http://stackoverflow.com/q/27384153
score: 0
has text: Do you mean the [0] ?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43231045
comment on: http://stackoverflow.com/a/27391632
type: AnswerComment
has text: @Stephane It doesn't for me.
type: Comment
score: 0

http://stackoverflow.com/comment/43232029
type: QuestionComment
type: Comment
score: 1
has text: no, you can't stall the return, but you can move the action needing the data into the callback.
comment on: http://stackoverflow.com/q/27392079

http://stackoverflow.com/comment/43275088
type: Comment
type: QuestionComment
score: 1
has text: Also, looking at your question again, is the purpose of this image to serve as a placeholder for the video? HTML5 gives [` `](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) a `poster` attribute.
comment on: http://stackoverflow.com/q/27415536

http://stackoverflow.com/q/27416932
has comment: http://stackoverflow.com/comment/43282028
tagged with: css
has answer: http://stackoverflow.com/a/27419601
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43278198
has comment: http://stackoverflow.com/comment/43278566
has comment: http://stackoverflow.com/comment/43287400
type: Question
linked to: http://stackoverflow.com/q/15659390
has answer: http://stackoverflow.com/a/27417354
possible better answer: http://stackoverflow.com/a/27417224
accepted answer: http://stackoverflow.com/a/27419601
tagged with: javascript
tagged with: ckeditor
has body: I'm developing a flask application and i'm trying to change the content inside of my textarea(see textarea tag below). I'm using an opensource web text editor called ckeditor. My issue is that when I try to style the stuff found in the p tag using the id name "name1" it won't actually style it. However when I use the just use p tag itself it works fine. I'm new at developing web applications and any help would be appreciated! Thanks Here is a snippet of the code: HTML: &lt;body&gt; &lt;form&gt; &lt;textarea name="editor1" id="editor1" rows="20" cols="70"&gt; &lt;p id = "name1"&gt; [Your Name]&lt;p&gt; &lt;/textarea&gt; &lt;script&gt; CKEDITOR.replace('editor1'); CKEDITOR.config.contentsCss = '../static/startpage.css'; &lt;/script&gt; &lt;/form&gt; &lt;/body&gt; CSS: #name1{ font-family: 'Raleway', sans-serif; font-weight: lighter; font-size: 18px; padding-left: 20px; } Here is the snippet of CSS code that works but is not what I want: p{ font-family: 'Raleway', sans-serif; font-weight: lighter; font-size: 18px; padding-left: 20px; }
has answer: http://stackoverflow.com/a/27417224
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43284292
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/15753956
has comment: http://stackoverflow.com/comment/43278090
has title: CSS not recognizing id or name

http://stackoverflow.com/comment/43352302
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27457349
type: QuestionComment
has text: it's not clear where you alert the response text

http://stackoverflow.com/q/27358592
type: UnansweredQuestion
has title: Listening websocket in MVC
tagged with: asp.net-mvc-4
has body: I'm using MVC 4. I have a js code that needs to communicate with the server with the help of Websockets. I'm using Fleck at the server. I'm creating the socket server in Application_Start event. But when I try the connection from browser console, I get errors like Connection refused. Here is my global.asax code. protected void Application_Start() { IPAddress ip = null; if (GetResolvedConnecionIPAddress(out ip)) // Get host ip { string Domain = "wss" + System.Uri.SchemeDelimiter + ip + ":" + "8092"; FleckLog.Level = Fleck.LogLevel.Debug; try { if (GetResolvedConnecionIPAddress(out ip)) { var server = new WebSocketServer(Domain); server.Start(socket =&gt; { LogWriter.Logger.Info("WS: Inside socket server"); socket.OnOpen = () =&gt; { LogWriter.Logger.Info("WS: OnOpen socket"); }; socket.OnClose = () =&gt; { LogWriter.Logger.Info("WS: OnClose socket"); }; socket.OnMessage = message =&gt; { LogWriter.Logger.Info("WS: OnMsg socket"); }; }); } } catch (Exception e) { throw; } } }
score: 0
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/27358949
tagged with: asp.net-mvc
tagged with: javascript
answer count: 1
tagged with: websocket

http://stackoverflow.com/a/27414931
answers question: http://stackoverflow.com/q/27414704
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43274914
accepted answer of: http://stackoverflow.com/q/27414704
has body: window.alert(this) will take the current value of this and pass it as an argument to the alert() function. What the current value of this is depends entirely upon the context that window.alert(this) is inside of. It may be window or it may point to some other object. We'd have to see the containing code to know for sure. For example, if you did this: var x = { callme: function() { alert(this); // alerts the x object } }; x.callme(); Then, the alert would show the x object because that's the value of this inside of the callme() function when called via x.callme(). In strict mode in a normal function call, this will be undefined. So, it very much depends upon the context: function hello() { "use strict"; alert(this); // alerts undefined } hello(); Or, not in strict mode: function hello() { alert(this); // alerts the window object (in a browser) } hello();

http://stackoverflow.com/comment/43161025
type: Comment
comment on: http://stackoverflow.com/a/27322141
score: 0
type: AnswerComment
has text: sorry,i am unable to understand your problem, do you mean is it the form in dialog box may cause problem?

http://stackoverflow.com/comment/43164927
comment on: http://stackoverflow.com/a/27355883
type: AnswerComment
score: 0
type: Comment
has text: I'd suggest you open a new question detailing the full process you go through, including JSON calls etc. I'd say this question has been covered now.

http://stackoverflow.com/a/27382548
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27381593
has comment: http://stackoverflow.com/comment/43217196
has body: To achive this you don't really need to use $rootScope(but you can), $broadcast will call watchers for event in current and all child scopes, so this code in parent controller: $scope.setData = function() { $timeout(function() { $scope.$broadcast("onSomething", ""); }, 5000); }; will trigger all $scope.$on('onSomething', ..) callback in current and all child controllers. here's a codepin with working example(text 'event received' will appear after 5s in rendered html). http://codepen.io/anon/pen/VYeEOg

http://stackoverflow.com/q/27443860
has comment: http://stackoverflow.com/comment/43326863
type: Question
possible better answer: http://stackoverflow.com/a/27443926
tagged with: javascript
tagged with: jquery
has title: Function only runs once
has comment: http://stackoverflow.com/comment/43326845
score: 0
has answer: http://stackoverflow.com/a/27444045
answer count: 3
has answer: http://stackoverflow.com/a/27444144
has comment: http://stackoverflow.com/comment/43327095
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43326752
accepted answer: http://stackoverflow.com/a/27444045
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43326934
has answer: http://stackoverflow.com/a/27443926
has comment: http://stackoverflow.com/comment/43327017
has body: I made this little jQuery function to make my navigation slide out on mobile devices. My only problem though... I can only show and hide it once... Can anyone help me out with this? Thanks in advance! $('#menu-btn').click(function(){ if ($('nav ul').css('margin') == '83px 0px 0px -225px') { $('nav ul').animate({ margin:'83px 0px 0px 0px' }, 200); } else { $('nav ul').animate({ margin:'83px 0px 0px -255px' }, 200); } });

breeze
tags question: http://stackoverflow.com/q/27415187
tags question: http://stackoverflow.com/q/27372326
tags question: http://stackoverflow.com/q/27338212
type: Tag
tags question: http://stackoverflow.com/q/27389639
tags question: http://stackoverflow.com/q/27372764
tag name: breeze

http://stackoverflow.com/a/27350932
answers question: http://stackoverflow.com/q/27350405
type: Answer
has body: As plain strings, the getHolidays function can be: // Get holidays between two dates function getHolidays(startDate, endDate) { var output = []; var i = 0; var holiday; while ((holiday = holidays[i++]) &amp;&amp; holiday &lt; endDate) { if (startDate &lt;= holiday) { output.push(holiday) } } return output; } If you are using ISO 8601 date strings, there's no need to convert them to Date objects. One of the reasons for the ISO format is that in most systems, you can compare strings directly rather than Date objects or some number value. You can also parse the strings to Date objects, then use those to do the calculations but it takes more code for no real benefit: // Parse date string in y-m-d format function parseYMD(s) { var b = s.split(/\D/); var d = new Date(); d.setHours(0,0,0,0); d.setFullYear(b[0], --b[1], b[2]); return d.getFullYear() == b[0] &amp;&amp; d.getDate() == b[2]? d : NaN; } // Holiday array var holidays = ['2014-01-01','2014-07-04','2014-12-24', '2014-12-25']; // Get holidays between two dates function getHolidays(startDate, endDate) { startDate = parseYMD(startDate); endDate = parseYMD(endDate); var output = []; var i = 0; var holiday; for (var i=0, iLen=holidays.length; i&lt;iLen; i++) { holiday = parseYMD(holidays[i]); if (holiday &lt;= endDate) { if (holiday &gt;= startDate) { output.push(holidays[i]); } } } return output; } console.log(getHolidays('2014-08-01', '2014-12-30')); // ["2014-12-24", "2014-12-25"]
score: 0

http://stackoverflow.com/comment/43340648
score: 0
type: Comment
has text: Use a JavaScript obfuscator then. It won't stop anyone who's determined, but it might make it a bit more annoying.
type: AnswerComment
comment on: http://stackoverflow.com/a/27418038

http://stackoverflow.com/comment/75475007
comment on: http://stackoverflow.com/a/27444025
score: 0
type: AnswerComment
has text: @James Fixed it. Thanks.
type: Comment

http://stackoverflow.com/a/27473773
answers question: http://stackoverflow.com/q/27471952
has comment: http://stackoverflow.com/comment/43446364
score: 0
has body: You can set the icon app in your ActionBar from your manifest file. See these lines &lt;application android:allowBackup="true" android:icon="@drawable/icona" android:label="@string/app_name" android:theme="@style/Theme.AppCompat.Light.DarkActionBar" &gt; So @drawable/icona means that you have an icon which called "icona" in your drawable folders. res/drawable-ldpi, res/drawable-mdpi ... So add your icona.png file in folders above. p.s I don't know what you mean when you said "the icon is an arrow" but i can imagine that you mean the up icon button. So this is not your app icon, your app icon located to the folders above. You can see more about the arrow in android Api here. I hope to help you!
type: Answer

http://stackoverflow.com/comment/43256018
comment on: http://stackoverflow.com/a/27357361
score: 0
type: AnswerComment
has text: but the interval is not same, I'd like to make the interval of x axis value keep same like this: 201111----201112----201301 , is it possible by using HighCharts?
type: Comment

http://stackoverflow.com/q/27317744
has comment: http://stackoverflow.com/comment/43097899
has comment: http://stackoverflow.com/comment/43098594
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43095741
score: -1
has comment: http://stackoverflow.com/comment/43095119
type: Question
has comment: http://stackoverflow.com/comment/43095136
has body: I have a long running method in Node.js that keeps listening for command line output until the user closes the command or an error halts. Long story short, this method had, among others, three callbacks: on_receive: Returns any new output from the command line to the callback, either as string or a converted json. on_end: When the execution is terminated by the user, I send this. on_error: When the command line prompts an error, I send it to the user. It always means the end of the command line execution, so on_end is called afterwards (though it could be called before if needed). After any time the command is called, I keep the spawned child referenced, so I can kill it later or limit the amount. Now, I was planning to move to promises (I'm using the library from Kris Kowal, q, but the three legs of the promise are not exactly how my callbacks are (taken from his wiki): resolve: Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. reject: Calling reject with a reason causes promise to be rejected with that reason. notify: Calling notify with a value causes promise to be notified of progress with that value. That is, any onProgress handlers registered with promise or promises derived from promise will be called with the progress value. It would make sense to tie on_error to reject and maybe on_end to resolve (although this may also come from an error), but the most important command to track in this case, on_receive, is not actually related to a "progress", as the wiki states. This code I'm doing is a node package for public use, so I don't know if using notify in this way would be actually confusing to other developers.
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43097937
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
accepted answer: http://stackoverflow.com/a/27319959
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/43112226
has answer: http://stackoverflow.com/a/27319959
upvote count: 0
has comment: http://stackoverflow.com/comment/43095206
has title: Is changing the meaning of promise methods a good idea?
tagged with: nomenclature

http://stackoverflow.com/comment/43114729
has text: No, I want to fetch Jquery, not js. getScript is a jquery function, and it cant work when you havent include the jQuery Library
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27327929

http://stackoverflow.com/q/27425990
has body: I have made a simple game and it's almost done, the only thing I have left is to make the game restart when I press Enter. Now the game starts when I press Enter but it doesn't restart. Can someone help me please? this is the code that starts the game document.onkeydown = function tast (e) { if (e.keyCode == 39) { // høyre høyre = 1; } if (e.keyCode == 37) { // venstre venstre = 1; } if (e.keyCode == 38) { // opp opp = 1; } if (e.keyCode == 40) { // ned ned = 1; } if(e.keyCode == 32) { newskudd(); snd.play(); console.log("hit space") } if(e.keyCode == 13){ spill(); } } to see a demo click the link DEMO the spill(); function is function spill() { ctx.clearRect(0, 0, canvas.width, canvas.height); for (var i = 0; i &lt; kuler.length; i++) { kuler[i].x += 0; kuler[i].y += kuler[i].dy; ctx.fillStyle = kuler[i].f; ctx.beginPath(); ctx.arc(kuler[i].x, kuler[i].y, kuler[i].r, 2*Math.PI, 0); ctx.closePath(); ctx.fill(); if (venstre == 1){ kuler[0].x -= 4; } if (høyre == 1){ kuler[0].x += 4;; } if (opp == 1){ kuler[0].y -= 4; } if (ned == 1){ kuler[0].y += 4; } if (kuler[0].x &gt;= canvas.width-kuler[0].r) { kuler[0].x = canvas.width-kuler[0].r }; if (kuler[0].x &lt;= 0+kuler[0].r) { kuler[0].x = 0+kuler[0].r }; if (kuler[0].y &gt;= canvas.height-kuler[0].r) { kuler[0].y = canvas.height-kuler[0].r }; if (kuler[0].y &lt;= 0+kuler[0].r) { kuler[0].y = 0+kuler[0].r }; for (var j = 0; j &lt; fiender.length; j++) { ctx.fillStyle = "blue"; ctx.beginPath(); ctx.arc(fiender[j].x, fiender[j].y, fiender[j].r, 2*Math.PI, 0); ctx.closePath(); ctx.fill(); fiender[j].y += fiender[j].vy; if (fiender[j].x &gt;= canvas.width -fiender[j].r) { fiender[j].x =canvas.width - fiender[j].r; }; if (fiender[j].x &lt;= 0 + fiender[j].r) { fiender[j].x =0 + fiender[j].r; }; if (fiender[j].vy &gt;= 2) { fiender[j].vy = 2; }; /*if (fiender[j].y + fiender[j].r &gt;= kuler[i].y &amp;&amp; fiender[j].x + fiender[j]. == kuler[i].x) { // remove kuler[i] and fiender[j] } fiender.splice(j, 1); kuler.splice(i,1);…
favorite count: 0
has title: How can I restart my game when I press ENTER?
has comment: http://stackoverflow.com/comment/43294810
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43296944
has comment: http://stackoverflow.com/comment/43296099
has comment: http://stackoverflow.com/comment/43296709
downvote count: 0
score: 1
tagged with: reload
tagged with: onkeypress
type: Question
has comment: http://stackoverflow.com/comment/43294779
has comment: http://stackoverflow.com/comment/43294007
tagged with: javascript
has answer: http://stackoverflow.com/a/27428090
linked to: http://stackoverflow.com/q/10735922
tagged with: keypress
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/43195439
type: Comment
comment on: http://stackoverflow.com/q/27371726
has text: I'm thinking this: http://www.autohotkey.com/board/topic/85281-help-with-ahk-l-and-the-dom/
score: 0
type: QuestionComment

http://stackoverflow.com/comment/52354038
has text: I think the simplest answer here is for OP to report the issue to the site owner. It's a bug!
type: AnswerComment
comment on: http://stackoverflow.com/a/31193724
score: 0
type: Comment

http://stackoverflow.com/a/27418253
has body: You cannot write directly on a file located on the server from the client. As willwin.w said, your data regData should be transmitted with the request. But you will have to direct your ajax request toward a server side script like PHP, ASP, etc. This script will then have to get the data passed in the ajax request and write them in a file or a database.
downvote count: 0
answers question: http://stackoverflow.com/q/27417705
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/43292425
has text: Sure thing. That is a pretty cool tutorial, I think I'm going to lose a few hours to messing around with it :)
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27425118

http://stackoverflow.com/q/27360712
score: 0
tagged with: firebug
answer count: 1
has body: I'm having a JavaScript debugging question. I would like to know, how it would be possible to find out in which file/line a new script is loaded and called. My website has several scripts which are appended via document.write(), and I would like to find a way to find the function call in all attached scripts of the website. I would prefer either Firebug or Chrome Dev tools. Thanks!
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1197575
tagged with: call
has answer: http://stackoverflow.com/a/27973733
type: Question
tagged with: debugging
has title: Check where/which line or document a script gets called
tagged with: google-chrome-devtools
tagged with: javascript

http://stackoverflow.com/q/27332555
tagged with: network-programming
tagged with: javascript
tagged with: express
possible better answer: http://stackoverflow.com/a/27332651
score: 0
has title: How to load source files from Express server for use in HTML file
has answer: http://stackoverflow.com/a/27332657
accepted answer: http://stackoverflow.com/a/27332657
has answer: http://stackoverflow.com/a/27332651
tagged with: node.js
type: AnsweredQuestion
type: Question
has body: So I have recently started learning Node.js using Express and Socket.io, and am making a web app (a game.) I have a /public folder that I am trying to use to serve the files the client will need from. I'm used to defining what source files my page will need by doing it in the index.html file, using multiple &lt;script src=whateverpath&gt;&lt;/script&gt;'s. How can I make the index.html get the source files it needs from the server? I think what I am trying to do is to send the required files to the client, then 'store' them somehow and access them from the index.html using &lt;script src=path to wherever they are stored&gt;&lt;/script&gt;. I don't feel the Express documentation explains stuff well enough for a beginner to understand. Not really sure what I am meant to be asking for or looking for. I don't know what I don't know. =(
answer count: 2

http://stackoverflow.com/comment/43261058
type: Comment
has text: Sorry for the late reply. Yes, i'm using the JQuery Datepicker widget.
type: QuestionComment
comment on: http://stackoverflow.com/q/27389336
score: 0

http://stackoverflow.com/comment/43231478
score: 2
comment on: http://stackoverflow.com/q/27384494
type: QuestionComment
type: Comment
has text: http://kangax.github.io/compat-table/es6/#for..of_loops

http://stackoverflow.com/a/27661144
score: 0
has body: If you are using Chrome or Firefox you can wrap ceratin operations in console.time to see which one is causing trouble. I would recommend: if (this.boxCollision(BBhead, BBfood)) { console.time('Moving food'); this.moveFood(this.canvHeight, this.canvWidth); console.timeEnd('Moving food'); console.time('Increasing score'); this.score += 10; console.timeEnd('Increasing score'); console.time('Updating score display'); document.getElementById("snake-score-div").innerHTML = this.score.toString(); console.timeEnd('Updating score display'); addLink = true; } if (addLink) { console.time('Body clone'); this.body.push(this.body[this.body.length - 1].clone()); console.timeEnd('Body clone'); } Then check out your console and watch the numbers.
type: Answer
answers question: http://stackoverflow.com/q/27465133

http://stackoverflow.com/a/27360871
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27360778
score: 1
answers question: http://stackoverflow.com/q/27360778
has body: You're double-encoding the JSON in the sub-dicts. You should serialize to Python dicts first, then dump the whole lot to JSON only at the end: data=serialize("python", vm_obj) data2=serialize("python", user_networks_list) data_dict["vm"] = vm_obj data_dict["nt"] = user_networks_list json = simplejson.dumps({'vm': data, 'nt': data2})
type: AcceptedAnswer

http://stackoverflow.com/comment/43262476
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27409076
has text: No I want to parse it on the PHP side to do server side work with the data.
score: 0

http://stackoverflow.com/q/27319807
type: AnsweredQuestion
tagged with: mean
has answer: http://stackoverflow.com/a/32063946
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/43100770
tagged with: templates
score: 0
accepted answer: http://stackoverflow.com/a/32063946
has comment: http://stackoverflow.com/comment/43100009
answer count: 1
has title: MEAN stack templates with grunt-angular-templates
has body: I'd like to reduce the load time in my MEAN project. So I would like to "minify" my Angular views, with the help of grunt-angular-templates. It generates successfully a "templates.js", with all my templates : angular.module('core').run(['$templateCache', function($templateCache) { // My templates here }]); So I want all my views loaded in one time with this file. I'm using "$stateProvider" to configure my routes. The problem is that I don't know where to put my templates, and how to tell $stateProvider the templates instead of the views. Thank you
tagged with: javascript
has comment: http://stackoverflow.com/comment/43100521

http://stackoverflow.com/comment/43304562
type: Comment
type: QuestionComment
has text: I did, sorry, I forgot the rest of the click function.
comment on: http://stackoverflow.com/q/27431572
score: 0

http://stackoverflow.com/comment/43331915
type: Comment
has text: I was trying to manipulate any variable from the DOM if the variable contained some html code (not into the .html / .php). But I discovered something that I didn't know before and - I think so - that obscured my brain. The .html() method doesn't return the outterHtml ! And this point was the key of my problem.
comment on: http://stackoverflow.com/a/27440068
score: 0
type: AnswerComment

http://stackoverflow.com/q/27374283
possible better answer: http://stackoverflow.com/a/27374661
has answer: http://stackoverflow.com/a/27374349
tagged with: regex
has body: We want to check if a URL matches mail.google.com or mail.yahoo.com (also a subdomain of them is accepted) but not a URL which contains this string after a question mark. We also want the strings "mail.google.com" and "mail.yahoo.com" to come before the third slash of the URL, for example https://mail.google.com/ is accepted, https://www.facebook.com/mail.google.com/ is not accepted, and https://www.facebook.com/?mail=https://mail.google.com/ is also not accepted. https://mail.google.com.au/ is also not accepted. Is it possible to do it with regular expressions? var possibleURLs = /^[^\?]*(mail\.google\.com|mail\.yahoo\.com)\//gi; var url; // assign a value to var url. if (url.match(possibleURLs) !== null) { // Do something... } Currently this will match both https://mail.google.com/ and https://www.facebook.com/mail.google.com/ , but we don't want to match https://www.facebook.com/mail.google.com/. Edit: I want to match any protocol (any string which doesn't contain "?" and "/") followed by a slash "/" twice (the string and the slash can both be twice), then any string which doesn't contain "?" and "/" (if it's not empty, it must end with a dot "."), and then (mail\.google\.com|mail\.yahoo\.com)\/. Case insensitive.
answer count: 4
type: AnsweredQuestion
has title: How do I match URLs with regular expressions?
has answer: http://stackoverflow.com/a/27374661
type: Question
has answer: http://stackoverflow.com/a/27374499
accepted answer: http://stackoverflow.com/a/27376670
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27376670

http://stackoverflow.com/comment/43174098
has text: your error is not in this php code, but when you get the response from ajax, please update you post by adding the part of loading page, in your javascript.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27360858

http://stackoverflow.com/q/27407829
upvote count: 1
linked to: http://stackoverflow.com/q/23679236
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 0
score: 1
has body: I ran into an error on IE with giving url as an example: http://example.com.br_ç When I put this url in the href property and try to access it using javascript, IE throws an "Not specified error". var link = document.getElementById('link'); console.log(link.href); test Firefox writes the correct url and Chrome writes the url enconded. I searched about it and I reached the IDN (International Domain Name), but nothing that leads to the error or if it's an IE bug. Does anyone have an idea?
duplicate of: http://stackoverflow.com/q/23679236
type: Question
tagged with: internet-explorer
tagged with: javascript
has title: Error when getting "href" value from link on IE

http://stackoverflow.com/comment/43353331
comment on: http://stackoverflow.com/q/27454718
score: 0
type: Comment
type: QuestionComment
has text: I'm using Laravel, and I will have a look at Smarty as well, thanks for the suggestion

http://stackoverflow.com/a/27393374
has comment: http://stackoverflow.com/comment/43234054
upvote count: 2
has comment: http://stackoverflow.com/comment/43234017
has body: From .closest() docs,For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree but in your case .fa is not ancestors of $('#name'). Instead of $(this).prev().closest(".fa").addClass("err"); Try elem.prev().children(".fa").addClass("err"); Working Demo
has comment: http://stackoverflow.com/comment/43233943
has comment: http://stackoverflow.com/comment/43234071
answers question: http://stackoverflow.com/q/27393358
accepted answer of: http://stackoverflow.com/q/27393358
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43234065
has comment: http://stackoverflow.com/comment/43234035
type: Answer
has comment: http://stackoverflow.com/comment/43234021

http://stackoverflow.com/a/27489684
accepted answer of: http://stackoverflow.com/q/27338259
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43412605
answers question: http://stackoverflow.com/q/27338259
type: Answer
has comment: http://stackoverflow.com/comment/43458089
score: 2
has body: It looks like your problem was caused by your div tags not being terminated correctly. I changed them to: (Notice the forward slash in the tag terminator.) hi hello This complete example works for me in Chrome: hi hello
upvote count: 2

http://stackoverflow.com/q/27441736
possible better answer: http://stackoverflow.com/a/27442079
type: AnsweredQuestion
has title: Catch the value input field with Javascript and put it in destination URL
type: Question
tagged with: javascript
score: 0
answer count: 2
has body: My website is almost ready but i still have to integrate something for the search-functionallity. The search-page is working good and has this URL: www.mywebsite.be/search/node/ Ofcourse there should be also the search-term in the url, something like this: www.mywebsite.be/search/node/search-term And that is my problem/question... Adding the search-term to the destination url... &lt;!-- START Search form--&gt; &lt;?php $searchterm = 'parket'; ?&gt; &lt;form action='/search/node/&lt;?php print $searchterm; ?&gt;' method='POST' role="search" class="navbar-form"&gt; &lt;div class="form-group has-feedback"&gt; &lt;input name="searchtest" type="text" placeholder="Schrijf hier" class="form-control"&gt; &lt;div data-toggle="navbar-search-dismiss" class="fa fa-times form-control-feedback"&gt;&lt;/div&gt; &lt;/div&gt; &lt;input type="submit" class="hidden btn btn-default"&gt;&lt;/button&gt; &lt;/form&gt; &lt;!-- END Search form--&gt; As you can see, i put in the search-term hard coded in with PHP... Like this the search-form works... So the only thing left to do is, catch the search-term that the visitor puts in and put this in the destination url... You can see a not working example of this code here: www.woodtex.be The visitors clicks the search icon and the input-field is appaering.. The visitor types in his search-term The visitor hits ENTER (no search-button!) And then the search term should be catched and put in the detsination-url I think this can be done with javascript, but i'm not in ninja JS man :( So any tips/code/links are welcome.
has answer: http://stackoverflow.com/a/27442002
has answer: http://stackoverflow.com/a/27442079
accepted answer: http://stackoverflow.com/a/27442002

http://stackoverflow.com/comment/43173611
has text: In what way is it "breaking the syntax"?
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27360429

http://stackoverflow.com/comment/43258253
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27406682
has text: that s true also not fair to angular to compare it with a simple example. when you have more complex data and structure you will see.
score: 0

http://stackoverflow.com/comment/43372162
score: 0
comment on: http://stackoverflow.com/q/27468070
type: Comment
type: QuestionComment
has text: So that means we can never use cordova on those devices?

http://stackoverflow.com/q/27372161
has comment: http://stackoverflow.com/comment/43200218
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43197869
has body: I have the following code, which works great, but I am relatively new to JavaScript(and jQuery) and I can't figure out how to only allow entries that are in the data source. It currently lets you chose from the data source AND type in anything you want. jQuery UI Autocomplete - Multiple values Tag programming languages:
type: Question
has comment: http://stackoverflow.com/comment/43198006
score: 0
has answer: http://stackoverflow.com/a/27372603
has answer: http://stackoverflow.com/a/27372643
has title: How do I modify this JavaScript to limit the entries to items in the data source?
answer count: 2
tagged with: jquery-ui

http://stackoverflow.com/a/28096097
has body: Use manual boostrapping as an alternative: /* Create script element */ var script = document.createElement('script'); /* Set src */ script.src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.1/angular.min.js"; /* Append to head */ document.getElementsByTagName("head")[0].appendChild(script); function dothis() { //template string var html = "&lt;div class=\u0022my-form\u0022&gt;{{$hello}}&lt;/div&gt;"; //template object var template = angular.element(html); //template transformer var compiler = angular.injector(["ng"]).get("$compile"); //template result var linker = compiler(template); //scope object var scope = angular.injector(["ng"]).get("$rootScope"); //scope assignment scope.hello = "hello world"; //scope binding var result = linker(scope)[0]; /* Append result to body */ document.body.appendChild(result); /* Render */ angular.bootstrap(document, ['ng']); } script.onload = dothis;
score: 1
accepted answer of: http://stackoverflow.com/q/27320907
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27320907
type: Answer
upvote count: 1

http://stackoverflow.com/a/27465447
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27465159
answers question: http://stackoverflow.com/q/27465159
type: AcceptedAnswer
downvote count: 0
has body: You probably just want to use $routeParams like so: here's a Plunker route .when("/article/:articleId", { . . Link &lt;a href="#/article/{{$index}}" . . . Param FeedApp.controller("ArticlesCtrl", ["$scope", "$routeParams", '$http', function($scope, $routeParams, $http) { var index = $routeParams.articleId; Article Object $scope.article = $scope.news[0].entries[index]; I would omit the entries bit altogether and I would probably use a factory to manage/maintain the data.
type: Answer
score: 2

http://stackoverflow.com/q/27333260
favorite count: 0
tagged with: angularjs
downvote count: 1
type: AnsweredQuestion
has body: I have been using VS2013 to develop my code which is an AngularJS application that talks to a back-end web server running ASP.NET Web API. I click on the build button, opening the application in the browser and then using Chrome Developer tools to debug the Javascript. Now I am looking into the idea of using WebStorm. When using that to develop my application will I still have to use the Chrome Developer tools to do all my Javascript debugging as the application is running or is there some way that WebStorm allows me to debug within the WebStorm client? Note I did see some answers here on SO relating to this question but these are very old and I wonder if new things have been added to the recent versions.
score: -1
has answer: http://stackoverflow.com/a/27333405
accepted answer: http://stackoverflow.com/a/27333405
type: Question
upvote count: 0
tagged with: javascript
tagged with: webstorm
has comment: http://stackoverflow.com/comment/43123909
has title: Can I debug Javascript of a Web Application inside Webstorm?
answer count: 1

http://stackoverflow.com/comment/71798481
comment on: http://stackoverflow.com/a/42097941
type: Comment
score: 2
has text: This works for those using a Grunt. Add this to gruntfile.js
type: AnswerComment

http://stackoverflow.com/q/27437066
score: 0
has comment: http://stackoverflow.com/comment/43315743
accepted answer: http://stackoverflow.com/a/27438029
type: Question
has comment: http://stackoverflow.com/comment/43316158
tagged with: internet-explorer-7
tagged with: javascript
tagged with: jquery
tagged with: image
has body: I have a next button and a input tag, user can enter page number into the input,and hit enter to jump to the page, every page is an image, like: &lt;img src="http://someurl.com/1_1.emf" &gt; // first page &lt;img src="http://someurl.com/2_1.emf" &gt; // second page as you can see the only defference is the url , when updateing the page , i did not update the src attributes , but change the whole img tag. the problem is that if I enter 2 in the input tag and hit enter , the image updated successfully, but when i click the next button the image just shows a white background, not matter how long i wait it will not render the image. the enter keydown event and the click event are exactly same.but I notic that when use input to update page, after hit the enter, there will be an loading circle beside the mouse pointer,but when click the next button there isn't. any idea why??? code: &lt;input type="text" class="currentPage" id="docCurrentPage" value="1" onfocus="this.className='currentPage_focus'" onkeydown="jumpToPage(event,this.value)" onblur="this.className='currentPage'" /&gt; window.jumpToPage = function(event, value) { var charCode = (event.which) ? event.which : event.keyCode; if (charCode == 13) { var num = parseInt(value); var totalPage = parseInt(doc.options.pageCount) if (num != 0 &amp;&amp; num &lt;= totalPage) { // doc.download(num) doc.download.apply(doc,[num]) } else { doc._node.docPager.val(doc.currPage) } } } &lt;a id="nextBtn" class="doc_right" onclick="openDocNextPage()" href="javascript:;" &gt;&lt;/a&gt; openDocNextPage = function() { if (!doc.isLastPage()) { var totalPage = parseInt(this.options.pageCount); var pageNum = parseInt(this.currPage) + 1; if (pageNum != totalPage + 1) { this.download(pageNum); } } } download: function(pageNum) { // debugger; if (pageNum != this.tempPage) { this.tempPage = pageNum || 1; if (this.options.id) { if (this.docType === 'emf') { if (!this.downloading) { this.getDoc(pageNum) } } else if (this.docType === 'txt') { th…
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/27438029
has title: Enter keydown and click event update image in ie 7
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43316166
has comment: http://stackoverflow.com/comment/43315803

http://stackoverflow.com/comment/43244324
has text: @edduvs: No, but he wants to add handlers while the page loads on elements that don't exist yet. It's the same problem/situation as if elements were added later by the script.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27398648

http://stackoverflow.com/a/27440807
upvote count: 3
has comment: http://stackoverflow.com/comment/43414687
has comment: http://stackoverflow.com/comment/43414632
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43411953
downvote count: 0
has comment: http://stackoverflow.com/comment/43497426
answers question: http://stackoverflow.com/q/27430689
has comment: http://stackoverflow.com/comment/43414545
has body: As requested, although note that this is not tested, so you might have to play around with it. $ meteor add percolatestudio:synced-cron Then something like this on the server: FutureEmails = new Meteor.Collection('future_emails'); // server-side only // "details" should be an object containing a date, plus required e-mail details (recipient, content, etc.) function sendMail(details) { Email.send({ from: details.from, to: details.to, etc.... }); } function addCronMail(id, details) { SyncedCron.add({ name: id, schedule: function(parser) { return parser.recur().on(details.date).fullDate(); }, job: function() { sendMail(details); FutureEmails.remove(id); SyncedCron.remove(id); return id; } }); } function scheduleEmail(details) { if (details.date &lt; new Date()) { sendMail(details); } else { var thisId = FutureEmails.insert(details); addCronMail(thisId, details); } } Meteor.startup(function() { FutureEmails.find().forEach(function(mail) { if (mail.date &lt; new Date()) { sendMail(mail) } else { addCronMail(mail._id, mail); } }); SyncedCron.start(); }); Then just call scheduleEmail(details) whenever you want to schedule a new mail. Hope that's helpful!
has comment: http://stackoverflow.com/comment/43414581
has comment: http://stackoverflow.com/comment/43417435
type: Answer
has comment: http://stackoverflow.com/comment/43414847
has comment: http://stackoverflow.com/comment/47341657
has comment: http://stackoverflow.com/comment/43412003
score: 3
accepted answer of: http://stackoverflow.com/q/27430689

http://stackoverflow.com/comment/43134206
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27335589
has text: Actually, it does answer the question. Not 100% right and in significant depth, but the author showed some good knowledge of programming so I made the assumption that I did not need to get more detailed.
type: Comment

http://stackoverflow.com/comment/43216993
type: QuestionComment
has text: http://stackoverflow.com/questions/6016120/relative-url-to-a-different-port-number-in-a-hyperlink
score: 1
comment on: http://stackoverflow.com/q/27384106
type: Comment

http://stackoverflow.com/comment/43114114
comment on: http://stackoverflow.com/q/27324716
score: 0
has text: One is forced to question *why* you want to do this. Evaluating arbitrary code is considered dangerous in almost every language that has the ability.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27324888
downvote count: 0
score: 1
has body: It is logging the indexes of letters in the string. This outputs the letters: string = "abc"; for(var i = 0; i &lt; string.length; i++){ console.log(string[i]); } Outputs: a b c
upvote count: 1
answers question: http://stackoverflow.com/q/27324822
type: Answer

http://stackoverflow.com/q/27353557
has body: I can successfully create an indexeddb database and load data into it. I can also read data from this database from the same page. I then try and read from the database from another page on my site. db = new ydn.db.Storage('test'); db.keys('items').done(function(d) { alert(d); }); This does not work. I just get an empty result. However if I enter the above code into the javascript console of Chrome directly it does work. After looking around it seems that the database may not be ready. So I try this. db = new ydn.db.Storage('test'); db.addEventListener('ready', function() { db.keys('items').done(function(d) { alert(d); }); }); This however gives me the the following error in the console. Uncaught TypeError: undefined is not a function The error is show for the following line of code. db.addEventListener('ready', function() { I am not sure what I am missing here.
has title: How do I check if ydn.db database is ready for use?
has answer: http://stackoverflow.com/a/27353625
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27353625
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: ydn-db
tagged with: indexeddb
tagged with: javascript

http://stackoverflow.com/comment/103920867
type: Comment
has text: Typo, I meant to say all click events.
comment on: http://stackoverflow.com/a/58509633
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43163619
comment on: http://stackoverflow.com/a/27353618
type: AnswerComment
score: 0
type: Comment
has text: yes! this worked. mixing ranges and capture groups was what got me. the ([ - ]) syntax. who says regex isn't poetic?

http://stackoverflow.com/q/27399709
favorite count: 0
has answer: http://stackoverflow.com/a/27400042
accepted answer: http://stackoverflow.com/a/27400042
has comment: http://stackoverflow.com/comment/43244903
has comment: http://stackoverflow.com/comment/43245197
has comment: http://stackoverflow.com/comment/43245163
has body: I have a form from there i want to send form data to the server side .But i am not able to create dynamic query string in jquery .I have a html like this : I have done this in jQuery var ids=[]; $('ul.items').each(function(){ var id = $(this).attr('id').replace(/test/,''); var tmp_arr=[]; $($(this).find("li")).each(function(){ var attr_val = $(this).attr("attr"); tmp_arr.push({$(this).attr('id')}); }); ids.push(tmp_arr); }); But my desired jquerystring is like this { "test"=>{ "ids"=>['11','12','13','14'], "attr=>['11','12','13','14']" }, "test1"=>{ "ids"=>['21','22','23','24'], "attr=>['21','22','23','24']" }, "test2"=>{ "ids"=>['31','32','33','34'], "attr=>['31','32','33','34']" } } How can we create this jQuery please help me
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43244713
score: 1
type: Question
upvote count: 2
answer count: 1
downvote count: 1
has title: create dynamic formdata in jQuery
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27334365
tagged with: custom-element
answer count: 10
has answer: http://stackoverflow.com/a/71562621
upvote count: 53
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/67338781
has answer: http://stackoverflow.com/a/76122389
possible better answer: http://stackoverflow.com/a/42432455
has answer: http://stackoverflow.com/a/27338773
has answer: http://stackoverflow.com/a/28259806
has answer: http://stackoverflow.com/a/35292071
type: Question
accepted answer: http://stackoverflow.com/a/28210364
has title: How to get list of registered custom elements
tagged with: w3c
tagged with: javascript
has answer: http://stackoverflow.com/a/47203114
score: 53
tagged with: web-component
has answer: http://stackoverflow.com/a/28210364
has answer: http://stackoverflow.com/a/42432455
favorite count: 0
has answer: http://stackoverflow.com/a/34321926
has body: I'm trying to detect whether a custom element with a specific name was registered or not. Is there a way to make such check? Or is there a way to get list of registered custom elements? I do document.registerElement, but what else is there? Is it one-way API?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43347463
comment on: http://stackoverflow.com/a/27435296
has text: Sorry. It looks like SVGs in FF don't have offsetLeft and offsetTop properties. I've tweaked the answer. It should work everywhere now.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27393870
answers question: http://stackoverflow.com/q/27393759
has comment: http://stackoverflow.com/comment/43260966
type: AcceptedAnswer
downvote count: 0
has body: link is only run once, during the initial directive link phase. There's several ways to do this though: Have a function on the scope called remainingChars(), and return the correct amount there. Then in your template have {{remainingChars()}} Second, you could have a watch expression: $scope.$watch(function() { // watch expression, fires the second function on change return transaction.checkNumber.length - transaction.depositnote.length}, function() { //update the remainingchars value here in the second function }) Or third, have some kind of ng-change event handler which updates the remainingchars variable. ng-change="calcRemanining()"
type: Answer
has comment: http://stackoverflow.com/comment/43292822
score: 1
accepted answer of: http://stackoverflow.com/q/27393759
has comment: http://stackoverflow.com/comment/43260489
upvote count: 1

http://stackoverflow.com/q/27424082
type: Question
accepted answer: http://stackoverflow.com/a/27424781
answer count: 2
tagged with: javascript
tagged with: jquery
has body: i need to display image when form is processing And this following code works problem is when i press submit image is displayed but if there are some error in form filed the form will not process but images is displayed How do i make images display when user press submit button the image should appear only when form is processing CODE &lt;input onclick="showImg()" class="btn btn-success" type="submit" name="submit" value="Search"/&gt; &lt;img alt="" src="ajax-loader.gif" id="progress_img" style="visibility:hidden;"&gt; &lt;script language="javascript" type="text/javascript"&gt; function showImg() { if (document.getElementById) { (document.getElementById("progress_img")).style.visibility = "visible"; } } &lt;/script&gt;
possible better answer: http://stackoverflow.com/a/27424567
score: 0
has answer: http://stackoverflow.com/a/27424567
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27424781
has title: ERROR displaying image while form is processing
type: AnsweredQuestion
tagged with: forms
has comment: http://stackoverflow.com/comment/43290680

http://stackoverflow.com/a/27316659
score: 0
has body: Maybe you should stick to normal SVG tools and not over complicate things for something as trivial as a rotation. It wasn't clear to me what you want to spin, so I made them both spin: <g> <g> <path class="bag" fill="#016D49" d="M42.1,45.6c-6.7,0-13.5,0-20.2,0c-0.2,0-0.3-0.1-0.3-0.3c0.4-6.9,0.9-13.8,1.3-20.7c0-0.2,0.2-0.3,0.3-0.3 c5.9,0,11.7,0,17.6,0c0.2,0,0.3,0.1,0.3,0.3c0.4,6.9,0.9,13.8,1.3,20.7C42.4,45.5,42.3,45.6,42.1,45.6z"/> </g> <g> <path fill="#016D49" d="M27.8,23.1c0-0.2,0.1-0.5,0.1-0.8c0.9-5.3,4.1-5,4.2-5c0,0,3-0.3,4,5c0,0.3,0.1,0.6,0.2,0.8H38 c0-0.2-0.1-0.5-0.2-0.8c-0.2-0.7-0.4-1.3-0.6-2.1c-1.2-3.1-3-4.7-5.4-4.6c-3.6,0.2-5.1,3.8-5.6,6.6c0,0.3-0.1,0.6-0.1,0.8 L27.8,23.1L27.8,23.1z"/> </g> <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="360 32 32" to="0 32 32" dur="10s" repeatCount="indefinite"/> </g> <g id="loadingRing"> <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 32 32" to="360 32 32" dur="5s" repeatCount="indefinite"/> </g> Here you go, a version with scripting, impractical, but since you wanted it... dz.setAttribute("transform", "rotate(" + zpos + " 32 32)"); <?xml version="1.0" encoding="utf-8"?> <g> <g> <path class="bag" fill="#016D49" d="M42.1,45.6c-6.7,0-13.5,0-20.2,0c-0.2,0-0.3-0.1-0.3-0.3c0.4-6.9,0.9-13.8,1.3-20.7c0-0.2,0.2-0.3,0.3-0.3 c5.9,0,11.7,0,17.6,0c0.2,0,0.3,0.1,0.3,0.3c0.4,6.9,0.9,13.8,1.3,20.7C42.4,45.5,42.3,45.6,42.1,45.6z"/> </g> <g> <path fill="#016D49" d="M27.8,23.1c0-0.2,0.1-0.5,0.1-0.8c0.9-5.3,4.1-5,4.2-5c0,0,3-0.3,4,5c0,0.3,0.1,0.6,0.2,0.8H38 c0-0.2-0.1-0.5-0.2-0.8c-0.2-0.7-0.4-1.3-0.6-2.1c-1.2-3.1-3-4.7-5.4-4.6c-3.6,0.2-5.1,3.8-5.6,6.6c0,0.3-0.1,0.6-0.1,0.8 L27.8,23.1L27.8,23.1z"/> </g> </g> <g id="loadingRing"> </g> Notes: I couldn't make it work with changing the style property. Not sure why. You don't need to reset from 359 to 0. Degrees are anyway computed mod 360.
has comment: http://stackoverflow.com/comment/43093587
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27316125
answers question: http://stackoverflow.com/q/27316125
type: Answer

http://stackoverflow.com/comment/43264780
comment on: http://stackoverflow.com/a/27409908
has text: *"if you have "1" * "2" * 1 multiplying by number 1 will automatically turn all the string in numbers."* - The multiplication between the strings will implicitly convert both to numbers, multiplying by a number doesn't make any difference.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27354593
type: Question
tagged with: angular-ui-router
has title: Angular ui router change state with query params
tagged with: javascript
answer count: 2
has body: How i can go to a state and add query params to the url at the same time? Lets say i have this state: $stateProvider .state('cart', { templateUrl: 'client/cart/cart.html', url: '/my-cart', controller: 'CartController' }) I want from some views to $state.go('cart') and from some views to $state.go('cart') but with query params added to it like, /cart?purchase=complete
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27354949
score: 3
has answer: http://stackoverflow.com/a/27354794
upvote count: 3

http://stackoverflow.com/a/27350401
answers question: http://stackoverflow.com/q/27350110
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43170821
type: Answer
has body: The cross domain issue only occurs when you test your app code on PC browser after code below is inserted into config.xml. &lt;access origin="*" /&gt; Anyway, your code seems to be correct. My suggestion is that you could try the steps below. (1) Not post your image and check if text data could be posted well. (2) Use phonegap "Filetransfer" to post data includes images.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27350110

http://stackoverflow.com/comment/43204775
comment on: http://stackoverflow.com/q/27377445
score: 0
type: Comment
type: QuestionComment
has text: I do not see where you link the dropdown box with the JavaScript code. It seems your code example is not complete?

http://stackoverflow.com/comment/43269229
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27400819
type: AnswerComment
has text: Incidentally, if you wish to use semantic HTML,as well as more of a jQuery solution, see http://jsfiddle.net/dvw30tjv/16

http://stackoverflow.com/q/27415677
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27416326
tagged with: tinymce
score: 0
has body: I want to alert the selected text from tinyMCE editor in Moodle. This is working fine in google chrome but not working in IE. alert selected text: alert(tinyMCEPopup.editor.selection.getContent()); // working in chrome not working in IE alert entire text in editor alert(tinyMCEPopup.editor.getContent()); //working in both chrome and IE How can I alert the selected text in IE browser?? I am using IE version 11 , tinyMCE 3.5 and Moodle 2.7
has title: Alert selected text from tinyMCE not working in IE
type: UnansweredQuestion
tagged with: internet-explorer

http://stackoverflow.com/q/27364911
answer count: 3
has comment: http://stackoverflow.com/comment/43181710
has body: I have a two page form, when a user fills out the first page he/she can either click Save For Later, or click Next and proceed to the next page and continue filling out the form. It is done through jquery. What I cannot figure out how to do is, how can I save the user input in the form, so if the browser crashes, internet goes out, or user simply wants to save form and come back to it later, the filled out information sits in the input fields. What is a method to accomplish that?
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43181721
has answer: http://stackoverflow.com/a/27364981
score: -2
has comment: http://stackoverflow.com/comment/43181703
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27364991
type: Question
possible better answer: http://stackoverflow.com/a/27365106
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27365106
accepted answer: http://stackoverflow.com/a/27364991
tagged with: javascript
tagged with: forms
has title: How to save user input data in the form?

http://stackoverflow.com/comment/43129298
has text: I thhink you have to do something like : $("#sizeForm").submit(function (event) { `event.preventDefault();...`
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27336233

http://stackoverflow.com/a/27342788
has body: try this in pure javascript: var td = document.createElement('td'); td.style.textAlign="center"; var input = document.createElement('input'); input.type="image"; input.src="nienteico.png"; input.style.cursor="pointer"; input.style.width="40px"; input.style.height="40px"; input.setAttribute("id","5.51"); input.className="ajaxEdit"; input.onClick = function() { cambiastato(5.51); }; td.appendChild(input);
score: 2
has comment: http://stackoverflow.com/comment/43141349
downvote count: 0
answers question: http://stackoverflow.com/q/27342671
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/43141426

http://stackoverflow.com/comment/43378436
score: 0
type: Comment
type: QuestionComment
has text: Did you take a look at the console?
comment on: http://stackoverflow.com/q/27471908

http://stackoverflow.com/a/27386199
score: 0
has comment: http://stackoverflow.com/comment/43220746
type: Answer
answers question: http://stackoverflow.com/q/27385955
has body: Your code is ok: var e = $("input[id*='dtpToDate']"); console.log(e.val()); // returns 12/10/2014 http://jsfiddle.net/jojc5rvw/1/

http://stackoverflow.com/comment/43364671
type: QuestionComment
has text: read the article i posted, i'm too lazy to write an answer cloning existing publications
comment on: http://stackoverflow.com/q/27464148
score: 0
type: Comment

http://stackoverflow.com/comment/43753528
score: 0
type: AnswerComment
has text: Using this solution, somehow the object is malformed so that the remove function of resources dont work, a better solution is posted using this/that
type: Comment
comment on: http://stackoverflow.com/a/27486862

http://stackoverflow.com/q/27348238
accepted answer: http://stackoverflow.com/a/27352090
score: 1
upvote count: 1
has title: Understanding the AngularFire extend FirebaseArray example?
type: Question
tagged with: firebase
tagged with: javascript
has answer: http://stackoverflow.com/a/27352090
answer count: 1
downvote count: 0
has body: I've been struggling with the proper implementation of this, I thought I had it but based on the example I am doing it wrong. How do you use this factory in a controller? What is the intended result? The example: app.factory("ListWithTotal", ["$FirebaseArray", "$firebase", function($FirebaseArray, $firebase) { // create a new factory based on $FirebaseArray var TotalFactory = $FirebaseArray.$extendFactory({ getTotal: function() { var total = 0; // the array data is located in this.$list angular.forEach(this.$list, function(rec) { total += rec.amount; }); return total; } }); return function(listRef) { // override the factory used by $firebase **// why do listRef and ref not match here? //where does listRef or ref come from** var sync = $firebase(ref, {arrayFactory: TotalFactory}); return sync.$asArray(); // this will be an instance of TotalFactory } }]); I've been able to use a version of extending factories that doesn't include the return of a reference to a new firebase. For example: A todo list that keeps count: http://plnkr.co/edit/iAGvPHFWn2GSPGzBRpKh?p=preview
has comment: http://stackoverflow.com/comment/43157931
tagged with: angularfire
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/a/63047318
answers question: http://stackoverflow.com/q/27314918
score: 0
has body: Removing the &lt;noscript&gt; should help.
type: Answer

prototypejs
tags question: http://stackoverflow.com/q/27443666
tags question: http://stackoverflow.com/q/27358695
tags question: http://stackoverflow.com/q/27413310
type: Tag
tag name: prototypejs
tags question: http://stackoverflow.com/q/27464884

http://stackoverflow.com/q/27440015
accepted answer: http://stackoverflow.com/a/27440068
has comment: http://stackoverflow.com/comment/43332055
tagged with: dom
has title: Create and manipulate from a variable content
type: Question
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43319770
favorite count: 0
has body: I've a - probably - easy question. I need to create and manipulate a variable from its html content. Here is the JS code : var table = ' 123 '; $('myVar').html(table); $('myVar').removeClass().addClass('my-class3'); console.log($('myVar').html()); But unfortunately, I'm just unable to succeed.... Thank you,
downvote count: 2
has comment: http://stackoverflow.com/comment/43319823
has comment: http://stackoverflow.com/comment/43319744
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27440068

http://stackoverflow.com/a/27357225
score: 1
upvote count: 1
downvote count: 0
has body: Assuming that subcategories is the array you want the length of, take out the second [0]. You aren't trying to get the length of the first subcategory, you're trying to get the number of subcategories.
type: Answer
answers question: http://stackoverflow.com/q/27357190

http://stackoverflow.com/comment/43223213
comment on: http://stackoverflow.com/a/27387139
has text: hmm, I'm not sure that concatenating the URL string inside of the passed parameter would work. Another suggestion is to change OnClick to OnClientClick. If the parameter is still giving you an issue, you can think about doing that logic in a javascript variable, and then passing that variable when you call the method.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27455719
has comment: http://stackoverflow.com/comment/43349858
upvote count: 1
tagged with: php
has title: Ajax call to Server PHP only sometimes print back request
has answer: http://stackoverflow.com/a/27455846
has comment: http://stackoverflow.com/comment/43349138
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43349147
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43349169
has comment: http://stackoverflow.com/comment/43349238
favorite count: 0
has body: When I load my index.html site, it would sometimes return the Ajax which would call the php on server to print the result of my dynamic page. Why does it only sometimes work when I go to the address bar and press enter or refresh? This is the site Click Here! This has been bothering me for sometime now. Christmas- 2014: Secret Santa Important Information WebSite Scheme: The Purpose of this is to have computer generated randomization of the "Secret Santa gifting". All wish list can be made online and will be automatically uploaded to the server. Then, I will run the program to randomly pair you then display the wish list to whom you'll be a secret Santa to. So things to do: Make an account Build your wish list WARNING: It is important that you make only ONE! account for yourself. Gifting Criteria: Amount of Gifts- Each person should have at least 3 gifts for the gift-er to chose from Price of Total Gifts- $50 Total Amount of gifts you buy for the person must be close to equal or more than $50 Commonly Asked Questions Can we list multiple gifts on our wish list to add up to the MAX dollar amount? Yes, if there are multiple low priced items, you will have to chose to buy enough gifts to add up to the total amount.
type: UnansweredQuestion

http://stackoverflow.com/comment/43339724
has text: yes, mate, it is a class, group of elements that fire , and as I said the first trigger works fine and after the ajax returns the html which consists the same .action elements but they dont fire..
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27450595
type: Comment

http://stackoverflow.com/a/27424361
has comment: http://stackoverflow.com/comment/43291216
score: -1
has comment: http://stackoverflow.com/comment/43290884
has comment: http://stackoverflow.com/comment/43291390
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43290820
has comment: http://stackoverflow.com/comment/43291377
type: Answer
has comment: http://stackoverflow.com/comment/43291193
accepted answer of: http://stackoverflow.com/q/27424325
answers question: http://stackoverflow.com/q/27424325
has body: That's because the listener function is called by the window, try that : x.each(function() { var self = this; this.addEventListener("click", function () { console.log(self, 'i was clicked') }); }); In fact when you add a callback function to your object this.addEventListener(...) it's not the object himself who call the function when the event append, it's the window. So that's why this is the window in you function. So you have to save the reference of your object with var self = this; then when the callback method will be called it will have the correct reference to your object.
downvote count: 1
has comment: http://stackoverflow.com/comment/43291815

http://stackoverflow.com/a/27354813
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/43163158
answers question: http://stackoverflow.com/q/27354665
has body: You have your comparisons backward in the else ifs, you're using 70 &gt;= percent rather than percent &gt;= 70 (and so on). Separately, there's no reason to assign '' to innerHTML if you're about to assign something else to it, and there's no reason to reiterate the upper bound (percent &lt;= 89 and such), because you're using else if, so the percent &gt;= 90 branch will have already been followed. Reiterating them is also a maintenance problem (you'll change one but forget to change the other). So: if (percent &gt;= 90) { grade.innerHTML = 'A ' + percent + '%'; } else if (percent &gt;= 80) { grade.innerHTML = 'B ' + percent + '%'; } else if (percent &gt;= 70) { grade.innerHTML = 'C ' + percent + '%'; } else if (percent &gt;= 60) { grade.innerHTML = 'D ' + percent + '%'; } else if (percent &gt;= 0) { grade.innerHTML = 'F ' + percent + '%'; } else { grade.innerHTML = ''; } Or of course, you can use a map, since your grade boundaries are evenly divisible by 10: // Somewhere central var grades = { 6: 'D', 7: 'C', 8: 'B', 9: 'A', 10: 'A' }; // ...then simply: if (percent &gt;= 0) { grade.innerHTML = (grades[Math.floor(percent / 10)] || 'F') + ' ' + percent + '%'; } else { grade.innerHTML = "Less than 0?!"; } var grades = { 6: 'D', 7: 'C', 8: 'B', 9: 'A', 10: 'A' }; function showGrade(percent) { var grade; if (percent &gt;= 0) { grade = (grades[Math.floor(percent / 10)] || 'F') + ' ' + percent + '%'; } else { grade = "Less than 0?!"; } snippet.log(grade); } var n; for (n = 0; n &lt;= 100; ++n) { showGrade(n); } &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt;
score: 6
downvote count: 0

http://stackoverflow.com/a/27339128
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27338938
has body: You can use media queries if your browser supports them. Here is an example where I've used them to alter some of the properties (but not all). Code contains explanatory comments. <-Back Your Personalized Maintenance Schedule Maintenance Item March 2015 Maintenance May 2015 Maintenance August 2015 Maintenance October 2015 Maintenance December 2015 Maintenance March 2016 Maintenance May 2016 Maintenance August 2016 Maintenance October 2016 Maintenance December 2016 Maintenance Pollen Filter Air Filter Brake Flush Transmission Flush
accepted answer of: http://stackoverflow.com/q/27338938
type: Answer
score: 0

http://stackoverflow.com/comment/43374150
has text: My main point is, could it introduce a memory leak if the created object reference another object ?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27469520
type: Comment

http://stackoverflow.com/q/27375173
upvote count: 8
possible better answer: http://stackoverflow.com/a/63606650
linked to: http://stackoverflow.com/q/65116880
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: markerclusterer
type: Question
score: 8
tagged with: google-maps
has answer: http://stackoverflow.com/a/27396929
tagged with: javascript
tagged with: google-maps-api-3
accepted answer: http://stackoverflow.com/a/27396929
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/63606650
has title: Markerclusterer set marker cluster icon depending on markers inside it
favorite count: 0
has body: Let's say that I want to make a webpage that will show approximate number of free parking spots left on each parking(due to confidentiality I'm not allowed to give any details of what I'm actually doing). For this I'm using Google maps and Markerclusterer. So for parking with less than 5% spots left I'd like to show a red marker, for parkings with 5%-25% spots I'd show a yellow one and for ones with more than 25% free spots I want to make it green. So far I could make those markers and cluster them, but here's the tricky part(and question itself): How can I make a cluster icon dependant on the markers inside it? For example: Parking A is green Parking B is red Parking C is green Parking D is yellow When zoomed out I want to show the cluster that has all 4 of them red(worst of all). When zoomed in I'd get 2 clusters(A+B and C+D). I want the first cluster(A+B) to be red and second(C+D) should be yellow. What I did so far: var mcOptions = {gridSize: 50, maxZoom: 15, styles: [{ height: 46, url: "///Users/Novarg/Downloads/foundation-5.4.7/img/greenC.png", width: 46 }, { height: 46, url: "///Users/Novarg/Downloads/foundation-5.4.7/img/redC.png", width: 46 }]}; var markers = []; for (var i = 0; i &lt; 100; i++) { var latLng = new google.maps.LatLng(51 + Math.random(), 4 + Math.random()); var marker = new google.maps.Marker({'position': latLng, icon: 'img/greenP.png'}); markers.push(marker); } for (var i = 0; i &lt; 20; i++) { var latLng = new google.maps.LatLng(51 - Math.random(), 4 - Math.random()); var marker = new google.maps.Marker({'position': latLng, icon: 'img/redP.png'}); markers.push(marker); } var markerCluster = new MarkerClusterer(map, markers, mcOptions); } google.maps.event.addDomListener(window, 'load', initialize); Right now I only have red and green markers, which should be enough to test it. But behaviour of this cluster now is as follows: All clusters with less than 10 markers in it are green All clusters with more than 9 markers in it are red EDIT From …

http://stackoverflow.com/comment/43345397
type: QuestionComment
comment on: http://stackoverflow.com/q/27453340
score: 0
type: Comment
has text: Can you possibly explain the context or use case you have in mind for this?

http://stackoverflow.com/q/27336966
type: Question
tagged with: gruntjs
score: 0
answer count: 1
tagged with: javascript
tagged with: web-deployment
has answer: http://stackoverflow.com/a/27341277
has body: when developing programs with Java (and Maven) I get a folder "target" where all files I need (the *.jar and resources of the program) are at one place. That way it's very comfortable to deploy. Right now I'm deveolping a website. Because I'm using grunt I'd like to know if there is something similar, so I can enter grunt build or something like that and grunt copies my minified js/css files, and the resources (html, images, ...) to a target directory. That way all files I need on the server are at one place, but files that are "unnecessary" for the server (like not minified js files) are not.
tagged with: node.js
tagged with: npm
type: UnansweredQuestion
has title: How to make deployable package/folder with grunt?

http://stackoverflow.com/a/27392966
score: 0
answers question: http://stackoverflow.com/q/27392797
type: Answer
has body: $(document).ready(function(){ $('.image_rollover img').hide(); var index = 0; var $imageRollover = $('.image_rollover'); var maxIndex = $imageRollover.find('img').length; $imageRollover.on('mouseenter', function(){ $('.image_rollover img').hide(); console.log(index); $imageRollover.find('img').eq(index).show(); index++; if (index &gt;= maxIndex) { index = 0; } }); }); You can also see http://jsfiddle.net/2q2ycbdz/2/

http://stackoverflow.com/q/27415400
favorite count: 0
has answer: http://stackoverflow.com/a/27415457
accepted answer: http://stackoverflow.com/a/27415457
downvote count: 0
tagged with: node.js
type: AnsweredQuestion
has body: I new at javascript so this might be something trivial. I am trying to run a set of functions in series according to waterfall method of async module for Node JS/Restify. The main advantage of this method is that it is possible to pass the "results" of the current callback to the next and so on having the possibility to break the "waterfall" and run the next middleware. As described in the documentation its arguments are an array of functions and a last middleware. So I setup my functions according to the code below and call var fn1 = function(callback){ console.log(req.params.user_id); callback(null, req.params.user_id); }; var fn2 = function(user_id, callback){ console.log(user_id); callback(); } server.get('/:user_id', function(req, res, next){ async.waterfall([fn1, fn2], function(err, result){ next(); }) }, ...(next middleware) ) And I am not getting the expected results, as the req object is not defined. However when doing this: server.get('/:user_id', function(req, res, next){ async.waterfall([ function(callback){ console.log(req.params.user_id); callback(null, req.params.user_id); }, function(user_id, callback){ console.log(user_id); callback(); } ], function(err, result){next()}); }, ...(next middleware) ) I get the results expected and the req object is well defined in the scope of function 1 (fn1). So I think I am missing something quite basic but don't no where to start.. Thanks
score: 1
has title: Lost of scope with async.waterfall
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: express
upvote count: 1
tagged with: asynchronous

http://stackoverflow.com/q/27458358
score: -2
upvote count: 1
answer count: 1
downvote count: 3
type: UnansweredQuestion
has title: how to place two canvas with image on each other
has answer: http://stackoverflow.com/a/27458581
tagged with: canvas
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have two canvas.One of them is a picture of a room and the other one is a picture of a chair.I have two question: First:How to put these two canvas with images on each other? Two: My first canvas which contains the image of the room is about 7 meters in width and the chair is about 80cm in width.By the way it's not the size of images.It's the size of their view.How should I put the second one according to the first one? Thanks
type: Question
has comment: http://stackoverflow.com/comment/43354202

http://stackoverflow.com/comment/43187110
type: Comment
type: QuestionComment
has text: What is `*pizza` supposed to do? What is `pizza`? Also, `document.getElementById("pizza")` returns the element, not its value.
comment on: http://stackoverflow.com/q/27367604
score: 0

http://stackoverflow.com/comment/43305103
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27430389
has text: thanks, but trying those examples I am still getting the sourceEvent null error.

http://stackoverflow.com/comment/43206017
type: Comment
comment on: http://stackoverflow.com/a/27377378
has text: Not really, you are placing the triangle in a single place on the top menu itself. Unless you move it for **each** submenu, it won't work properly...or will it?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43236051
type: QuestionComment
score: 0
has text: Do you need to keep this counter on server-side, in MySQL for e.g?
comment on: http://stackoverflow.com/q/27394506
type: Comment

http://stackoverflow.com/comment/43227053
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27387242
score: 1
has text: Use the `transformRequest()` method.

http://stackoverflow.com/comment/50044633
has text: @Giszmo I noticed a typo in my previous comment. It should be `'script!modernizr'` not `script!modernizr`. (quotes were missing)
type: Comment
comment on: http://stackoverflow.com/a/28086849
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43100589
type: Comment
has text: It's not looping on Chrome 39.0.2171.71 m. What browser are you testing on?
score: 0
comment on: http://stackoverflow.com/q/27320673
type: QuestionComment

http://stackoverflow.com/comment/43098766
type: QuestionComment
score: 1
has text: [FROM MDN substr](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) *start is a character index. The index of the first character is **0**, and the index of the last character is 1 less than the length of the string. substr() begins extracting characters at start and collects length characters (unless it reaches the end of the string first, in which case it will return fewer).*
comment on: http://stackoverflow.com/q/27319681
type: Comment

http://stackoverflow.com/comment/43347595
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27454774
type: Comment
has text: The background is not showing up, heres a fiddle i made: http://jsfiddle.net/jesse_meth/xp8echja/

http://stackoverflow.com/a/27467746
has comment: http://stackoverflow.com/comment/43372389
type: Answer
has comment: http://stackoverflow.com/comment/43371058
has comment: http://stackoverflow.com/comment/43372511
has comment: http://stackoverflow.com/comment/43371080
score: 1
upvote count: 1
has body: You are trying to return and JSON not setting header('Content-type: application/json'); Decide whether you want to pass plaintext or json. Your string might be now "0", not 0 Try if (data === '"0"') {
has comment: http://stackoverflow.com/comment/43370989
has comment: http://stackoverflow.com/comment/43371038
accepted answer of: http://stackoverflow.com/q/27467647
has comment: http://stackoverflow.com/comment/43371115
has comment: http://stackoverflow.com/comment/43372636
has comment: http://stackoverflow.com/comment/43371026
answers question: http://stackoverflow.com/q/27467647
has comment: http://stackoverflow.com/comment/43371148
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43372592
has comment: http://stackoverflow.com/comment/43372568

http://stackoverflow.com/a/27421294
answers question: http://stackoverflow.com/q/27420743
score: 0
has comment: http://stackoverflow.com/comment/43291512
has body: Yes, it's possible. angular.module('starter.services', []).factory('Equipements', function($http) { var equipements = {}; $http({ method: 'GET', url: 'http://example.com/get_all_equipments' }). success(function(data, status, headers, config) { equipements = data; }); return { all: function() { return equipements; } } })
type: Answer
has comment: http://stackoverflow.com/comment/43292120

http://stackoverflow.com/a/27321526
score: 0
accepted answer of: http://stackoverflow.com/q/27320940
has comment: http://stackoverflow.com/comment/43102362
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27320940
has body: Personally I handle this with one method and a global variable. Example: var backState = false; function backButton() { if(backState === 'LogicA') { //do logic a } elseif(backState === 'LogicB') { //do logic b } else { //some default action if needed } } document.addEventListener("backbutton", backButton, false); Then as needed I can change the value of backState and directly affect the function of the back button.
has comment: http://stackoverflow.com/comment/43103087

http://stackoverflow.com/q/27369410
favorite count: 0
has comment: http://stackoverflow.com/comment/43223420
type: Question
tagged with: twitter-bootstrap
has body: I'm trying to add a map as a full screen background below my Bootstrap NavBar, but at the moment my code is causing the bottom of the map to overflow the page. I've tried different margins and positions and I cant get it to show the map within the bounds of the page under the navbar. I understand part of the issue is having top:50px but I don't know how to rectify the problem. My CSS code is as follows: #map { /* Set rules to fill background */ height: 100%; width: 100%; /* Set up positioning */ position: fixed; top: 50px; left: 0; } Here is a screen shot of my page, you can see in the bottom right that the map attribution and controls have been cut off:
has comment: http://stackoverflow.com/comment/43223438
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/39953782
tagged with: css
has answer: http://stackoverflow.com/a/27370386
answer count: 2
has comment: http://stackoverflow.com/comment/43190595
upvote count: 1
has comment: http://stackoverflow.com/comment/43190932
has title: Full Screen Map Beneath NavBar
tagged with: google-maps
has comment: http://stackoverflow.com/comment/43223393
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43231057
has comment: http://stackoverflow.com/comment/43193258
downvote count: 0
score: 1

http://stackoverflow.com/a/27359071
score: 2
upvote count: 2
has body: There is a little confusion here with attributes and properties. First of all both Firefox an IE don't support input with type="date" (at the time of writing, IE11, Firefox 34). Check support table. By default browser will treat unknown input type as if it was text. The property of the DOM element object in this case will also be text. this is what you are observing in this code: var input = document.querySelector("input"); var inputType = input.type; // will give `text` in Firefox and IE However attribute value will still be date even if browser has no support for this input type: var input = document.querySelector("input"); var inputType = input.getAttribute("type"); // will give `date` everywhere
has comment: http://stackoverflow.com/comment/43210503
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27358775
answers question: http://stackoverflow.com/q/27358775
type: Answer

http://stackoverflow.com/comment/43215124
type: QuestionComment
has text: `$('#nextForm').css("display","block");` and `$('#nextForm').show();` do the same thing...
comment on: http://stackoverflow.com/q/27383209
score: 0
type: Comment

http://stackoverflow.com/q/27388397
has comment: http://stackoverflow.com/comment/43225261
score: 0
linked to: http://stackoverflow.com/q/6190249
has comment: http://stackoverflow.com/comment/43225366
has comment: http://stackoverflow.com/comment/43224982
type: UnansweredQuestion
tagged with: php
answer count: 0
type: Question
has title: Create .vcf file. [PHP]
has body: I access contacts from my mobile using Cordova then making that contact in string form like this. BEGIN:VCARD VERSION:3.0 FN:John Doe N:John Doe ;;;; TEL;TYPE=mobile:34458777452 NOTE: NICKNAME: END:VCARD after making string i send data in PHP to save vCard. in '*.vcf' form. But when i am open that file using Nokia PC Suite it show me like this figure below Here is my sample code First javascript part $(function(){ var vcfData = 'BEGIN:VCARD'; vcfData += '\n'; vcfData += 'VERSION:3.0'; vcfData += '\n'; vcfData += 'FN:John Doe'; vcfData += '\n'; vcfData += 'N:John Doe ;;;;'; vcfData += '\n'; vcfData += 'TEL;TYPE=mobile:34458777452'; vcfData += '\n'; vcfData += 'NOTE:'; vcfData += '\n'; vcfData += 'NICKNAME:'; vcfData += '\n'; vcfData += 'END:VCARD'; console.log(vcfData); var params = { data:vcfData } var sUrl = 'test.php'; $.ajax({ url:sUrl, method:'POST', data:params, success:function(result){ console.log(result); } }); }); and in php i made a file like this. $data = $_POST['data']; $myfile = fopen('demo.vcf', "w"); fwrite($myfile, $data); fclose($myfile); Note I dont want to use any php classes for making vcf file (if possible)
tagged with: javascript

http://stackoverflow.com/comment/43097999
score: 2
comment on: http://stackoverflow.com/q/27319245
has text: The documentation is pretty clear on that. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage Read the part about parameters. You want to use `dx`, `dy`, `dWidth` and `dHeight`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27393479
has title: Obtain value of Javascript string variable via an alias
tagged with: eval
possible better answer: http://stackoverflow.com/a/27394637
favorite count: 0
has answer: http://stackoverflow.com/a/27393756
has comment: http://stackoverflow.com/comment/43234453
has comment: http://stackoverflow.com/comment/43234712
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43234648
has comment: http://stackoverflow.com/comment/43234565
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43234810
has comment: http://stackoverflow.com/comment/43234127
has comment: http://stackoverflow.com/comment/43234401
has body: I have written a Javascript function to retrieve JSON data from either a server or local files, in any browser. This code digests JSON data from either: (a) an XMLHttpRequest response, or (b) an imported script variable. For the latter case, this code expects the variable 'JSONdata'. Instead of putting it inline in two (or more) places, it is initialised as a global constant JSCRIPTVAR. This is for legibility and maintenance - to change if the data file uses a different value. You'll see the code uses an eval function to extract the (pointer to our) JSON data - a bit too close to the actual data for my comfort. My question is, how do I read the value of the primitive variable 'JSONdata' via its alias JSCRIPTVAR without using (the dreaded) eval function? I have tried closures and other methods described here (Reference a Javascript variable by a text alias) but am unable to get the JSON data, only the variable name or 'undefined'. var JSCRIPTVAR = "JSONdata"; // any variable name less than 10 characters or less function digestJSON(response, JSONobjName) { if (typeof response == 'string') JSONstring = response; else if (typeof JScriptVar !== 'undefined' &amp;&amp; typeof JSCRIPTVAR.valueOf() !== 'undefined') JSONstring = eval(JSCRIPTVAR.substring(0, 10)); // ensure that we don't take in any malicious code try { // this method assigns the JSON data to a global object using JSONobjName, so can support multiple JSON objects window[JSONobjName] = JSON.parse(JSONstring); // Parse JSON string into object - IE 8+ supports JSON.parse() console.log("Successfully digested JSON. Data is now available via DOM methods."); } catch (e) { alert("Error parsing the '" + JSONobjName + "' file'. Check that the file is properly formatted."); console.error("JSON parsing error: ", e + ", type: " + this.type); } } The function digestJSON is called in 3 functions that employ anonymous callbacks: loadViaXHR2, loadViaXHR1 and loadViaJScript. The latter is the one that imports the JSON data via …
has comment: http://stackoverflow.com/comment/43234467
upvote count: 1
linked to: http://stackoverflow.com/q/21399520
tagged with: global-variables
type: Question
has comment: http://stackoverflow.com/comment/43234510
accepted answer: http://stackoverflow.com/a/27393756
answer count: 2
has comment: http://stackoverflow.com/comment/43234886
downvote count: 0
tagged with: javascript
tagged with: alias
has answer: http://stackoverflow.com/a/27394637

http://stackoverflow.com/comment/43113737
type: AnswerComment
comment on: http://stackoverflow.com/a/27327251
score: 0
type: Comment
has text: Look at your JS console, those functions aren't automatically visible from the HTML. You need to attach them to `window` like so: hhttp://jsfiddle.net/y97rbvo9/5/

http://stackoverflow.com/comment/43279868
type: QuestionComment
comment on: http://stackoverflow.com/q/27417160
has text: Updated the answer again. :P
score: 0
type: Comment

http://stackoverflow.com/a/27443413
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43326474
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27443292
has comment: http://stackoverflow.com/comment/43326180
has body: You should build you style variable as JSON $scope.uploadDropStyle = { "height": $scope.$parent.state.size.window.height - calculateDeduction() + "px" }; I would extend my answer with recommending you to use a scope variable into the ng-style tag instead of a binded one: markup += &lt;div class="fileTransferContainer" ng-style="uploadDropStyle"&gt;&lt;br/&gt;&lt;hr/&gt;\
answers question: http://stackoverflow.com/q/27443292

http://stackoverflow.com/comment/43216271
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27383179
has text: When I check the inspector in Firefox and mouseover the created shapes, it shows me as follows: use 1160x620.
score: 0

http://stackoverflow.com/a/27428539
downvote count: 0
answers question: http://stackoverflow.com/q/27428481
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43299035
score: 1
has body: You could try binding to the attribute with a library like this: http://meetselva.github.io/attrchange/ or as these posts suggest: jquery bind change css Or as others have suggested just add the handler in whatever shows it.
has comment: http://stackoverflow.com/comment/58287066
has comment: http://stackoverflow.com/comment/43298880
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43298931
accepted answer of: http://stackoverflow.com/q/27428481

http://stackoverflow.com/a/27393182
downvote count: 0
answers question: http://stackoverflow.com/q/27392129
type: Answer
has comment: http://stackoverflow.com/comment/43245230
accepted answer of: http://stackoverflow.com/q/27392129
upvote count: 1
has comment: http://stackoverflow.com/comment/43245423
score: 1
has comment: http://stackoverflow.com/comment/43245086
has body: So, essentially when you have: i = setInterval(function () { i is undefined. As in, it doesn't even exist. So when you get to this part clearInterval(i); It says, i? What's that? Now I think JS has some capability to where it would derive that i is a variable, but I'm guessing that because you're passing it into another inner function, that that is where the issue comes into play. So var i = setInterval(function () { should solve your problem
type: AcceptedAnswer

http://stackoverflow.com/comment/43148902
score: 1
has text: I'm really not sure why you don't see the grey area, if I copy the html from your question, get the bootstrap files from a cdn (see external resources), fix the type and add the `padding-top: 70px` it looks good I think. See http://jsfiddle.net/ckuijjer/jLv3Lfy6/ or the screenshot in http://imgur.com/0AKg4TE. I'm afraid I can't help you any further
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27343829

http://stackoverflow.com/q/27450438
has comment: http://stackoverflow.com/comment/43339759
tagged with: web-scraping
has comment: http://stackoverflow.com/comment/43339857
has comment: http://stackoverflow.com/comment/43339790
has answer: http://stackoverflow.com/a/27450681
tagged with: java
has title: Checking if defined and has a Value
has body: I have some javascript which uses jsoup to extract info from a webform. All works great if the textarea Element is found on the page. But if it cant find it throws an error " Variable ASRRMK is undefined." asrRmk = asrRmk.select("textarea[name=asr_remarks]").first(); if (asrRmk != null &amp;&amp; asrRmk != undefined) { asrRmk = asrRmk.html() data = { name="asr_remarks" , value=asrRmk , type="textarea" }; so what I am trying to do is check if asrRmk is actually defined and has a value, if it is defined, I want to append it to my array, otherwise I will leave it of.
has comment: http://stackoverflow.com/comment/43343741
type: Question
tagged with: jsoup
has comment: http://stackoverflow.com/comment/43343775
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43341031
type: UnansweredQuestion

http://stackoverflow.com/comment/43335587
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27410367
type: Comment
has text: @VsevolodGoloviznin Sorry for not able to get back to this yesterday. "trigger chosen properly" meant the chosen plugin does not get initialized. $(".chosen-select).chosen() seems to take no affect. My dropdown appears as a multiselect list box instead of a chosen multi-select dropdown.

http://stackoverflow.com/comment/43217187
type: Comment
has text: my bad havent noticed that
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27383892

http://stackoverflow.com/a/27431068
type: Answer
answers question: http://stackoverflow.com/q/27430974
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: It's because you're removing the phonediv contents. so div#editPhone (a child of phonediv) doesn't exist when you try to prepend to it. $(document).on('click','#phoneDiv',function(){ var phone=$("#editPhone").val(); $("#phoneDiv").contents().filter(function() { return (!$(this).is(".editmode")); }).remove(); $('div#phoneDiv').prepend(phone); //&lt;-- div#editPhone doesn't exist anymore, you removed it above }); See here: http://jsfiddle.net/KyleMuir/ftngmx4j/5/
accepted answer of: http://stackoverflow.com/q/27430974

http://stackoverflow.com/q/27323482
answer count: 1
has comment: http://stackoverflow.com/comment/43106401
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43106675
tagged with: overflow
type: Question
has body: When I set the style on the html tag, like so in AngularJS: angular.element($document[0].documentElement).css('overflow', 'hidden'); The page jumps to the top of the page. How can I prevent this? I am trying to display a full page overlay, and when I try to scroll, the background scrolls. It doesn't scroll when I set the overflow: css style on the html tag. That has lead me to this problem.
has title: Hiding overflow on HTML tag makes browser jump to top of the page
has answer: http://stackoverflow.com/a/27323573
tagged with: javascript
score: 0

http://stackoverflow.com/q/27442816
score: 0
accepted answer: http://stackoverflow.com/a/27442890
tagged with: radio-button
has body: Is there any way to make this work? I have 2 radio buttons and 7 checkboxes. &lt;body&gt; &lt;input type="radio" id="upper"&gt;Uppercase &lt;input type="radio" id="lower"&gt;Lowercase&lt;br /&gt; &lt;input type="checkbox" name="days" id="1" data-val=""&gt; Monday &lt;input type="checkbox" name="days" id="2" data-val=""&gt; Tuesday &lt;input type="checkbox" name="days" id="3" data-val=""&gt; Wednesday &lt;input type="checkbox" name="days" id="4" data-val=""&gt; Thursday &lt;input type="checkbox" name="days" id="5" data-val=""&gt; Friday &lt;input type="checkbox" name="days" id="6" data-val=""&gt; Saturday &lt;input type="checkbox" name="days" id="0" data-val=""&gt; Sunday &lt;/body&gt; When I chose "Uppercase" radio button, I'd like to use "var DAYS", and set value as "data-val". For example, &lt;input type="checkbox" name="days" id="1" data-val="MON"&gt;Monday &lt;input type="checkbox" name="days" id="2" data-val="TUE"&gt;Tuesday . . . &lt;input type="checkbox" name="days" id="0" data-val="SUN"&gt;Sunday And when I chose "Lowercase", I'd like to use "var days", and set value as "data-val". &lt;input type="checkbox" name="days" id="1" data-val="mon"&gt;Monday &lt;input type="checkbox" name="days" id="2" data-val="tue"&gt;Tuesday . . . &lt;input type="checkbox" name="days" id="0" data-val="sun"&gt;Sunday I tried to make this happen as following way, but it doesn't wowrk. &lt;script&gt; var DAYS = ['MON', 'TUE', 'WED', 'THU','FRI', 'SAT', 'SUN']; var days = ['mon', 'tue', 'wed', 'thu','fri', 'sat', 'sun']; if ($('#upper').prop('checked')) { $.each(DAYS, function (i, value) { var ID = parseInt($("input[ type='checkbox' ]").attr('id')); if (ID === i) { $("[ type='checkbox' ]").attr( 'data-val', value); } }); else if ($('#lower').prop('checked')) { $.each(days, function (i, value) { var ID = parseInt($("input[ type='checkbox' ]").attr('id')); if (ID === i) { $("input[ type='checkbox' ]").attr( 'data-val', value); } }); } &lt;/script&gt; Could anyone help me with the follo…
has answer: http://stackoverflow.com/a/27442890
tagged with: checkbox
type: AnsweredQuestion
type: Question
tagged with: arrays
answer count: 1
tagged with: javascript
has title: jquery switching array list with radio buttons and checkboxes
tagged with: jquery

http://stackoverflow.com/comment/78481418
score: 0
type: Comment
type: AnswerComment
has text: @AleksandarĐorđević did you try the 2nd HTML example in the answer? That's exactly what it does: ` ... `
comment on: http://stackoverflow.com/a/33987292

http://stackoverflow.com/comment/43244682
type: Comment
type: QuestionComment
has text: Actually your function is called every 3 seconds but the condition in the `if` statement will evaluate to `false` because you are using a relative path while your browser transforms it in an absolute path when setting `document.body.style.backgroundImage`.
comment on: http://stackoverflow.com/q/27399384
score: 0

http://stackoverflow.com/comment/68499950
has text: @Unspeakable this [works just fine for me](https://i.imgur.com/wSdJEqi.png)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27472191
type: AnswerComment

http://stackoverflow.com/comment/43175013
score: 1
has text: A bit weird though, but what if I add data right after when I create stores? At least in the example 1 of http://www.w3.org/TR/IndexedDB/#range-concept they have did it.
type: AnswerComment
comment on: http://stackoverflow.com/a/27361022
type: Comment

http://stackoverflow.com/a/27391747
has comment: http://stackoverflow.com/comment/44513638
answers question: http://stackoverflow.com/q/27390912
type: Answer
has comment: http://stackoverflow.com/comment/44511730
accepted answer of: http://stackoverflow.com/q/27390912
has body: That's because the jQuery you are using is referencing to HTML elements that you do not use. In your HTML, there are no classes on or off. Also, you only have one slide, so the functions for closing slides do not work correctly. If you just want to toggle the .slideDown() and .slideUp() animations on the submenu, you can do this: $(document).ready(function() { $('.sub-menu').hide(); //ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING) $('.menu-item-has-children').click(function() { $('.sub-menu').slideToggle('normal'); }); }); This works for a simple sliding animation. See what I mean in this demo: DEMO
upvote count: 3
has comment: http://stackoverflow.com/comment/44513328
has comment: http://stackoverflow.com/comment/44513525
type: AcceptedAnswer
downvote count: 0
score: 3

http://stackoverflow.com/comment/43384447
score: 0
has text: I think for now maybe its better just to use a custom attribute like data-idx and just pass the idx I want from html. I originally did this,I modified question to demonstrate, but it just seemed like a lot of extra work for something that should be easy to get to. Still for better solution.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27473247

http://stackoverflow.com/a/32171122
has body: Angular provides service '$filter'. We can inject this service on controller. with the help of this service, we can format the date . var dateFrom = $filter('date')(new Date(), "MM/dd/yyyy"); in this way, we can able to format the date with or without Timezone. The return valus is string and we can convert the string into DateTime on Backend. The otherway is to use library moment.js. This library provides better way of converting/formatting Dates. check this blog , which provides angular date/time filtering &amp; formatting.
answers question: http://stackoverflow.com/q/27421821
score: 0
type: Answer

http://stackoverflow.com/q/27421933
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have 3 s as follows. In that one of the has panel bar so its height may be increased based on the content of each panel bar. Now I want to increase the height of other two divs based on the height of the which has panel bar. How can I achieve this? //Panel bar is inside this div. "leftdiv" and "rightdiv" height should be increase base on "maindiv" height???
accepted answer: http://stackoverflow.com/a/27422597
type: AnsweredQuestion
has title: HTML: auto increase height based on other div's height
has comment: http://stackoverflow.com/comment/43286177
type: Question
has answer: http://stackoverflow.com/a/27422129
has answer: http://stackoverflow.com/a/27422420
has comment: http://stackoverflow.com/comment/43286276
possible better answer: http://stackoverflow.com/a/27422039
score: 0
has answer: http://stackoverflow.com/a/27422039
has answer: http://stackoverflow.com/a/27422597
tagged with: javascript
has comment: http://stackoverflow.com/comment/43286244
has answer: http://stackoverflow.com/a/27422120
answer count: 5

http://stackoverflow.com/q/27379060
has comment: http://stackoverflow.com/comment/43209300
has comment: http://stackoverflow.com/comment/43207974
has comment: http://stackoverflow.com/comment/43209576
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43208179
has comment: http://stackoverflow.com/comment/43207927
has comment: http://stackoverflow.com/comment/43208121
has title: How to set cookie in url in jquery
tagged with: symfony
tagged with: php
has comment: http://stackoverflow.com/comment/43209566
tagged with: cookies
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43207875
score: 0
type: Question
has body: what i need i need to append the cookie data in url in jquery. AcmeExtension.Php Public function get_hash_attend($event_id,$user_id) { echo $event_id; echo "&lt;pre&gt;"; echo $user_id; $key = '!@#hjka@#$jks*&amp;@'; $encrypt=$user_id."-".$event_id; $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $encrypt, MCRYPT_MODE_ECB); $xyz = (base64_encode($encrypted)); $xyz = urlencode($xyz); $xyz = str_replace("%2F",")",$xyz); $xyz = str_replace("%3F","_",$xyz); $xyz = str_replace("%2B","(",$xyz); $hash='http://'.DOMAIN_NAME.'/ticket_transaction/autosubmit_advance/'.$event_id.'/'.$user_id.'/'.$xyz.'?source=oneclickEmail'; return $hash; //$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $d, MCRYPT_MODE_ECB); } js code &lt;script&gt; $(document).ready(function() { $( "#attend" ).click(function() { alert( "attend .click() ." ); $.ajax({ type:"POST", url:"{{get_hash_attend(9,13530767)}}", success: function(data) { alert(data); $("#attend").text("Attending"); //alert(data); } }); }); }); &lt;/script&gt; problem im facing when i used url:"{{get_hash_attend(9,13530767)}}" works fine. but how to get cookie data as user is save in cookie. i have $data[$k]['event_id'] in twig I Need : i Need to fetch user data from cookie in function . id of particular url.
has answer: http://stackoverflow.com/a/27379308
tagged with: javascript

http://stackoverflow.com/comment/43368997
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27465574
has text: Just let JS garbage collect, it's what it does for a living. Or, to put it another way, can you construct a case where something you want to be and should be GC'd is not?
score: 0

http://stackoverflow.com/comment/43157784
type: Comment
type: QuestionComment
has text: try these two Video plugins: https://github.com/macdonst/VideoPlayer and https://github.com/remcob00/cordova-phonegap_youtube_player_api_android
score: 0
comment on: http://stackoverflow.com/q/27351466

http://stackoverflow.com/comment/43110415
type: QuestionComment
comment on: http://stackoverflow.com/q/27324802
has text: @Pointy As I mentioned in the question, it's not. I will try to create a minimal reproducible sample.
score: 0
type: Comment

http://stackoverflow.com/a/27361933
has comment: http://stackoverflow.com/comment/43176995
accepted answer of: http://stackoverflow.com/q/27361907
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/27361907
score: 2
has body: You have a syntax error: 'Procedere con l'acquisto?' You can't use ' characters in a string delimited by ' characters without escaping them. \' You should have got an error message about this in your JS error console.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27331275
tagged with: javascript
has answer: http://stackoverflow.com/a/27331288
upvote count: 2
accepted answer: http://stackoverflow.com/a/27331288
has comment: http://stackoverflow.com/comment/43120971
answer count: 1
favorite count: 0
has title: Regular expression that validate username like
tagged with: regex
has comment: http://stackoverflow.com/comment/43138720
downvote count: 4
type: AnsweredQuestion
has body: I need a regular expression that matches string that contain alphanumeric value must start with alphabetic character no special character allowed and min length 5 char and max 20. ^[A-Za-z][A-Za-z0-9]+$ I have generated many but above is working for me only one thing remain in above expression that is length validation.
type: Question
score: -2

http://stackoverflow.com/comment/43118127
comment on: http://stackoverflow.com/q/27330007
type: QuestionComment
type: Comment
has text: your markup is invalid...you cannot use duplicate id's.. **its wrong**
score: 1

http://stackoverflow.com/comment/43178735
score: 0
comment on: http://stackoverflow.com/q/27363134
type: Comment
type: QuestionComment
has text: There are no js errors thrown, and the fiddle works fine, just not the same code in practice. I'll edit and post the rendered html.

http://stackoverflow.com/q/27396887
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/27397016
has answer: http://stackoverflow.com/a/27397007
has comment: http://stackoverflow.com/comment/43240149
downvote count: 0
tagged with: jquery
has body: I want to get the parent div id (the div class is called "col-sm-2") when selecting each option in HTML "select" tag in each div. But it always gives only the div id of latest added product at "id" alert. For example if the id of my last added product is "7", it always gives "7" as the alert. Here is my PHP code for getting the product id. $jsql_ae7 = mysql_query("select request_list.product_id from request_list where request_list.product_id='{$jrowa2['id']}' and request_list.email='$visit_email'") or die(mysql_error()); $jfeta7 = mysql_fetch_assoc($jsql_ae7); Here is my HTML code. &lt;div class="col-sm-2" id="&lt;?php echo $jfeta7['product_id']; ?&gt;"&gt; &lt;select id="formats_id" name="aformats" onchange="showFormat(this);"&gt; &lt;option value="&lt;?php echo $jrowa2['formats']; ?&gt;"&gt;&lt;?php echo $jrowa2['formats']; ?&gt;&lt;/option&gt; &lt;?php foreach($formats3 as $v3){ ?&gt; &lt;?php if($v3 !== $jrowa2['formats']) { ?&gt; &lt;option value="&lt;?php echo $v3; ?&gt;"&gt;&lt;?php echo $v3; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;?php } ?&gt; &lt;/select&gt; &lt;/div&gt; Here is my javaScript code. var showFormat = function(dd) { var format_value = dd.options[dd.selectedIndex].value; var scriptTags = document.getElementsByTagName('select'); var id = scriptTags[scriptTags.length - 1].parentNode.id; alert(id); };
has title: How to get the parent div id in javaScript?
has answer: http://stackoverflow.com/a/27397022
favorite count: 0
possible better answer: http://stackoverflow.com/a/27396974
accepted answer: http://stackoverflow.com/a/27396936
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27396936
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27396974

multi-device-hybrid-apps
tag name: multi-device-hybrid-apps
type: Tag
tags question: http://stackoverflow.com/q/27405720

http://stackoverflow.com/a/27345346
type: Answer
answers question: http://stackoverflow.com/q/27345092
score: 0
has body: When you are uploading a file via ajax the input values and the file are still on the form you must clear the form $('#dataform')[0].reset(); or clear the value of the input $("#datafiletxt").val(""); which triggers the upload button.

http://stackoverflow.com/q/27337026
tagged with: dc.js
has title: dc.js - plotting large data sets and multiple series on same chart w/ different rendering styles (line, bar, etc)
has comment: http://stackoverflow.com/comment/43171171
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43130798
score: 0
has comment: http://stackoverflow.com/comment/43130787
has comment: http://stackoverflow.com/comment/43180683
has body: I have been using dimple.js for sometime and i do like it. however for large sets of data i am noticing some performance issues and would like to try crossfilter + dc to see how it performs. My problem is i am not quite sure how to best package the payload before delivering to the page/javascript. my json is somewhat complex, but at the core of it, it contains an array of data sets that i want to plot on the same chart as line or bar charts. so for example, below, i would like to plot the first two sets (Open and Close) as line series and the third series as a barchart (ideally on a 2nd y-axis). my questions are: Is this possible with dc.js? Do i get any benefits of crossfilter in this case with regards to page load speed (the real data will consists of 6 arrays and about 3k data points each).? Here is what the json looks like: { "hist_quotes" : [{ "title" : "Open Prices", "data" : [{ "y" : 4318.28, "x" : "2014-12-05 00:00:00", "category" : "Open" }, { "y" : 4309.48, "x" : "2014-12-04 00:00:00", "category" : "Open" }, { "y" : 4312.17, "x" : "2014-12-03 00:00:00", "category" : "Open" }, { "y" : 4291.33, "x" : "2014-12-02 00:00:00", "category" : "Open" } }], [{ "title" : "Close Prices", "data" : [{ "y" : 4324.28, "x" : "2014-12-05 00:00:00", "category" : "Open" }, { "y" : 4355.48, "x" : "2014-12-04 00:00:00", "category" : "Open" }, { "y" : 4333.17, "x" : "2014-12-03 00:00:00", "category" : "Open" }, { "y" : 4334.33, "x" : "2014-12-02 00:00:00", "category" : "Open" } }], [{ "title" : "Volume", "data" : [{ "y" : 431828000, "x" : "2014-12-05 00:00:00", "category" : "Open" }, { "y" : 401828000, "x" : "2014-12-04 00:00:00", "category" : "Open" }, { "y" : 431828000, "x" : "2014-12-03 00:00:00", "category" : "Open" }, { "y" : 401828000, "x" : "2014-12-02 00:00:00", "category" : "Open" } }] ] }
type: Question
has comment: http://stackoverflow.com/comment/43136428
tagged with: javascript

http://stackoverflow.com/comment/43229255
has text: Are you certain this method is firing in response to a route being hit?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27389800

http://stackoverflow.com/q/27334951
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27335460
favorite count: 0
has answer: http://stackoverflow.com/a/27335460
answer count: 4
type: AnsweredQuestion
has body: I have a functions which asks the users to write their favorites animals ant then stores it in an array called animals.When a user executes the function I want to check if the animal he wants is inside the array and if yes to show the index of the animal(for example:The animal you entered is already in the array.Its index number is...).Any ideas? var animals=[] function anim(){ var ani=prompt("Give me an animal you like"); animals.push(ani); }
score: 1
accepted answer: http://stackoverflow.com/a/27335049
has title: How to check if a string or a number exists inside an array Javascript
type: Question
has answer: http://stackoverflow.com/a/27335049
tagged with: javascript
upvote count: 2
has answer: http://stackoverflow.com/a/27335001
downvote count: 1
tagged with: arrays
has answer: http://stackoverflow.com/a/27334989

http://stackoverflow.com/comment/43139287
has text: its not working when i add it externally please help me out..!!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27341751

esri
tags question: http://stackoverflow.com/q/27418105
tag name: esri
type: Tag
tags question: http://stackoverflow.com/q/27442634

http://stackoverflow.com/comment/43245973
type: Comment
comment on: http://stackoverflow.com/q/27400359
type: QuestionComment
has text: not clear with question can you explain clearly ?
score: 0

http://stackoverflow.com/comment/116733241
has text: Please, don't post code without an explanation as an answer. Try to explain what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes.
comment on: http://stackoverflow.com/a/66022370
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43227028
has text: In which line of http://cdn.mxpnl.com/libs/mixpanel-2-latest.js is the export with `window`?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27389463

percentage
tags question: http://stackoverflow.com/q/27350704
type: Tag
tag name: percentage

http://stackoverflow.com/a/27442227
accepted answer of: http://stackoverflow.com/q/27440581
type: AcceptedAnswer
type: Answer
score: 16
has comment: http://stackoverflow.com/comment/43324351
answers question: http://stackoverflow.com/q/27440581
upvote count: 16
has comment: http://stackoverflow.com/comment/43339375
has body: The point is that the getter is a property of the object you pass to React.createClass, not of the class that is created: react treats it as a value. From reacts perspective, the following 2 code snippets are exactly the same: var MyComponent = React.createClass({ foo: "asdf", ... }) vs. var MyComponent = React.createClass({ get foo() { return "asdf" }, ... }) For functions that you pass to createClass, react binds the this variable to the component, but for getters it is not possible.
downvote count: 0

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/27363959
tags question: http://stackoverflow.com/q/27333173
tags question: http://stackoverflow.com/q/27425573
tags question: http://stackoverflow.com/q/27372964
tags question: http://stackoverflow.com/q/27345449
tags question: http://stackoverflow.com/q/27408079
tags question: http://stackoverflow.com/q/27462196
tags question: http://stackoverflow.com/q/27345977
tags question: http://stackoverflow.com/q/27363951
tags question: http://stackoverflow.com/q/27442178
tags question: http://stackoverflow.com/q/27417503
tags question: http://stackoverflow.com/q/27359276
tags question: http://stackoverflow.com/q/27429560
tags question: http://stackoverflow.com/q/27395588
tags question: http://stackoverflow.com/q/27352485
tags question: http://stackoverflow.com/q/27383738
tags question: http://stackoverflow.com/q/27467603
tags question: http://stackoverflow.com/q/27344193
tags question: http://stackoverflow.com/q/27334330
tags question: http://stackoverflow.com/q/27394564
tags question: http://stackoverflow.com/q/27400766
tags question: http://stackoverflow.com/q/27424094
tags question: http://stackoverflow.com/q/27342638
tags question: http://stackoverflow.com/q/27386119
tags question: http://stackoverflow.com/q/27349882
tags question: http://stackoverflow.com/q/27453828
tags question: http://stackoverflow.com/q/27442828
tags question: http://stackoverflow.com/q/27353249
tags question: http://stackoverflow.com/q/27383097
tags question: http://stackoverflow.com/q/27326681
tags question: http://stackoverflow.com/q/27417705
tags question: http://stackoverflow.com/q/27379655
tags question: http://stackoverflow.com/q/27453805
tags question: http://stackoverflow.com/q/27340897
tags question: http://stackoverflow.com/q/27378210
tags question: http://stackoverflow.com/q/27363936
tags question: http://stackoverflow.com/q/27394022
tags question: http://stackoverflow.com/q/27445435
tags question: http://stackoverflow.com/q/27420743
tags question: http://stackoverflow.com/q/27371160
tags question: http://stackoverflow.com/q/27341248
tags question: http://stackoverflow.com/q/27360778
tags question: http://stackoverflow.com/q/27428973
tags question: http://stackoverflow.com/q/27371839
tags question: http://stackoverflow.com/q/27384350
tags question: http://stackoverflow.com/q/27341619
tags question: http://stackoverflow.com/q/27437768
tags question: http://stackoverflow.com/q/27324635
tags question: http://stackoverflow.com/q/27412827
tags question: http://stackoverflow.com/q/27352084
tags question: http://stackoverflow.com/q/27322181
tags question: http://stackoverflow.com/q/27453015
tags question: http://stackoverflow.com/q/27350832
type: Tag
tags question: http://stackoverflow.com/q/27357014
tags question: http://stackoverflow.com/q/27425622
tags question: http://stackoverflow.com/q/27449718
tags question: http://stackoverflow.com/q/27333453
tags question: http://stackoverflow.com/q/27457747
tags question: http://stackoverflow.com/q/27315634
tags question: http://stackoverflow.com/q/27346346
tags question: http://stackoverflow.com/q/27315760
tags question: http://stackoverflow.com/q/27473437
tags question: http://stackoverflow.com/q/27318175
tags question: http://stackoverflow.com/q/27442522
tags question: http://stackoverflow.com/q/27375353
tags question: http://stackoverflow.com/q/27347601
tags question: http://stackoverflow.com/q/27408197
tags question: http://stackoverflow.com/q/27366660
tags question: http://stackoverflow.com/q/27340334
tags question: http://stackoverflow.com/q/27419985
tags question: http://stackoverflow.com/q/27360492
tags question: http://stackoverflow.com/q/27406703
tags question: http://stackoverflow.com/q/27446091
tags question: http://stackoverflow.com/q/27447058
tags question: http://stackoverflow.com/q/27447062
tags question: http://stackoverflow.com/q/27363522
tags question: http://stackoverflow.com/q/27365155
tags question: http://stackoverflow.com/q/27451551
tags question: http://stackoverflow.com/q/27322585

http://stackoverflow.com/comment/43194649
has text: I would, then, suggest you use `God is good`'s answer.
comment on: http://stackoverflow.com/q/27371550
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43183080
has text: There are no errors in the console. This solution you suggested may not work for Telerik mobile apps. The admin at [this forum post](http://www.telerik.com/forums/app-showloading()-and-app-hideloading()#LdCLln8PNEiMp9eTApA_vQ) said to use a web worker.
comment on: http://stackoverflow.com/a/27347775
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/43307981
comment on: http://stackoverflow.com/q/27433383
score: 0
has text: What does the raw response from that URL look like?
type: Comment
type: QuestionComment

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/27420838

http://stackoverflow.com/a/27417659
answers question: http://stackoverflow.com/q/27314855
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27314855
has body: Did it, changed all the directories to permission 777 sudo find /Users/black_monk/meteor_examples/todos/.meteor/local/ -type d -exec chmod 777 {} \; and all the files inside it to 777 as well sudo find /Users/black_monk/meteor_examples/todos/.meteor/local/ -type f -exec chmod 777 {} \;

http://stackoverflow.com/comment/43180736
type: Comment
comment on: http://stackoverflow.com/a/27363552
type: AnswerComment
score: 0
has text: Ok, the way you formatted the code makes it appear that you can.

http://stackoverflow.com/q/27421833
tagged with: javascript
has comment: http://stackoverflow.com/comment/43287936
has title: Custom css properties or partial css-variables shim
type: Question
score: 0
linked to: http://stackoverflow.com/q/6274350
answer count: 1
has comment: http://stackoverflow.com/comment/43286137
has comment: http://stackoverflow.com/comment/43291401
favorite count: 0
has comment: http://stackoverflow.com/comment/43288239
has body: I'd like to be able to define some non-standard properties inside my CSS classes which can then be picked up by my javascript at runtime in exactly the same way and with the same precedence as standard ones using Window.getComputedStyle() or jQuery.css(). This is to allow flexible theming of items such as gauge needle paths, radial scale extents etc, in some SVG-based gauges in a dashboard. This facility is provided by the css-variables specification but is currently only implemented in firefox: http://dev.w3.org/csswg/css-variables/ I don't need the full functionality of the css-variables specification since the variables only need to be read by my JavaScript code, not by standard css properties. Can anybody suggest a shim or a means of implementing this? Thanks.
has comment: http://stackoverflow.com/comment/43286020
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43287977
has answer: http://stackoverflow.com/a/27422280
type: UnansweredQuestion
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/27342821
has answer: http://stackoverflow.com/a/27343386
type: AnsweredQuestion
has body: I've created a ScalaJS project using: http://www.scala-js.org/doc/tutorial.html Reading the docs at http://www.scala-js.org/doc/faq.html, it does not seem that creating and calling a JavaScript function is described? How do I create a JavaScript function and invoke it? I'll manually add d3 to the head element to index.html: But how do I create the below code using ScalaJS? $(document).ready(function () { var svgContainer = d3.select("body").append("svg") .attr("width", 1200) .attr("height", 1200) .attr("text-align", "center"); testFunction(svgContainer); }); Entire index.html: Example Scala.js application Example Scala.js application - full-optimized version After having compiled and full-optimized properly the code for the application (using `sbt fullOptJS`), you should see "It works" herebelow. See README.md for detailed explanations. Update: object ScalaJSExample extends js.JSApp { def main(): Unit = { jQuery(dom.document).ready { () => { val svgContainer = "d3.select(\"body\").append(\"svg\").attr(\"width\", 1200).attr(\"height\", 1200).attr(\"text-align\", \"center\")"; val function = "callFunction(svgContainer)"; } } } def callFunction(svgContainer): Unit = { } } In callFunction should svgContainer be typed, will callFunction be created as a JavaScript function when built using fastOptJS? Within jQuery(dom.document).ready {, is this the correct method of creating svgContainer and testFunction?
accepted answer: http://stackoverflow.com/a/27343386
type: Question
tagged with: scala.js
answer count: 1
downvote count: 0
tagged with: javascript
has title: How to create a javascript function using Scala.js?
favorite count: 0
score: 2
upvote count: 2
tagged with: d3.js
tagged with: scala

http://stackoverflow.com/a/27373688
has comment: http://stackoverflow.com/comment/43198327
accepted answer of: http://stackoverflow.com/q/27373625
type: AcceptedAnswer
upvote count: 2
has comment: http://stackoverflow.com/comment/43198633
has comment: http://stackoverflow.com/comment/43198079
type: Answer
has body: Couple of things: 1) You need to escape special character present in id tag. 2) You need to find option by selected attribute and not select element as selected $("#\\#jform_params_foreignmanuf :selected").length Demo for selected option count and for getting selected elements value in textbox as comma seprated string: var count=$("#\\#jform_params_foreignmanuf").val().join(","); $("#jform_params_manucounter").val(count); Demo for selected value Update: for getting first selected option text: var firstselectedtext=$("#\\#jform_params_foreignmanuf :Selected:first").text(); $("#jform_params_manucounter").val(firstselectedtext); Demo for first selected option text for getting all selected options text: var selectedtext=$.map( $('#\\#jform_params_foreignmanuf :Selected'), function (element) { return $(element).text() }); $("#jform_params_manucounter").val(selectedtext.join(',')); Demo for getting all selected options text
score: 2
has comment: http://stackoverflow.com/comment/43198020
downvote count: 0
has comment: http://stackoverflow.com/comment/43198064
has comment: http://stackoverflow.com/comment/43198522
answers question: http://stackoverflow.com/q/27373625
has comment: http://stackoverflow.com/comment/43198157

http://stackoverflow.com/comment/43331938
score: 0
type: QuestionComment
has text: so whats the problem
type: Comment
comment on: http://stackoverflow.com/q/27446520

http://stackoverflow.com/comment/43274032
has text: I did not say `this` == scope. What I meant is that the value of `this` depends upon the current scope, but I'll edit to make that more clear.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27414940
score: 0

http://stackoverflow.com/q/27353001
type: Question
has answer: http://stackoverflow.com/a/27353649
has answer: http://stackoverflow.com/a/27353511
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27353511
has comment: http://stackoverflow.com/comment/43159852
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/43159641
tagged with: jsp
has body: I have a .jsp file with structure of a page (lets call it base.jsp), it also includes link to CSS file (base.css). Now I want to include this base.jsp in another jsp file, pass some parameter and according to this parameter load additional CSS file. It should be something like that (I know this code is incorrect, I just want to demonstrate what I want to achieve eventually): &lt;%@include file="base.jsp" x="720" %&gt; if(x == "720") load 720.css else if(x == "460") load 460.css else load 320.css How can it be done? Edit Perhaps it can be done with something like that? &lt;%@include file="base.jsp?x=720" %&gt; and then somehow read this x parameter in the base.jsp file and load additional css accordingly? Is there such possibility?
favorite count: 0
has comment: http://stackoverflow.com/comment/43159932
has comment: http://stackoverflow.com/comment/43159608
has answer: http://stackoverflow.com/a/27353421
accepted answer: http://stackoverflow.com/a/27353421
type: AnsweredQuestion
downvote count: 0
has title: Including a page with JSP and loading various CSS files
score: 1
tagged with: java

http://stackoverflow.com/q/27355555
has title: IndexOf doesn't work correctly with object which contain array
has comment: http://stackoverflow.com/comment/43165428
answer count: 1
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/43168046
tagged with: javascript
has comment: http://stackoverflow.com/comment/43165460
favorite count: 0
has body: I have a the next code: function insertIfNotThere(array, item) { /* Push the new element everytime: because return -1 */ if (array.indexOf(item) === -1) { array.push(item); } /*But this log shows 1, 2, 3 and so on...*/ console.log(array.length); } function EventManager(target) { var target = target || window, events = {}; this.observe = function(eventName, cb) { if (events[eventName]){ /* This insert the new event everytime: indexOf doesn't work... */ insertIfNotThere(events[eventName], cb); }else{ events[eventName] = []; events[eventName].push(cb); } return target; }; this.fire = function(eventName) { if (!events[eventName]) return false; for (var i = 0; i &lt; events[eventName].length; i++) { events[eventName][i].apply(target, Array.prototype.slice.call(arguments, 1)); } }; } I use "insertIfNotThere" method for checking if the element with the content indicated exist. But... It push the element ever... I don't know what's happening... I created the event with a button: if I click several times in this, duplicate the elements...
has answer: http://stackoverflow.com/a/27357972
score: 2
tagged with: listener
has comment: http://stackoverflow.com/comment/43164972
upvote count: 2
has comment: http://stackoverflow.com/comment/43165036
has comment: http://stackoverflow.com/comment/43168167
accepted answer: http://stackoverflow.com/a/27357972
type: AnsweredQuestion
tagged with: indexof
tagged with: duplicates
type: Question

http://stackoverflow.com/comment/43142783
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27343505
has text: @rfornal The extra ids which are 2,4 not present in the first array should be present in the last in any order.

http://stackoverflow.com/a/27422524
type: Answer
has comment: http://stackoverflow.com/comment/43288011
score: 0
has body: JS uses Call by reference method.So when update obj it changes all values. You need to do deep copy.Use this dataObj.compareESX.push(JSON.parse(JSON.stringify(obj)));
answers question: http://stackoverflow.com/q/27422415

http://stackoverflow.com/a/27385241
answers question: http://stackoverflow.com/q/27385181
downvote count: 0
type: Answer
score: 2
has body: alert(JSON.stringify(obj)) returns a string of the property names and their values of an object.
upvote count: 2
has comment: http://stackoverflow.com/comment/43218856

http://stackoverflow.com/q/27343382
has comment: http://stackoverflow.com/comment/43148567
score: 6
type: Question
tagged with: javascript
tagged with: fullcalendar
has title: Cannot read property 'clone' of undefined
has body: I'm using Fullcalendar and I'm trying to update events. I'm trying to make an ajax callback to get def edit of that event. The route would be /controls/:id/edit, so I've built this ajax callback: eventClick: function(date, jsEvent, view) { console.log(date.id) console.log(jsEvent) console.log(view) $.ajax({ type: "GET", url: "/controls/"+date.id+"/edit", }); $('#calendar').fullCalendar('updateEvent', event); } The code of the controls_controller.rb is this: def edit if request.xhr? @control = Control.find(params[:id]) end end My problem is that when I click on one event the console tells me "Uncaught TypeError: Cannot read property 'clone' of undefined". I don't know what that means. I think I'm doing it right but it doesn't work. Anyone could help me?? Thank you in advance.
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43142140
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43150820
type: UnansweredQuestion
upvote count: 6
has answer: http://stackoverflow.com/a/36129295

http://stackoverflow.com/q/27317226
has body: I have a for-loop in javascript/jQuery to create an html unordered list. I want every multiple of 10 iteration to be a new unordered list tag. JavaScript code: var count = 100; for(var i = 0; i <= count; i++) { if(i == 0) { $('ul.list').append(' ' + i + ' '); } else { if(i % 10 == 0) { $('ul.list').after(' '); } $('ul.list:last-child').append(' ' + i + ' '); } } It looks like it should work, but JavaScript generates this: 0 ... I expect it to output 10 items and then create a new unordered list tag every 10th item. Clearly the code is all wrong. Can I get some help.
answer count: 1
has title: JavaScript generate an HTML list with content in a for loop
type: AnsweredQuestion
tagged with: loops
type: Question
has answer: http://stackoverflow.com/a/27317405
tagged with: modulo
tagged with: javascript
tagged with: iteration
accepted answer: http://stackoverflow.com/a/27317405
score: 0

http://stackoverflow.com/q/27402698
linked to: http://stackoverflow.com/q/1206203
has answer: http://stackoverflow.com/a/27402853
has title: How to check whether the mouse left button is down or not while mouse move?
linked to: http://stackoverflow.com/q/322378
type: Question
has body: I have a below situation. function mousemove(e){ if(left button clicked){ //drag the element } else{ //show the tooltip } } Initially i have binded the mousemove function. while mouse moving i need to check whether the left button is clicked or not. if clicked means i need to drag it. else means i need to show tooltip. i searched a lot. i cant get the solution for all the browser, I need to do this for IE8,IE9,IE10,IE11,Chrome, firefox and safari. please help me... thanks in advance..
has comment: http://stackoverflow.com/comment/43250191
tagged with: mouseevent
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/322378
type: UnansweredQuestion

http://stackoverflow.com/a/27319155
has body: You can't pass the for statement to the alert, but you can create an string with the array data and pass it to the alert as follow: array = ['some', 'text', 'to', 'print'] alert("message: " + array.map(function(s){return s;})) join is good, but for dict objects you can't use it array = [{text:'some'}, {text:'text'}, {text:'to'}, {text:'print'}] alert("message: " + array.map(function(s){return s['text'];})) hope it helps
answers question: http://stackoverflow.com/q/27319043
score: 0
type: Answer

local
tags question: http://stackoverflow.com/q/27323758
type: Tag
tag name: local

http://stackoverflow.com/a/27380863
answers question: http://stackoverflow.com/q/27380818
type: Answer
score: 0
has body: In javascript you can check if the variable is assigned by putting it in an if statement. If it has a value it will be true (well unless its value is false or 0). If it has no value or evaluates at null it will return false. Looks like they are verifying it has a value before passing it into the function.

http://stackoverflow.com/a/27432844
upvote count: 4
answers question: http://stackoverflow.com/q/27387956
score: 4
has body: found it! I missed to import of the pdfMake plugin in my home html file.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/65362876
has comment: http://stackoverflow.com/comment/55854884
accepted answer of: http://stackoverflow.com/q/27387956

rethinkdb
tags question: http://stackoverflow.com/q/27464880
tags question: http://stackoverflow.com/q/27429709
tag name: rethinkdb
type: Tag
tags question: http://stackoverflow.com/q/27318060

http://stackoverflow.com/comment/43091467
score: 0
comment on: http://stackoverflow.com/q/27314704
type: Comment
has text: The only error I am getting is `Uncaught SyntaxError: Unexpected end of input` which has been there since I first created the map.
type: QuestionComment

http://stackoverflow.com/comment/43173893
has text: I suggest you check the outputted HTML code in your browser, it is likely an issue with the loaded CSS itself (or 404).
score: 0
comment on: http://stackoverflow.com/q/27360858
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27345469
type: Question
tagged with: jquery-masonry
tagged with: masonry
has comment: http://stackoverflow.com/comment/43146621
tagged with: javascript
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43146203
has body: I have which works ok with standard masonry functionality, but masonry is trying to do the layout before some of the images loaded so it's looking messed up. I tried adding $(function() { var $container = $('.js-masonry'); // initialize Masonry after all images have loaded $container.imagesLoaded( function() { $container.masonry(); }); }); But it's not helping! Is the issue me mixing the data attributes and the js code? Or is it something else i cannot see? Any help very gratefully appreciated! Added - .item css is width: 49%; margin-bottom: 15px;
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/27346206
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Masonry imagesLoaded not working
score: 2
has answer: http://stackoverflow.com/a/27345565
has comment: http://stackoverflow.com/comment/43146878

http://stackoverflow.com/a/27350582
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has body: The answer is quite simple : "It works on the premade divs but on the newly made one, it doesn't work. How do I fix that?" It's normal : $(".widget").mousedown(...); // should be read as (except that a new var is not created) var $currentlyExistingWidgets = $(".widget"); $currentlyExistingWidgets.mousedown(...); To each element of class widget currently existing, you bind an event. If you want to bind events to elements not existing... You have to reconider your way of thinking and then bind an event listener to a container always existing, with an event delegation mechanism and proper filtering. For example the following code should catch the event for all .widget, created before or after : // http://api.jquery.com/on/ $('body').on('mousedown', '.widget', function() { ... }); If you want to search and learn, the key concepts are event bubbling and event delegation.
accepted answer of: http://stackoverflow.com/q/27350447
answers question: http://stackoverflow.com/q/27350447

http://stackoverflow.com/comment/43225685
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27382856
type: Comment
has text: Unfortunately I am not allowed to answer because of a banned account for some unknown reason. If you would like to post the answer with my solution then I will accept it. Thanks.

http://stackoverflow.com/comment/43171930
comment on: http://stackoverflow.com/a/27359509
type: Comment
score: 0
type: AnswerComment
has text: Your answer worked as well. Thanks. But there is an update to my question, please read and if you can, tell me what is the solution?

http://stackoverflow.com/comment/43203784
comment on: http://stackoverflow.com/q/27376661
score: 0
type: QuestionComment
has text: Most probably problem is in changing ` ` value. [Example without changing value](http://jsfiddle.net/orxwgapo/1/).
type: Comment

http://stackoverflow.com/q/27352008
has body: I am automating a website test using Selenium Webdriver and Phantomjs (Casperjs). I would like to do some performance check and as a part of it, I would like to check the size of the JS or CSS files (They should not exceed 40kb). I want to do this on client side. I know that chrome dev tools or yslow shows me this information. So I would like to get the information from them if possible and easy, or just replicate whatever they are doing. How can I do this?
tagged with: phantomjs
has comment: http://stackoverflow.com/comment/43159425
tagged with: google-chrome-devtools
tagged with: javascript
has comment: http://stackoverflow.com/comment/43159457
has comment: http://stackoverflow.com/comment/43157974
has title: How to get JS and CSS file size on client side?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43179077
tagged with: css
has comment: http://stackoverflow.com/comment/43162065
tagged with: selenium-webdriver
answer count: 0
score: 0
type: Question
has comment: http://stackoverflow.com/comment/43179122

http://stackoverflow.com/comment/43318313
type: AnswerComment
comment on: http://stackoverflow.com/a/27436354
type: Comment
has text: Just to clarify, with using classes as you put above, it these cases ( when including from separate file ) it is the order of execution that matters. So if you execute the code for the class after including everything then it should work, because it doesn't try to find the functions and what not until you actually execute them. That sounded more complicated then it is :(
score: 0

http://stackoverflow.com/q/27369795
tagged with: javascript
has title: Snap.SVG attaching SVG elements
score: 0
has answer: http://stackoverflow.com/a/27376766
answer count: 1
has body: I'm trying to insert an SVG using snap.svg, to a page and then have it rotate and expand slightly. I'm using brackets at the moment as some local live preview thing, and the problem I'm having is twofold; I managed to get it in place about half an hour ago and then broke it somehow and now I don't know how to get it back, and the syntax for snap.svg is condensed enough to make it kind of iffy to read, and the documentation isn't very good, so I'm unable to work out how exactly I do what I want to do. I gave search a go, but the callback method I found doesn't seem to be working. Can anybody help? &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;script src="snap.svg-min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var paper = Snap(500,500), Snap.load('ringing-phone.svg', function (phone) { phone.selectAll("path[fill='#ff0000']").attr({fill: "#00ff00"}); var g = phone.select("g"); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;
tagged with: http://stackoverflow.com/tag/svg
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43201351
type: Question
accepted answer: http://stackoverflow.com/a/27376766
has comment: http://stackoverflow.com/comment/43193925

http://stackoverflow.com/q/27398667
type: AnsweredQuestion
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/43243243
has comment: http://stackoverflow.com/comment/43243071
has answer: http://stackoverflow.com/a/27435224
type: Question
accepted answer: http://stackoverflow.com/a/27435224
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: Getting nodeName/elem is null on DataTables 1.10.4
tagged with: datatables
has body: So I have a html page with html table and this script &lt;script&gt; $(document).ready(function () { $('table').DataTable(); }) &lt;/script&gt; It is working fine when I tried to change the total entries shown or search, but the console give me an error 'Cannot read property 'nodeName' of null' on Chrome or 'elem is null' on firefox. I'm using jquery 1.11.1 and this is the culprit (jquery-1.11.1.js:3618) : jQuery.acceptData = function( elem ) { var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). return nodeType !== 1 &amp;&amp; nodeType !== 9 ? false : // Nodes accept data unless otherwise specified; rejection can be conditional !noData || noData !== true &amp;&amp; elem.getAttribute("classid") === noData; }; The error is thrown because elem is null, I'm a beginner in js so anyone know if this is jquery fault or datatables bug? Any help will be appreciated

http://stackoverflow.com/comment/43192902
type: AnswerComment
has text: Haha, :) I would really love to learn more, but there's just not enough time ^_^.
comment on: http://stackoverflow.com/a/27370418
type: Comment
score: 0

http://stackoverflow.com/comment/43132453
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27337850
has text: you can pass the trigger to the handler, and then use parentNode to reach the td and tr: http://jsfiddle.net/6srjc7qL/3/
score: 1

http://stackoverflow.com/q/27404421
answer count: 3
has answer: http://stackoverflow.com/a/27404464
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27404448
has answer: http://stackoverflow.com/a/27404487
has body: So here's what I've got: Fonts! Hello. Goodbye. Hello. This is a paragraph. It is meant to test this font. What do you think? Do you like this font? I think I do, although I'm not sure. That's why I'm writing this paragraph. Eh? Bigger you say? I agree. Let's make it bigger. Yeah, you know what, I'm using this. Allong with that Hagin thing. Some sexy shit. Right now, I'm just trying to get the font to change to Sans when the window gets below 1000px in width. It's not working... nothing happens. No errors reported in the console. Any ideas?
has answer: http://stackoverflow.com/a/27404448
has title: How to Change HTML Elements When Window Gets Too Small?
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/27404487
tagged with: javascript
tagged with: resize
score: 0

http://stackoverflow.com/comment/43170375
type: Comment
comment on: http://stackoverflow.com/a/27358821
score: 0
type: AnswerComment
has text: OKay I am trying ,will tell you ...bunch of Thanks for the quick response.

http://stackoverflow.com/a/27376796
type: Answer
answers question: http://stackoverflow.com/q/27376694
has body: the list view which you have defined your layout you are suppose to give the id as android:id="@android:id/list"
score: 0

http://stackoverflow.com/comment/43262121
type: Comment
type: QuestionComment
has text: Is the first code snippet on this page what you are looking for? http://passportjs.org/guide/authenticate/ literally the first thing that comes up when you go to `authenticate` in the guide.
comment on: http://stackoverflow.com/q/27408789
score: 0

http://stackoverflow.com/q/27431850
has comment: http://stackoverflow.com/comment/43415584
has comment: http://stackoverflow.com/comment/43422352
favorite count: 0
has comment: http://stackoverflow.com/comment/43311812
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/43348877
type: UnansweredQuestion
has title: What's the easiest way to turn the non-transparent parts of any image file into a single svg path?
tagged with: css
has comment: http://stackoverflow.com/comment/43311898
score: 3
has comment: http://stackoverflow.com/comment/43312058
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/43311989
type: Question
has body: Is there an automated way to turn the non-transparent parts of any png file to a single svg path? So the starting png file might look something like this... And the resulting `SVG` path might look something like this... I have searched for a free online or open source tool that can do an ok job of this with no luck...
tagged with: javascript
has comment: http://stackoverflow.com/comment/43311968
upvote count: 3
has comment: http://stackoverflow.com/comment/43311583

http://stackoverflow.com/comment/43252368
type: QuestionComment
comment on: http://stackoverflow.com/q/27403827
has text: cant it go more easily?
score: 0
type: Comment

http://stackoverflow.com/comment/43211084
comment on: http://stackoverflow.com/a/27380338
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43349623
has text: in this code when I alert span is coming, I mean that!!
type: AnswerComment
comment on: http://stackoverflow.com/a/27455862
type: Comment
score: 0

http://stackoverflow.com/comment/43130371
type: Comment
type: QuestionComment
has text: “I can’t attach event to custom/child elements” Perhaps that’s true by default, but if your implementation of `ContentAreaHeader` had something like `return ... ;`, the event handler would be threaded through properly with `<ContentAreaHeader onClick={this.toggleCollapse}>` and you wouldn’t need a wrapper `span`.
score: 0
comment on: http://stackoverflow.com/q/27336583

http://stackoverflow.com/a/27325365
answers question: http://stackoverflow.com/q/27325290
has comment: http://stackoverflow.com/comment/43111125
has comment: http://stackoverflow.com/comment/43110675
has comment: http://stackoverflow.com/comment/43110440
score: 0
has comment: http://stackoverflow.com/comment/43110184
has comment: http://stackoverflow.com/comment/43110286
type: Answer
has comment: http://stackoverflow.com/comment/43110142
has body: Assuming your div has id="specialContent", something like this (after document load, in your $(document).ready(function() { ... } ); or wherever) should do the trick... function showSpecialContent() { $('#specialContent').show(); setTimeout(hideSpecialContent, 1000*30); // show the content for 30 seconds, then hide it document.cookie = "lastshown=" + Date.now(); } function hideSpecialContent() { $('#specialContent').hide(); setTimeout(showSpecialContent, 1000*60*60); // hide the content, and then show it again in an hour } function initTimers() { var lastShown = getCookie("lastshown"); if(lastShown) { var lsd = new Date(new Number(lastShown)); var timeShownDelta = Date.now() - lsd; // if we last showed the div more than an hour ago if (timeShownDelta &gt; 60*60*1000) { showSpecialContent(); } else { setTimeout(showSpecialContent, 1000*60*60 - timeShownDelta); } } else { showSpecialContent(); } } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i&lt;ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1); if (c.indexOf(name) != -1) return c.substring(name.length,c.length); } return ""; } initTimers(); and an updated fiddle: http://jsfiddle.net/vj2dqqyr/4/
has comment: http://stackoverflow.com/comment/43110078

http://stackoverflow.com/comment/43253713
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27403644
has text: it works but text input suppose to show the price called harga_satuan instead of id_barang. The result was show the id_barang, not harga_satuan. how?

http://stackoverflow.com/comment/43284226
has text: Well that's odd. What OS? I've updated my post with more code.
type: Comment
comment on: http://stackoverflow.com/q/27405126
score: 1
type: QuestionComment

http://stackoverflow.com/comment/43102599
type: AnswerComment
comment on: http://stackoverflow.com/a/27321284
type: Comment
has text: By initializing the session with `session_start()` and read the session variable `$_SESSION`of the declared session. [See the manual: Sessions](http://php.net/manual/en/session.examples.basic.php)
score: 0

http://stackoverflow.com/a/27338992
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27338914
type: Answer
answers question: http://stackoverflow.com/q/27338914
has comment: http://stackoverflow.com/comment/43134851
upvote count: 1
score: 1
has body: So, putting &lt;span&gt; inside of an option actually violates the HTML spec (It is bad to put &lt;span /&gt; tags inside &lt;option /&gt; tags, only for string manipulation not styling?), so depending on the user's browser, the spans may not even be present in the dom (replaced instead with a text-type node containing the contents of the spans). You'll probably want to use something like this instead $(".country").on('change', function(e){ var kode = $(this).val(); var $selected = $('option:selected', this); var parts = $selected.text().split(/\W+/); var name = parts[0] var id = parts[1] console.log(kode); console.log(name); console.log(id); }); fiddle: http://jsfiddle.net/9nn1rune/
type: AcceptedAnswer

http://stackoverflow.com/comment/43213446
score: 0
comment on: http://stackoverflow.com/q/27380904
type: Comment
type: QuestionComment
has text: Yes and no white space after it either.

http://stackoverflow.com/a/27449318
has body: You could use &lt;c:forEach&gt; but since Java runs on server side, it will only help you to generate plain text that may be used for your JavaScript. By knowing this, you could create a JavaScript string array like this: &lt;script type="text/javascript"&gt; var myJavaScriptArray = [ &lt;c:forEach items="${myArray}" var="elem" varStatus="currentStatus"&gt; "${elem}" &lt;c:if test="${not currentStatus.last}"&gt; , &lt;/c:if&gt; &lt;/c:forEach&gt; ]; &lt;/script&gt; Code above not tested yet.
accepted answer of: http://stackoverflow.com/q/27449140
type: Answer
answers question: http://stackoverflow.com/q/27449140
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27323387
has body: Most probably, you are not going in the right direction. if you have some function like this function animate() { requestAnimationFrame(animate); render (); } The render is doing it's work all the time. When you are seeing the scene unfinished, it's because the meshes haven't finished loading, not because the render hasn't finished rendering. So, you have to listen for some onload event on the models that you are loading, that will depend on the method that you use to load them (and that you don't explain, so I can't help you more) Given the code in your reply, it isn't clear when you add the mesh to the scene. Anyway, I would try something in the line of function loaderCallback() { mesh = new THREE.Mesh (... scene.add (mesh); requestAnimationFrame(saveImage); render (); } the function invoked at requestAnimationFrame should be called when render finishes.
answers question: http://stackoverflow.com/q/27318854
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43130064
type: Answer
accepted answer of: http://stackoverflow.com/q/27318854
score: 0

http://stackoverflow.com/a/27441279
type: Answer
downvote count: 1
upvote count: 6
accepted answer of: http://stackoverflow.com/q/27440961
has comment: http://stackoverflow.com/comment/43323243
answers question: http://stackoverflow.com/q/27440961
has comment: http://stackoverflow.com/comment/43322681
score: 5
has comment: http://stackoverflow.com/comment/43322388
type: AcceptedAnswer
has body: Get the date from the server, convert it to a javascript date, then increment it yourself. &lt;?php $today = getdate(); ?&gt; &lt;script&gt; var d = new Date(Date.UTC(&lt;?php echo $today['year'].",".$today['mon'].",".$today['mday'].",".$today['hours'].",".$today['minutes'].",".$today['seconds']; ?&gt;)); setInterval(function() { d.setSeconds(d.getSeconds() + 1); $('#timer').text((d.getHours() +':' + d.getMinutes() + ':' + d.getSeconds() )); }, 1000); &lt;/script&gt; &lt;label id="timer"&gt;&lt;/label&gt; EDIT: JSFiddle with example PHP echoed in.
has comment: http://stackoverflow.com/comment/43326344
has comment: http://stackoverflow.com/comment/43323305

http://stackoverflow.com/a/27381164
answers question: http://stackoverflow.com/q/27380353
type: AcceptedAnswer
score: 0
type: Answer
has body: Ok, that's an odd interface. I'm not entirely sure how he expects people to use particles.js... but to destroy it, you run the line: pJS.fn.vendors.destroy(); http://codepen.io/anon/pen/QwyZaj That's it. I'm assuming this only supports one particle canvas on the page at once. And FWIW, most open source js libraries don't work this way.
accepted answer of: http://stackoverflow.com/q/27380353

http://stackoverflow.com/comment/43371683
type: Comment
type: QuestionComment
has text: The `:lang` pseudo-class doesn't work in IE until version 8, and it may require ` `. It's been supported by Chrome since version 1, so if it works on your computer, it *should* work on hers. You could try setting the language on 'body' instead of 'html'.
comment on: http://stackoverflow.com/q/27468110
score: 0

http://stackoverflow.com/comment/43650549
type: QuestionComment
has text: as said by others we need more code likely what does your model look like...
score: 0
comment on: http://stackoverflow.com/q/27420637
type: Comment

http://stackoverflow.com/q/27367604
favorite count: 0
has comment: http://stackoverflow.com/comment/43187290
has comment: http://stackoverflow.com/comment/43187150
has comment: http://stackoverflow.com/comment/43187075
has comment: http://stackoverflow.com/comment/43187124
linked to: http://stackoverflow.com/q/336859
has comment: http://stackoverflow.com/comment/43187110
has comment: http://stackoverflow.com/comment/43187091
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27367695
has comment: http://stackoverflow.com/comment/43187184
accepted answer: http://stackoverflow.com/a/27367695
has title: JS function is not getting called
has answer: http://stackoverflow.com/a/27367671
type: Question
has body: Here is my JSP code: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Order a PIZZA SUBIR'S JUST IN PIZZA All PIZZAs in just 30 minutes Pizza=150/- Garlic Bread=60/- Soft drink=45/- Extra Cheese=45/- Tax=12.25% Name: Number of Pizza: Number of Garlic breads: Number of Soft drinks:: Number of Extra cheese: Total: Tax: My evaluate.JS javascript is the following: var price=0; var tax=0; var pizza=150; var garlicBread=60; var softdrink=45; var extraCheese=45; var pizza_total=0; var softdrink_total=0; function pizza_calculate() { var test=document.getElementById("pizza"); console.log(test); pizza_total=document.getElementById("pizza")*pizza; document.getElementById("total").innerHTML =pizza_total; }; From Firebug I understand that my JS function is not getting executed. What might possibly be the reason for this error, please suggest.
has comment: http://stackoverflow.com/comment/43187457
has answer: http://stackoverflow.com/a/27367836
tagged with: javascript
score: 0
answer count: 3
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/27367671

http://stackoverflow.com/comment/43271130
type: Comment
score: 0
has text: check that out. Should help you understand good js patterns for this kind of thing.
type: AnswerComment
comment on: http://stackoverflow.com/a/27386770

prepared-statement
tags question: http://stackoverflow.com/q/27393991
type: Tag
tag name: prepared-statement

http://stackoverflow.com/a/27458806
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27458755
type: Answer
has body: You'll need to remember where the mouse was clicked and check mouseup to determine if it's a drag. See this answer https://stackoverflow.com/a/4139860/1620112.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27458755
score: 1

http://stackoverflow.com/q/27459027
has comment: http://stackoverflow.com/comment/43357887
type: Question
has answer: http://stackoverflow.com/a/27459240
has comment: http://stackoverflow.com/comment/43355313
has comment: http://stackoverflow.com/comment/43358232
tagged with: javascript
has comment: http://stackoverflow.com/comment/43355863
has comment: http://stackoverflow.com/comment/43355700
has comment: http://stackoverflow.com/comment/43355388
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43355556
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27459504
has comment: http://stackoverflow.com/comment/43358344
has comment: http://stackoverflow.com/comment/43355683
tagged with: jquery
has comment: http://stackoverflow.com/comment/43355525
has comment: http://stackoverflow.com/comment/43355187
favorite count: 0
has body: I'm trying to create a player edit system for an admin section of a football website. The process goes as follows: Once a coach has logged in on 'coaches.php', they can then choose what coaching session they want to look at via dropdown, which then populates the 'player' dropdown (done via js below) coaches.php form Activity : --Select Activity Group-- <?php include('dbconnect.php'); $sql=mysql_query("select activity from coaches where username='$coach'"); while($row=mysql_fetch_array($sql)) { $activity2=explode(",",$row["activity"]); foreach ($activity2 as $activity) echo ' '.$activity.' '; } ?> Player : --Select Player-- <input name="thisID" type="hidden" value="<?php echo $id; ?>" /> coaches.php js function As the js above shows, the player list is handled via a separate page with a query on it as follows: <?php if($_POST['activity']) { $activity=$_POST['activity']; $sql=mysql_query("SELECT id, username FROM stats WHERE activity='$activity'"); while($row=mysql_fetch_array($sql)) { $id=$row['id']; $username=$row['username']; $activity=$row['activity']; echo ' '.$username.' '; } } ?> Once all of this is done, the coach submits the form, taking them to coachplayer.php. This is where the problem begins. coachplayer.php is a template page, with empty fields filled with echo's, to echo the player details where necessary. A query runs to get the id of the selected player, bring up their details and fill the page. Instead, however, it echos what usually comes up if the query cannot find a matching result via $playerCount as shown below, saying "Player doesn't exist". coachplayer.php SQL query <?php // Check to see the URL variable is set and that it exists in the database if (isset($_GET['id'])) { // Connect to the MySQL database $targetU = preg_replace('#[^0-9]#i', '', $_GET['id']); // Use this var to check to see if this ID exists, if yes then get the player // details, if no then exit this script and give message why $sql = mysql_query("SELECT * FROM stats WHERE id='$…
has comment: http://stackoverflow.com/comment/43355029
has answer: http://stackoverflow.com/a/27459082
tagged with: php
has title: Form not posting variables/mySQL Query not searching corrently
has comment: http://stackoverflow.com/comment/43355147
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43356941
tagged with: mysql
has comment: http://stackoverflow.com/comment/43355673
tagged with: forms

http://stackoverflow.com/a/27425538
answers question: http://stackoverflow.com/q/27425318
score: 0
has body: By following the example at Registering jQuery click, first and second click. I was able to solve my issue by basically adding back the depreciated .toggle function. $( "#go" ).click(function() { var clicks = $(this).data('clicks'); if (clicks) {//on odd clicks this will run $( "#wrapper" ).animate({ paddingLeft: "170px" }, 500 ); $( ".side-nav" ).animate({ width: "170px", fontSize: "14px", }, 500 ); } else{//on even clicks this will run $( "#wrapper" ).animate({ paddingLeft: "38px" }, 500 ); $( ".side-nav" ).animate({ width: "45px", fontSize: "18px", left: "215px", paddingLeft:"2px" }, 500 ); } $(this).data("clicks", !clicks); });
type: Answer

http://stackoverflow.com/a/27343871
has comment: http://stackoverflow.com/comment/43143418
has comment: http://stackoverflow.com/comment/43143535
has comment: http://stackoverflow.com/comment/43160066
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43144047
has body: Not rounding is an unusual requirement, and it's too bad because if you were okay with rounding, you could just use toFixed: var num = 1234.5678; snippet.log(num.toFixed(2)); // "1234.57" -- note the rounding! var num = 1234.5678; snippet.log(num.toFixed(2)); // "1234.57" -- note the rounding! &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt; (And no, you can't just do .toFixed(3) and then chop off the last digit; rounding doesn't necessarily only change the last digit, consider using toFixed(3) on 1111.9999, which gives you 1112.000. Just chopping off the last digit of that still gives you a rounded result.) To do it without rounding, I don't think there's much available but brute force: // Assumes `digits` is never more than 20 function toFixedNoRounding(num, digits) { var parts = String(num).split('.'); if (digits &lt;= 0) { return parts[0]; } var fractional = (parts[1] || "0") + "000000000000000000000"; return parts[0] + "." + fractional.substring(0, digits); } // Assumes `digits` is never more than 20 function toFixedNoRounding(num, digits) { var parts = String(num).split('.'); if (digits &lt;= 0) { return parts[0]; } var fractional = (parts[1] || "0") + "000000000000000000000"; return parts[0] + "." + fractional.substring(0, digits); } var num, notRounded; num = 1234; notRounded = toFixedNoRounding(num, 2); snippet.log(num + " =&gt; " + notRounded); num = 1234.5678; notRounded = toFixedNoRounding(num, 2); snippet.log(num + " =&gt; " + notRounded); num = 1234.1; notRounded = toFixedNoRounding(num, 2); snippet.log(num + " =&gt; " + notRounded); num = 1234.999999; notRounded = toFixedNoRounding(num, 2); snippet.log(num + " =&gt; " + notRounded); &lt;!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/sn…
has comment: http://stackoverflow.com/comment/43143286
type: Answer
has comment: http://stackoverflow.com/comment/43145779
has comment: http://stackoverflow.com/comment/43143547
answers question: http://stackoverflow.com/q/27343789
has comment: http://stackoverflow.com/comment/43143710
has comment: http://stackoverflow.com/comment/43143424
has comment: http://stackoverflow.com/comment/43143308

http://stackoverflow.com/comment/43347554
type: QuestionComment
comment on: http://stackoverflow.com/q/27454718
has text: I have used Smarty in the past, but I'm not really a big fan of it. Mainly due to the fact that I had no experience with it at the time I used it, and I couldn't really see why I would use it in the first place. Is Smarty a really helpful on this oarticular case, or is that merely a side functinality?
score: 0
type: Comment

http://stackoverflow.com/comment/43377181
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27469726
has text: I am not familiar with Polymer, but it looks to me like the simplest approach would be to add an input for {{idx}} within the phone template, just like the one in the contact template. This would allow `removePhone` to get the proper contact in the same way that `removeContact` does.
score: 0

http://stackoverflow.com/q/27361680
has comment: http://stackoverflow.com/comment/43175699
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43175702
has answer: http://stackoverflow.com/a/27361887
has comment: http://stackoverflow.com/comment/43175826
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43175534
has comment: http://stackoverflow.com/comment/43175574
type: Question
has answer: http://stackoverflow.com/a/27361795
tagged with: javascript
has title: Timer : clearInterval() doesn't work (js)
has comment: http://stackoverflow.com/comment/43175725
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27362031
has body: I don't understand this bug. There is my simple code : var refreshInterval; function refreshAuto() { if($("#refresh-select").val() == "off") { clearInterval(refreshInterval); console.log("I'm here !"); } else { refreshInterval = setInterval("console.log('bip')", $("#refresh-select").val()); } } I select the timer with a drop-down list. The code works excepted (timer's arguments are ok, I've tested) the part who I clear the interval. It's not clearing the Interval. The console tell me "I'm here" when I select "off", but doesn't stop to "bip". Any idea? Thanks.
favorite count: 0

http://stackoverflow.com/comment/43291372
type: QuestionComment
has text: I cant seem to find any dedicated render function in the extensive code snippets you posted? If you're trying to call `model.render` in your texture callbacks you need to call it on your model instance.
comment on: http://stackoverflow.com/q/27415084
score: 0
type: Comment

http://stackoverflow.com/a/27353459
type: Answer
has body: Use JSON.stringify() instead of toString() like so: Change your AJAX call to this: $(document).on('click','.savenow',function(){ recordid = $(this).data('id'); locations = []; $('.selectrec').each(function () { parent = $(this).parent().parent(); name = parent.find('td').eq(5); address = parent.find('td').eq(6); lat = parent.find('td').eq(1); lng = parent.find('td').eq(2); row = [name,address,lat,lng]; locations.push(row); }); ajaxData = { recordid : recordid,locations : locations } $.ajax({ type: "POST", url:'/record/saveSearchedLocations', data: JSON.stringify(ajaxData), dataType: 'json', success: function (data) { console.log(data); }, error:function(data){ alert("something went wrong, please try again."); } }); }); JSON.stringify() converts your array to an actual json string as opposed to Array.prototype.toString() which joins your array (one level) using a comma as separator.
has comment: http://stackoverflow.com/comment/43160365
has comment: http://stackoverflow.com/comment/43160814
accepted answer of: http://stackoverflow.com/q/27353430
upvote count: 4
answers question: http://stackoverflow.com/q/27353430
type: AcceptedAnswer
downvote count: 0
score: 4

http://stackoverflow.com/comment/43276888
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27415939
score: 0
has text: No, it's never "okay" to use deprecated codes. Be a professional developer.

http://stackoverflow.com/comment/43119098
type: AnswerComment
has text: didn't work bro. let me know you what actually i am trying to do , actually my order image with anchor tag took time to process order during this time if any user click on same image again then it process another order i want to prevent it.. now i have other idea put an alert on click so user can not click twice on that image . but i need an autotimer after 5 second alert disappear and process link
type: Comment
comment on: http://stackoverflow.com/a/27329848
score: 0

http://stackoverflow.com/q/27324802
has comment: http://stackoverflow.com/comment/43109596
has comment: http://stackoverflow.com/comment/43110204
has comment: http://stackoverflow.com/comment/43109439
tagged with: scala
tagged with: java-8
has title: Multi-threaded Nashorn: o.constructor === o.constructor gives false
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43109273
has comment: http://stackoverflow.com/comment/43109527
upvote count: 2
has comment: http://stackoverflow.com/comment/43110415
has comment: http://stackoverflow.com/comment/43109239
tagged with: multithreading
has comment: http://stackoverflow.com/comment/43109349
has answer: http://stackoverflow.com/a/27329358
type: Question
tagged with: nashorn
linked to: http://stackoverflow.com/q/27032656
has body: I'm experimenting with multi-threaded scripts loading and evaluation in Nashorn and get kind of shocking behavior: // having some object o loaded in another thread print(o.constructor === o.constructor); // false print(o.constructor === Object); // false as well print(o.foo === o.foo); // true - OK How can this be possible within single script engine? o above is just an object created using object literal notation (in another thread). Printing o.constructor gives usual function Object() { [native code] };. At the same time: print({}.constructor === {}.constructor); // true Any ideas? Update It turned out this was unrelated to multi-threading at all. See my answer below for details.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43109335
has comment: http://stackoverflow.com/comment/43109518
has comment: http://stackoverflow.com/comment/43109382
accepted answer: http://stackoverflow.com/a/27329358
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43109757
favorite count: 0

http://stackoverflow.com/a/34433675
upvote count: 16
score: 14
has body: Add and Optimize You should use this form : ng-class
has comment: http://stackoverflow.com/comment/63321457
answers question: http://stackoverflow.com/q/27371711
has comment: http://stackoverflow.com/comment/62892653
downvote count: 2
type: Answer

http://stackoverflow.com/q/27419759
has comment: http://stackoverflow.com/comment/43282649
has comment: http://stackoverflow.com/comment/43282632
upvote count: 1
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/12281775
has comment: http://stackoverflow.com/comment/43282551
has body: If I upload data (say a text file) from my local computer, with this function var button = document.getElementById('myFile'); The content of the file is How do I retrieve data from the uploaded file? I'm thinking about the simplest case which can be a text file to be appended to a div.
tagged with: javascript
duplicate of: http://stackoverflow.com/q/12281775
answer count: 1
has answer: http://stackoverflow.com/a/27419860
has comment: http://stackoverflow.com/comment/43282473
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How to access data from input function in javascript
score: 0

http://stackoverflow.com/comment/43170464
has text: Just do whatever you need to do (animation) and change the `location` to reflect the link right after.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27359086
score: 1

http://stackoverflow.com/q/27355984
score: 0
has title: string.replace strange behaviour
has comment: http://stackoverflow.com/comment/43165090
has answer: http://stackoverflow.com/a/27356127
type: AnsweredQuestion
has body: I have an app that gets youtube video id's to share them out over twitter. Looking at the tweets I can see users are sharing them out, but in some cases the share content is broken. We have a restful API which responds with the id, and then with a string replace method we replace {{id}}. http://twitter.com/intent/tweet?text=http://www.youtube.com/watch?v={{id}} Share your video to win. Replace method var href = $('#twitter-btn').attr('href'); $('#twitter-btn').attr('href', href.replace('{{id}}', response.youtube_id) ); In most cases the tweets can be seen like so... http://www.youtube.com/watch?v=0bxW5fd Share your video to win. But in some cases we are seeing... http://www.youtube.com/watch?v What I find really strange is that the '=' has been removed as well. We have ruled out the server giving a bad response as we are logging all ID's to check they are valid. Is anyone aware of how this could happen, or if certain ID's break twitter as I am aware the '#' symbol needs to be url encoded to %23 else it breaks. The share functionality works using the standard twitter share. &lt;script type="text/javascript" async src="//platform.twitter.com/widgets.js"&gt;&lt;/script&gt; This has really stumped me as it is such a basic task I cant understand how this can happen. Any Ideas would be very appreciated.
tagged with: twitter
type: Question
possible better answer: http://stackoverflow.com/a/27356194
answer count: 2
has answer: http://stackoverflow.com/a/27356194
accepted answer: http://stackoverflow.com/a/27356127
tagged with: javascript

http://stackoverflow.com/comment/43157931
has text: It's a typo. They should both be `listRef`, or `ref`. Not one and the other.
type: Comment
comment on: http://stackoverflow.com/q/27348238
score: 0
type: QuestionComment

http://stackoverflow.com/q/27416274
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43276839
type: UnansweredQuestion
tagged with: php
has answer: http://stackoverflow.com/a/27608186
has comment: http://stackoverflow.com/comment/43276897
score: 1
tagged with: codeigniter
upvote count: 1
has comment: http://stackoverflow.com/comment/43276574
has title: JQuery Ajax Error {"readyState":0,"responseText":"","status":0,"statusText":"OK"}
type: Question
has answer: http://stackoverflow.com/a/27647828
has body: I try to get the cities according to the country which is passed as parameter and sent via ajax. But for some countries I can get cities and update my form with these cities, for against for other I have this error {"readyState":0,"responseText":"","status":0,"statusText":"OK"} When I look in logs for those countries that returns me an error I have the names of the cities retrieved from the database. I do not understand why this error. how can I fix it? Please find below my code Model function get_ville_depart($country = null){ $this-&gt;db-&gt;select('NUMVILLEDEPART, NOMVILLEDEPART')-&gt;from('villedepart'); $this-&gt;db-&gt;join('pays','pays.NUMPAYS=villedepart.numpays'); $this-&gt;db-&gt;where('pays.NUMPAYS', $country); $this-&gt;db-&gt;order_by("NOMVILLEDEPART","asc"); $query = $this-&gt;db-&gt;get(); $cities = array(); if($query-&gt;result()){ foreach ($query-&gt;result() as $city) { $cities[$city-&gt;NUMVILLEDEPART] = $city-&gt;NOMVILLEDEPART; } return $cities; }else{ return FALSE; } } Controller function get_ville_depart($country){ foreach($this-&gt;ville_model-&gt;get_ville_depart($country) as $ville){ log_message('debug',json_encode($ville)); } header('Content-Type: application/json; charset=utf-8'); echo json_encode($this-&gt;ville_model-&gt;get_ville_depart($country)); } View $('#paysdepart').on("change",function(){ $("#villedepart &gt; option").remove(); var country_id = $('#paysdepart').val(); var base_url="&lt;?= site_url('annonce');?&gt;"; $.ajax({ type: "GET", url: base_url+"/get_ville_depart/"+country_id, dataType:'json', success: function(cities) { if(!jQuery.isEmptyObject(cities)) { $("#ifnotvilledepartindatabase").hide(); $("#dynamicvilledepart").show(); $.each(cities,function(NUMVILLEDEPART,NOMVILLEDEPART) { var opt = $('&lt;option /&gt;'); opt.val(NUMVILLEDEPART); opt.text(NOMVILLEDEPART); $('#villedepart').append(opt); }); }else { $("#dynamicvilledepart").hide(); $("#ifnotvilledepartindatabase").show() } }, error:function(error) { alert("Error…
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43276339
answer count: 2
has comment: http://stackoverflow.com/comment/43276400
tagged with: jquery

http://stackoverflow.com/a/27466594
upvote count: 1
has comment: http://stackoverflow.com/comment/43369284
has comment: http://stackoverflow.com/comment/43369330
type: Answer
has body: Please dont create elements and make it super complicated. You can set styles of elements using javascript itself, for eg: document.getElementsByClassName("blur_background")[0].style.backgroundColor ='red' will change the color to red for your div. Try that code in your website and it changes background color. So you can conditionally trigger this statement instead of document.write UPDATE: To set backgorund-image use this document.getElementsByClassName("blur_background")[0].style.backgroundImage = 'url(http://adventureofucm.com/OtherSites/Day_Time_Background/imperial_boy_2800x1600_wallpap_2800x1600_.jpg)';
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27466500
has comment: http://stackoverflow.com/comment/43369144
has comment: http://stackoverflow.com/comment/43369199

http://stackoverflow.com/comment/43209608
comment on: http://stackoverflow.com/q/27377688
score: 0
has text: calling $digest worked. If you compose this as an answer, I'll accept it.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27413635
has title: Animate background image of a :after element
answer count: 1
score: 1
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27413745
upvote count: 1
has body: Having this code: #header .banner { background-color:#000; height:270px; } #header .banner:after { content: ""; background:url(/images/header_1.jpg) center center; width:100%; min-width: 1024px; height:270px; margin: auto; display: block;} I need to make a transition of the /images/header_1.jpg to other image, using javascript (jquery) or css3. Is this possible?
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/27537045
answers question: http://stackoverflow.com/q/27426869
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27426869
has comment: http://stackoverflow.com/comment/43935027
upvote count: 3
type: Answer
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/43927700
has body: To add to Chri's answer, JavaScript can't actually track the full value of a long! The most precise number it can track is the equivalent of a Java double (64-bit IEEE 754 floating point), and there are some legal values that when cast to double and back again, are no longer the same number! If you are only reading the property and you don't care if you have enough precision to actually store it, the unsafe long annotation will work. Use double if you can, or use String if you want a db ID or whatever that doesnt change you when you look at it funny through JS...

http://stackoverflow.com/a/27404165
has comment: http://stackoverflow.com/comment/43259488
score: 0
has body: Please make sure that you load the files in following order in head tag, Also please add following line to the app.js, myApp.controllers = angular.module('myApp.controllers',[]) And change your code to following in controller.js, myApp.controllers.controller('BookController', function($scope){ $scope.name="Scope for BookController"; }); Hope this will resolve your issue.
type: Answer
has comment: http://stackoverflow.com/comment/43253300
has comment: http://stackoverflow.com/comment/43279829
has comment: http://stackoverflow.com/comment/43279769
answers question: http://stackoverflow.com/q/27403886

http://stackoverflow.com/q/27446366
has comment: http://stackoverflow.com/comment/43332155
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27446409
accepted answer: http://stackoverflow.com/a/27446430
has comment: http://stackoverflow.com/comment/43331669
has answer: http://stackoverflow.com/a/27446409
has title: JavaScript - Why can't I call a variable "name"?
favorite count: 0
has body: Why can't you call a variable in JS "name"? var wrapper = document.createElement("div"); var name = document.createElement("div"); wrapper.appendChild(name); // TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. document.body.appendChild(wrapper); When I type "name" in the console in a new tab it returns an empty string? I use Chrome.
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/43331615
tagged with: syntax
upvote count: 3
has comment: http://stackoverflow.com/comment/43331676
type: Question
has answer: http://stackoverflow.com/a/27446430
answer count: 2

http://stackoverflow.com/a/27499823
downvote count: 0
score: 1
has body: Karma use https://github.com/isaacs/minimatch to find the files (it's mention here http://karma-runner.github.io/0.12/config/preprocessors.html) so you can use a glob. On our project we just add our code from various folders, it was not that bad : preprocessors: { // source files, that you wanna generate coverage for // do not include tests or libraries // (these files will be instrumented by Istanbul) 'www/js/controllers/**/*.js': ['coverage'], 'www/js/directives/**/*.js': ['coverage'], 'www/js/filters/**/*.js': ['coverage'], 'www/js/initializers/**/*.js': ['coverage'], 'www/js/services/**/*.js': ['coverage'], 'www/js/services.js': ['coverage'] } EDIT : Reffering to this https://github.com/karma-runner/karma/issues/508 It seems that this syntax is working resources/javascript/**/!(*Spec).js Apply to you it would be './App/**/!(*Tests).js': ['coverage']
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27446530
has comment: http://stackoverflow.com/comment/43434197
type: Answer
answers question: http://stackoverflow.com/q/27446530

http://stackoverflow.com/comment/43284204
score: 0
comment on: http://stackoverflow.com/q/27420168
type: Comment
type: QuestionComment
has text: @Gorostas anyone there to answer this question??

http://stackoverflow.com/comment/43299578
type: AnswerComment
score: 0
has text: I've seen it but I thought it is in early stage. At closer inspection it also relies on Oriento. So I just forked it and will add the necessary improvements on the way to contribute to the adapter.
type: Comment
comment on: http://stackoverflow.com/a/27426298

http://stackoverflow.com/comment/43142586
has text: Okay. So where are you stuck? What part are you having trouble with? Right now, this reads as "please do my work for me."
type: Comment
type: QuestionComment
score: 4
comment on: http://stackoverflow.com/q/27343505

http://stackoverflow.com/q/27393759
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: Angular directive does not update as scope updates
has body: I'm puzzled by the apparent failure of my directive to update whenever its scope updates. I want to add up the characters in 3 different form fields, subtract that length from 29 (cause of reasons...), and output that total as a string in a piece of DOM contained in the directive template. Directive: return { restrict: 'AE', replace: true, templateUrl: '{{remainingChars}} remaining', scope: { checktype: '=', checknumber: '=', depositnote: '=' }, link: function (scope, elem) { scope.remainingChars = 29 - scope.checktype.length - scope.checknumber.length - scope.depositnote.length; } } Reference to directive in index.html: <deposit-note checknumber="transaction.checkNumber" checktype="transaction.checkType" depositnote="transaction.depositNote" /> This works sort-of: I can step through the directive when the page loads and watch scope.remainingChars get set to the right number when the directive loads the first time. However, if I change the transaction object, the number never updates. I can get the behavior I want if I set up a $watchCollection on the transaction object, but I should be able to just pass that object into the isolate scope using the '=' two-way-binding mechanism. Yet the directive runs 1 time, calculates correctly, and never changes it's value again even when I update the form fields it's model is bound to. Everything is happening on scope, so I don't believe I need to run $apply(), and I need this to be done in a directive because I need to apply styling to the DOM based on the number (positive / negative). Otherwise I would just have something like {{29 - transaction.checkType.length - transaction.checkNumber.length - transaction.depositnote.length}} remaining in index.html. What am I missing here? Thanks!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27393870
upvote count: 1
type: Question
tagged with: angularjs-directive
score: 1
has comment: http://stackoverflow.com/comment/43234766
accepted answer: http://stackoverflow.com/a/27393870
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43126664
has text: Yep, that's what I'm looking for. Thanks very much. Now how can I "condense" a little bit or close the gap between images? Again, thanks very much for your assistance.
comment on: http://stackoverflow.com/q/27334701
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27358656
score: 1
upvote count: 1
downvote count: 0
type: Answer
has body: You should use escape character identifier \\ to archive this, $("tr[df\\:row_id='"+theId+"']").css({ 'background-color' : 'green'}); View Static demo jsFiddle $("tr[df\\:row_id='1']").css({ 'background-color' : 'green'});
answers question: http://stackoverflow.com/q/27358567

http://stackoverflow.com/q/27419118
favorite count: 0
type: UnansweredQuestion
has body: I would like to generate datatable footer in a "article" tag instead of "div" and i don't know how to perform that using param sDom. Code expected : //datatable content //datatable footer 100 sites Premier Préc. 1 2 3 Suiv. Dernier Is it possible?
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Datatable generate custom footer outside default div
tagged with: javascript
tagged with: datatables
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/27395460
has comment: http://stackoverflow.com/comment/43270316
has comment: http://stackoverflow.com/comment/43239043
score: 0
has body: Tl/Dr The below code will be completely pseudo-code describing the method you'll need to run through to get this to work. The first step is that you'll need to add an identifier to all "internal" links within your site. For example, if your page is contact, and there is a link to that page form your home page, you need to distinguish between the types of pages. function confirmExit() { if (!internal_link) { // random shit.. return message } } var key = "internal_link"; window[key] = false; var message = "Your custom message. Are you sure you want to blah?"; window.onbeforeunload = confirmExit; internal_link = false; $(document).ready(function () { if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname } $("a").each(function () { if ($(this)[0].href.indexOf(window.location.origin) == 0) { if ($(this).attr("onclick") == "undefined") { $(this).attr("onclick", key + " = true") } else { if ($(this).attr("onclick")) { var e = $(this).attr("onclick"); $(this).attr("onclick", e + " " + key + " = true") } else { $(this).attr("onclick", key + " = true") } } } else { if ($(this).attr("onclick") !== key + " = true" || $(this).attr("onclick") == "undefined") { $(this).attr("onclick", key + " = false") } } }); }); The above is what I've used previously and it's worked perfectly. Basically what it does is adds an attribute to internal links (links within your site), then when users navigate around your site, the onbeforeunload runs the confirmExit() function and checks if the internal_link is false, if so, it shows the message otherwise it navigates through the site.
has comment: http://stackoverflow.com/comment/43275292
answers question: http://stackoverflow.com/q/27395064
type: Answer
has comment: http://stackoverflow.com/comment/43245646

http://stackoverflow.com/comment/43220094
type: AnswerComment
score: 2
comment on: http://stackoverflow.com/a/27385908
type: Comment
has text: Basically, it's currently confirming internet connection at the beginning of the countdown, not the end as it should.

http://stackoverflow.com/a/27449842
type: Answer
answers question: http://stackoverflow.com/q/27413185
has body: After a little bit of research, it seems the only way around this bug is to modify the API so that once the variable holding the JSONP is initialized, the script itself triggers the callback. Unfortunately, this would not work as a solution for others if they do not have access to modify whatever API is in use, but it does solve the problem for me. //somejson.js /* window["queryResult"] = {blah:'blah'}; scriptCallback() */ function loadScript(callback) { var c = new afterScriptLoad(callback) window["scriptCallback"] = c head.load("/somejson.js", c) } function afterScriptLoad(callback) { var retrieved = false return function () { if (!retrieved) { retrieved = true callback(queryResult) } } } function myCallback(response) { //do something }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27413185
score: 0

http://stackoverflow.com/comment/43249564
has text: @ user2510547: Check this EIDAWebComponent.GetSex(); statement whether it returns value 'M' or 'F' or 'X'.
score: 0
comment on: http://stackoverflow.com/a/27401986
type: Comment
type: AnswerComment

http://stackoverflow.com/a/27381532
has comment: http://stackoverflow.com/comment/43213930
has comment: http://stackoverflow.com/comment/43292932
type: Answer
has body: Hi you could disable the other dropable element(s) on hover: over: function(event, ui){ $( ".layer1 .item" ).droppable( "disable" ) }, out: function(event, ui){ $( ".layer1 .item" ).droppable( "enable" ) } http://jsfiddle.net/Lxmr1n4p/5/
has comment: http://stackoverflow.com/comment/43213768
answers question: http://stackoverflow.com/q/27380836
has comment: http://stackoverflow.com/comment/43291639
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43212589
has comment: http://stackoverflow.com/comment/43214117
has comment: http://stackoverflow.com/comment/43213396
upvote count: 1
has comment: http://stackoverflow.com/comment/43214248
has comment: http://stackoverflow.com/comment/43212829

http://stackoverflow.com/comment/43212802
comment on: http://stackoverflow.com/a/27323820
type: AnswerComment
type: Comment
score: 0
has text: I'm not sure I follow, I see urlencoded utf-16 le not utf-8. Is it utf-8 and you convert it to `urlencoded utf-16 le`?

http://stackoverflow.com/comment/43302660
comment on: http://stackoverflow.com/q/27430557
type: Comment
score: 0
has text: @Madbreaks then vote to close it with a reference to another question here on SO
type: QuestionComment

http://stackoverflow.com/comment/43096157
type: QuestionComment
has text: Please provide code samples where appropriate to make it easier to help you
score: 0
comment on: http://stackoverflow.com/q/27318148
type: Comment

http://stackoverflow.com/comment/43356063
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27459679
type: AnswerComment
has text: If they are multiple how come they all have ids, then it should have classes, id is not used for multiple elements.

http://stackoverflow.com/comment/43148633
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27346830
has text: @jfriend00 yes, i mean it to be sometimes synchronous sometimes asynchronous depending on if the result has been cached. I just dont know all the mechanics in doing that.

http://stackoverflow.com/a/27474162
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43382950
accepted answer of: http://stackoverflow.com/q/27474122
type: Answer
answers question: http://stackoverflow.com/q/27474122
has body: Use the .css() function of jQUery (docs). Something like the following will work: $('#btnAnswer1').css('color', 'green').
has comment: http://stackoverflow.com/comment/43383022
score: 0

http://stackoverflow.com/comment/47121922
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27335148
score: 0
has text: I"m having the exact same issue. Being a complete newbie to coding I don't entirely understand what you mean or how I can fix it. Could you elaborate?

http://stackoverflow.com/comment/43172162
type: AnswerComment
comment on: http://stackoverflow.com/a/27359543
has text: @t-j-crowder my class1 is clickable, when I click on it, it adds the seocnd class2 to it. So this javascript code does the job of this clicking which adds another class to it.
score: 0
type: Comment

http://stackoverflow.com/a/27406684
score: 18
accepted answer of: http://stackoverflow.com/q/27406377
has comment: http://stackoverflow.com/comment/45737612
has body: it should be or instead of and function generateRandom(min, max) { var num = Math.floor(Math.random() * (max - min + 1)) + min; return (num === 8 || num === 15) ? generateRandom(min, max) : num; } var test = generateRandom(1, 20)
has comment: http://stackoverflow.com/comment/45647620
downvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/140060708
answers question: http://stackoverflow.com/q/27406377
upvote count: 20
type: AcceptedAnswer

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/27350296
tags question: http://stackoverflow.com/q/27413565
tags question: http://stackoverflow.com/q/27323723
tags question: http://stackoverflow.com/q/27421856
tags question: http://stackoverflow.com/q/27332893
tags question: http://stackoverflow.com/q/27316804
tags question: http://stackoverflow.com/q/27437748
tags question: http://stackoverflow.com/q/27382162
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/27340742

http://stackoverflow.com/a/27368302
downvote count: 1
answers question: http://stackoverflow.com/q/27368174
score: 0
has comment: http://stackoverflow.com/comment/43188803
type: AcceptedAnswer
has body: Function declarations are hoisted to the top of their JavaScript scope by the JavaScript interpreter. Then, function theClass() { this.foo = 'bla'; } var theO = new theClass(); function theClass() { this.foo = 'lol'; } becomes function theClass() { this.foo = 'bla'; } function theClass() { this.foo = 'lol'; } var theO = new theClass(); Therefore, the theClass is overridden at the beginning, so theO.foo is 'lol'. However, it's different with function expressions: var theClass; theClass = function theClass() { this.foo = 'bla'; }; var theO = new theClass(); theClass = function theClass() { this.foo = 'lol'; }; in this case, theClass is overridden after instantiating it, so theO.foo is 'bla'.
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27368174

http://stackoverflow.com/q/27416706
downvote count: 2
has comment: http://stackoverflow.com/comment/43278033
has title: Slider not working correctly
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43277762
has answer: http://stackoverflow.com/a/27417570
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27417570
type: AnsweredQuestion
tagged with: jquery
has body: I created a slider that half way works. If I click on the left arrow then the images rotates nicely, but when I click on the right arrow that is where the problem comes in. When I click on it, it rotates to the second image but after that it goes wrong. Here is the js $(".nav_arrows").click(function(){ $direction1 = ($(this).hasClass("left-arrow") ? "left" : "right"); var activeBanner1 = 100; if($direction1 == "right"){ $(".inactive_banner").css("left","100%").show(); activeBanner1 = -100; if($(".active_banner").next().length &lt; 1){ $(".banner_wrapper").eq(0).animate({"left":0+"%","opacity":1}, 500,function(){ $(this).addClass("active_banner").removeClass("inactive_banner"); }); }else{ $(".active_banner").next().animate({"left":0+"%","opacity":1}, 500,function(){ $(this).addClass("active_banner").removeClass("inactive_banner"); }); } }else{ $(".inactive_banner").css("left","-100%").show().fadeTo(250, 0); if($(".active_banner").prev().length &lt; 1){ $(".banner_wrapper").eq($(".banner_wrapper").length- 1).animate({"left":0+"%","opacity":1}, 500,function(){ $(this).addClass("active_banner").removeClass("inactive_banner"); }); }else{ $(".active_banner").prev().animate({"left":0+"%","opacity":1}, 500,function(){ $(this).addClass("active_banner").removeClass("inactive_banner"); }); } } $(".active_banner").animate({"left":activeBanner1+"%","opacity":0}, 500,function(){ $(this).addClass("inactive_banner").removeClass("active_banner"); }); }); My HTML &lt;div class="slider-wrapper"&gt; &lt;div class="banner_wrapper active_banner" style="display: block; left: 0%; opacity: 1;"&gt; &lt;img class="bgwidth" src="http://s25.postimg.org/keaisiflb/mini_brown_fairy.jpg" /&gt; &lt;/div&gt; &lt;div class="banner_wrapper inactive_banner" style="left: 100%; opacity: 0;"&gt; &lt;img class="bgwidth" src="http://s25.postimg.org/xwhf4srqn/mini_blue_fairy.jpg" /&gt; &lt;/div&gt; &lt;a class="left-arrow nav_arrows" href="javascript:void(0);"&gt; &lt;img src="http://s25.postimg.org/3uhfk0for…
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: -1

http://stackoverflow.com/q/27410331
score: -1
has body: I'm new to web development and it's my first post on stack overflow, I'm trying to follow a guide from http://untame.net/2013/05/how-to-build-a-modal-contact-form-in-twitter-bootstrap-with-php-ajax/ to create a Bootstrap modal contact form when a button is clicked on my website. It's exactly what I need and the tutorial is simple enough but I just can't get it to work. When I click the button, nothing happens, no modal pop up. I even downloaded their source code and the same thing happens. No errors show and all libraries load correctly. Any advice would be amazing thanks ! Code is all on the tutorial linked. Appreciate any help :)
tagged with: modal-dialog
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43268064
favorite count: 0
tagged with: contacts
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Can't get Bootstrap Modal contact form to open when clicking button
upvote count: 0
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43265397
type: Question
has answer: http://stackoverflow.com/a/27410858
tagged with: javascript

http://stackoverflow.com/q/27365054
tagged with: ajax
has answer: http://stackoverflow.com/a/27365205
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43182029
score: -3
has comment: http://stackoverflow.com/comment/43182129
tagged with: http://stackoverflow.com/tag/html
has title: Need help making a calculator using AJAX
tagged with: php
has comment: http://stackoverflow.com/comment/43182217
has comment: http://stackoverflow.com/comment/43182130
downvote count: 3
has body: This is part of my assessment and we have to use JavaScript HTML and PHP to make a calculator with buttons, not fields. I have managed to make the 'interface' but cannot workout how to make the buttons work. I need the numbers to show in the input field (has to be readonly) What I'm asking for is help with making the buttons I've created show in the input field: I need to show the input within the text field HTML 1 2 3 CE 4 5 6 / 7 8 9 * 0 - + = JavaScript (jQuery) PHP <?php $_POST['formText']; ?>
type: Question
has comment: http://stackoverflow.com/comment/43181958
tagged with: javascript
has comment: http://stackoverflow.com/comment/43182242
has comment: http://stackoverflow.com/comment/43182103
upvote count: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43182027
favorite count: 0

http://stackoverflow.com/comment/43388262
has text: Hey @Mekong try this answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27459095
type: AnswerComment

http://stackoverflow.com/comment/43277563
type: QuestionComment
score: 0
has text: type a in search box u'll get charlie as first result. In that i want, if i type a that it should show only that results which are starting with 'a'.
comment on: http://stackoverflow.com/q/27416594
type: Comment

http://stackoverflow.com/a/27458456
type: Answer
has body: I'm afraid you can't open the keyboard without using a input. For more information you can read the following thread: Show virtual keyboard on mobile phones in javascript
answers question: http://stackoverflow.com/q/27458409
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27458409

http://stackoverflow.com/comment/78114170
score: 1
type: AnswerComment
has text: @pikilon "Adding attribute to JSX object"? What does that mean? I am creating a method, a bound one, on a JS class that extends React component. Of course it is preferable to re-binding on each render (although with TurboFan in V8 it should be much much better). That aside -- it is much more idiomatic this way.
comment on: http://stackoverflow.com/a/39878181
type: Comment

http://stackoverflow.com/comment/43179816
has text: I read the link you included and also ended up finding this explanation of update and exit helpful: [link] (http://bost.ocks.org/mike/join/), but read it to say that dealing with the update selection means using .data, which I think I'm doing, and for exit it's .enter, which I'm also calling in the update function. Pretty sure I'm missing something obvious, but am really scratching my head, especially now that I've got my y and x axis updating correctly in the revised code above.
comment on: http://stackoverflow.com/q/27346327
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27322148
tagged with: jquery
score: 1
has answer: http://stackoverflow.com/a/27322211
has answer: http://stackoverflow.com/a/27323535
favorite count: 0
possible better answer: http://stackoverflow.com/a/27322211
tagged with: web
has title: How do I find how many occurences are there of a highlighted string, and which occurence is it?
has comment: http://stackoverflow.com/comment/43103588
accepted answer: http://stackoverflow.com/a/27323535
upvote count: 1
type: AnsweredQuestion
has body: As the title says, say I have some website with a text inside some div, is there a way to highlight some part of it and know which occurence it is? If a text has 4 occurences of the word "something", and I highlight the 3rd, how do I get that information using Javascript/JQuery?
type: Question
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/5379120
tagged with: javascript

http://stackoverflow.com/comment/43215993
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27383383
has text: maybe you did not get my point :)

http://stackoverflow.com/a/27423119
has comment: http://stackoverflow.com/comment/43288488
type: Answer
has body: It would be easier if you use a loop. Interate through the desired values, and if it exists, you add it +1... If none is set, the default one is applied... var cookieToSet = "1"; for(var i=1; i&lt;=4; i++) { if(getCookie(i)) { cookieToSet = i+1; break; } } setCookie(cookieToSet', 1, 365);
answers question: http://stackoverflow.com/q/27422940
score: 0
has comment: http://stackoverflow.com/comment/43292583

http://stackoverflow.com/comment/43147858
type: Comment
has text: Ok, thanks. Still, there's the unexpected error. It's probably caused by the script itself.
type: AnswerComment
comment on: http://stackoverflow.com/a/27346353
score: 0

http://stackoverflow.com/comment/43106164
comment on: http://stackoverflow.com/a/27323313
type: Comment
has text: i am sorry my mistake
score: 0
type: AnswerComment

http://stackoverflow.com/q/27391306
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/27391405
tagged with: php
possible better answer: http://stackoverflow.com/a/27391426
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27391426
upvote count: 5
has title: Ajax redirect on error
type: Question
answer count: 2
score: 5
has body: I'm calling php file through ajax call and if it returns nothing i want to redirect user to another page (It's for error reports, if it doesn't return anything it means that user logged in). Tried to add error section but it doesn't work. Any suggestions will help. Thanks! Btw, I have small jQuery function at the top of the ajax function, why it breaks my whole ajax call? ajax.js function loginAjax() { //$("#email_errors").empty(); //This function doesnt work and kills whole ajax call. Here is loginAjax function call line - PushMe $.ajax({ url: "Classes/call_methods_login.php", type: "POST", dataType: "json", data: { login_email: $("#login_email").val(), login_password: $("#login_password").val(), }, success: function(data) { $("#login_error").html(data.login_message); } }); }
accepted answer: http://stackoverflow.com/a/27391405

http://stackoverflow.com/comment/43203327
type: Comment
has text: Also, I was wanting to transform the shape on mouse click with a 45 degree rotation and a slight scaling operation. I've seen your name pop up fairly often in snap related threads, I was wondering if you could point me the right way? The documentation is a bit tricky for me personally. I feel like I've jumped into the deep end a bit.
comment on: http://stackoverflow.com/a/27376766
score: 0
type: AnswerComment

http://stackoverflow.com/a/27391713
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27391691
has comment: http://stackoverflow.com/comment/43258494
answers question: http://stackoverflow.com/q/27391691
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43231098
has body: You could use Underscore to do it, in particular, findWhere(). bobs = _.findWhere(users, { username: "Bob" }); If you must use jQuery, you could use... bobs = $.grep(users, function(user) { return user.username === "Bob"; }); Or if your platforms support Array.prototype.filter(), use it in the same way you use jQuery's grep(). Also, when iterating over something with jQuery that isn't a jQuery collection, don't use jQuery.prototype.each(), but use jQuery.each().
has comment: http://stackoverflow.com/comment/43231119
type: Answer
has comment: http://stackoverflow.com/comment/43269504
score: 3

http://stackoverflow.com/q/27445341
tagged with: javascript
has comment: http://stackoverflow.com/comment/43330537
has comment: http://stackoverflow.com/comment/43396436
favorite count: 0
has title: Using polymer in Java or NodeJS
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/43477067
type: Question
tagged with: polymer
has comment: http://stackoverflow.com/comment/43360275
has comment: http://stackoverflow.com/comment/43463658
score: 1
tagged with: java
has comment: http://stackoverflow.com/comment/51458956
has body: I would like to generate static HTML5 pages, defining my own tags and rendering more complex HTML in the generated pages. I like the polymer architecture approach to define new sets of tags. When I want to generate my pages, I'm not in a browser, so I can use Java or NodeJS engines to compute the final HTML pages (from a console for instance). To sum up, I want to define my own tag libraries using the polymer approach, code some HTML using those new tags, and "print" the result DOM in a static HTML file, running all that from a console program (using Java or NodeJS). Does somebody know how to do so? It seems I must have some DOM interpreters, and I know that in Java I can use jsoup, but it will probably lack some JavaScript interpreter? Can NodeJS do that more simply?
downvote count: 0
has comment: http://stackoverflow.com/comment/43330442

http://stackoverflow.com/q/27414627
has comment: http://stackoverflow.com/comment/43275527
tagged with: dynamic
type: Question
has comment: http://stackoverflow.com/comment/43273410
tagged with: javascript
has title: Dynamic loading of external javascript
has comment: http://stackoverflow.com/comment/43273459
score: 0
has body: I am currently working on changing the Angular Bootstrap Datepicker Language. I already saw some answers such as linking to the locale(s). But what I want to have is everytime I change the language, which I have a translation. The language of datepicker should also change. I think I can achieve this by loading the angular locale like &lt;script type ="text/javascript" src ="js/angular-locale_de-de.js"&gt;&lt;/script&gt; what I want to do is to change the src dynamically everytime I change the language so the Angular Calendar's language would also update. Example, when I click the language "Espaniol", the src would change to 'js/angular-locale_es-es.js" french to "js/angular-locale_fr-fr.js" etc. I have a code here this is the function function loadjscssfile(filename) { var fileRef = document.createElement('script'); fileRef.setAttribute("type", "text/javascript"); fileRef.setAttribute("src", filename); if (typeof fileRef != "undefined") { document.getElementsByTagName("head")[0].appendChild(fileRef); } } however, its no working. please do help me with this thank you! Thanks!
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43275178
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43273368

http://stackoverflow.com/comment/43150970
type: QuestionComment
comment on: http://stackoverflow.com/q/27347618
has text: @royhowie: By any chance do you know of an example that I could refer to?
score: 0
type: Comment

http://stackoverflow.com/comment/43328731
score: 0
type: Comment
has text: @pquest: Without File API you cannot read its URL and data, so .. how?
comment on: http://stackoverflow.com/q/27444695
type: QuestionComment

http://stackoverflow.com/q/27367396
type: Question
has comment: http://stackoverflow.com/comment/43189107
tagged with: angularjs-routing
has answer: http://stackoverflow.com/a/27371620
has answer: http://stackoverflow.com/a/27368808
downvote count: 0
has answer: http://stackoverflow.com/a/27367666
favorite count: 0
has comment: http://stackoverflow.com/comment/43188922
tagged with: angularjs
has title: Dynamically Creating Routes in Angular JS
answer count: 4
accepted answer: http://stackoverflow.com/a/27368808
has body: We're trying to make the switch to angular, but we have a pretty big issue with routing. Our current site has something like 10,000 unique routes -- ever page has a unique ".html" identifier. There's no particular convention that would allow us to assign the controller to them, so I created a lookup API endpoint. Here's the workflow I'm trying to create: Angular app loads. One "otherwise" route is set up. When someone clicks a link, I don't know if the resource is a product or a category, so a query is made to the lookup endpoint with the unique ".html" identifier. The endpoint returns two things: the name of the resource, and an ID ("product" and "10" for example). So to be clear, they hit a page like, "http://www.example.com/some-identifier.html," I query the lookup API to find out what kind of resource this is, and get a result like, "product" and "10" -- now I know it's the product controller/template and I need the data from product id 10. The app assigns the controller and template ("productController" and "product.html"), queries the correct endpoint for data ("/api/product/10"), and renders the template. The problems I'm facing: $http isn't available during config, so I can't hit the lookup table. Adding routes after the config is sloppy at best -- I've done it successfully by assigning $routeProvider to a global variable and doing it after the fact, but man, it's ugly. Loading all the routes seems impractical -- just the size of the file would be pretty heavy for a lot of connections/browsers. We can't change the convention now. We have 4 years of SEO and a lot of organic traffic to abandon our URLs. I feel like I might be thinking about this the wrong way and there's something missing. The lookup table is really the problem -- not knowing what kind of resource to load (product, category, etc). I read this article about loading routes dynamically, but again, he's not making an external query. For us, loading the controllers isn't the problem, it's resolving…
upvote count: 3
possible better answer: http://stackoverflow.com/a/27367501
has answer: http://stackoverflow.com/a/27367501
type: AnsweredQuestion
score: 3
tagged with: javascript

http://stackoverflow.com/a/27457478
has comment: http://stackoverflow.com/comment/43352099
type: Answer
downvote count: 2
score: -2
has body: Here is an exmaple snippet you can refer to:-
upvote count: 0
has comment: http://stackoverflow.com/comment/43352563
answers question: http://stackoverflow.com/q/27457427

http://stackoverflow.com/comment/43135323
comment on: http://stackoverflow.com/q/27339351
score: 0
has text: so You should accept my answer as right, then!!!! :P
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27428919
has body: I would suggest using the jQuery.each() generic iterator function in combination with the javascript JSON.parse() to accomplish what you are attempting to do. jQuery.each() JSON.parse .done(function( result ) { checkpoints = JSON.parse(result); $.each( checkpoints, function( index, value) { alert(index + " "+ value); }); });
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27428465
answers question: http://stackoverflow.com/q/27428465

http://stackoverflow.com/a/27409345
has comment: http://stackoverflow.com/comment/43263303
type: Answer
accepted answer of: http://stackoverflow.com/q/27409303
has comment: http://stackoverflow.com/comment/43263088
has comment: http://stackoverflow.com/comment/43263533
answers question: http://stackoverflow.com/q/27409303
score: 1
has comment: http://stackoverflow.com/comment/43263023
has comment: http://stackoverflow.com/comment/43264080
has body: Answer is simple, each time tap event is bound to the first button occurrence, which is page 1. Have a different button on each page.
has comment: http://stackoverflow.com/comment/43263153
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43263379
has comment: http://stackoverflow.com/comment/43264119
has comment: http://stackoverflow.com/comment/43263640
upvote count: 1

http://stackoverflow.com/comment/43348429
score: 0
type: AnswerComment
has text: Thank you for your answer Cory, but I need to keep the original element in case they are some other attributes added to it.
type: Comment
comment on: http://stackoverflow.com/a/27455320

http://stackoverflow.com/a/27417465
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43279212
has comment: http://stackoverflow.com/comment/43279105
accepted answer of: http://stackoverflow.com/q/27416584
has comment: http://stackoverflow.com/comment/43279525
answers question: http://stackoverflow.com/q/27416584
has body: In your DIV, CSS-hide the cursor using cursor:none; Create a .png Cursor image and move it (left, top) with jQ on mousemove Randomize the .png margin-left and margin-top using a setTimeout (to make the re-positioning smooth use CSS3 transition or do it with jQ .animate()). Note: The script cannot know if the hand is still on the mouse ;) function rand(min, max) {return Math.random() * (max - min) + min;} var $cursor = $('div img'); $('div').mousemove(function(e) { $cursor.css({ left: e.pageX, top:e.pageY }); }).hover(function(e){ $cursor.toggle(); }); (function tremor(){ $cursor.css({ marginLeft: rand(-15,15), // arm tremor marginTop: rand(-30,30) // hand contractions }); setTimeout(tremor, rand(50,100)); }()); div{ position:absolute; background:#eee; height:100%; width:100%; cursor:none; } div img{ display:none; position:absolute; transition: margin 0.2s; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div&gt;&lt;img src="https://i.sstatic.net/KwMGA.png"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/43299326
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43278582
downvote count: 0

http://stackoverflow.com/comment/43309055
type: AnswerComment
comment on: http://stackoverflow.com/a/27432442
type: Comment
has text: Good, now you can test it passing the parameters in my aprroach
score: 0

http://stackoverflow.com/q/27364732
score: 0
type: Question
has comment: http://stackoverflow.com/comment/43181283
has comment: http://stackoverflow.com/comment/43181279
tagged with: javascript
has answer: http://stackoverflow.com/a/27364869
tagged with: jquery
has title: Using jQuery each() function to calculate heights of divs
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Currently I'm using a function to calculate the height of certain divs within an element to enforce a jquery plugin called 'DotDotDot'. This works absolutely perfectly for a singular div. But what I'm trying to achieve is a series of divs doing this but currently it's not working out for me when using a .each() function, and it's breaking when it hits the second div. Would love any help on this, not the best at jQuery - fiddle below. TL;DR Calculating heights of div inside container to ellipsis text with a jquery plugin called DotDotDot. Replicating for multiple divs using .each() function. Not working. JS Fiddle DotDotDot Plugin $(document).ready(function () { $("#desc").each(function () { var imgheight = $(".image").height(); var h2height = $("#desc h2").height(); $("#desc").height(670 - imgheight - h2height - 30); $("#desc").dotdotdot({ after: "a.readmore" }); }); });
accepted answer: http://stackoverflow.com/a/27364869
tagged with: each
type: AnsweredQuestion

http://stackoverflow.com/comment/43256523
type: QuestionComment
has text: The tinymce has a fullscreen function (found inside View->fullscreen). But it won't cover the full screen width,height it will cover the width the height the modal takes up. If i move the html code outside of modal it will cover everything.
score: 0
comment on: http://stackoverflow.com/q/27405138
type: Comment

http://stackoverflow.com/q/27383509
has comment: http://stackoverflow.com/comment/43215891
has answer: http://stackoverflow.com/a/27383710
has answer: http://stackoverflow.com/a/27436800
upvote count: 1
downvote count: 1
type: Question
has title: Place my javascript at the end of the source code for the page
tagged with: javascript
has comment: http://stackoverflow.com/comment/43215879
score: 0
answer count: 2
tagged with: jquery
tagged with: sitefinity
favorite count: 0
has body: I am writing a piece of javascript to modify a breadcrumb on my page, the breadcrumb is being loaded dynamically by Sitefinity through a script after the entire page is loaded. See Below for the script that loads the breadcrumb &lt;script type="text/javascript"&gt; //&lt;![CDATA[ ;(function() { function loadHandler() { var hf = $get('ctl05_TSSM'); if (!hf._RSSM_init) { hf._RSSM_init = true; hf.value = ''; } hf.value += ';Telerik.Sitefinity.Resources, Version=7.1.5200.0, Culture=neutral, PublicKeyToken=b28c218413bdf563:en:e8482271-e037-4f4c-9782-d3ef83d41650:7a90d6a;Telerik.Web.UI, Version=2014.2.618.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4:en:75278af3-5298-4076-a167-6de45b7d14f0:580b2269:eb8d8a8e'; Sys.Application.remove_load(loadHandler); }; Sys.Application.add_load(loadHandler); })();Sys.Application.add_init(function() { $create(Telerik.Web.UI.RadSiteMap, null, null, null, $get("ctl00_cph_header_T1D6EFA53006_ctl00_ctl00_Breadcrumb")); }); //]]&gt; &lt;/script&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; As you can see the script that places the breadcrumb on the page is right at the end of source code for the page, just before the closing body tag. I need to be able to modify the breadcrumb so I wrote my own little script. The problem I am having is, no matter where I place my little script on the page, when the page loads, my script is always above the script that loads the breadcrumb. As a result, trying to access the elements in the breadcrumb from my code is returning UNDEFINED. I have tried: $(document).ready(function(){ //my code }); window.load(function(){ //my code }); window.bind("load",function(){ //my code }); None of these seem to place/execute my script after the existing script(breadcrumb load) on the page. Anyone can direct me towards a workaround for this?
type: UnansweredQuestion

http://stackoverflow.com/comment/43220113
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27384946
score: 0
has text: If you want to display the progress of a processing, I'd recommend you to first develop the process you want to do (you mentioned some array in your question, which we do not see in the example code). Then you'll be in measure to properly implement what you're looking to do (and probably get rid of the `setTimeout`). updated jsFiddle: http://jsfiddle.net/kan777ab/1/

http://stackoverflow.com/comment/43170936
has text: i suppose after adding these two lines to your Spring dispatcher servlet file, Spring mvc will start scanning your components.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27322141
type: Comment

http://stackoverflow.com/q/27322741
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
has body: Iam using Elastislide Responsive Carousel Slider LINK I modification code, I want 1 page show 2 slider with different width i want slider 1 width : 100% and slider 2 width : 50% this my code, i confused :( index.html elastislide.css .elastislide-wrapper { position: relative; background-color: #fff; margin: 0 auto; min-height: 60px; box-shadow: 1px 1px 3px rgba(0,0,0,0.2); } .elastislide-wrapper.elastislide-loading { background-image: url(../images/loading.gif); background-repeat: no-repeat; background-position: center center; } .elastislide-horizontal { padding: 10px 40px; } .elastislide-carousel { overflow: hidden; position: relative; } .elastislide-carousel ul { position: relative; display: block; list-style-type: none; padding: 0; margin: 0; -webkit-backface-visibility: hidden; -webkit-transform: translateX(0px); -moz-transform: translateX(0px); -ms-transform: translateX(0px); -o-transform: translateX(0px); transform: translateX(0px); } .elastislide-horizontal ul { white-space: nowrap; } .elastislide-carousel ul li { margin: 0; -webkit-backface-visibility: hidden; } .elastislide-horizontal ul li { height: 100%; display: inline-block; } .elastislide-carousel ul li a { display: inline-block; width: 100%; } .elastislide-carousel ul li a img { display: block; border: 2px solid white; max-width: 100%; } /* Navigation Arrows */ .elastislide-wrapper nav span { position: absolute; background: #ddd url(../images/nav.png) no-repeat 4px 3px; width: 23px; height: 23px; border-radius: 50%; text-indent: -9000px; cursor: pointer; opacity: 0.8; } .elastislide-horizontal nav span { top: 50%; left: 10px; margin-top: -11px; } .elastislide-horizontal nav span.elastislide-next { right: 10px; left: auto; background-position: 4px -17px; } jquery.elastislide.js This code in link > LINK modernizr.custom.17475.js This code in link > LINK
tagged with: css
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27322898
has title: How to set different width of jquery slider

http://stackoverflow.com/comment/43101281
type: AnswerComment
comment on: http://stackoverflow.com/a/27320856
score: 0
type: Comment
has text: @TrueBlueAussie There was Multiple people talking at once, I am not Super-Man. I can only respond to so many at once, and saw your point as something I already tried. I am not bashing you, only stating what happened while I was reading and trying examples. I really do appreciate your input.

http://stackoverflow.com/comment/43277377
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27416959
has text: Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'a:not(:has(>img))' is not a valid selector.
score: 0

http://stackoverflow.com/comment/43206871
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27376996
has text: No problem, it was for @Think Different
score: 0

http://stackoverflow.com/comment/43275281
score: 0
type: Comment
has text: Note that in `a + parseInt(this.value)` the use of *parseInt* is pointless. `this.value` is a string to start with, so is *a*, so the `+` operator will convert the result of `parseInt(this.value)` back to a string then append it to the value of *a* as if *parseInt* had not been used.
comment on: http://stackoverflow.com/a/27414956
type: AnswerComment

http://stackoverflow.com/comment/43402917
type: AnswerComment
has text: Thank you very much, sorry for the late update. is there any way i can make less code??
comment on: http://stackoverflow.com/a/27396148
type: Comment
score: 0

http://stackoverflow.com/comment/43309014
score: 0
type: AnswerComment
has text: the probleme was var valueSelectede i changed it to var valueSelected and var threads = GmailApp.search("in:inbox", 0, 500); changed to var threads = GmailApp.search("in:inbox", 0, max); and then if the user chose a number it will show only the number of msgs than he want to check i got my answer when i have tried to use you code so thank you @Verhaeren
comment on: http://stackoverflow.com/a/27432442
type: Comment

http://stackoverflow.com/comment/43281230
type: AnswerComment
comment on: http://stackoverflow.com/a/27418008
has text: Ok will try this. But why there are real time events when they will not show up until 20 minutes or so?
score: 0
type: Comment

http://stackoverflow.com/comment/43326137
type: Comment
comment on: http://stackoverflow.com/a/27441585
score: 0
type: AnswerComment
has text: While this doesn't have the syntax I wanted e.g `document.getElementById('my-element').**addClass('new-class')**;` I think this implementation will suit my needs - thanks.

http://stackoverflow.com/q/27437746
has body: I've been working to get the difference of two dates using moment JS. test1 = new Date("01/12/2015") test2 = new Date("12/12/2014") get_diff = moment.duration(moment(test1,"DD/MM/YYYY").diff(moment(test2,"DD/MM/YYYY"))) result_diff = get_diff.asDays() console.log result_diff It gives: 365. It supposed to give 31 days.
has title: Moment JS gives wrong date when I use diff
has answer: http://stackoverflow.com/a/27437929
type: Question
accepted answer: http://stackoverflow.com/a/27437927
upvote count: 3
has answer: http://stackoverflow.com/a/27437816
downvote count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27437927
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27437930
favorite count: 0
has answer: http://stackoverflow.com/a/27437930
tagged with: momentjs
answer count: 4
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/43250136
type: Comment
has text: @TomekBuszewski: Stack Overflow is a poor substitute for a debugger. Step through your code in a debugger and watch what's happening. The code is doing *exactly* what it's written to do. That last `if` block is going to write the value `dzisiaj` any time `sameDay` is `true`. Given that today is `10.12.2014`, why is this surprising?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27402512

http://stackoverflow.com/comment/43284968
comment on: http://stackoverflow.com/a/27419796
type: Comment
has text: @Ben In Promises/A+ compliant promises (which I believe the $q promises are), the `.then()` method is guaranteed not to call its callbacks immediately, even if it is called on an already-resolved promise.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/43091699
has text: I would actually ask OP to provide bytecode for their both instant and 4 second version, since it's curious indeed.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27315890

http://stackoverflow.com/q/27374293
answer count: 0
upvote count: 2
type: UnansweredQuestion
has body: I'm using node-captcha to generate captchas as data URLs. I want to display the resulting PNG image in the browser. My captcha generator looks like this, pretty much identical to the example in the link to node-captcha: exports.getChallenge = function(req, res) { captcha({ fileMode: 0 }, function(text, data) { res.send(data); }); }; I have that function routed to /api/challenge, and an angular controller that retrieves this challenge: app.factory('Challenge', ['$resource', function($resource) { return $resource('/api/challenge'); }]); app.controller('challengeController', ['$scope', 'Challenge', function($scope, Challenge) { $scope.initChallenge = function() { Challenge.get( function(res) { $scope.captchaImage = res; }); }; }]); Now, in my actual HTML file, I have this: &lt;div data-ng-controller="challengeController" data-ng-init="initChallenge()"&gt; &lt;img ng-src="{{captchaImage}}"&gt;&lt;/img&gt; &lt;/div&gt; However, the image doesn't load. You only see the little broken image icon that appears whenever an image doesn't load. How can I make a captcha display as an image?
type: Question
has comment: http://stackoverflow.com/comment/43199077
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43199074
tagged with: node.js
score: 2
has title: Display an image in browser from data url with node/angular?

http://stackoverflow.com/q/27450782
has comment: http://stackoverflow.com/comment/43340266
type: Question
has comment: http://stackoverflow.com/comment/43340163
has answer: http://stackoverflow.com/a/27450969
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
upvote count: 3
has body: I am trying to use jQuery's AJAX deferreds to return a JSON string that can be parsed and used but I have coded myself into a corner and may have screwed up the logic. I expected the results of the AJAX call to be returned in the .done() callback and they are. I thought once done that I could return the result for use in the remainder of the function. I know that I'm missing something really obvious and simple, I just cannot put a finger on what it is. Here is the initial coding of the function, stil very much in test mode. The JSON is correctly returned in the .done() function but I cannot assign it outside of the function for use. checkUserRoles = function(){ var userRole, foo, roles, i$, len$, i; userRole = roleChecker(); foo = userRole.done(function(data){ var bar; bar = foo.responseText; // correctly returns the JSON data console.log(bar); return bar; // is undefined, this is the problem }); if (userRole !== false) { userRole = jsonDecode(userRole); } else { userRole = ""; } roles = userRole.split(','); $("if-user-role").hide(); for (i$ = 0, len$ = roles.length; i$ &lt; len$; ++i$) { i = roles[i$]; $("if-user-role[data-role~=" + i + "]").show(); } return true; }; this.roleChecker = function(){ var retVal, allCookies, i$, len$, thecookie, hashedCookie, theHash, userHash, post; retVal = ""; allCookies = document.cookie.split(';'); for (i$ = 0, len$ = allCookies.length; i$ &lt; len$; ++i$) { thecookie = allCookies[i$]; if (thecookie.indexOf('userHash') &gt;= 0) { hashedCookie = thecookie; theHash = hashedCookie.split('='); userHash = theHash[1]; } } post = $.ajax({ url: '/services/check_hash.php', data: { hash: userHash }, type: "POST" }); return post; }; The code that you see here is the output from the compiling of LiveScript which we use extensively. I don't think the LiveScript is having an effect on the final result, I just had to do a lot to get what I expected would be the proper JavaScript / jQuery output. NOTE: because this is more or less the first pass …
linked to: http://stackoverflow.com/q/14220321
tagged with: deferred
favorite count: 0
tagged with: promise
possible better answer: http://stackoverflow.com/a/27450969
type: AnsweredQuestion
score: 3
has title: I'm using .done() incorrectly, doesn't return value as expected
has answer: http://stackoverflow.com/a/27450822
accepted answer: http://stackoverflow.com/a/27450822

http://stackoverflow.com/q/27357593
has answer: http://stackoverflow.com/a/27357701
accepted answer: http://stackoverflow.com/a/27357701
has title: How can I store elements to pass to .not()?
has comment: http://stackoverflow.com/comment/43167478
has comment: http://stackoverflow.com/comment/43167483
has comment: http://stackoverflow.com/comment/43167606
type: AnsweredQuestion
type: Question
tagged with: javascript
has body: Basically I want to use $( "#c1" ).parents() with the .not() function. I thought of storing the selector in a variable, something like this: var ele = $( "#c1" ).parents(); But I didn't really know how to continue from here.
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43167533
has comment: http://stackoverflow.com/comment/43167723
answer count: 1
has comment: http://stackoverflow.com/comment/43167465

http://stackoverflow.com/q/27470652
has body: I am using javascript to do this. And I was wondering if there was a 'prettier' way to do this? Here is my way: I find the width and height of screen in use: var x = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var y = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); I find the ratio between the canvas and screen: var Xf = (x / a_canvas.width); var Yf = (y / a_canvas.height); Then i use this function after wards to scale the canvas: function resize_canvas() { if (a_canvas.width &lt; x) { a_canvas.width = x; } if (a_canvas.height &lt; y) { a_canvas.height = y; } } resize_canvas(); After this is draw my code and functions, I multiply every single coordinates with Xf or Yf, depending on if it's x and y axis. My full code is here: https://github.com/GunZi200/Memory-Colour/blob/master/test.js If you guys know of a better way? Please let me know!
tagged with: ios
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/43381650
tagged with: javascript
type: UnansweredQuestion
score: 1
favorite count: 0
type: Question
has title: More efficient way for scaling phonegap iphone application's UI?
has comment: http://stackoverflow.com/comment/43382901
tagged with: cordova
has comment: http://stackoverflow.com/comment/43380321
upvote count: 1
has comment: http://stackoverflow.com/comment/43377599
tagged with: canvas
tagged with: iphone

http://stackoverflow.com/q/27453749
has comment: http://stackoverflow.com/comment/43346174
has title: table in html to take up all of screen, one column bigger than other
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27454138
tagged with: css
has comment: http://stackoverflow.com/comment/43346189
type: Question
has answer: http://stackoverflow.com/a/27454081
has body: Hi I basically want to create a login page, one side of the page saying login, and he other saying register. I was thinking of doing it by implementing a 2 column table. This is what I have for html: Login Username: Password: Register First Name: Last Name: Username: Password: Confirm Password: however even though i set the width of the table to be 100% of the screen I can see because I added a border that the column to right is bigger than the column to the left. Why is that and how do I fix it? This is a side note but also how would I make my input fields align, like all be at the same position, right now it looks very ugly. I would apprciate any help!
tagged with: javascript
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43297549
type: Comment
type: QuestionComment
has text: Give this a look: http://stackoverflow.com/questions/1874560/how-to-use-javascript-to-change-div-backgroundcolor
comment on: http://stackoverflow.com/q/27427963
score: 0

http://stackoverflow.com/q/27435355
type: Question
tagged with: javascript
tagged with: browser
score: 0
has comment: http://stackoverflow.com/comment/43311656
upvote count: 1
has answer: http://stackoverflow.com/a/27435398
accepted answer: http://stackoverflow.com/a/27435398
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43311638
has comment: http://stackoverflow.com/comment/43311699
has comment: http://stackoverflow.com/comment/43311669
tagged with: http://stackoverflow.com/tag/html
has title: Tags to watch out for, when coding for all browsers?
has comment: http://stackoverflow.com/comment/43311628
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43311670
has body: SO I coded a website and it looks and works great in Chrome. Testing it in Mozilla: some animations (transitions) aren't looking right. And Safari and IE are completely wrong (border radius not showing, No transitions, formatting all wrong). Could someone point me to a list of TAGS in CSS which don't work between browsers ...or.. Do I have to transfer most of the code to JS, due to my abuse of CSS. note: I primarily use % to dimension my boxes. eg (60% and 40% boxes in a wrapper). I chrome the two boxes appear in one line. In safari and IE, they wrap onto the next line... WHY? not what I want. //This seems like a question that would be asked before but I can't seem to find much on stackoverflow or other sites

http://stackoverflow.com/q/27365327
upvote count: 0
type: Question
tagged with: filtering
has comment: http://stackoverflow.com/comment/43182563
has comment: http://stackoverflow.com/comment/43183307
tagged with: javascript
score: -1
has body: I have been trying to figure out a way to change my current search filter so that any text found within each box's div can be searched, rather than just filtering by each that contains the class 'name'. Does anyone know any simple solutions for adjusting this code so that any additional text can be searched from the same search box? I appreciate any suggestions or ideas. http://jsfiddle.net/point71echo/mttgj1tt/1/ The JavaScript currently used: document.getElementById("box").oninput=function(){ for (var i=0;i&lt;document.getElementsByClassName("name").length;i++) { if (document.getElementsByClassName("name")[i].innerHTML.match(new RegExp(document.getElementById("box").value, "gi"))) { document.getElementsByClassName("name")[i].parentElement.parentElement.parentElement.style.display="inline-block"; } else { document.getElementsByClassName("name")[i].parentElement.parentElement.parentElement.style.display="none"; } } }
has comment: http://stackoverflow.com/comment/43183193
tagged with: filter
accepted answer: http://stackoverflow.com/a/27435067
answer count: 1
downvote count: 1
tagged with: jquery
tagged with: show-hide
favorite count: 0
has title: Filter by any text found within div
has answer: http://stackoverflow.com/a/27435067
type: AnsweredQuestion

http://stackoverflow.com/comment/43296443
type: Comment
comment on: http://stackoverflow.com/a/27419419
has text: no i am not using user1 and user2. There can be any number of users. I just want to add index to each user in ... class='user10'>
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43217711
has text: This is better than the accepted answer, div.style.height shouldn't be used to measure the position.
type: Comment
comment on: http://stackoverflow.com/a/27362827
score: 0
type: AnswerComment

http://stackoverflow.com/q/27449740
answer count: 1
has body: So I am using the gem 'angular-file-upload-rails' which installs me this Angular plugin: Angular File Ipload Now the code I am using currently to upload my file looks like this: HTML: &lt;form ng-controller="MediumNewCtrl"&gt; &lt;input type="file" ng-file-select="upload2($files)" multiple&gt; &lt;/form&gt; Coffescript: $scope.upload2 = ($file) -&gt; console.log($file[0]) fileReader = new FileReader() fileReader.readAsArrayBuffer($file[0]) fileReader.onload = (e) -&gt; $upload.http( url: "/media.json" headers: 'Content-Type': $file[0].type data: medium: {text: 'text', image_video: e.target.result} ).progress((evt) -&gt; console.log "percent: " + parseInt(100.0 * evt.loaded / evt.total) return ).success((data, status, headers, config) -&gt; # file is uploaded successfully console.log data ).error((data) -&gt; console.log 'Error' ) And now when I look at what my server responded, I see this: Started POST "/media.json" for 127.0.0.1 at 2014-12-12 20:19:10 +0200 Processing by Content::MediaController#create as JSON User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1 {"action"=&gt;"create", "controller"=&gt;"content/media", "format"=&gt;"json"} Completed 400 Bad Request in 3ms ActionController::ParameterMissing - param is missing or the value is empty: medium: Is the problem in the fact that I format it as json? But shouldnt atleast the text params be passed to the controller? I cannot use the html Post too because the nature of my application is so that it will intercept all HTML requests when you log in. Also maybe worth nothing that I use paperclip to manage my uploads for me. So I probably have to get the file sent into a proper format too for it?
tagged with: javascript
has title: Not able to upload a file to Rails server with Angular
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27451172
favorite count: 0
tagged with: ruby
has comment: http://stackoverflow.com/comment/43461493
tagged with: angularjs
type: Question
tagged with: angular-file-upload
upvote count: 2
accepted answer: http://stackoverflow.com/a/27451172
tagged with: ruby-on-rails

http://stackoverflow.com/comment/43142574
comment on: http://stackoverflow.com/q/27339132
has text: I was slightly wrong, semantics. You have an Object. Not an array, nor a JSON object (because you don't have quotes around your keys, but easily could). Hope that helps.
score: 0
type: Comment
type: QuestionComment

w3c
type: Tag
tag name: w3c
tags question: http://stackoverflow.com/q/27334365

http://stackoverflow.com/q/27396591
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43239812
has answer: http://stackoverflow.com/a/27396767
has comment: http://stackoverflow.com/comment/43239683
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27396668
has comment: http://stackoverflow.com/comment/43239636
has comment: http://stackoverflow.com/comment/43239450
favorite count: 0
has body: I was digging around some older javascript code when i've come across the following piece of code: constructor: function (data) { DataArr = data || {} if (DataArr.fileId == undefined) { .... } } The values passed as data are always an array: {fileId: 'someFileId', fileName: 'someFilename' ... } Question: So what does data || {} exactly do and in what context should I use it? Note: The code uses both jquery and extjs. Perhaps this function is only available in one of those frameworks. I thank you for your time. Note2: I know it probably has something to do with the array (e.g. exposing the values). But i was looking for some deeper info.
has title: What does '|| {}' do
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/27396767
type: Question
has comment: http://stackoverflow.com/comment/43239764
has answer: http://stackoverflow.com/a/27396660
accepted answer: http://stackoverflow.com/a/27396668

http://stackoverflow.com/a/27401682
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27401427
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43248264
has body: Try langeJSON["placeholder"][0]["#colEmail01"] You define placeholder as array, not just one object. And if you want to use langeJSON["placeholder"]["#colEmail01"];, you should build your json as: var langeJSON = { "placeholder": { "#colEmail01": "Hello you" } } var result = langeJSON["placeholder"]["#colEmail01"];
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27401427
upvote count: 1

http://stackoverflow.com/comment/43369675
has text: so during the second click, id is changing but previous image is being displayed?
comment on: http://stackoverflow.com/q/27466872
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43230611
type: QuestionComment
comment on: http://stackoverflow.com/q/27391404
score: 0
has text: Have you even looked in your console for potential errors?
type: Comment

http://stackoverflow.com/comment/43247103
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27400559
has text: Can you get this working for UK date. So start = 12-10-2014 -> 12th October 2014

http://stackoverflow.com/q/27409552
score: 1
tagged with: variables
favorite count: 0
has body: I was explaining some basic javascript stuff to someone and found myself very embarrassed when a variable was not treated as a number, albeit being a number. There are no NaN checks here, but we only input numbers. var number1 = prompt("choose any number"); var number2 = prompt("choose another number"); alert("thank you I will multiply your numbers now!"); var multiplication = function(a, b) { var c = a * b; alert("the product of " + number1 + " and " + number2 + " is: " + c); var number3 = prompt("please choose a number to add to the product."); var sum = c + number3; alert(sum); }; multiplication(number1, number2); It seems that variable "number3" is not treated as a number and the last alert does not give a sum but rather treats "number3" as a string. Things get better when I use trivial var sum = c + +number3; I cannot understand why number3 is not treated as a number, any ideas? I could not explain this to my friend and had to retreat in disgrace. Tired on Chrome and Firefox with the same effect.
has answer: http://stackoverflow.com/a/27409602
linked to: http://stackoverflow.com/q/61088
type: Question
upvote count: 2
answer count: 6
has answer: http://stackoverflow.com/a/27409842
downvote count: 1
has answer: http://stackoverflow.com/a/27409856
has answer: http://stackoverflow.com/a/27409599
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27410118
has answer: http://stackoverflow.com/a/27409908
has title: Variables not treated as numbers

http://stackoverflow.com/comment/43317408
score: 3
comment on: http://stackoverflow.com/q/27438671
type: Comment
type: QuestionComment
has text: I wouldn't post this as a SO question, because your own code shows errors if you run web browser's debugger (i.e. Chrome Dev Tools or Firebug), and the debugger should be enough for you to fix the issue. In the other hand, it seems like you expect an observable array to turn object properties into observable too, and this isn't how KO works!!

http://stackoverflow.com/comment/43170514
has text: Actually we are using gulp, what do you suggest?
comment on: http://stackoverflow.com/a/27358774
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43354146
type: Comment
type: QuestionComment
has text: then you need to use PHP CURL if you have no control over the external page and add your scripts to the PHP CURL page... CULR would allow you to sort data/information before they are displayed on YOUR PAGE.
score: 0
comment on: http://stackoverflow.com/q/27458505

http://stackoverflow.com/comment/43162992
type: AnswerComment
type: Comment
has text: @user3932382 I've fixed that, see my new link here: http://jsfiddle.net/eeG86/16/
comment on: http://stackoverflow.com/a/27354679
score: 0

cocoonjs
type: Tag
tags question: http://stackoverflow.com/q/27443350
tag name: cocoonjs

http://stackoverflow.com/q/27413768
answer count: 3
upvote count: 7
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27773130
favorite count: 0
has answer: http://stackoverflow.com/a/27414123
accepted answer: http://stackoverflow.com/a/27414123
has body: I am trying to draw a movie frame to the canvas element using ctx.DrawImage and I am getting what I think are very weird scaling / cropping behaviors. First, here is my code: HTML &lt;body&gt; &lt;video autoplay width="125" height="125"&gt;&lt;/video&gt; &lt;img src=""&gt; &lt;canvas&gt;&lt;/canvas&gt; &lt;/body&gt; Javascript: var video = document.querySelector('video'); var canvas = document.querySelector('canvas'); var ctx = canvas.getContext('2d'); var localMediaStream = null; function snapshot() { if (localMediaStream) { ctx.drawImage(video, 0, 0, 125, 125); document.querySelector('img').src = canvas.toDataURL('image/webp'); } } video.addEventListener('click', snapshot, false); navigator.getUserMedia( { video: true }, function(stream) { video.src = window.URL.createObjectURL(stream); localMediaStream = stream; }); What this does is essentially take the still from the video and squish it so that it is about 1/3 the original width and about 70% of the height. This is frustrating. Leaving off the 125 and just using ctx.drawImage(video, 0, 0) fills the canvas with the still, however, it is only about the top left corner (25%) of the image. This is also frustrating. How can I make the canvas draw the exact same sized image as the video element is playing? This is coupled with the fact the video element itself is indeed 125px x 125px but my because of the aspect ratio, there is letter boxing (white space) around the video element. Is there a way to force the video element to fill itself with the incoming video stream?
score: 6
tagged with: css
downvote count: 1
tagged with: video
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/70850697
possible better answer: http://stackoverflow.com/a/27773130
type: Question
has comment: http://stackoverflow.com/comment/43271812
tagged with: javascript
has title: Why is ctx.drawImage only drawing part of the video element to canvas?

http://stackoverflow.com/comment/43378918
comment on: http://stackoverflow.com/a/27459142
type: AnswerComment
score: 0
has text: @ChandlerLee: Unless you want to write a function for it and do `var v1 = foo(scope1, "b.value", 0);`, which is probably overkill. :-) I added an example of doing that. The last couple of examples *are* shorter than `var v1 = scope1.b && scope1.b.baz && scope1.b.baz.boz && scope1.b.baz.boz.value || 0;` would be...
type: Comment

http://stackoverflow.com/a/28113188
has body: I like an event bus. Angular does provide $emit on $rootScope but I don't think that should bound your decision to use it for event-based flows if they are complex or foreseeably complex. Angular has lots of features and while most are great, even the authors admit they're mostly meant to compliment good software engineering principles, not replace them. I like this post on using postal.js: An angular.js event bus with postal.js. The two main benefits are channels and envelopes, which will make for more explicit, understandable and flexible event-based logic. I find service based approaches to be error prone if state is not managed tightly, which is hard with async calls and injections, where you can't be certain how a service will be multi-purposed in the future.
answers question: http://stackoverflow.com/q/27356299
downvote count: 0
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/43666179
type: AnswerComment
has text: Honestly? Just look at the library source code. Once I tried lowering the `errorTresh` and noticed that it still only ran 20,000 times, I looked to see what exactly the `net.train` method was doing. From there you can see all the different options and how they affect various parts. Normally this would be in the documentation, but looks like brain.js isn't that well documented
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27596780

http://stackoverflow.com/comment/43175368
type: Comment
type: QuestionComment
has text: i trying it at line 71-74
comment on: http://stackoverflow.com/q/27361575
score: 0

http://stackoverflow.com/comment/43293285
has text: Try `console.log(xhr.responseText)` to see whether you are getting right JSON on not
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27425622
score: 0

http://stackoverflow.com/comment/43187469
has text: in the php code below, it lists items in a shopping cart. each line has its own subtotal. I want to add the totals together and show it in the DIV tag at the end.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27367743
type: AnswerComment

http://stackoverflow.com/comment/43265619
type: Comment
has text: Do you maybe need to use vanilla JS?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27410151

http://stackoverflow.com/q/27361875
downvote count: 2
has body: http://jsfiddle.net/t32h0gj4/4/ how to show variable inside input box SMS () Characters left Please help me
type: Question
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27362200
favorite count: 0
has title: How to show Javascript variable inside input box ,so that i cant post it in html form?
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27362200

validation
tags question: http://stackoverflow.com/q/27423353
tags question: http://stackoverflow.com/q/27418074
tags question: http://stackoverflow.com/q/27379306
tags question: http://stackoverflow.com/q/27424740
tags question: http://stackoverflow.com/q/27382799
tags question: http://stackoverflow.com/q/27348036
tags question: http://stackoverflow.com/q/27353433
tags question: http://stackoverflow.com/q/27319042
tags question: http://stackoverflow.com/q/27325439
tags question: http://stackoverflow.com/q/27457406
type: Tag
tag name: validation
tags question: http://stackoverflow.com/q/27317251
tags question: http://stackoverflow.com/q/27402427
tags question: http://stackoverflow.com/q/27382876
tags question: http://stackoverflow.com/q/27338008
tags question: http://stackoverflow.com/q/27436712
tags question: http://stackoverflow.com/q/27451319
tags question: http://stackoverflow.com/q/27382466
tags question: http://stackoverflow.com/q/27394266
tags question: http://stackoverflow.com/q/27397716
tags question: http://stackoverflow.com/q/27323682
tags question: http://stackoverflow.com/q/27337618
tags question: http://stackoverflow.com/q/27471540
tags question: http://stackoverflow.com/q/27336005
tags question: http://stackoverflow.com/q/27423747
tags question: http://stackoverflow.com/q/27426341
tags question: http://stackoverflow.com/q/27343018
tags question: http://stackoverflow.com/q/27452630
tags question: http://stackoverflow.com/q/27388094
tags question: http://stackoverflow.com/q/27473706
tags question: http://stackoverflow.com/q/27318420
tags question: http://stackoverflow.com/q/27411545
tags question: http://stackoverflow.com/q/27444569
tags question: http://stackoverflow.com/q/27374481
tags question: http://stackoverflow.com/q/27383263
tags question: http://stackoverflow.com/q/27353967
tags question: http://stackoverflow.com/q/27427807
tags question: http://stackoverflow.com/q/27322382

http://stackoverflow.com/q/27441268
has answer: http://stackoverflow.com/a/32284731
has answer: http://stackoverflow.com/a/29850834
has comment: http://stackoverflow.com/comment/43322944
has comment: http://stackoverflow.com/comment/43322278
score: 3
downvote count: 0
type: Question
tagged with: ecmascript-6
has title: Angular 2.0: Migration path from Angular 1.x
answer count: 2
tagged with: javascript
upvote count: 3
has body: I'm not looking for an opinion - just a solid migration strategy. We started to design a new project that designated to be built with Angular as each of our previous, the importance of this project is very high and it's going to live and maintained for at least 3-4 years. Angular 2.0 is coming in the end of 2015 and it seems like everything is about to change, $scope is out, directives are out and the whole DI concept is about to change. Is there a migration path/strategy to be considered in the next few months? If we built the project using 1.x, what action do we need to take during development to ensure a clean migration? Are those 2 versions can be considered as 2 different framework? (Yes means Angular 1.x will continued to be supported and evolved by google)
has comment: http://stackoverflow.com/comment/43322217
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/43096787
score: 0
type: Comment
type: QuestionComment
has text: check the order you referred by any means your refereed mapping plugin in before knockout.js or jquery may be .
comment on: http://stackoverflow.com/q/27317954

http://stackoverflow.com/q/27357210
has answer: http://stackoverflow.com/a/27357431
accepted answer: http://stackoverflow.com/a/27357431
downvote count: 1
type: Question
tagged with: javascript
score: 0
answer count: 3
upvote count: 1
has title: jQuery how display as variables in text fields
has answer: http://stackoverflow.com/a/27357395
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27357433
has body: This is my JavaScript function $(document).ready(function() { (function($) { $.fn.calculateMortgage = function(options) { var defaults = { params: {} }; var calculate = function(params) { params = $.extend({ benzyna: 0, gaz: 0, sp_benz: 0, przebieg: 0, cena_inst: 0 }, params); var N = params.benzyna * params.sp_benz; var I = (+(params.sp_benz * 0.15)) + (+(params.sp_benz)); var J = params.gaz * I; var K = (((params.cena_inst) / (N - J)) * 100); var L = params.przebieg / 12; var L1 = K / L; var M = (L / 100 * (N - J)); var R = (M * 12); var result = N; return result; }; return this.each(function() { var $element = $(this); var $result = calculate(options.params); var output = ' koszt przejazdu na 100km = ' + $result.toFixed(2) + ' '; $(output).appendTo($element); }); }; })(jQuery); $(function() { $('#test').on('submit', function(e) { e.preventDefault(); var $params = { benzyna: $('#benzyna').val(), gaz: $('#gaz').val(), sp_benz: $('#sp_benz').val(), przebieg: $('#przebieg').val(), cena_inst: $('#cena_inst').val() }; $(this).calculateMortgage({ params: $params }) }); }); }); And this is code when I use visible value 100km ... I want to display the values of individual variables in separate text boxes. Such as the Internet helped me to get variables from a text field and perform operations on them. But now I have to show them in the appropriate fields of the form. How to do it? Thanks
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27357395

http://stackoverflow.com/a/27380660
answers question: http://stackoverflow.com/q/27380361
upvote count: 1
type: Answer
has body: No, you can't nest links. What happens is that the browser then compensates for the invalid HTML by closing elements to make it valid, so your original: One Becomes: One
downvote count: 0
score: 1

http://stackoverflow.com/comment/43167723
comment on: http://stackoverflow.com/q/27357593
has text: @morkro - I'm assuming a simple error when copy/pasting the code into the post....
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27352088
has comment: http://stackoverflow.com/comment/43158579
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43158063
has body: I have a Javascript object which I have to iterate over the keys of. I need to check whether the key matches with my local variable, if it matches I need the corresponding value of that key. I'm getting the object using session attribute. The object looks like this when I see it in alert. { 1= Apple , 2= Orange }.
has answer: http://stackoverflow.com/a/27352143
has comment: http://stackoverflow.com/comment/43159436
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/43196704
favorite count: 0
has comment: http://stackoverflow.com/comment/43159150
has comment: http://stackoverflow.com/comment/43158591
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43158723
has comment: http://stackoverflow.com/comment/43159138
tagged with: dictionary
upvote count: 0
has comment: http://stackoverflow.com/comment/43158915
has comment: http://stackoverflow.com/comment/43159790
has comment: http://stackoverflow.com/comment/43158108
type: Question
has comment: http://stackoverflow.com/comment/43159546
has comment: http://stackoverflow.com/comment/43160499
has comment: http://stackoverflow.com/comment/43159927
has title: How to iterate over object/hash in JavaScript?
has comment: http://stackoverflow.com/comment/43191717

http://stackoverflow.com/comment/43093282
has text: forgot { after func declaration?
score: 4
type: Comment
comment on: http://stackoverflow.com/q/27316796
type: QuestionComment

http://stackoverflow.com/q/27356547
tagged with: ckeditor
tagged with: jquery
tagged with: content-editor
score: 0
has comment: http://stackoverflow.com/comment/43200347
tagged with: contenteditable
has body: Looking for some solution to my big big problem with text edit. Short description below: Lets say I have two (or more) editable containers. What I need is when you typing on a first container and the cursor reaches end of it, instead expanding it i want it to move to next editable container, it is like in regular Word document, when you reach end of the page it takes cursor to the next page, i need the same thing on two div containers, looking for tips solutions. Is it doable ?
type: UnansweredQuestion
has title: CKeditor - move cursor to next container when reached end of the first one
has comment: http://stackoverflow.com/comment/43169840
has comment: http://stackoverflow.com/comment/43168182
type: Question
has answer: http://stackoverflow.com/a/27506904
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43098210
type: AnswerComment
comment on: http://stackoverflow.com/a/27318888
has text: @ncohen The actual function, that determines, whether an entry should stay in the array or get filtered is that `predicateFn()`, right? If so, just return this at the end of the function.
type: Comment
score: 0

http://stackoverflow.com/comment/43214502
type: Comment
type: QuestionComment
has text: @Leo I could yes, but I wouldn't know about the specific name 'extension' at that point, if that's why u're asking.
comment on: http://stackoverflow.com/q/27382844
score: 0

http://stackoverflow.com/comment/43169861
type: Comment
has text: connect can't be dependency on build-dev because it can run also after build-staging.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27358484

http://stackoverflow.com/comment/43242988
has text: @Robbit does [this](http://stackoverflow.com/a/27385683/2333214) this help..? You can't call widget functions directly like `.destroy()`, you have to pass the name of the method as a string to the `draggable()` factory function. The factory will compare the string and call corresponnding method in it. The actual name of the method inside facory might be something else...
type: Comment
comment on: http://stackoverflow.com/a/27385393
score: 0
type: AnswerComment

http://stackoverflow.com/q/27371257
has title: browser close event not page refresh/reload event
tagged with: jquery
has answer: http://stackoverflow.com/a/27372048
accepted answer: http://stackoverflow.com/a/27372048
has body: i need to detect the browser close event only not page refresh/reload event I have tried this , but in both condition its working $(window).bind('beforeunload',function(){ }); window.onbeforeunload = function (e) { } $(window).unload(function() { });​
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27372327
score: 0
has answer: http://stackoverflow.com/a/27372096
type: Question
possible better answer: http://stackoverflow.com/a/27372096
tagged with: javascript
has answer: http://stackoverflow.com/a/34674361

http://stackoverflow.com/a/62645383
upvote count: 2
has body: There is a tool I used to use from MrDoob to export my meshes into a format that three.js can easily incorporate. Github to Mr.Doobs export tool https://github.com/mrdoob/three.js/tree/r92
score: 2
answers question: http://stackoverflow.com/q/27403515
downvote count: 0
type: Answer

http://stackoverflow.com/q/27382588
type: Question
has answer: http://stackoverflow.com/a/27386046
duplicate of: http://stackoverflow.com/q/8638621
has comment: http://stackoverflow.com/comment/43215290
has body: I have created a SVG map, I want to change color on the targeted area of the map when i hover over a link. When i hover over a area on my map, the link get the underline class from jQ and the CSS hover effect change the fill color on the map. But when i hover over the link my SVG area dont get the fill color. Im stuck and hope you guys can help me. Here you can see an example of my goal: http://www.blocket.se/ CSS: path:hover{ fill: #FEFF7F !important; } .svgcolor{ fill: #FEFF7F !important; } .underline{ font-weight:600; text-decoration: underline; } HTML: Text SVG: <stop offset="0" style="stop-color:#E7ECF9" /> <stop offset="1" style="stop-color:#C4CFE1" /> <path id="mapimg01" style="fill:url(#SVGID_5_);stroke:#000000;stroke-width:0.5;stroke-miterlimit:10;" d="M440.333,216... /> jQ: //This works fine: $("#mapimg01").hover(function () { $("#maplink01").addClass('underline'); }, function () { $("#maplink01").removeClass('underline'); }); //This does not work: $("#maplink01").hover(function () { $("#mapimg01").addClass('svgcolor'); }, function () { $("#mapimg01").removeClass('svgcolor'); });
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: css
has title: Hover a link and change color in SVG
upvote count: 0
linked to: http://stackoverflow.com/q/8638621
has comment: http://stackoverflow.com/comment/43214427
score: -1

http://stackoverflow.com/q/27405642
possible better answer: http://stackoverflow.com/a/51993984
has title: How to leave semantic-ui sidebar opened
upvote count: 3
has answer: http://stackoverflow.com/a/51993984
tagged with: sidebar
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has body: I now have a sidebar which opens with a button. html: &lt;div class="ui left sidebar"&gt;&lt;a class="item"&gt;Home&lt;/a&gt;&lt;/div&gt; &lt;div class="pusher"&gt;&amp;nbsp;&lt;/div&gt; javascript: $('.left.sidebar') .sidebar('setting', { dimPage : false, transition : 'push', mobileTransition : 'push'}) .sidebar('attach events', '#show-menu'); How can I prevent the sidebar to close when the user clicks somewhere on the page? Thanks!
favorite count: 0
has answer: http://stackoverflow.com/a/27426349
tagged with: semantic-ui
accepted answer: http://stackoverflow.com/a/27426349
type: AnsweredQuestion
score: 3

encryption
tags question: http://stackoverflow.com/q/27339198
tags question: http://stackoverflow.com/q/27371389
tags question: http://stackoverflow.com/q/27457123
tags question: http://stackoverflow.com/q/27345839
tags question: http://stackoverflow.com/q/27375908
tag name: encryption
tags question: http://stackoverflow.com/q/27418611
tags question: http://stackoverflow.com/q/27449453
tags question: http://stackoverflow.com/q/27452342
type: Tag
tags question: http://stackoverflow.com/q/27326735

http://stackoverflow.com/comment/43129567
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27335914
has text: Yes, you right. I thinking in how do that, so in that slide the only image than change every request is from the Instagram.

http://stackoverflow.com/comment/43283268
comment on: http://stackoverflow.com/a/27420094
score: 0
type: AnswerComment
has text: @dfsq it indeed is :)
type: Comment

http://stackoverflow.com/q/27336489
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43132552
has comment: http://stackoverflow.com/comment/43132464
tagged with: node.js
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/27339739
upvote count: 1
has title: enable CORS on angular-fullstack generator?
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/10375946
tagged with: cors
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27339739
has body: Ok i have a EC2 instance up and running with nodeJs and express I'm uing the vanilla install of the generator and my app.js file is as follows: /** * Main application file */ 'use strict'; // Set default node environment to development process.env.NODE_ENV = process.env.NODE_ENV || 'development'; var express = require('express'); var mongoose = require('mongoose'); var config = require('./config/environment'); // Connect to database mongoose.connect(config.mongo.uri, config.mongo.options); // Populate DB with sample data //require('./config/seed'); // Setup server var app = express(); var server = require('http').createServer(app); var socketio = require('socket.io')(server, { serveClient: (config.env === 'production') ? false : true, path: '/socket.io-client' }); require('./config/socketio')(socketio); require('./config/express')(app); require('./routes')(app); // Start server server.listen(config.port, config.ip, function () { console.log('Express server listening on %d, in %s mode', config.port, app.get('env')); }); // Expose app exports = module.exports = app; route.js as declared in require('./routes')(app); is as follows: /** * Main application routes */ 'use strict'; var errors = require('./components/errors'); var cors = require('./config/cors'); module.exports = function(app) { /* app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "X-Requested-With"); next(); }); app.all('/', function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "X-Requested-With"); next(); }); app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "X-Requested-With"); next(); }); */ // Insert routes below app.use('/api/things', require('./api/thing')); app.use('/api/users', require('./api/user')); app.use('/auth', require('./auth')); // All undefined asset or api routes should r…

http://stackoverflow.com/q/27379866
tagged with: angularjs
type: UnansweredQuestion
tagged with: animation
has answer: http://stackoverflow.com/a/27420543
has comment: http://stackoverflow.com/comment/43213205
has body: While trying to build an animation based on velocity.js with AngularJS $animate, I encountered a small problem I couldn't figure for hours, although the solution was very simple. To avoid you the same difficulty, I present to you my solution: Considering the following code: app.directive("animate", function ($animate, $timeout) { return function (scope, element, attrs) { element.on('click', function () { // to fire $animate, need to wrap it into a $timeout wrapper. $timeout(function () { $animate.addClass(element, 'test').then(function () { $timeout(function () { $animate.removeClass(element, 'test'); }, 0); }); }, attrs.delay || 0); }); }; });
type: Question
has comment: http://stackoverflow.com/comment/43242566
has comment: http://stackoverflow.com/comment/43209573
tagged with: javascript
has title: Custom AngularJS animation with third-party javascript libraries
has comment: http://stackoverflow.com/comment/43215862
score: 0
answer count: 1
tagged with: velocity.js

http://stackoverflow.com/a/27439422
answers question: http://stackoverflow.com/q/27439384
type: Answer
upvote count: 0
score: -1
has body: I am not sure if I understand correctly but if you need the text for each element of the node then for JQuery you would do: node.each(function (index){ console.debug($(this).text()); });
downvote count: 1

http://stackoverflow.com/a/27319416
downvote count: 0
has comment: http://stackoverflow.com/comment/43103165
score: 1
answers question: http://stackoverflow.com/q/27318475
upvote count: 1
type: AcceptedAnswer
has body: You made a simple typo : var company = date[0].name; Try this : var company = data[0].name;
has comment: http://stackoverflow.com/comment/43103211
type: Answer
accepted answer of: http://stackoverflow.com/q/27318475

http://stackoverflow.com/q/27372764
score: 0
accepted answer: http://stackoverflow.com/a/27384500
has body: I am following the course on Pluralsight at Building Data-Centric Single Page Apps with Breeze. The code here was using 1.4.2 version of Breeze and was running on Web API v1 and EF 5. I upgraded the solution to EF 6, Web API v2 and Breeze v1.5.1 with some success. I was able to get a basic query up and running as well as a simple predicate running as shown below: var productsWithBacon = function () { var query = breeze.EntityQuery.from("Products").where("Description", "contains", "bacon"); app.em.executeQuery(query) .then(function (data) { products(data.results); }) .fail(errorLoading); }; The problem occurs when I try to do a complex predicate as seen here. var ordersGreaterThan100InMay = function () { clearCollections(); var gteMay1 = new breeze.Predicate("OrderDate", "&gt;=", moment("2013-05-01")); var lteMay31 = new breeze.Predicate("OrderDate", "&lt;=", moment("2013-05-31")); var gt100 = new breeze.Predicate("ItemsTotal", "&gt;=", 100); var predicate = breeze.Predicate.and(gteMay1, lteMay31, gt100); var query = breeze.EntityQuery.from("Orders").where(predicate).expand("Customer"); app.em.executeQuery(query) .then(function (data) { orders(data.results); }) .fail(errorLoading); }; When executing, I get the error as seen in the title Unable to resolve an expression for: 1367380800000 on entityType: Order:#Zza.Data Originally, the code (as described in the course) was to use a line like: var gt100 = new breeze.Predicate("ItemsTotal", "greaterThanOrEqual", 100); This cause an error of: Uncaught Error: Unable to resolve predicate after the phrase: 'ItemsTotal' for operator: 'greaterThanOrEqual' and value: '100' but that was resolved by changing to ">=". What is causing the expression error though?
tagged with: javascript
has answer: http://stackoverflow.com/a/27394039
has answer: http://stackoverflow.com/a/27402928
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27394039
has title: Breeze.js - Unable to resolve an expression for: 1367380800000 on entityType: Order:#Zza.Data
tagged with: breeze
type: Question
has comment: http://stackoverflow.com/comment/43216517
answer count: 3
has answer: http://stackoverflow.com/a/27384500
has comment: http://stackoverflow.com/comment/43217193
has comment: http://stackoverflow.com/comment/43216639
tagged with: entity-framework

http://stackoverflow.com/comment/43377950
type: AnswerComment
comment on: http://stackoverflow.com/a/27461675
type: Comment
has text: after all js line in last write this line $("tbody").last().after(" your Button ")
score: 0

http://stackoverflow.com/a/27385433
type: AcceptedAnswer
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/27323723
has body: As arinh said, the issue is that Bootstrap was being loaded twice. The main culprit was my application.js: //= require bootstrap //= require bootstrap-sprockets Once I removed the top line, i.e. just converted my application.js to this: //= require bootstrap-sprockets It worked perfectly.
answers question: http://stackoverflow.com/q/27323723

http://stackoverflow.com/q/27322432
has answer: http://stackoverflow.com/a/55124969
tagged with: sprockets
answer count: 3
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/40701389
score: 2
tagged with: leaflet
has body: Using RoR 4.1.4 I am trying to use the leaflet-rails gem. I followed the steps outlined in the github page, but when I try to load the map, I see ReferenceError: L is not defined in the browser console. This obviously means that the helper from the gem is being loaded and executed but it can't find the leaflet.js file. However, the head section of the page shows that /assets/leaflet.js is being referenced and it actually IS there. When I look at the generated code: So the gem adds a script right below the map div, and only then, due to the sprockets mechanism and all that, the other scripts are loaded. To me this looks like then obviously the script can't possibly load the leaflet.js as it's being referenced afterwards! So...am I misunderstanding something re how RoR handles gems and javascripts? It must have been working at some point... Here's my /app/assets/javascript/application.js: //= require jquery //= require jquery.ui.widget // Here I load a whole bunch of javascripts which are related to jquery-fileupload, cut for brevity //= require bootstrap.min //= require bootbox.min //= require bootstrap-datepicker //= require exif //= require leaflet //= require turbolinks //= require_tree .
tagged with: rubygems
type: Question
downvote count: 0
tagged with: javascript
has title: ruby on rails: leaflet-rails not loading
has answer: http://stackoverflow.com/a/27381113

http://stackoverflow.com/q/27346549
has answer: http://stackoverflow.com/a/27346658
type: Question
has answer: http://stackoverflow.com/a/27346592
tagged with: javascript
answer count: 3
has title: To get JSON data from Javascript file
has body: I have a subject.js javascript file in which json data is stored: Subject.js Example: Teacher = { "Eng" : "English", "Math" : "Maths", "Sci" : "Science", "SST" : "Social Studies", "Hin" : "Hindi" }; I want to read json data from this js file into another js file. But I learnt that $.getJSON('filename.json', function(data) { is used to get data from json file but my json data is stored in js file. Can anyone tell me how to get started? I tried using getJson but can't get it to work.
downvote count: 0
favorite count: 0
type: UnansweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
has answer: http://stackoverflow.com/a/27351526

http://stackoverflow.com/a/27332013
has body: With JQuery you may do something like: $("form2").on("submit", function(){ ... });
answers question: http://stackoverflow.com/q/27331993
type: Answer
score: 0

http://stackoverflow.com/comment/43158279
score: 0
type: Comment
has text: I think you have not understand my question properly. I want to count keystroke and mouse move in any where on the system not only on browser or on my page. Anywhere even the browser is minimize.
comment on: http://stackoverflow.com/a/27352179
type: AnswerComment

http://stackoverflow.com/comment/43339454
type: Comment
comment on: http://stackoverflow.com/a/27450400
type: AnswerComment
has text: I forgot the array, but that should not be a Problem for you :-)
score: 0

http://stackoverflow.com/q/27465574
has comment: http://stackoverflow.com/comment/43375991
has title: Delete object from object?
type: Question
has comment: http://stackoverflow.com/comment/43367208
has comment: http://stackoverflow.com/comment/43368997
tagged with: object
tagged with: javascript
has answer: http://stackoverflow.com/a/27465640
answer count: 2
has comment: http://stackoverflow.com/comment/43367271
has comment: http://stackoverflow.com/comment/43381222
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43367458
has comment: http://stackoverflow.com/comment/43369040
has comment: http://stackoverflow.com/comment/43367211
has body: Given something like this: function test(){ var o = { // ... del: function(){} } return o; } Is it possible to have .del() remove/set to null the reference to the variable o such that it becomes eligible for garbage collection? In other words, is this possible (and if so how): var test1 = test(); // test1 = {...} test1.del(); // test1 == null or test1 == undefined; I did try setting o = null but the outside reference (test1 would still refer to the object). I also understand that setting test1 = null would solve the issue, but where's the fun in that?
has comment: http://stackoverflow.com/comment/43367423
has comment: http://stackoverflow.com/comment/43367331
has answer: http://stackoverflow.com/a/27465747
has comment: http://stackoverflow.com/comment/43367192
has comment: http://stackoverflow.com/comment/43388259
has comment: http://stackoverflow.com/comment/43369018
score: 0

http://stackoverflow.com/comment/43369627
has text: CSS part of Boxes: .boxes{ background-color: lightgreen; height: 140px; width: 160px; border: 1px solid green; margin: 30px; display: inline-block; } .boxes:hover{ transform:scale(1.74,1.84); }
comment on: http://stackoverflow.com/q/27466857
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43153320
has text: Yeah, that makes sense. But when I redirect, shouldn't that trigger a `disconnect` for socket.io if the connection is not preserved? It isn't currently, and this is causing my array of connected sessions to just keep growing on each redirect.
comment on: http://stackoverflow.com/q/27349252
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43332690
score: 0
comment on: http://stackoverflow.com/q/27446752
type: QuestionComment
type: Comment
has text: Do you see any other errors when you run your app with a Developer Tools console open? (You might be prevented from accessing frame document for security reasons.)

http://stackoverflow.com/comment/43197918
type: Comment
has text: It should be the same preflight.
comment on: http://stackoverflow.com/a/27330578
score: 0
type: AnswerComment

http://stackoverflow.com/a/27406906
has body: Doesn't look like concat task handles absolute paths or files from remote locations. However I was able to get it to work using curl task combined with the concat task. EXAMPLE: module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), curl: { 'download/jquery.js': 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', }, concat: { js: { src: ['download/jquery.js'], dest: 'output/test.js' }, } }); grunt.loadNpmTasks('grunt-curl'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.registerTask('default', ['curl', 'concat']); }; DEMO DIRECTORY STRUCTURE: I used this Node Module Package for CURL. https://github.com/twolfson/grunt-curl, there may be better ones out there. But this one seemed to work fine.
answers question: http://stackoverflow.com/q/27364948
score: 1
upvote count: 1
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43263245
type: Answer
has comment: http://stackoverflow.com/comment/43265281
accepted answer of: http://stackoverflow.com/q/27364948

http://stackoverflow.com/q/27384851
score: 0
answer count: 3
has title: Dropdown menu java script
tagged with: drop-down-menu
has answer: http://stackoverflow.com/a/27385148
has answer: http://stackoverflow.com/a/27385202
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27385663
has comment: http://stackoverflow.com/comment/43218581
has comment: http://stackoverflow.com/comment/43219191
has comment: http://stackoverflow.com/comment/43218356
type: UnansweredQuestion
type: Question
has body: I want to hide my drop down menu, to the right so it comes out when the settings logo is clicked on but for some reason it is not working. If anyone can take a look at my code and see what the problem is it would be a great help. function Startgame() { var x = Math.floor(Math.random() * 13) + 1; document.getElementById('computer').src = 'card' + x + '.gif'; document.getElementById('startButton').disabled = "false"; } function reset() { total = 0 document.getElementById('computer').src = 'dieDefault.gif'; document.getElementById('img2').src = 'dieDefault.gif'; document.getElementById('score').innerHTML = "0" + total; } function puppies() { document.getElementById('higher').disabled = "false"; document.getElementById('equal').disabled = "false"; document.getElementById('lower').disabled = "false"; } /////DROPDOWN MENU///////////// var menuIsOpen = "false"; window.onload = initialise; function initialise() { document.getElementById('togglemenu').onclick = navigate; } function navigate() { var panel = document.getElementById("menu"); if (menuIsOpen) { panel.style.right = "-40em"; menuIsOpen = "false"; document.getElementById('togglemenu').innerHTML = "Open"; } else { panel.style.top = "0em"; menuIsOpen = "true"; document.getElementById('togglemenu').innerHTML = "Close"; } } Colour Black BG Gray BG Card Game Computer Player Start Game Higher Equal Lower Draw your card Reset Score
tagged with: javascript

http://stackoverflow.com/q/27400818
type: Question
answer count: 2
tagged with: ios
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27416017
has body: when i try to run meteor todos example app in ios, by command sudo meteor run ios --verbose (The reason i use sudo because without sudo, it displays eaccess error, permission denied error) Then after using above command with sudo i get following error: ** BUILD SUCCEEDED ** 2014-12-10 17:55:17.475 ios-sim[4120:60148] stderrPath: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/console.log 2014-12-10 17:55:17.476 ios-sim[4120:60148] stdoutPath: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/console.log Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7ffcbb4103c0 {NSLocalizedDescription=Simulator session timed out.} Command finished with error code 1: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/run --emulator Error: /Users/black_monk/meteor_examples/todos/.meteor/local/cordova-build/platforms/ios/cordova/run: Command failed with exit code 1 at ChildProcess.whenDone (/Users/black_monk/.meteor/packages/meteor-tool/.1.0.36.690ab6++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:755:16) at Process.ChildProcess._handle.onexit (child_process.js:822:5) Could not start the app in the iOS simulator. Try running again with the --verbose option. It only display this message i am not sure what is the problem. I'm trying to get meteor run on mobile but one way or another it only fails, and im not sure why. I tried same on android, same EACCESS error. All the SDKs are installed. No guide to learn from to clue whatsoever. Please help.
tagged with: meteor
has answer: http://stackoverflow.com/a/27417650
type: UnansweredQuestion
tagged with: node.js
has title: Meteor run ios --verbose

http://stackoverflow.com/a/27468315
answers question: http://stackoverflow.com/q/27466716
has comment: http://stackoverflow.com/comment/43371907
upvote count: 1
downvote count: 0
type: Answer
has body: The main issue is that PhantomJS 1.x has no support for Function.prototype.bind. The workaround can be found here: CasperJS bind issue. Because of this none of the JavaScript runs, since there is a page error and you see nothing, because it is a JS driven page. You can verify this by registering to the page.error event: casper.on("page.error", function(pageErr){ this.echo("page.err: " + JSON.stringify(pageErr)); }); This yields this page.err: "TypeError: 'undefined' is not a function (evaluating 'b.bind(a)')" page.err: "TypeError: 'undefined' is not a function (evaluating 'c.bind(null,\"margin\")')" page.err: "TypeError: 'undefined' is not a function (evaluating 'RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\\d_.\\-]*$/)')" Which otherwise doesn't pop up with debug output or verbose enabled. The other issue is that you forgot to use the XPath utility for XPaths: var x = require('casper').selectXPath; somewhere at the top and later: casper.waitForSelector(x('//*[@id="WRchTxt0-3cb"]/h2[3]/span'), function() { var res = this.getHTML(); this.echo(res); }); Without the XPath utility, it tries to interpret this as a CSS selector. Since you have verbose: true, you have to have seen [error] [remote] findAll(): invalid selector provided "//*[@id="WRchTxt0-3cb"]/h2[3]/span":Error: SYNTAX_ERR: DOM Exception 12
score: 1

http://stackoverflow.com/comment/43102794
score: 0
comment on: http://stackoverflow.com/q/27321328
has text: Oops! Thanks silentw.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27326035
has title: Using Javascript and Automator and the Mail App in Yosemite - How to make a new email?
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/73876950
has comment: http://stackoverflow.com/comment/44143658
answer count: 1
tagged with: email
tagged with: osx-yosemite
favorite count: 0
type: UnansweredQuestion
has body: I am stumped with the Mac Automator for the Mail App. I am trying to automate sending emails to people, letting them know that mail has arrived at our office. Since Mountain Lion (I have Yosemite) you can't drag and drop variables into the recipient or body input fields. So, I can't say "Hi [NAME], you have a package." I just have to settle for saying "Hi, you have a package" because as far as I know, I can't use a variable in the body. Well, that's not good enough for me, so I went searching and found out that in Yosemite, we can use Javascript instead of Applescript. I thought this was the solution, and found this great tutorial. But I am struggling still with the basics, like how to create a simple email Message. The way that the Script Editor organizes actions, methods, and calls in the Library is a bit confusing. And there are no examples. For example, I know how to control the Mail app: mail = Application('Mail); Easy enough, but how do I make a message? message = mail.Message(); //doesn't work message = new mail.Message(); //doesn't work message = Message(); //doesn't work And there is confusion because the 'Message' object in the Library is underneath the framework option... how do I access this? This image is the practice code I'm trying, the Library, and the methods and objects available with the Mail app. Can someone explain to me why it says 'Mail' and not 'Mail Suite' and why Messages are under 'Mail Framework' and how do I create a message? This would be a lifesaver! Thanks so much!
tagged with: automator
has comment: http://stackoverflow.com/comment/46485299
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/27388652
accepted answer of: http://stackoverflow.com/q/27388445
upvote count: 9
type: Answer
has body: You aren't getting function closure for the mouseout handler, but you are for the mouseover handler. To fix the issue, change: function setMarkers(map, locations) { for (var i=0; i &lt; locations.length; i++){ var item = locations[i]; var myLatLng = new google.maps.LatLng(item[1], item[2]); var address1 = item[5]; var marker = new google.maps.Marker({ position: myLatLng, map: map, }); var content = address; var infowindow = new google.maps.InfoWindow() google.maps.event.addListener(marker,'mouseover', (function(marker,content,infowindow){ return function() { infowindow.setContent(content); infowindow.open(map,marker); }; })(marker,content,infowindow)); google.maps.event.addListener(marker, 'mouseout', function(){ infowindow.close(); }); } } google.maps.event.addDomListener(window, 'load', initialize); To: function setMarkers(map, locations) { for (var i=0; i &lt; locations.length; i++){ var item = locations[i]; var myLatLng = new google.maps.LatLng(item[1], item[2]); var address = item[5]; var marker = new google.maps.Marker({ position: myLatLng, map: map, }); var content = address; var infowindow = new google.maps.InfoWindow() google.maps.event.addListener(marker,'mouseover', (function(marker,content,infowindow){ return function() { infowindow.setContent(content); infowindow.open(map,marker); }; })(marker,content,infowindow)); google.maps.event.addListener(marker, 'mouseout', (function(marker,content,infowindow){ return function() { infowindow.close(); }; })(marker,content,infowindow)); } } google.maps.event.addDomListener(window, 'load', initialize); working fiddle Working code snippet: function initialize() { var map = new google.maps.Map( document.getElementById("map_canvas"), { center: new google.maps.LatLng(37.4419, -122.1419), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }); setMarkers(map, locations); } google.maps.event.addDomListener(window, "load", initialize); var locations = [ ['Bondi Beach', -33.890542, 151.274856, , , 'Bondi Beach', 4], ['Coogee…
downvote count: 0
has comment: http://stackoverflow.com/comment/43226658
has comment: http://stackoverflow.com/comment/43225424
score: 9
answers question: http://stackoverflow.com/q/27388445
type: AcceptedAnswer

http://stackoverflow.com/a/27337043
has body: You said the article divs are loaded through AJAX, seems that this script is running before they are loaded. Try putting this script after #news so all the content is already loaded when it is executed.
score: 0
has comment: http://stackoverflow.com/comment/43134259
type: Answer
answers question: http://stackoverflow.com/q/27336935

http://stackoverflow.com/comment/43362830
type: Comment
score: 0
type: AnswerComment
has text: It was you; it had been 20 minutes before someone responded and you were the first person to respond and I had had no down votes before you posted.
comment on: http://stackoverflow.com/a/27463308

http://stackoverflow.com/comment/43291256
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27421376
type: AnswerComment
has text: Yes, that's correct. If you call a `res.render()` before your `res.end()` or `res.send()` or whatever, you'll get an error, because the response was already sent.

http://stackoverflow.com/q/27471952
tagged with: android-actionbar
has answer: http://stackoverflow.com/a/27472400
has answer: http://stackoverflow.com/a/27472067
has answer: http://stackoverflow.com/a/30566455
linked to: http://stackoverflow.com/q/27612424
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/49203738
type: Question
has answer: http://stackoverflow.com/a/27473773
tagged with: javascript
has answer: http://stackoverflow.com/a/29269503
has title: How to show app icon in the action bar?
downvote count: 0
has body: n the action bar only appears the title and the app icon is hide. What can I do to show the app icon? I try many things for example the logo and a lot of others codes but anything work. MyActivity: package com.example.myapp; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.view.MenuItem; public class MyActivity extends ActionBarActivity { private InterstitialAd interstitial; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } My Manifest: <?xml version="1.0" encoding="utf-8"?> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> My layout activity: <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hello world" /> And in my main.xml I haven't any item
favorite count: 0
linked to: http://stackoverflow.com/q/26720759
answer count: 5
type: UnansweredQuestion
tagged with: android

http://stackoverflow.com/comment/43251129
has text: Ah! I see! All of the posts and explanation videos I have seen stated that `socketIO.sockets.on` applied a handler to all sockets, this seems true, but also false at the same time, any comments?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27401803
score: 0

http://stackoverflow.com/comment/43161167
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/66383/discussion-between-re350-and-sanjay).
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27322141
type: Comment

richtext
tags question: http://stackoverflow.com/q/27419413
tag name: richtext
type: Tag

http://stackoverflow.com/q/27341305
tagged with: ajax
type: UnansweredQuestion
tagged with: php
has title: Is there a better way to include jquery event handlers with xmlhttprequest()
has body: I've written the real-time form validation necessary for my Site. It's included in my javascript/jquery.js file and does things like: //Let user know if they've left an invalid email in the field $signupEmail.on("blur", function() { var form = new SignupForm($signupEmail.val()); if ( !form.isEmailEmpty() && !form.isEmailValid() ) { form.showEmailError("Invalid email"); } else { form.isEmailRegistered(); if (!form.emailError && form.isEmailValid()) { form.hideEmailError(); form.showValidEmail(); } } }); and: //Let user know when they've entered a valid email $signupEmail.on("keyup", function() { var form = new SignupForm($signupEmail.val()); var userEmail = form.userEmail(); $.post("/sitename/scripts/checkEmailAvailability.php", {"userEmail": userEmail}, function (data) { if (form.isEmailValid() && !data) { form.showValidEmail(); } else { form.hideEmailError(); } }); }); This and the rest of the code works flawlessly with my signup and contact forms. I also have a directory called users/ with a sub-directory called account-settings/. Each page in the sub-directory contains a different form users can submit to update their account. For instance, there is an update-email.php, update-password.php, etc. These pages are loaded onto an account-settings.php page through an xmlhttprequest(). The problem I'm having is figuring out an efficient way of including the jquery real-time validation, which doesn't seem to work unless included in the xmlhttp.onreadystatechange function. As it is now, I have to include the jquery validation twice; One for the signup/contact forms and another for the account-settings forms. Please review the following code: Site/users/account-settings/account-settings.php //php includes //session configurations Update Email Update Password Update Photo Manage Friends //php include footer Site/javascript/jquery.js //Show User Profile's Settings Forms $("#user-settings li").on('click', function() { var data = $(this).find('a').attr('href'); var xmlhttp = …
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27341359
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/43377538
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27471247
has text: I've looked your code over and updated my answer (I changed the "what I think you wanted to do" part).
score: 0

http://stackoverflow.com/q/27395031
tagged with: jquery
answer count: 2
downvote count: 3
has title: Jquery syntax error while changing image src
favorite count: 0
has comment: http://stackoverflow.com/comment/43236835
has answer: http://stackoverflow.com/a/27395106
has body: Below is my code to change the img src when one condition is satisfied &lt;script type="text/javascript"&gt; var e = document.getElementById("shopperlanguage"); var strUser = e.options[e.selectedIndex].value; if(strUser=="ja_JP"){ var japaneseImgSrcs=['slider1.jpg','slider2.jpg','slider3.jpg','slider4.jpg']; jQuery(".jcarousel img").each(function(index,ele){ jQuery(this).attr("src",japaneseImgSrcs[index]); }); } &lt;/script&gt; This code is not working and i'm getting syntax error in console on line 2. I am not getting what is wrong with it? Fixed the code as Beri suggested but still getting syntax error at line number 2 in mozila firefox console.
score: -3
accepted answer: http://stackoverflow.com/a/27395057
has comment: http://stackoverflow.com/comment/43238098
possible better answer: http://stackoverflow.com/a/27395106
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/43237705
has answer: http://stackoverflow.com/a/27395057
type: Question
has comment: http://stackoverflow.com/comment/43238137
tagged with: javascript

http://stackoverflow.com/comment/43192641
has text: If your question 'how do i add options to a drop down via JavaScript'?
score: 0
comment on: http://stackoverflow.com/q/27370542
type: QuestionComment
type: Comment

http://stackoverflow.com/a/27346777
has body: The easiest way is to use Buffer's helper functions. Buffer.byteLength(str)
accepted answer of: http://stackoverflow.com/q/27346387
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27346387
score: 2
upvote count: 3
downvote count: 1

http://stackoverflow.com/q/27413260
accepted answer: http://stackoverflow.com/a/27414367
type: Question
type: AnsweredQuestion
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/27414367
possible better answer: http://stackoverflow.com/a/27416517
tagged with: jquery-select2
has body: I would like a dropdown of text and then when one is selected I would like to load the full value as the tag and have it behave as normal. I'm capturing the values selected then clearing the list and appending them as text into the .select2-choices div. It appears to work as it should but I've lost the ability to clear the manually appended tags. Markup: John Smith Script: $('#select2').select2({ }).on('change', function (e) { values = $(this).val(); console.log(values); $('#select2-container .select2-choices').empty(); for (var i = 0; i < values.length; i++) { console.log(values[i]); $('#select2-container .select2-choices').append(' ' + values[i] + ' '); } }); I'm going to look into the formatSelection function but any help is greatly appreciated.
has answer: http://stackoverflow.com/a/27416517
has title: Select2 Custom Tags, Transform Value on Select

http://stackoverflow.com/comment/43169427
type: Comment
comment on: http://stackoverflow.com/a/27358544
has text: he is working in javascript , so there is nothing called hashmap
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43256794
type: Comment
type: QuestionComment
has text: @Pointy I have added the top of the results of "View Page Source" to the end of my post. I believe that answers your question.
comment on: http://stackoverflow.com/q/27405864
score: 0

http://stackoverflow.com/a/27414956
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43275281
accepted answer of: http://stackoverflow.com/q/27414630
answers question: http://stackoverflow.com/q/27414630
has body: To add the numbers to the textarea you can use this code: var button = document.querySelectorAll('input[type=button]'); for(var x=0; x<button.length; x++) { button[x].addEventListener('click', function(e) { var a = document.getElementById('txt').value; document.getElementById('txt').value = a + this.value; }); } If you want a list of all elements that match a selector, you can use document.querySelectorAll() and loop through the object list. You will need to alter your html and delete all the wrong onclicks, you too should use the value attribute only for the actual value and not for code styling, as the output will include your spaces, too. Online Calculator I didn't implement the calculating functions, but I hope this is enough for you to start with.
type: Answer
has comment: http://stackoverflow.com/comment/43280879
has comment: http://stackoverflow.com/comment/43280843
has comment: http://stackoverflow.com/comment/43278781
score: 0

http://stackoverflow.com/a/27418211
score: 0
accepted answer of: http://stackoverflow.com/q/27418059
answers question: http://stackoverflow.com/q/27418059
type: AcceptedAnswer
has body: I would do it like that. It is plain Javascript, but should do the Job, if i get it right: function input(object){ if (object.id=="text"){ if (object.value!=""){ document.getElementById("select").style.visibility="hidden"; document.getElementById("select").removeAttribute("required"); document.getElementById("select").setAttribute("disabled",""); document.getElementById("lable").style.visibility="hidden"; }else{ document.getElementById("select").style.visibility="visible"; document.getElementById("lable").style.visibility="visible"; document.getElementById("select").setAttribute("required",""); document.getElementById("select").removeAttribute("disabled"); } }else{ if (object.value!=""){ document.getElementById("text").style.visibility="hidden"; document.getElementById("lable").style.visibility="hidden"; document.getElementById("text").removeAttribute("required"); document.getElementById("text").setAttribute("disabled",""); }else{ document.getElementById("text").style.visibility="visible"; document.getElementById("text").setAttribute("required",""); document.getElementById("lable").style.visibility="visible"; document.getElementById("text").removeAttribute("disabled"); } } } Or, Select the Buyer From Drop Down Test1 Test2 Test3
type: Answer

http://stackoverflow.com/comment/43174820
type: AnswerComment
type: Comment
has text: Love the Einstein references. I use ALOT of globals, but I do agree - stay well away from them if you can avoid it.
comment on: http://stackoverflow.com/a/27361327
score: 0

http://stackoverflow.com/comment/43253408
score: 0
type: QuestionComment
type: Comment
has text: Look, maybe, it will help: [loader molecule from .xyz](http://alexan0308.github.io/threejs/examples/#loader_molecule_xyz)
comment on: http://stackoverflow.com/q/27389801

http://stackoverflow.com/comment/43251659
type: Comment
comment on: http://stackoverflow.com/a/27403487
has text: How can I set the values to only the selected fields?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43153789
comment on: http://stackoverflow.com/a/27345718
score: 0
type: AnswerComment
type: Comment
has text: Sorry, I forgot that your alphaResult is not a string, but an array. You should pass string where you want to count frequencies to my freqLet function from your alphaOnly function.

datejs
tags question: http://stackoverflow.com/q/27400179
tag name: datejs
type: Tag

http://stackoverflow.com/a/27413969
score: 0
type: Answer
has body: You should place your script directly above the closing tag or/and in a document.onload = function() {}. The element doesn't exist by the time you call the function.
answers question: http://stackoverflow.com/q/27413950

http://stackoverflow.com/q/27409040
has comment: http://stackoverflow.com/comment/43263380
answer count: 1
has comment: http://stackoverflow.com/comment/43262487
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27410790
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43264258
tagged with: settimeout
has body: I have a IIFE that self-fires on load and recursively calls itself every 30 seconds to get any alerts the system may have written out. This works fine. (function GetAlerts() { setTimeout(function() { $.ajax({ url: "?DO=getalertcount", success: function(data) { //do DOM stuff with data }, complete: GetAlerts }); }, 30000); })(); There are things I will do, such as stop a widget, that write to the alert queue. As such, that should immediately trigger an alert to display, not wait up to 30 seconds for it to fire. (sockets and long polling are not an option due to server constraints) So, I want to call this GetAlerts() on demand in some fashion from the handler of the action (such as stopping the widget click event) What is the proper way to on-demand call this so that the 30 second loop is retained (or re-started after the on-demand interject) I don't end up with multiple setTimeout loops running I don't duplicate a ton of code (as there is a lot of DOM stuff that happens in the guts of the success The things I tried such as calling the function by name, attempting to set the timeout to a global var and stopping the timeout all failed one of the above points or simply did not invoke at all.
type: Question
has answer: http://stackoverflow.com/a/27410790
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: jQuery IIFE, interject on demand?

http://stackoverflow.com/a/27444542
has comment: http://stackoverflow.com/comment/43328372
upvote count: 42
downvote count: 0
has body: To save a string in Local Storage you use window.localStorage.setItem(key, value); You can get the value later with: window.localStorage.getItem(key);
has comment: http://stackoverflow.com/comment/43355363
type: Answer
score: 42
has comment: http://stackoverflow.com/comment/43355648
has comment: http://stackoverflow.com/comment/96025975
has comment: http://stackoverflow.com/comment/43329256
answers question: http://stackoverflow.com/q/27444403

http://stackoverflow.com/comment/43376165
comment on: http://stackoverflow.com/q/27466436
has text: @Harry 1. your title is misleading 2. your current question suggest tool/lib finding which is off topic here 3. if you want the physics look here http://stackoverflow.com/a/26174961/2521214 if gfx then specify closely (not JAVA programer byt isnt Canvas equivalent to Wndows GDI? so there should be spline,arc,ellipticarc...) what did you try?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43287058
type: QuestionComment
comment on: http://stackoverflow.com/q/27422381
has text: http://momentjs.com/docs/#/query/
score: 0
type: Comment

http://stackoverflow.com/a/27446002
accepted answer of: http://stackoverflow.com/q/27445954
type: Answer
has body: Your current code will repeat the span tag for each card that you have inside cards. I don't think that's what you intended to do. You probably want to repeat the li, right? Try this instead: Group 1 {{ card.title }}
has comment: http://stackoverflow.com/comment/43331824
upvote count: 3
answers question: http://stackoverflow.com/q/27445954
score: 3
has comment: http://stackoverflow.com/comment/43331720
has comment: http://stackoverflow.com/comment/43331038
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43204352
has text: Did you check the console for errors?
type: Comment
comment on: http://stackoverflow.com/q/27377429
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43156246
comment on: http://stackoverflow.com/a/27350397
type: Comment
has text: Here you go, I made an account real quick just to test. http://api.data24-7.com/v/2.0?user=othertxt&pass=othertxt&api=C&p1=" + "1" + phonenum
type: AnswerComment
score: 0

http://stackoverflow.com/q/27370706
score: 0
tagged with: mongodb
answer count: 3
has answer: http://stackoverflow.com/a/27371482
tagged with: meteor
possible better answer: http://stackoverflow.com/a/27371482
has body: I'm currently having an issue with a collection insert in Meteor. I call a method to insert a new item into a collection. The server database shows the new item but the client side has no record of the collection. I've found if I refresh the page, my template referencing the collection populates and works. Here is the method inserting the item located at 'lib/collections/items.js' Items = new Mongo.Collection("items"); Meteor.methods({ addItem: function (text) { if (! Meteor.userId()){ throw new Meteor.Error("not-authorized"); } console.log(text); console.log(Meteor.userId()); console.log(Meteor.user().username); console.log(Meteor.user().household); Items.insert({ text: text, createdAt: new Date(), //current time owner: Meteor.userId(), username: Meteor.user().username, household: Meteor.user().household }); }, Here is the server publishing of the items located at '/server/main.js' Meteor.publish("items", function(){ if(typeof Meteor.users.findOne({'_id': this.userId}) === 'undefined') return null; return Items.find( {household : Meteor.users.findOne({'_id': this.userId}).household}); }); Here is the code calling the method located at 'client/main.js' Template.body.events({ "submit .new-task": function (event) { // This function is called when the new task form is submitted var text = event.target.text.value; text = text.trim(); if(text)//Check for non-null, non-empty { text = capitalizeEachWord(text); console.log(text); Meteor.call("addItem",text); } //Clear form event.target.text.value = ""; //Prevent default form submit return false; }, Here is where the collection is queried from to display in a template at 'client/templates/itemList.js' Template.itemList.helpers({ items: function() { console.log('Trying to subscribe'); return Items.find({}, {sort : {checked: 1, createdAt: -1}}); } I'm just starting to learn Meteor. I appreciate any help! Edit Thanks for the responses, I've tried these suggestions and still getting the same result. I've tried a different way of…
accepted answer: http://stackoverflow.com/a/27511931
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27377904
has title: Meteor collection insert not updating on client
type: Question
has comment: http://stackoverflow.com/comment/43197626
has answer: http://stackoverflow.com/a/27511931
tagged with: javascript

menu-items
tag name: menu-items
tags question: http://stackoverflow.com/q/27469701
type: Tag

http://stackoverflow.com/comment/64581656
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/38596506
has text: Is production.min.js loaded like ` ` ? If so, you could load jQuery first, then use `$.script()` to load production.min.js and the other two resources in parallel.
score: 0

http://stackoverflow.com/q/27401488
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: bootstrap-modal
score: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I want to use bootstrap modal in all places where alert() and confirm() is used in my application. I found that bootbox is a good solution for this purpose. However it does not function the same way as native js functions. For example, it does not stop js code execution. I have to put all code in callback function if I need to wait for user click after opening modal. Is there any way to create a javascript plugin like bootbox which can freely replace all places where confirm() is used without putting all functions that depend on result of user confirmation in callback.
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43261812
has answer: http://stackoverflow.com/a/27402697
upvote count: 1
type: Question
has title: Use bootstrap modal the same way as javascript alert() and confirm()

http://stackoverflow.com/comment/54729072
has text: Thank you for your tips bro. Much appreciated.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27318997

timer
tag name: timer
tags question: http://stackoverflow.com/q/27356145
type: Tag
tags question: http://stackoverflow.com/q/27460483
tags question: http://stackoverflow.com/q/27393960
tags question: http://stackoverflow.com/q/27350551
tags question: http://stackoverflow.com/q/27380687
tags question: http://stackoverflow.com/q/27397165
tags question: http://stackoverflow.com/q/27417699
tags question: http://stackoverflow.com/q/27469138
tags question: http://stackoverflow.com/q/27374248
tags question: http://stackoverflow.com/q/27350114
tags question: http://stackoverflow.com/q/27391817
tags question: http://stackoverflow.com/q/27393095
tags question: http://stackoverflow.com/q/27360457

http://stackoverflow.com/comment/43257962
type: QuestionComment
has text: Since you are using bootstrap have you considered using AngularUI? It has it's own modal directive that makes working with them fairly easy and straightforward without reinventing the wheel.
comment on: http://stackoverflow.com/q/27406486
score: 0
type: Comment

http://stackoverflow.com/a/34121933
has comment: http://stackoverflow.com/comment/89495510
upvote count: 10
has comment: http://stackoverflow.com/comment/93940920
score: 10
answers question: http://stackoverflow.com/q/27341511
downvote count: 0
has body: I don't like the patch from http://keith-wood.name/rtlsliders.html simply because it patches an old version of jQuery UI, and unfortunately they did not incorporate it into the main code yet (why?!). Another option would be to reverse the min and max, but the widget doesn't allow min &gt; max, so I tricked it. I did { min: max * -1, max: min * -1 }, and then used value * -1. Example time: say you want a slider that lets the user choose a number between 1 and 10. { min: 1, max: 10 } Generates: &lt;[1][2][3][4][5][6][7][8][9][10]&gt; { min: -10, max: -1 } Generates: &lt;[-10][-9][-8][-7][-6][-5][-4][-3][-2][-1]&gt; Now it looks from right to left! Now you simply need to multiply whatever result you get from the slider by -1, so when he moves the slider the where 7 in RTL would be and you'd get a -7, simply multiply by -1 it before using. This also works for ranges. You can obviously use other mathematical systems but I found this to be the simplest to comprehend.
type: Answer
has comment: http://stackoverflow.com/comment/93949417

http://stackoverflow.com/a/27418259
upvote count: 1
has comment: http://stackoverflow.com/comment/43430263
has body: try to use Intervals like this: var myInt=null $(document).keydown(function(e){ var key = e.which; if(key == "39"){ //38 is the code for up key //event.preventDefault(); console.log("Down key is pressed"); myInt = setInterval(function(){ myAnimation() }, 40); //40 milliseconds because of 25 images per sec } }).bind('keyup', function(e){ if(e.which == "39") { console.log("Down key pressed is released "); clearInterval(myInt); } function myAnimation(){ //your animation that last 40 milliseconds } you can set some kind of boolean in the keyeup event and check for it at every event with if (if(keyreleased==false){//do normal stuff}else{//skip}) after your animation is done set the booleon back to default var keyreleased=false; .bind('keyup', function(e){ keyreleased=true; } someEvent(){ if(keyreleased!=true){ //do stuff } //animation done keyreleased=false; } i have no idea ^^
type: Answer
has comment: http://stackoverflow.com/comment/43552399
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27418145

http://stackoverflow.com/q/27450108
has comment: http://stackoverflow.com/comment/43340634
has comment: http://stackoverflow.com/comment/43338913
type: Question
has comment: http://stackoverflow.com/comment/43338905
has answer: http://stackoverflow.com/a/27450786
accepted answer: http://stackoverflow.com/a/27450786
has comment: http://stackoverflow.com/comment/43338847
has title: Rock,Paper,Scissors Game on Codecademy
tagged with: javascript
score: 0
answer count: 1
has body: I tried to incorporate the additional suggestions given on the website(Codecademy), viz. the feature in which there's a tie and the provision for taking input again. This is the error-containing piece of code: var userChoice, computerChoice; var choicesDetermination = function(){ userChoice = prompt("Do you choose rock, paper or scissors?"); if(userChoice !== "rock" &amp;&amp; userChoice !== "paper" &amp;&amp; userChoice !== "scissors"){ userChoice = prompt("Invalid input. Please try again.\n Do you choose rock, paper or scissors?"); } computerChoice = Math.random(); if (computerChoice &lt; 0.34) { computerChoice = "rock"; } else if(computerChoice &lt;= 0.67) { computerChoice = "paper"; } else { computerChoice = "scissors"; } console.log("User: " + userChoice); console.log("Computer: " + computerChoice); } var compare = function(choice1, choice2){ if(choice1 === choice2){ console.log("The result is a tie! Let's try one more time."); choicesDetermination(); compare(userChoice, computerChoice); } else if(choice1 === "rock"){ if(choice2 === "scissors"){ return "rock wins"; } else{ return "paper wins"; } } else if(choice1 === "paper"){ if(choice2 === "rock"){ return "paper wins"; } else{ return "scissors wins"; } } else{ if(choice1 === "scissors"){ if(choice2 === "paper"){ return "scissors wins"; } else{ return "rocks wins"; } } } } choicesDetermination(); compare(userChoice, computerChoice); Here, choicesDetermination() is the function in which I've taken the input and stored them in userChoice, computerChoice(both global variables). I don't know why but the code seems to run fine when I ask for the input again; the variables are changed correctly. But the function compare() doesn't run correctly; the return statements don't get printed to screen.
type: AnsweredQuestion

http://stackoverflow.com/a/27419816
has comment: http://stackoverflow.com/comment/43282641
score: 1
answers question: http://stackoverflow.com/q/27419646
has comment: http://stackoverflow.com/comment/43282653
has comment: http://stackoverflow.com/comment/43282475
has body: Change your code as below and check: function myFunction(){ var uName = document.getElementById("uName").value; var pWord = document.getElementById("pWord").value; if(uName != "" &amp;&amp; pWord != ""){ /* Ensure both fields have value */ if(uName == "Admin" &amp;&amp; pWord == "Admin"){ alert("Welcome " + uName); /* Redirection code goes here */ }else{ /* If user is not Admin */ } }else{ /* Validation message goes here */ } }
upvote count: 1
has comment: http://stackoverflow.com/comment/43282672
downvote count: 0
has comment: http://stackoverflow.com/comment/43282506
type: Answer
has comment: http://stackoverflow.com/comment/43282587
has comment: http://stackoverflow.com/comment/43282516
has comment: http://stackoverflow.com/comment/43282539

http://stackoverflow.com/a/27362729
score: 0
answers question: http://stackoverflow.com/q/27362489
has body: The initial value for the input element is undefined instead of '' If you compare undefined == '' //false To make your function work as expected you could simplify it and rewrite it as function validateFilterCriteria() { var partFilter = document.getElementById("selectedPartFilter").value; //Here we check if the value is truthy instead of comparing it directly with an empty string if (partFilter) { document.getElementById("partFilter").value = partFilter; return true; } else { alert('Please enter part of the part number'); return false; } }
type: Answer

http://stackoverflow.com/q/27445613
has comment: http://stackoverflow.com/comment/43330826
has answer: http://stackoverflow.com/a/27446217
accepted answer: http://stackoverflow.com/a/27446217
type: Question
has comment: http://stackoverflow.com/comment/43330227
tagged with: javascript
has body: I want to make my buttons change colour after clicking on another button. At the moment, I have an idea in mind... but that would be creating more html pages which is not what I want. The code below features 3 buttons where button1 is set as dark grey, and button2 and button3 are light grey. Clicking button2 or button3 should change to dark grey, and button1 should be light grey. I have tried researching on the internet and haven't found any solution to this. Note: I have created my buttons using divs. Here's a snippet of my code: .select:hover { background-color: #2a2a2a; } .select:visited { background-color: pink; } .bcardunlaminated { display: table-cell; height: 37px; width: 210px; float: left; background-color: #2a2a2a; text-align: left; margin-top: 10px; line-height: 36px; } .bcardmatt { display: table-cell; height: 37px; width: 225px; float: left; background-color: #757575; text-align: left; margin-left: 3px; margin-top: 10px; line-height: 36px; } .bcardspotuv { display: table-cell; height: 37px; width: 230px; float: left; background-color: #757575; text-align: left; margin-left: 3px; margin-top: 10px; line-height: 17px; } .mat-font { color: white; font-size: 9pt; text-align: center; } 1 2 3 1 2 3 Any suggestions?
has comment: http://stackoverflow.com/comment/43330138
has comment: http://stackoverflow.com/comment/43330327
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43356606
has comment: http://stackoverflow.com/comment/43330357
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43333641
has comment: http://stackoverflow.com/comment/43349488
has comment: http://stackoverflow.com/comment/43330407
has title: How to change button colour after clicking another button
has comment: http://stackoverflow.com/comment/43377555
has answer: http://stackoverflow.com/a/27460798
tagged with: css
has answer: http://stackoverflow.com/a/27446142
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27446142
has comment: http://stackoverflow.com/comment/43330271

http://stackoverflow.com/q/27458649
has comment: http://stackoverflow.com/comment/48551209
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/47232995
has comment: http://stackoverflow.com/comment/43473919
has comment: http://stackoverflow.com/comment/47097652
answer count: 1
tagged with: gmaps4rails
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43409695
has comment: http://stackoverflow.com/comment/43365350
has title: Impossible to prevent auto panning to a marker when clicking on it (google maps)
has answer: http://stackoverflow.com/a/30223664
type: Question
tagged with: google-maps
has body: I use the google maps api v3, gmaps4rails and infobox and I cannot figure out how to remove the event which consist in auto panning the map on a marker as soon as it has been clicked... The markers are sent from my controller: Gmaps4rails.build_markers(experiences) do |experience, marker| marker.lat experience.latitude marker.lng experience.longitude marker.infowindow render_to_string(partial: "/trip_experiences/infowindow.html.erb", locals: { experience: experience, trip: trip }) marker.title experience.name end And my map is built in js and markers are created by calling addMarkers on the handler: handler = Gmaps.build('Google', { builders: { Marker: InfoBoxBuilder} }); handler.buildMap({ provider: mapOptions, internal: { id: 'map' } }, function(){ $.get(url, function(data) { handler.removeMarkers(markers); markers = handler.addMarkers(data); setCarouselOnInfowindow(); handler.bounds.extendWith(markers); callback(false) }); }); I have tried so far to diasbleAutoPan:true in the map options, to set the markers to unclickable and then add a listener on click, and done a lot of research but I did not found anything like this... So I guess I am doing something wrong but cannot find what!! Any help would be so grateful.... many tahnks Edit : As suggested by @apneadiving, I tried to override the infowindow_binding method within the custom builder in order to remove @markers.panTo line but the map still auto center on marker when clicking on it.... Here is the code for the custom builder : ` class @InfoBoxBuilder extends Gmaps.Google.Builders.Marker # inherit from base builder # override method create_infowindow: -&gt; return null unless _.isString @args.infowindow boxText = document.createElement("div") boxText.setAttribute("class", 'infobox-container') #to customize boxText.innerHTML = @args.infowindow @infowindow = new InfoBox(@infobox(boxText)) infobox: (boxText)-&gt; content: boxText ,disableAutoPan: true ,pixelOffset: new google.maps.Size(-140, -40) ,alignBottom: tr…

http://stackoverflow.com/q/27313861
downvote count: 0
score: 1
tagged with: cakephp
has comment: http://stackoverflow.com/comment/43460433
type: Question
possible better answer: http://stackoverflow.com/a/27316093
upvote count: 1
has answer: http://stackoverflow.com/a/27316093
tagged with: javascript
has title: function is not working if I put this into js folder
has comment: http://stackoverflow.com/comment/43087987
tagged with: jquery
has body: I have a add.ctp file, where I can add a multiple rows, and if I put addNumber function to app/webroot/js, then its not working, why? My view file (add.ctp) &lt;table id="mytable"&gt; &lt;tr id="number0" style="display:none;"&gt; &lt;td&gt;&lt;?php echo $this-&gt;Form-&gt;button('&amp;nbsp;-&amp;nbsp;',array('type'=&gt;'button','title'=&gt;'Click Here to remove this number')); ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $this-&gt;Form-&gt;input('lisanumbrid', array ('name'=&gt;'data[Kontaktid][lisanumbrid][0]')) ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id="trAdd"&gt;&lt;td&gt; &lt;?php echo $this-&gt;Form-&gt;button('+',array('type'=&gt;'button','title'=&gt;'Click Here to add another number','onclick'=&gt;'addNumber()')); ?&gt; &lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;?php echo $this-&gt;Form-&gt;end('Lisa'); ?&gt; Adding multiple rows function(addNumber.js) is here app/webroot/js: var lastRow=0; function addNumber() { $("#mytable tbody&gt;tr#number0").clone(true).attr('id','lisanumbrid'+lastRow).removeAttr('style').insertBefore("#mytable tbody&gt;tr#trAdd"); $("#lisanumbrid"+lastRow+" button").attr('onclick','removeNumber('+lastRow+')'); $("#lisanumbrid"+lastRow+" input:first").attr('numbrid','data[Lisanumbrid]['+lastRow+'][lisanumbrid]').attr({'id':'numbridlisaNumber'+lastRow,'name': 'data[Kontaktid][lisanumbrid]['+ lastRow +']'}); lastRow++; } function removeNumber(x) { $("#lisanumbrid"+x).remove(); } Jquery file is in the same folder like a function, and its echoed in C:\wamp\www\cakephp-2.5.6\app\View\Layouts\default.ctp echo $this-&gt;Html-&gt;script('jquery-2.1.1.min.js'); If I put this addNumber function into add.ctp file and put into add.ctp &lt;?php echo $this-&gt;Html-&gt;script(array('jquery-2.1.1.min.js'));?&gt; then its working nice, put I dont want these into add.ctp file. Thanks for helping !
favorite count: 0
has answer: http://stackoverflow.com/a/27316080
accepted answer: http://stackoverflow.com/a/27316080
answer count: 3
has answer: http://stackoverflow.com/a/27316204
tagged with: php
has comment: http://stackoverflow.com/comment/43088110
type: AnsweredQuestion

http://stackoverflow.com/q/27420539
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27522433
tagged with: youtube-api
linked to: http://stackoverflow.com/q/7443578
has title: Difficulty with youtube API on low bandwith
has body: I have a YouTube player that sits in a slide of a Bootstrap carousel that sits in a template (the below doesn't include the html for the carousel): &lt;script type="text/html&gt; &lt;div class="video-container" id="introVideoTmpl"&gt; &lt;iframe width="640" height="480" src="//www.youtube.com/embed/Kn-7OlEVdNM?rel=0&amp;enablejsapi=1" id="videoOne" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; &lt;/script&gt; I render this by making a JavaScript call: renderPageOne = function(){ var introVideoTmpl= $("#introVideoTmpl").html(); $("#container").empty(); $("#container").append(_.template(introVideoTmpl, "")); getPlayerOne(); getPlayerOne() generates an instance of the player: function getPlayerOne() { playerOne = new YT.Player('videoOne', {}); } This playerOne has a pauseVideo() method which I call when needed. It works fine most of the times but sometimes, with low bandwith the API seems not to load properly and the pauseVideo() does not work. How can I check that the API is loaded properly so that the video can be paused when necessary?

http://stackoverflow.com/a/27472810
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27472625
has body: You can compress it all into the mouseenter if you use on and off combined with namespaced events (docs): $('.live').on('mouseenter',function() { $(this).addClass('active'); var $that = $(this); // store $(this) so that it can be used in the next block... $('.cancel-btn').on('click.remove_class',function() { // bind namespaced click event handler $that.removeClass('active'); // ...use $(this) from parent block $('.cancel-btn').off('click.remove_class'); // unbind namespaced event handler }); }); .live.active { background: red; color: #FFF; } .submenu { display: none; } .live.active .submenu { display: block; } Link Submenu Content Cancel
score: 1

http://stackoverflow.com/a/28520243
answers question: http://stackoverflow.com/q/27340334
downvote count: 0
has body: The Steam API is limited to 100,000 requests per day -- whether a day is within a 24 hour period or based on calendar day isn't exactly clear. I've made thousands of requests from the same IP address without any problems in the past. Are you getting a 403 response code? If so, you might be hitting the rate limit. I would also be surprised if using multiple IP addresses will help since the rate limit is probably associated with your API key.
score: 10
upvote count: 10
type: Answer

http://stackoverflow.com/comment/43189115
comment on: http://stackoverflow.com/q/27368467
type: Comment
type: QuestionComment
has text: Unfortunately I don't have a link for you to look on sorry. Should I copy the code to the post?(It's not much at all)
score: 0

http://stackoverflow.com/a/27379195
has body: Local storage is the way to go. http://www.w3schools.com/html/html5_webstorage.asp
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27379000

http://stackoverflow.com/q/27328271
upvote count: 6
favorite count: 0
tagged with: cordova
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/27537288
has answer: http://stackoverflow.com/a/27537288
score: 6
tagged with: css
has answer: http://stackoverflow.com/a/28070542
type: AnsweredQuestion
has title: Use inputs in AngularJS Material bottom-sheet
tagged with: material-design
accepted answer: http://stackoverflow.com/a/28070542
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has body: The problem I'm designing a Cordova hybrid app using the (very) new AngularJS Material Design dependency. I have a log in form in a bottom sheet called via $mdBottomSheet service. Example below: $scope.showLogin = function ($event) { $mdBottomSheet.show({ templateUrl: 'views/login/login.html', controller: 'loginCtrl' }) }; The contents of views/login/login.html are: Sign in Everything runs and displays just fine. HOWEVER! when I go to click on the input, the focus is never given to the input, and instead the md-bottom-sheet element is dragged back and forth. Clicking on the button (when not disabled) fires just fine, but the click on the input to give it focus is never recognized. Things I've tried Adding ng-click="return false", 'ng-click="$event.preventDefault()"` Adding a -webkit-transform: translate3d(0, 80px, 0) !important; rule to the CSS, as that's the default state of the property which is being altered on drag. Adding angular.element('md-bottom-sheet').on('click', function() { return false; }); to an ng-init block. Doing the same as above (using jQuery to try to ham-hand this) on the dragstart event. The question How can I use an input in a bottom sheet with material design, given I've tried every workaround that I know to get this to work for touch? Caveats 1. I would love to offer a live example for this, but I can't find a CDN source for angular/material 2. This only happens on a mobile device, no idea if it will happen on a mobile website as I've only tested it in a Cordova hybrid app 3. There are no examples of this I've found via search, so I can't even point you to a resource that might emulate the problem. 4. Basically, this is going to be very hard to reproduce. Update One possible fix I've identified: The following block in the function BottomSheet(element) "class" for the provider has the following: function onTouchStart(e) { e.preventDefault(); /* do the rest of the code */ } Changing that e.preventDefault() to the following does allow normal in…

http://stackoverflow.com/comment/43226660
has text: I get the same error with firefox and chrome browsers
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27371389

http://stackoverflow.com/q/27350367
has answer: http://stackoverflow.com/a/27350824
tagged with: php
answer count: 1
downvote count: 1
has body: question1 1 2 3 4 5 6 7 8 9 10 question2 1 2 3 4 5 6 7 8 9 10 question3 1 2 3 4 5 6 7 8 9 10 question4 1 2 3 4 5 6 7 8 9 10 question5 1 2 3 4 5 6 7 8 9 10 my intetion is when the user checked the value from radio and store the value ,started with all name="D" (D1,D2,D3-D25) how to i make so many D value plus up and store with session ?? i am making a quiz webpage and user checked the value ( like D1 = 5 , D2= 10) how i plus those and store it into session ? i have being using java for loop but i cant pass those var to php. thank.
tagged with: mysql
upvote count: 0
accepted answer: http://stackoverflow.com/a/27350824
tagged with: javascript
has title: total point and store to session?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
score: -1
type: Question

http://stackoverflow.com/comment/43480306
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27376331
has text: That's what I do as well ;)
type: AnswerComment

http://stackoverflow.com/comment/43298803
has text: You are setting the x,y,width,height attributes, shouldn't you rather be setting a `rotate` [transform](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform)?
type: Comment
comment on: http://stackoverflow.com/q/27426692
score: 0
type: QuestionComment

http://stackoverflow.com/q/27317716
has answer: http://stackoverflow.com/a/27317790
has body: So I try to select a div within another div. My html goes like this: &lt;div id="Stage_game_page1"&gt;&lt;div id="cube0"&gt;[...]&lt;/div&gt;&lt;div id="cube1"&gt;[...]&lt;/div&gt;&lt;/div&gt; I want to select my #cube0 within my Stage_game_page specifically, with jQuery or JS. The goal of the selection is to use it in an loop. I tried : var count =$("#Stage_game_page").children().length; for(i=0; i&lt;count;i++){ $("#Stage_game_page")$("#cube"+i)[...] } I don't understand what I'm doing wrong.
tagged with: for-loop
tagged with: jquery-selectors
has comment: http://stackoverflow.com/comment/43095133
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27317803
has answer: http://stackoverflow.com/a/27317771
has title: Select a div insinde another div with jQuery
type: Question
has answer: http://stackoverflow.com/a/27317969
has answer: http://stackoverflow.com/a/27317851
favorite count: 0
has comment: http://stackoverflow.com/comment/43095004
answer count: 8
has comment: http://stackoverflow.com/comment/43346656
has answer: http://stackoverflow.com/a/27317946
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43095063
has answer: http://stackoverflow.com/a/27317770
has comment: http://stackoverflow.com/comment/43094967
score: 0
has answer: http://stackoverflow.com/a/27317893

http://stackoverflow.com/q/27455134
type: AnsweredQuestion
tagged with: c#
tagged with: certificate
tagged with: ssl
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/27455452
has answer: http://stackoverflow.com/a/27456654
score: 0
answer count: 2
has body: I am trying to get a secured Websocket line going when both ends of the connection are on variable locations. What im doing: I have a c# program running a Websocket server (Fleck), this program is deployed to the user's machine. Next, i have both a website and an android app running Websocket clients (in javascript and java respectively). The clients know how to connect to the server (queried from database via php). So this way a direct connection is made from the client to the server, without going thru a website or anything, this is primarly since it can contain sensitve information and not having the website having to touch that is a giant plus! The website itself is running HTTPS using a trusted certificate. The c# Fleck server requires a pfx certificate for WSS, i tried making that using openSSL and the certificate i use for the website. But the browser silently drops the connection when a websocket certificate is no good. If i go to https://localhost:port i get the expected browser warning that my domain isn't matching with the certificate, the same error is probably why the browser drops the websocket connection, since neither the user's PC or any computer/phone they connect from is using that domain. If my above observations are correct, in essence i would need something like a trusted certificate with a variable domain. Does such a thing exist? Thanks for your time!
possible better answer: http://stackoverflow.com/a/27455452
accepted answer: http://stackoverflow.com/a/27456654
has title: How to run c# websockets over TLS when both client and server location are dynamic?

http://stackoverflow.com/comment/43195727
type: AnswerComment
type: Comment
has text: Hi Godwin, thanks for your help. I got the script to create items and loop but when i add some text in the table columns I get the following text added to the SharePoint list item once I hit the try button: System.Collections.Generic.Dictionary`2[System.String,System.Object] Any suggestions? Thanks
comment on: http://stackoverflow.com/a/27360731
score: 0

http://stackoverflow.com/comment/43392435
has text: this is what I have also thought of as a last resort :) I was just trying to find out if there is any new api for this from google !
comment on: http://stackoverflow.com/a/27451383
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27395907
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
has title: How would I clear the content of a previous form entry with JQUERY?
type: Question
has comment: http://stackoverflow.com/comment/43238429
upvote count: 1
has comment: http://stackoverflow.com/comment/43238893
has comment: http://stackoverflow.com/comment/43282645
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I am busy Implementing a flow form where it show and hides divs as needed. onLoad all divs are hidden except for chartdiv1 and the initial selection. Selection Options 1) Unit Price in US Dollars - really just keeps chartdiv1 there 2) Unit Price in Alternative Currency - Brings in chartdiv2 + an additional dropdown (#currency) allowing for additonal Chartdivs to be brought in (all initally hidden). 3) Unit Price Perfomance over a Period - Brings in chartdiv5 + additional dropdown(#currency2) hiding the previous dropdown, This allows for additonal divs to be selected date. The problem I am have is that the last clicked divs in these additional dropdown are not clearing and I end up have two divs showing at the same time. how can I manipulate my JQUERY code to make the divs clear once the other slections are made in the main dropdown I have attached my JSfiddle http://jsfiddle.net/Jason1975/9jz8pjwy/ to show this, I do apologise though I am new to JSfiddle and do not know how to add my Body onLoad="hide()" function in it show all the divs are showing currently, some help with that would also be great. HTML Code Chart Type: Unit Price in US Dollars Unit Price in Alternative Currency Unit Price Performance over a Period Alternative Currency: GSO_EUR GSO_GBP GSO_ZAR Alternative Currency Period: GSO_USD GSO_EUR GSO_GBP GSO_ZAR CHARTDIV1 - USD CURRENCY CHARTDIV2 - EURO CURRENCY CHARTDIV3 - GBP CURRENCY CHARTDIV4 - ZAR CURRENCY CHARTDIV5 - USD PERFORMANCE PERIOD CHARTDIV6 - EURO PERFORMANCE PERIOD CHARTDIV7 - GBP PERFORMANCE PERIOD CHARTDIV8 - ZAR PERFORMANCE PERIOD JAVASCRIPT/JQUERY // MENU TOGGLE SCRIPTS // Menu Toggle Script 1 - Working $(document).ready(function() { hide(); $( '#chart-type').change( function() { var $select = $( this ), selected = $select.val(); if ( selected == "unit-price1" ) { $( 'div#chartdiv1' ).show(); } else { $( 'div#chartdiv1' ).hide(); } }); $( '#chart-type' ).change( function() { var $select = $( this ), selected = $select.val(); if ( selecte…
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43250062

http://stackoverflow.com/a/27431853
score: 28
has comment: http://stackoverflow.com/comment/83020868
has comment: http://stackoverflow.com/comment/131408222
accepted answer of: http://stackoverflow.com/q/27429123
type: Answer
has comment: http://stackoverflow.com/comment/131404402
has comment: http://stackoverflow.com/comment/46251366
has comment: http://stackoverflow.com/comment/83006028
has comment: http://stackoverflow.com/comment/131408879
has comment: http://stackoverflow.com/comment/83087572
has comment: http://stackoverflow.com/comment/83006673
has comment: http://stackoverflow.com/comment/131407252
type: AcceptedAnswer
has body: The same-origin policy says that scripts run on some origin cannot read resources from another origin. (An origin is a domain, plus a scheme and port, like http://foo.example.com:80.) Note that the same-origin policy does not prevent cross-origin media from being displayed to the user. Rather, it prevents scripts from programmatically reading cross-origin resources. Consider the &lt;img&gt; tag: a page on example.com can show a cross-origin image from other.com, but a script on example.com's page cannot read the contents of that image. The user can see it; the page cannot. The Web Audio API can read the contents of audio files. If an audio file is from a different origin, this kind of reading is not allow by the same-origin policy. A user can listen to a cross-origin audio file, but a script on the page cannot read the contents of the file. When you attempt to feed a cross-origin audio file into an analyzer script (e.g., so that you can draw a visualization on a canvas), the same-origin policy should stop you. You are attempting to violate the same-origin policy, and the browser is correctly stopping you by refusing to play the audio in way that would allow you to read the file contents. Note that Chrome does not prevent such cross-origin file reading for audio files, and this is incorrect behavior. The correct solution is to have your media servers serve the audio files with a CORS Access-Control-Allow-Origin: * HTTP response header. However, this currently does not work in Firefox, which is incorrect behavior. If Firefox hopes to have a compliant implementation, this will be fixed eventually.
answers question: http://stackoverflow.com/q/27429123
upvote count: 28
has comment: http://stackoverflow.com/comment/49458183
downvote count: 0
has comment: http://stackoverflow.com/comment/83005962
has comment: http://stackoverflow.com/comment/83022085

http://stackoverflow.com/q/27341885
type: AnsweredQuestion
has title: What's the meaning of var variableName = variableName || {};
has answer: http://stackoverflow.com/a/27341917
has comment: http://stackoverflow.com/comment/43139514
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27341917
upvote count: 0
score: -2
possible better answer: http://stackoverflow.com/a/27341909
tagged with: javascript
has answer: http://stackoverflow.com/a/27341909
has body: I'm new to javascript from C++ background. I always see code like var variableName = variableName || {}; It seems quite strange to me. Can somebody explain the meaning of the code? Thanks a lot.
linked to: http://stackoverflow.com/q/6439579
has comment: http://stackoverflow.com/comment/43139652
favorite count: 0
downvote count: 2

http://stackoverflow.com/comment/43405796
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27435588
has text: it worked like a charm, cool but what was the issue ? thanks a ton !!

http://stackoverflow.com/comment/43322284
type: AnswerComment
comment on: http://stackoverflow.com/a/27427936
has text: Hi Mark, Seeing my html & HavaScript source is not what I am concerned with. I know there is no way to stop that. I put a few little stumbling blocks in CF that make it that much harder to write to a CF page via the URL. I would like to hide the Location in CF so they can't see that either is all. You know it's evil out there so we got to always be thinking.
type: Comment
score: 0

http://stackoverflow.com/comment/43151945
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27348227
type: Comment
has text: what do you mean? you want a link to click as well? Or you just want to highlight on keypress?

http://stackoverflow.com/a/27396779
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27396698
accepted answer of: http://stackoverflow.com/q/27396698
type: Answer
upvote count: 34
has comment: http://stackoverflow.com/comment/43239792
score: 34
has body: Array.prototype.filter will create and return a new array consisting of elements that match the predicate. function removeByIndex(array, index) { return array.filter(function (el, i) { return index !== i; }); } Even shorter with ECMAScript 6: var removeByIndex = (array, index) =&gt; array.filter((_, i) =&gt; i !== index);
has comment: http://stackoverflow.com/comment/43239736

http://stackoverflow.com/comment/43210509
score: 1
has text: why id("total").innerHTML = val_fenster + val_fassade + val_keller; doesn't fit for you?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27380765

http://stackoverflow.com/comment/43325204
comment on: http://stackoverflow.com/q/27314067
has text: No. it is saving the task perfectly. But it is still showing the error message. can you please give me some clear explanation to do it.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27332280
downvote count: 0
has comment: http://stackoverflow.com/comment/43122555
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43122166
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27332606
favorite count: 0
has comment: http://stackoverflow.com/comment/43122821
upvote count: 2
has comment: http://stackoverflow.com/comment/43122436
has answer: http://stackoverflow.com/a/27332593
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/27332606
possible better answer: http://stackoverflow.com/a/27332593
has body: I've created 4 divs and allotted a variable 'i' which indicates the number of divs. If I delete a div, the variable 'i' should decrease without refreshing the webpage(dynamically). Here is the code var i = 0; $(document).ready(function () { $(document).on('click', '#new-mcq', function () { if (i == 0) $(".insert-question-container").html(''); i++; createdDivs++; mcqCount++; $(".insert-question-container").append(' '+i+'Multiple Choice Question ').show('slow'); //alert("MCQ: "+mcqCount); }); }); $(document).on('click', '.close-btn-mcq', function () { var id = $(this).attr("id"); var className = $(".add-question-new").attr("id"); $("#" + id).remove(); //alert(id); deletedDivs++; mcqCount--; i--; //alert("i = " + i); //alert("mcq = " + mcqCount); if (createdDivs == deletedDivs) i = 0; }); HTML Add Question: Multiple Choice True / False Short Answer Match Column
type: Question
answer count: 2
has title: Maintaining a count of divs in var i

http://stackoverflow.com/a/27318341
score: 2
has body: You can set different widths of lines. jsFiddle: http://jsfiddle.net/24qf98xL/9/ $(function () { $('#container').highcharts({ series: [{ id: 'main', data: [{x: 5, y: 10}, {x: 7, y: 10}] }, { data: [{x: 2, y: 12}, {x: 9, y: 12}], lineWidth: 10, linkedTo: 'main' }, { data: [{x: 6, y: 12}, {x: 19,y: 12}], lineWidth: 6, linkedTo: 'main' }, { data: [{x: 4, y: 12}, {x: 10,y: 12}], linkedTo: 'main' }] }); }); Or alternatively you can try columnrange type series jsFiddle: http://jsfiddle.net/tjcg60p4/
answers question: http://stackoverflow.com/q/27317557
downvote count: 0
has comment: http://stackoverflow.com/comment/43096887
upvote count: 2
type: Answer

http://stackoverflow.com/comment/43258829
score: 1
comment on: http://stackoverflow.com/q/27406427
type: Comment
type: QuestionComment
has text: I didn't get it... When do you want to put your Javascript function inside your JSP file? Do you want to call javascript function `fillMethodData` depending on the result of your JSP *when test* ?

http://stackoverflow.com/comment/43209562
type: Comment
comment on: http://stackoverflow.com/a/27367310
type: AnswerComment
has text: Felix: based on your answer:function is_empty(myvar) {var res=false; if (!myvar || myvar==='0') res=true; return res; }
score: 0

http://stackoverflow.com/comment/43213673
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27380447
has text: Absolutely, because it is javascript it is agnostic of what server side programming language you choose. With MVC you can add ` ` tags into pages, you can also bundle up the files just like it does with jQuery, so this means that you can even have file version with source control!
score: 0

http://stackoverflow.com/q/27418578
has answer: http://stackoverflow.com/a/27418710
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: Drag and Drop Javascript
type: Question
accepted answer: http://stackoverflow.com/a/27418710
tagged with: javascript
favorite count: 0
score: 0
tagged with: drag-and-drop
has body: In my project I've got a bunch of images, and each image does different functions, the thing is that I want to know what is the image that the user has dragged, and then make a function or other. Here's my code : Javascript (Drag and Drop) My html :
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
answer count: 1

http://stackoverflow.com/a/27428864
accepted answer of: http://stackoverflow.com/q/27428416
answers question: http://stackoverflow.com/q/27428416
has comment: http://stackoverflow.com/comment/43300849
has comment: http://stackoverflow.com/comment/43299532
has comment: http://stackoverflow.com/comment/43300009
score: 0
has body: The problem is that your JavaScript code is running before the form has actually been added to the page. When using AJAX, you need to run whatever JavaScript you need in the callback: $.get('/some/url', function (result) { $('#whatever').html(result); $('form').submit(function(e) { var id = $(this).prop('id'); // do whatever with id }); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43299589
type: Answer

http://stackoverflow.com/comment/43360186
score: 0
has text: What's wrong with this `^AB[0-9]{6}[A-Z][0-9]{2}$`? I think this satisfies your conditions. I don't know why you used an alternation operator.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27461812

http://stackoverflow.com/q/27406869
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43258352
has title: Drawing an array of images on canvas in javascript
has comment: http://stackoverflow.com/comment/43258328
tagged with: javascript
type: Question
tagged with: canvas
upvote count: 1
tagged with: arrays
favorite count: 0
duplicate of: http://stackoverflow.com/q/14610771
has body: I want to draw an array of images on canvas. Here is my code without array: var monsterReady1 = false; var monsterImage1 = new Image(); monsterImage1.onload = function () { monsterReady1 = true; }; monsterImage1.src = "fruit1.png"; var monster1 = {x: 0, y: 0}; var monsterXY1 = function () { monster1.x = (Math.random() * (canvas.width - 50)); monster1.y = (Math.random() * (canvas.height - 50)); }; var render = function() { if (monsterReady1) { ctx.drawImage(monsterImage1, monster1.x, monster1.y); } }; And this is the code I tried to use an array with, but it doesn't work: var fruits = ["fruit1.png", "fruit2.png", "fruit3.png", "fruit4.png"]; for (var i = 1; i &lt;= fruits.length; i++) { var monsterReady1 = false; var monsterImage1 = new Image(); monsterImage1.onload = function () { monsterReady1 = true; }; monsterImage1.src = fruits[i]; }
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/14610771
answer count: 0
downvote count: 0

http://stackoverflow.com/q/27351523
type: Question
has body: I have attached jquery file upload button in each repeater row but on click file upload selected files display for first row only. For other rows only total files selected (count)display but progress bar for selected files not display Please help me i am learner in asp.net actually i am front end developer. Actually i have to use client side file uploader for multiple files in repeater..My code is as follows: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %> <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2"> </asp:Repeater> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:countryConnectionString %>" SelectCommand="SELECT * FROM [countries]"></asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Students1ConnectionString %>" SelectCommand="SELECT * FROM [Students]"></asp:SqlDataSource>
tagged with: javascript
has answer: http://stackoverflow.com/a/27351928
upvote count: 1
answer count: 1
downvote count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0
has title: Jquery file upload not working for each row of asp.net repeater
type: UnansweredQuestion
score: 1

http://stackoverflow.com/a/27464650
has comment: http://stackoverflow.com/comment/43365664
has body: You must include an ng-controller to tell angular where to look for your scope variable. Try adding an ng-controller attribute to your view 0 Joueurs en ligne
answers question: http://stackoverflow.com/q/27464599
score: 0
type: Answer

http://stackoverflow.com/a/27393327
answers question: http://stackoverflow.com/q/27392925
score: 2
accepted answer of: http://stackoverflow.com/q/27392925
has body: i want to call $scope.myFunction(); [my directive is] not reusable as in my other controller i want to call $scope.myFunction2(); SO i want something so that i can pass the function name in directive: 1) The attributes in your custom tag are available in the link function, so you can save the value of the fname attribute for future use: link: function(scope, element, attrs){ scope.data = {fname: attrs.fname}; }, 2) An object's properties can be retrieved using dot notation, e.g. $scope.fname, but the properties can also be retrieved using array notation, e.g. $scope[fname], where fname is a string. And if $scope[fname] is a function, you can execute it by writing $scope[fname](): app.controller('MyDirCtrl', function($scope) { $scope.test = function() { var fname = $scope.data.fname; $scope[fname](); //fname property not found in current scope, so parent scope is searched }; }); .... ... var app = angular.module('myApp',[]); app.controller('Ctrl1', ['$scope', function($scope) { $scope.funcInCtrl1 = function() { console.log('funcInCtrl1 called...'); }; }]); app.controller('Ctrl2', ['$scope', function($scope) { $scope.funcInCtrl2 = function() { console.log('funcInCtrl2 called...'); }; }]); app.controller('MyDirCtrl', ['$scope', function($scope) { $scope.test = function() { var fname = $scope.data.fname; $scope[fname](); }; }]); app.directive('myDir', function () { return { restrict: 'E', scope: true, template:' click me ', link: function(scope, element, attrs){ scope.data = {fname: attrs.fname}; }, controller: 'MyDirCtrl', } }) And, here it is with Controller as syntax: ... var app = angular.module('myApp',[]); app.controller('Ctrl1', function() { this.funcInCtrl1 = function() { console.log('funcInCtrl1 called...'); }; }); app.controller('Ctrl2', function() { this.funcInCtrl2 = function() { console.log('funcInCtrl2 called...'); }; }); app.controller('MyDirCtrl', ['$scope', function($scope) { this.test = function() { var fnames = $scope.data.fname.split('.'); var ctrl_n…
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/27377127
score: 1
tagged with: kendo-grid
downvote count: 0
tagged with: tooltip
tagged with: javascript
favorite count: 0
answer count: 0
type: UnansweredQuestion
has body: I have grid which has around 8 columns, 8th column has the delete button. When the user hovers over the delete button tooltip should appear with some content. Now the content in the tooltip depends on the row value from 6th and 7th column. Consider if the row value of 6th column is 'Yes' and row value of 7th column is "No", tooltip content will be Hello and as the row value of 6th and 7th column changes tooltip content will also change. Below is my code, but i am unable to get that. function initializeGrid() { $("#wellboreGrid").kendoGrid({ filterable: true, resizeable: true, reorderable: true, columnMenu: true, scrollable: false, dataBound: function (e) { debugger; $("#wellboreGrid").find(".k-button").kendoTooltip({ content:e.data.item.ExistingAssn=="Yes" &amp;&amp; e.data.item.ExistingGeologic=="NO" ? "Hello" : e.data.item.ExistingAssn=="Yes" &amp;&amp; e.data.item.ExistingGeologic=="YES" ? "EXIT":e.data.item.ExistingAssn=="No" &amp;&amp; e.data.item.ExistingGeologic=="YES" ? "WHAT" : Error, width: 100, height: 60, position: "bottom", }); }, columns: [ { field: "FacilityId", title: "", hidden: true }, { field: "FacilityName", title: "Shell Name" }, { field: "shortName", title: "Shell Short Name" }, { field: "ApiNumber", title: "API Number" }, { field: "InService", title: "Service Status" }, { field: "State", title: "State" }, { field: "ExistingAssn", title: "Existing Association", format: "{0:c}" }, { field: "ExistingGeologic", title: "Existing Geologic", format: "{0:c}" }, { field: "LithoStratColoumnId", title: "", hidden: true }, { field: "GeoIntervalId", title: "", hidden: true }, { command: [{ click: deleteItem, text: "X" }], title: "Delete" } ] }); $("#dvshowWellbore").attr("style", "display:inline;float: left;font-weight:bolder;font-style:italic;padding-bottom:10px;padding-left:15px;font-size:15px;"); $("#wellboreGrid").find('.k-grid-header .k-header').css('font-weight', 'bold'); };
upvote count: 1
type: Question
has title: Kendo Tooltip content chnages dynamically depending on the other 2 row data

http://stackoverflow.com/q/27427043
type: UnansweredQuestion
has body: Here I have a jQuery UI accordion: http://jsfiddle.net/1e6z2ubp/3/ I would like to make the speed of each individual item opening, the same speed as when the 'show all' button is clicked. The bit of js in question is below, but best to view the JSFiddle. I think the speed should be 100 if possible. $(".faq-accordion &gt; div").accordion({ header: "h4", collapsible: true, active: false, speed: 100, });
answer count: 0
has comment: http://stackoverflow.com/comment/43301728
has comment: http://stackoverflow.com/comment/43301794
type: Question
tagged with: jquery-ui
tagged with: jquery-ui-accordion
tagged with: javascript
has title: jQuery UI accordion - make individual FAQ speed the same as 'show all'
score: 0
tagged with: jquery
tagged with: accordion

http://stackoverflow.com/comment/43258229
type: Comment
type: QuestionComment
has text: Makes sense, I'll include the line I use.
comment on: http://stackoverflow.com/q/27406765
score: 0

http://stackoverflow.com/q/27435335
type: AnsweredQuestion
has title: Get the exact position of div using div class
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/43311604
accepted answer: http://stackoverflow.com/a/27435386
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43311644
favorite count: 0
tagged with: css
upvote count: 2
has comment: http://stackoverflow.com/comment/43311943
has answer: http://stackoverflow.com/a/27435386
score: 0
downvote count: 2
has body: How can i get the top.left, right and width of the div which has no id but only class is defined. &lt;div class="content"&gt; &lt;/div&gt; I want to get the exact position on the screen using content class. is it possible using jqyery??

http://stackoverflow.com/a/27367875
upvote count: 0
answers question: http://stackoverflow.com/q/27367276
has body: function c(val) { document.getElementById("d").value=val; } function math(val) { document.getElementById("d").value+=val; } function e() { try { c(eval(document.getElementById("d").value)) } catch(e) { c('error') } }
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/43270500
score: -1

http://stackoverflow.com/comment/43241709
has text: I edited the answer to show how to get cookies in Symfony, that should be all you need. However you should note that 1) you had a typo in your question, `evnt_id` instead of `event_id`. If this typo is also in your code then you'll need to fix it or change it in the code I provided and 2) if your vars are numbers and not strings you can leave out the quotes
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27396425
score: 0

http://stackoverflow.com/comment/43320983
has text: @Justcode code or a plugin for jquery, or any idea on how I can achieve something like that. 'cause I've searched for color tints that can be applied images, but what they do is like a filter to the whole image and not to a specific color only.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27440619

http://stackoverflow.com/q/27385679
type: AnsweredQuestion
tagged with: webview
has answer: http://stackoverflow.com/a/27386088
accepted answer: http://stackoverflow.com/a/27386088
type: Question
has body: I am using a webview that reads from a local HTML in my project. I am using some javascript on the HTML after if has finished loading the html file. This is my set-up: final WebView webview = (WebView)rootView.findViewById(R.id.webView); webview.getSettings().setJavaScriptEnabled(true); final String letter = "hello"; webview.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { webview.loadUrl("javascript:(function() { " + "var text = 'HELLO';"+ "document.body.innerHTML = document.body.innerHTML.replace(/"+letter+"/g, 'text');"+ "})()"); } }); webview.loadUrl("file:///android_asset/2.html"); Basically what this does now is to change the word hello into a red word text. But what i want it to do is to change the word into HELLO as i declared in the javascript. So my question is how to incorporated variables into javascript code this way. Btw i know i could delcare var text outside where i declare String letter. But this is just a small example of what i try to do. I would be very grateful if someone could explain how to use forloops inside the webview.LoadUrl(javascript code below: var color = "#FF0000"; var text = "fem"; for (i = 0; i < 5; i++) { text += "The number is " + i + " "; } document.body.innerHTML = document.body.innerHTML.replace(/with/g, ''+text+''); How do i put it inside webview.loadURL. Please dont hesitate to ask if something was unclear.
has comment: http://stackoverflow.com/comment/43220463
tagged with: javascript
has comment: http://stackoverflow.com/comment/43221049
score: 0
answer count: 1
tagged with: android
has title: Use javascript in an android webview

http://stackoverflow.com/comment/43238576
has text: And how do you access this page?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27396158
score: 0

http://stackoverflow.com/a/27578324
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27457943
has body: connect() function was not exist. You forgot to insert it. please recheck again.

http://stackoverflow.com/comment/43151906
type: QuestionComment
comment on: http://stackoverflow.com/q/27348595
score: 0
has text: What I know that, you must know exactly the portion that you want to highlight, then split the body string before and after of this portion, then enclose the portion with a `span` then rejoin the string again.
type: Comment

http://stackoverflow.com/a/27342833
has body: Too slow and can't vote up yet but yes, you should only use onload event onto the body element and the diabled attribute is for buttons or form fields, not for divs.
score: 0
answers question: http://stackoverflow.com/q/27342685
type: Answer

http://stackoverflow.com/a/27357548
upvote count: 1
has comment: http://stackoverflow.com/comment/43170314
has body: You need to iterate on each serie and point, comparing x value. tooltip: { formatter: function () { var s = '&lt;b&gt;' + this.x + '&lt;/b&gt;', x = this.point.x; $.each(this.series.chart.series, function (i, serie) { $.each(serie.data, function (j, p) { if (p.x === x) { s += '&lt;br/&gt;' + this.series.name + ': ' + p.y; } }); }); return s; }, shared: true }, Example: http://jsfiddle.net/gn6dtx6x/5/
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27334728
accepted answer of: http://stackoverflow.com/q/27334728
type: Answer
has comment: http://stackoverflow.com/comment/43170460

http://stackoverflow.com/comment/43289336
has text: this way the .js function will be called just the first time...when i press another button the method don't answer
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27423171

http://stackoverflow.com/a/27403181
has body: It's hard to say whether a large number will affect system performance, since it depends an aweful lot on what they're doing and how they're doing it, as well as how many end up hitting at one time, etc. That said, my opinion is that using this sort of thing for managing the sorts of things you're describing will severely limit your scalability, as each one is scoped to the application instance (so if you want to scale horizontally, each manages they're own; if one crashes w/o sending notifications out, what happens? etc). I think you're far better off using some kind of distributed task manager, based perhaps on a Redis queue or similar. Your web app posts jobs to that, and a separate process or processes can handle running tasks when they expire. There's a few modules for this sort of thing, kue is the one I've played with.
downvote count: 1
answers question: http://stackoverflow.com/q/27402889
score: 2
has comment: http://stackoverflow.com/comment/43258312
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/121014448
upvote count: 3
has comment: http://stackoverflow.com/comment/43274127
accepted answer of: http://stackoverflow.com/q/27402889

http://stackoverflow.com/q/27321087
has answer: http://stackoverflow.com/a/27324461
score: 0
has answer: http://stackoverflow.com/a/27321130
answer count: 2
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27321130
accepted answer: http://stackoverflow.com/a/27324461
type: AnsweredQuestion
has body: $(document).ready(function() { $(".tabs-menu a").click(function(event) { event.preventDefault(); $(this).parent().addClass("current"); $(this).parent().siblings().removeClass("current"); var tab = $(this).attr("href"); $(".tab-content").not(tab).css("display", "none"); $(tab).fadeIn(1200); }); }); This is for tabbed menu with contents (using jQuery, of course). When I opening new tab, current contents fades out wery fast, but new tab contents opens slowly (as indicated 1200). So, how can I edit this existing script to fade out contents slowly? Example http://jsfiddle.net/2uts2kdt/7/
type: Question
has title: Add fadeOut to current JS
tagged with: javascript

acrobat
type: Tag
tags question: http://stackoverflow.com/q/27417524
tag name: acrobat
tags question: http://stackoverflow.com/q/27471285

http://stackoverflow.com/q/27328788
has answer: http://stackoverflow.com/a/27328855
has comment: http://stackoverflow.com/comment/43116620
score: 2
has comment: http://stackoverflow.com/comment/43116205
answer count: 1
favorite count: 0
has title: How to rewrite table using ajax response
upvote count: 2
accepted answer: http://stackoverflow.com/a/27328855
type: AnsweredQuestion
has body: I'm trying to re-write table using javascript and ajax. Here request has been sent and response is arrived but innerHTML cannot re-write table content with response text. Here is my code. Product Name: P1 Javascript function compareProd(prodID,tId){ browse(); var url = 'process.jsp'; url += '?compareProd='+prodID; xmlHttp.onreadystatechange = changeProd(tId); xmlHttp.open('POST', url, true); xmlHttp.send(null); } function changeProd(tID) { if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') { document.getElementById('product1').innerHTML = xmlHttp.responseText; } } process.jsp Product Name: P2 here response is arrived but cannot rewrite table.
type: Question
downvote count: 0
tagged with: jsp
tagged with: javascript
tagged with: ajax

http://stackoverflow.com/q/27333654
has body: Im sorry if this question sounds one previously asked. However after looking through the other answers, my exact problem was not addressed. My code generates many cookies successfully but in only one occurrence document.cookie returns an empty string. I only recieve an error message on a function that calls the wrongly undefined cookie. In the variable details list from the debugger, i found "&lt;return&gt;: undefined;" appears immediately before the bad cookie is returned. This works: function selectChall() { var challengeArray = JSON.parse(CookieUtil.get("challenge")); var rand = Math.floor(Math.random() * 5); if (challengeArray[rand] == null || challengeArray[rand] == "undefined") { selectChall(); } else { document.cookie = ("challNum="+ encodeURIComponent(rand)); } } //Selects random array value if that value is defined. Value is made into cookie. Used to choose next html page This does not work: function selectItem() { var itemArray = JSON.parse(CookieUtil.get("items")); var itm1 = CookieUtil.get("item1"); var itm2 = CookieUtil.get("item2"); var rand = Math.floor(Math.random() * 3); if (rand == 0 || itemArray[rand] == "") { rand=""; selectItem(); } else { SetNewItem(itemArray[rand]); } } function SetNewItem(itm){ var itm1 = CookieUtil.get("item1"); var itm2 = CookieUtil.get("item2"); if (itm1 == "") { document.cookie = ("item1="+ encodeURIComponent(itm)); } else { document.cookie = ("item2="+ encodeURIComponent(itm)); } } //Selects random array value if that value is defined and is not first value in array. Then converts the value into cookie to be called on another page Tried in Chrome(on a server) and Firefox(locally). Checking the cookie list confirms that out of 13 cookies, item2 is the only one without a value When i call the cookie, (rate(challNum, itm2)).toString() breaks "Uncaught TypeError: Cannot read property 'toString' of undefined" function StartChallenge(challNum) { var itemchoice; var itm1 = CookieUtil.get("item1"); var itm2 = CookieUtil.get("ite…
has comment: http://stackoverflow.com/comment/43125020
type: Question
tagged with: javascript
score: 0
has title: document.cookie returns undefined 1 in 13 times
tagged with: undefined
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43124703
answer count: 0
tagged with: cookies

http://stackoverflow.com/a/28395716
has body: "hl" is not a parametr of the "render" function, so you can't use it as is in your example. See: https://developers.google.com/recaptcha/docs/display#auto_render If you would like to render reCaptcah2 with localized text, you have to call api.js from google https://www.google.com/recaptcha/api.js with parameter "hl" and its value for example "cs" (for Czech language), so it means: https://www.google.com/recaptcha/api.js?hl=cs
answers question: http://stackoverflow.com/q/27379648
type: Answer
score: 3
upvote count: 3
downvote count: 0

http://stackoverflow.com/comment/43199271
comment on: http://stackoverflow.com/q/27374380
type: QuestionComment
has text: `this` in selfexecuted function reference to global object - in this case - _window_, so `this.prototype` is equals `window.prototype`
score: 2
type: Comment

http://stackoverflow.com/comment/43311572
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27420637
has text: Have you checked out `Ember.computed.sort`? Also there's a standard property `arrangedContent` that is used as the result of a sort if you're looking for that sort of thing.

http://stackoverflow.com/comment/43127669
has text: Are they on different domains? If you control both pages, you should be able to make it work by setting document.domain in both of them, as mentioned in the pages I linked.
type: Comment
comment on: http://stackoverflow.com/a/27333869
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43160888
score: 0
type: Comment
type: QuestionComment
has text: @Harshana you mean call this on every page of the website?? That will be a lot,I was hoping to call it at one particular place to be effective through out the website
comment on: http://stackoverflow.com/q/27353541

http://stackoverflow.com/comment/43212556
type: QuestionComment
comment on: http://stackoverflow.com/q/27368972
has text: The problem as I see it is that the value inside of the `ppSlick` object is being overwritten on `touchMove` even though it should only be set on `touchStart`. Chrome handles this correctly, are there any iOS specific JavaScript quirks when dealing with objects that I'm unaware of?
score: 0
type: Comment

http://stackoverflow.com/q/27418255
has comment: http://stackoverflow.com/comment/44455954
answer count: 1
downvote count: 0
favorite count: 0
tagged with: hammer.js
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
has title: HammerJS v2 with 'overflow-y: auto' does not scroll on ipad
has comment: http://stackoverflow.com/comment/44480747
type: Question
has body: I have a page with HammerJS v2 on it. My layout looks like: body - overflow: hidden div1 - overflow: hidden (this is always the size of the viewport) div2 - overflow-y: auto div1 - overflow: hidden (this is always the size of the viewport) div2 - overflow-y: auto div2 shows a scrollbar when it has overflowed content, however, when trying to scroll on an iPad in safari or chrome, it doesn't work. On android devices it seems to work OK. When you swipe on div1, it will take you to the next div1. I have tried setting the hammer setting: Hammer.defaults.touchAction = "pan-y"; But this starts allowing scrolling of the whole document, and I don't want that. I just want to scroll div2. has anyone else came across this issue, or have any ideas what it could be?
tagged with: javascript
has answer: http://stackoverflow.com/a/28049408
tagged with: touch

http://stackoverflow.com/comment/69865857
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27345933
has text: How to decrypt the same file?

http://stackoverflow.com/comment/43135433
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27339307
has text: By all means, please post a sample.

http://stackoverflow.com/a/27362572
type: Answer
has body: .offset() is the element's position relative to the document boundaries. If A offsetTop is let's say 800, clicking on A, the B element you try to position to top: A-offset will go well... to that top position. If it's inside a parent somewhere in the page, that 800px top will not match the A's position. If you put B directly as a &lt;body&gt; child than that 800 px top B moved will match the exact A position Same parent - demo B in body - demo
score: 0
answers question: http://stackoverflow.com/q/27362421

http://stackoverflow.com/comment/43367714
comment on: http://stackoverflow.com/a/27454395
type: Comment
has text: This are unique values. Text":" Bob-Ann169$ Text":" Brian-Pam4$ Text":" Ken-Greer126$
score: 0
type: AnswerComment

http://stackoverflow.com/q/27428457
linked to: http://stackoverflow.com/q/1732348
has title: Why does my regex work in .NET but not in Javascript?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27428489
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/43298425
has comment: http://stackoverflow.com/comment/43300892
upvote count: 1
has comment: http://stackoverflow.com/comment/43301015
has body: I am using an asp RegularExpressionValidator to validate if a textarea has html or encoded html. I need the validator to work client side because I have ValidateRequest set to true on the page. My regex is set to match any string that does not have a less than character followed by an alpha character or an ampersand followed by some number of alpha characters ending in a semi-colon. ^((?![&lt;]{1}[a-z]{1}).)*$ ^((?![&amp;]{1}[a-z]+;).)*$
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/27428489
has comment: http://stackoverflow.com/comment/43302891
has comment: http://stackoverflow.com/comment/43299468
tagged with: forms
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/43298703
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43201295
has text: As I said: "each special combination with "%" gets translated server-side to a character, resulting in query returning no results.". For example, trying to search for something beginning with "b" turns to a URL containing `%b`, which is a special combination representing a character
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27375635

http://stackoverflow.com/comment/43159136
has text: go through http://stackoverflow.com/questions/158319/cross-browser-onload-event-and-the-back-button
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27352718

http://stackoverflow.com/q/27349701
has title: The correct way to calculate Radians in Javascript?
tagged with: math
type: Question
has answer: http://stackoverflow.com/a/27349950
tagged with: javascript
tagged with: jquery
has body: I have this fiddle http://jsfiddle.net/pp7oby62/. The fiddle consists of a paddle game with rocks being hurdled at a paddle on a 80x10 sensor grid. The function notify_player has two parameters which give me the location of the rocks and the paddle. My code looks like this: defender.start( function notify_player(rocks, paddle_y) { var rocks_x = Math.max(rocks); var rocks_y = Math.min(rocks); var paddle_x = Math.max(paddle_y); var paddle_yp = Math.min(paddle_y); var deltaY = rocks_y - paddle_yp; var deltaX = rocks_x - paddle_x; var angleInRadians = Math.atan2(deltaY, deltaX); var angleRound=Math.round(angleInRadians); // random plan var moves = []; for (var i = 0; i &lt; 22; i++) { // -1, 0, 1 to move the fiddle up and down on the grid //moves.push( Math.floor(Math.random()*3) - 1 ); if (angleInRadians &gt;0) moves.push(-1); else if (angleInRadians &lt; 0) moves.push(0, 1, -1); } return moves; } ); The moves array controls the paddle moving up and down. As you can see I am calculating the angle in radians using the the information I get from the two parameters. But when I run it there's no effect on the movement of paddle when I give conditional loops stating that the angle is >0 or &lt;0. But suppose I say: if(angleInRadians!==0) The paddle moves. How could this be possible?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43154475
has comment: http://stackoverflow.com/comment/43154954
accepted answer: http://stackoverflow.com/a/27349950
type: AnsweredQuestion

http://stackoverflow.com/a/27413175
answers question: http://stackoverflow.com/q/27412886
score: 0
type: Answer
has body: The calculator above doesn't seem to work for me. However, I can make a couple of suggestions that think will help you a long the way. A) Please don't take this the wrong way. Part of programming is resolving the issues that you are having -- that is the fun of it. Gets more fun when your under pressure of deadlines. B) I would recommend using jQuery. You will inherently learn javascript. C) Finally, use div tags to write the validated key press to read from that separating the values by operators. eg: calculation=$('#output_div_id').val(); calculation_parts = calculation.split('+'); answer = parseInt(calculation_part[0]) + parseInt(calculation_part[1]). $('#output_div_id').html($('#output_div_id').html()+ "=" + answer); Hope that helps - good luck with learning java

http://stackoverflow.com/comment/43144245
score: 0
comment on: http://stackoverflow.com/q/27344385
type: QuestionComment
type: Comment
has text: Technically, all recursions can be rewritten with iterations. Since JS doesn't take care of tail recursion, you may give iteration a try. Oh by the way, looks like your code is animating endlessly, which I'm afraid isn't necessary.

http://stackoverflow.com/q/27428277
tagged with: comments
type: Question
upvote count: 4
tagged with: javascript
has answer: http://stackoverflow.com/a/27428381
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
has body: I just tried this code on my browser (Chrome 39, Windows 8) :- This produces the Header text on the browser. But when I make a slight change- put the HTML comment stuff on a single line, This doesn't display anything. Why is it so? I don't think HTML comments are in the Javascript standards. p.s. I know how to put javascript comments. I'm only wondering about this erratic behavior.
has comment: http://stackoverflow.com/comment/43298012
favorite count: 0
has title: Why does Javascript ignore single line HTML Comments?
accepted answer: http://stackoverflow.com/a/27428381
score: 4
type: AnsweredQuestion

http://stackoverflow.com/q/27391834
tagged with: javascript
has comment: http://stackoverflow.com/comment/43232436
has answer: http://stackoverflow.com/a/28883561
linked to: http://stackoverflow.com/q/8790915
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Convert HTML table to dropdown (or otherwise getting a select tag with columns)
favorite count: 0
tagged with: html-select
upvote count: 1
has comment: http://stackoverflow.com/comment/43231922
accepted answer: http://stackoverflow.com/a/28883561
has comment: http://stackoverflow.com/comment/43231464
type: AnsweredQuestion
score: 1
has body: What I have in my code right now: Dr. Steve 555-222-9393 Jim 333-999-1111 New Emergency Services 0118-999-881-99-9119-7253 It looks bad, and after a few dozen entries it's very, very hard to read. What I'd like is to emulate a dropdown by using a table and then displaying just one row of the table at a time (with the currently selected row's value stored in a hidden input). The question: before I start writing it myself, has someone already done this (in any library)? I've been going through the jquery plugin registry and there are plenty of plugins for converting to behave like and tons to create fancy multi-selects. (Some of these might even work, if you could disable the multi- part. SE's own Tags input has pretty fancy formatting in its "dropdown".) But if there's one that can turn a (or anything else) into a select-with-columns, it's lost in the noise. Note: I've found a number of related posts that suggest using monospace fonts and padding to line data up in a plain select tag, but I'd like to think it can be done better, especially after seeing jquery plugins like Chosen.
has comment: http://stackoverflow.com/comment/43234671
has comment: http://stackoverflow.com/comment/43232456
type: Question
downvote count: 0

http://stackoverflow.com/q/27377882
tagged with: events
has comment: http://stackoverflow.com/comment/43205187
favorite count: 0
score: -1
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/43206225
has body: Jquery on event is not working with selector where as its working with Jquery(document)? I have moved all page script to js file, all working fine but Event Handler Attachment are not working with element selector. here the problem i am facing after moving to js file: $(document).ready(function () { //this event is not working $('.add-new').on('click',function(){ //code }); //this event is working fine. $(document).on('click','.add-new', function(){ //code }); }); Because of some dependencies i am using jquery version 1.7.1 and 2.1.2 the sequence of these jquery and page js file as follow. //page js where from i have moved all page js to this file and using of $(document).on('click','.add-new', function(){}) would not be the correct way. am i doing wrong somewhere ?
has comment: http://stackoverflow.com/comment/43205326
has title: Jquery on event is not working with selector where as its working with Jquery(document)?
has comment: http://stackoverflow.com/comment/43205280
type: Question
has comment: http://stackoverflow.com/comment/43205249
upvote count: 0
has comment: http://stackoverflow.com/comment/43205170
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27378082
has comment: http://stackoverflow.com/comment/43205208
has comment: http://stackoverflow.com/comment/43205426
has comment: http://stackoverflow.com/comment/43207123
answer count: 1

http://stackoverflow.com/a/27377932
has body: differentiate the form with some variable . for example after submission form you can post back errors in variable name like if the submitted form is forgot password means define the variable name is $forgot like that. in view file check if(isset($forgot)) then set it's style as display block .
score: 0
answers question: http://stackoverflow.com/q/27377093
type: Answer

http://stackoverflow.com/q/27320728
score: 6
tagged with: css
tagged with: scroll
tagged with: absolute
type: Question
tagged with: mobile-webkit
downvote count: 0
answer count: 1
upvote count: 6
tagged with: javascript
has title: -webkit-overflow-scrolling breaks absolute positioning
has comment: http://stackoverflow.com/comment/74940818
has body: I am building a page that needs to have some elements which stick to the top of the page when they would otherwise be scrolled off the screen. I managed to do this using position:absolute. Everything was working perfectly, but it needed momentum scrolling. I added -webkit-overflow-scrolling: touch to the css of the scrollable area. This broke everything. My sticky elements with position:absolute are now just scrolling with the rest of the content. My question is this: Why does -webkit-overflow-scrolling: touch affect absolute positioning, and is there a way around this? UPDATE: I added an alert whenever a child element becomes "fixed" or "unfixed". The alerts continue to fire, so the styling is still being applied, it just isn't working. This means that it's not a problem with keeping track of scroll position but rather a problem with the styling. UPDATE: I tried using position: fixed instead of position: absolute and -webkit-overflow-scrolling broke that too UPDATE: After a lot of digging, I found references to this problem here and here. However, the only proposed solution in both cases is to restructure the DOM so that the sticky elements are not in the scrollable area. This is a difficult thing to do in my case, and I would prefer not to have to. Have things progressed since ios5 or is that still the only option?
linked to: http://stackoverflow.com/q/18163568
has answer: http://stackoverflow.com/a/28321934
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27453379
has body: I want to append an image after every image tag to show share button. Here is the fiddler link http://jsfiddle.net/q98up2f3/ $(document).ready(function() { $("img").each(function() { if($(this).prop('height')&gt;100 &amp;&amp; $(this).prop('width')&gt;100) { $(this).addClass( "myClass" ); $(this).wrapInner('&lt;img src="https://cdn3.iconfinder.com/data/icons/iconic-1/32/share-128.png" /&gt;'); } }); }); .myclass:hover{ opacity: 0.7; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="check"&gt; &lt;img src='http://media-cdn.tripadvisor.com/media/photo-s/05/e4/f7/89/little-venice.jpg'&gt; &lt;img src='http://media-cdn.tripadvisor.com/media/photo-s/05/e4/f7/89/little-venice.jpg'&gt; &lt;img src='http://media-cdn.tripadvisor.com/media/photo-s/05/e4/f7/89/little-venice.jpg'&gt; &lt;/div&gt; Adding class dynamically. while inspecting elements showing class and injected tag but its not reflecting
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27453406
score: 0
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/27453406
type: Question
possible better answer: http://stackoverflow.com/a/27453446
has answer: http://stackoverflow.com/a/27453446
has title: How to show image in image tag jQuery
answer count: 2
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/27424711
upvote count: 0
answer count: 1
downvote count: 5
tagged with: javascript
tagged with: jquery
has title: $post method using in jQuery
favorite count: 0
has comment: http://stackoverflow.com/comment/43291398
has comment: http://stackoverflow.com/comment/43291357
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43291768
has answer: http://stackoverflow.com/a/27425173
score: -5
has body: I want to create a "add" button in my jQuery calculator. When I click "add" button, it display "+" in the display and the number that I have entered will be stored. After that I can input another number to finish the equation. I can stuck in the part of the add button not sure how to do it. Do I need to use load()?
type: Question

http://stackoverflow.com/comment/43099531
type: Comment
type: QuestionComment
has text: It just doesn't do any of the canvas drawing
comment on: http://stackoverflow.com/q/27320095
score: 0

http://stackoverflow.com/comment/43131322
comment on: http://stackoverflow.com/a/27337354
score: 0
type: AnswerComment
has text: The OP could also just return the Constructor function itself. It need not be embedded in an object.
type: Comment

http://stackoverflow.com/comment/43235040
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27393974
has text: how about pushing it all in a variable onchange?
type: Comment

http://stackoverflow.com/q/27401833
answer count: 3
has body: JSFiddle link: http://jsfiddle.net/lustre/awpnd6L1/1/ Was wondering if there was a way I could create a function in JavaScript, so that I'm not having to copy the mouseenter code each time I need a "More Info" tooltip. Is this even possible? Below is the JavaScript I'm looking to condense into a function so that I don't have to copy it several times. jQuery(".bspaMoreInfo").mouseenter(function(){ clearTimeout(jQuery('.bspaMoreInfoText').data('timeoutId')); jQuery('.bspaMoreInfoText').show(200); }).mouseleave(function(){ var timeoutId = setTimeout(function(){ jQuery('.bspaMoreInfoText').hide(200); }, 650); jQuery('.bspaMoreInfoText').data('timeoutId', timeoutId); }); jQuery(".bspaMoreInfoText").mouseenter(function(){ clearTimeout(jQuery('.bspaMoreInfoText').data('timeoutId')); }).mouseleave(function(){ var timeoutId = setTimeout(function(){ jQuery('.bspaMoreInfoText').hide(200); }, 650); jQuery('.bspaMoreInfoText').data('timeoutId', timeoutId); }); Hope this makes sense x3
tagged with: this
downvote count: 0
has comment: http://stackoverflow.com/comment/43248449
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27401989
has title: JavaScript/jQuery tooltip function using "this"?
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/27401989
type: Question
tagged with: function
possible better answer: http://stackoverflow.com/a/27401939
tagged with: tooltip
tagged with: javascript
has answer: http://stackoverflow.com/a/27401958
has answer: http://stackoverflow.com/a/27401939

http://stackoverflow.com/comment/82104038
score: 17
type: AnswerComment
has text: FYI: `isSameOrBefore` is also available
type: Comment
comment on: http://stackoverflow.com/a/38712945

firefox
tags question: http://stackoverflow.com/q/27347860
tags question: http://stackoverflow.com/q/27315087
tags question: http://stackoverflow.com/q/27384069
tags question: http://stackoverflow.com/q/27447679
tags question: http://stackoverflow.com/q/27368537
tags question: http://stackoverflow.com/q/27397295
tags question: http://stackoverflow.com/q/27332761
tags question: http://stackoverflow.com/q/27350973
tags question: http://stackoverflow.com/q/27334856
tags question: http://stackoverflow.com/q/27374900
tags question: http://stackoverflow.com/q/27354277
tags question: http://stackoverflow.com/q/27469551
tags question: http://stackoverflow.com/q/27388779
tags question: http://stackoverflow.com/q/27333745
tags question: http://stackoverflow.com/q/27429123
tags question: http://stackoverflow.com/q/27394507
tags question: http://stackoverflow.com/q/27456782
tags question: http://stackoverflow.com/q/27320871
tags question: http://stackoverflow.com/q/27341136
tags question: http://stackoverflow.com/q/27372967
tags question: http://stackoverflow.com/q/27456706
tag name: firefox
tags question: http://stackoverflow.com/q/27407424
tags question: http://stackoverflow.com/q/27325750
tags question: http://stackoverflow.com/q/27381620
tags question: http://stackoverflow.com/q/27387009
tags question: http://stackoverflow.com/q/27367837
tags question: http://stackoverflow.com/q/27320852
tags question: http://stackoverflow.com/q/27461487
tags question: http://stackoverflow.com/q/27375470
tags question: http://stackoverflow.com/q/27335214
tags question: http://stackoverflow.com/q/27320038
tags question: http://stackoverflow.com/q/27363205
tags question: http://stackoverflow.com/q/27418196
type: Tag
tags question: http://stackoverflow.com/q/27446162
tags question: http://stackoverflow.com/q/27456519
tags question: http://stackoverflow.com/q/27352249
tags question: http://stackoverflow.com/q/27422884
tags question: http://stackoverflow.com/q/27347339
tags question: http://stackoverflow.com/q/27405644
tags question: http://stackoverflow.com/q/27375146
tags question: http://stackoverflow.com/q/27420580
tags question: http://stackoverflow.com/q/27424777
tags question: http://stackoverflow.com/q/27412572
tags question: http://stackoverflow.com/q/27357277
tags question: http://stackoverflow.com/q/27376661
tags question: http://stackoverflow.com/q/27423633
tags question: http://stackoverflow.com/q/27391145

http://stackoverflow.com/q/27419894
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43282643
has comment: http://stackoverflow.com/comment/43282836
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43282747
has comment: http://stackoverflow.com/comment/43282931
type: Question
has comment: http://stackoverflow.com/comment/43282669
tagged with: hyperlink
has title: How to create link to a hidden div?
has comment: http://stackoverflow.com/comment/43282693
has comment: http://stackoverflow.com/comment/43282832
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27420329
accepted answer: http://stackoverflow.com/a/27420329
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a html file having divs. All the divs are hidden by default, and each has a button associated which unhides them (javascript). How can I create an external link on another site which points to one of the divs, and loads the page with the given div visible? http://example.com/page.html#div1 works but the div is hidden. &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#div1").hide(); $("#div2").hide(); $("#div3").hide(); $("#btn1").click(function(){ $("#div1").show(); $("#div2").hide(); $("#div3").hide(); }); $("#btn2").click(function(){ $("#div1").hide(); $("#div2").show(); $("#div3").hide(); }); $("#btn3").click(function(){ $("#div1").hide(); $("#div2").hide(); $("#div3").show(); }); });&lt;/script&gt;
has comment: http://stackoverflow.com/comment/43282746

http://stackoverflow.com/q/27450546
answer count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/43339763
has answer: http://stackoverflow.com/a/27450588
has body: I need truly random integer numbers in node.js. I was wondering if anyone had experience with how good or bad underscore.js is for providing "randomness" (e.g. with the _.random(min, max) function) ? Reference: http://underscorejs.org/#random Thanks
has answer: http://stackoverflow.com/a/27450878
has comment: http://stackoverflow.com/comment/43339631
downvote count: 1
tagged with: node.js
possible better answer: http://stackoverflow.com/a/27450878
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/43340243
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/43339642
has answer: http://stackoverflow.com/a/27450653
has comment: http://stackoverflow.com/comment/43339652
accepted answer: http://stackoverflow.com/a/27450588
has comment: http://stackoverflow.com/comment/43340116
type: Question
upvote count: 4
tagged with: javascript
has title: How good is underscore.js at providing truly random numbers?
has comment: http://stackoverflow.com/comment/43340172

http://stackoverflow.com/comment/43365585
score: 0
comment on: http://stackoverflow.com/q/27464053
type: QuestionComment
type: Comment
has text: But that process does not have anything to do with the contents of the code body. The process he described is only concerned with the prototype object and some builtin methods of the Function object.

http://stackoverflow.com/a/27425070
downvote count: 0
score: 6
type: Answer
accepted answer of: http://stackoverflow.com/q/27424942
has comment: http://stackoverflow.com/comment/43292172
upvote count: 6
answers question: http://stackoverflow.com/q/27424942
type: AcceptedAnswer
has body: Put the curly brace of your return on the same line as return. Instead of: return { init : initialize }; Do this: return { init : initialize }; JavaScript has automatic semi-colon insertion which will automatically end the return statement before it hits the curly brace.
has comment: http://stackoverflow.com/comment/43292032

http://stackoverflow.com/comment/43175407
score: 0
type: Comment
type: QuestionComment
has text: help a brother out. We don't see line numbers. Which lines are they?
comment on: http://stackoverflow.com/q/27361575

http://stackoverflow.com/a/51110317
has comment: http://stackoverflow.com/comment/102016935
has comment: http://stackoverflow.com/comment/131787201
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/131783785
has body: Just construct a new Date from the existing one using only the year, month, and date. Add half a day to ensure that it is the closest date. var offset = new Date(Date.now() +43200000); var rounded = new Date(offset .getFullYear(),offset .getMonth(),offset .getDate()); console.log(new Date()); console.log(rounded); Since this seems to have a small footprint, it can also be useful to extend the prototype to include it in the Date "class". Date.prototype.round = function(){ var dateObj = new Date(+this+43200000); return new Date(dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate()); }; console.log(new Date().round()); Minimized: Date.prototype.round = function(){var d = new Date(+this+43200000);return new Date(d.getFullYear(), d.getMonth(), d.getDate());};
has comment: http://stackoverflow.com/comment/102018677
answers question: http://stackoverflow.com/q/27323791
score: 5
downvote count: 2

http://stackoverflow.com/q/27345402
score: -1
has comment: http://stackoverflow.com/comment/43146101
type: Question
has body: Here is the link to the website: website i am finding detail code of just the preloader / loading circle gif image in start. Please let me know how to do so?
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27345476
tagged with: http://stackoverflow.com/tag/html
has title: How to see specific code of preloader in a website?
answer count: 1
favorite count: 0
tagged with: css
downvote count: 1
accepted answer: http://stackoverflow.com/a/27345476
type: AnsweredQuestion

http://stackoverflow.com/a/30269757
has comment: http://stackoverflow.com/comment/48694700
has body: Tried wrapping the toolbar in a div and using position:relative; to try and hack it together, but didn't cooperate this time. It appears that the toolbar actually is accounting for its position at the time of click. So your only conflict is if the opened toolbar is position:absolute and then changes to position:fixed or vice versa. Your best [manual] bet would be to call a function at the same time that you change the position of the toolbar that: Detects if any menus are open. Changes the toolbar position. Reopens the menus that were open. The lazy (discouraged) fix would be to close all submenus whenever the position changes. This will fix the layout, but it will require the user to click once again to bring the menu back. Sorry this isn't a silver bullet answer :(
answers question: http://stackoverflow.com/q/27398639
score: 4
has comment: http://stackoverflow.com/comment/48885294
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/48873336
downvote count: 0

http://stackoverflow.com/comment/43188635
score: 0
type: Comment
has text: Can you give me an example directly from my code so I could understand a bit better?
type: AnswerComment
comment on: http://stackoverflow.com/a/27368270

http://stackoverflow.com/comment/43316755
comment on: http://stackoverflow.com/a/27438326
score: 1
has text: @Playmaker: Not if a) there is a `break` statement somewhere in the body or b) `doSomething()` returns a different value for each call and probably `null` when there are no more results.
type: AnswerComment
type: Comment

android-actionbar
type: Tag
tags question: http://stackoverflow.com/q/27471952
tag name: android-actionbar

http://stackoverflow.com/comment/43189567
has text: Thanks. Didn't know you have to call a function within a function for it work.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27368516

http://stackoverflow.com/comment/43116649
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27328855
type: Comment
has text: it shows me output what i want. and it also show me response in console.

http://stackoverflow.com/q/27376876
downvote count: 3
has answer: http://stackoverflow.com/a/27377063
linked to: http://stackoverflow.com/q/8627902
type: Question
has answer: http://stackoverflow.com/a/27377073
duplicate of: http://stackoverflow.com/q/8627902
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43203596
score: -3
answer count: 3
upvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27377073
possible better answer: http://stackoverflow.com/a/27377010
has comment: http://stackoverflow.com/comment/43203652
has answer: http://stackoverflow.com/a/27377010
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: i am trying to put this in a text area with the id registers and though i tried many ways i was unable to get a new line in the text area var r0=0,r1=0,r2=0,r3=10; $('#run').click(function(){ ; $("#registers").html('Register 3:'+r3+ '&lt;br&gt;' + 'Register 0:'+r0 ); }); and this is the out put i get in the text area Register 3:10&lt;br&gt;Register 0:0
has title: Take a new line when using $().html in jQuery

http://stackoverflow.com/comment/43270373
has text: You have the tag; use ajax to get the data, rather than a `script` element.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27412861
score: 0

http://stackoverflow.com/comment/43227574
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27364138
has text: Oh, okay, do I understand this correctly that I dont actually need the acknowledgement func to do anything?
score: 0

http://stackoverflow.com/comment/43294784
type: QuestionComment
score: 0
has text: 2 carousels yes, each with 2 rows. Each carousel though has many items. Basically I want whats shown in the JSFiddle here: http://jsfiddle.net/BBoyJuss/thbLB/light/ except repeated twice. I have it working already with one but activating 2 isn't working for me.
comment on: http://stackoverflow.com/q/27426178
type: Comment

http://stackoverflow.com/comment/43283239
comment on: http://stackoverflow.com/q/27420157
score: 0
type: Comment
type: QuestionComment
has text: Can you be more specific of which browser you're using and what exact behavior you're expecting, I see the login form (input field and the submit button) just fine as this [jsfiddle demo](http://jsfiddle.net/3wyxtL00/) shows.

http://stackoverflow.com/q/27416200
has title: Script do not affect all the element
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27417905
favorite count: 0
has body: I am posting because I have encountered a problem with one script that I am trying to develop . What I am trying to create is a gallery that receives it's images from Instagram. In order to accomplish this two tasks I've found two plugins that fits my needs , but I am unable to fusion them both. I'm relatively new to Jquery , and I do not understand why the script that I'm trying to run only affects one part of the code. This example gallery has two fundamental parts : 1)Pre-loaded by the developer : And , the ones that are added dynamically thanks to the instagram api : Well , the main problem is that the part that handles the gallery seems to read only the part added manually , but not the ones that comes thanks to the instagram api . I'm pretty sure that my problem is related to the time that the script is loaded , since the script changes some atributes of the images like href to data-href , but I've tried to pre-load that information , and I received the same results. In order to give a visual idea of my problem , I have the script in codepen : http://codepen.io/anon/pen/XJdbZR And , this is the idea I have that tells me that only the per-loaded information is being modified by the script I appreciate any kind of help or hint. Thanks
tagged with: instagram-api
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27416303
has comment: http://stackoverflow.com/comment/43276230
has answer: http://stackoverflow.com/a/27416303
has answer: http://stackoverflow.com/a/27417905
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/43280340
has text: What do you mean with `compress`?
type: Comment
type: QuestionComment
score: 6
comment on: http://stackoverflow.com/q/27418647

http://stackoverflow.com/a/27426277
has body: Try this. $(document).ready(function() { var hiddenID; $('input').live("focus", function() { hiddenID = $(this).attr('id'); alert(hiddenID ); }); }); `focus will binds only to elements that exist at the time it's called. live() binds a function to an event for all existing elements, and any that are added to the DOM later. Hope it will help you :)
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27426005

http://stackoverflow.com/a/27394838
has comment: http://stackoverflow.com/comment/43242567
downvote count: 0
has comment: http://stackoverflow.com/comment/43238328
score: 7
has body: runInNewContext creates a new "context" or "sandbox" in which the code runs. Say, for example, you have a chunk of code you want to run, which is loaded as a string. Just eval-ing the string can be dangerous, and gives you little control over what variables and globals this code has. So, instead, you can create a sandbox, a new context, in which this code can be run. Further, you can "preset" variables that you want available, whether as contexts or as a way to pass things into the context. So say your code looks like this: var code = "var add = function(a,b){return a + b;}; add(one,two);"; This is a function, defined in a string, that adds two numbers, and then actively adds one and two. What are one and two? Right now they are undefined. But if you run it in a new context, you can (reasonably) safely run the string code and even define one and two: vm.runInNewContext(code,{one:1,two:2}); which will cause the code to run and add(1,2). A more useful example might be to save it. var result = 0, code = "var add = function(a,b){return a + b;}; result = add(one,two);"; vm.runInNewContext(code,{one:1,two:2,result:result}); console.log(result); // spits out 3 Notice that we created a variable result in our sandbox context, so that the code in code could set it. I used it in cansecurity's declarative authorization, where you can set an expression to be evaluated and the output will only pass if the result is true. https://github.com/deitch/cansecurity look at https://github.com/deitch/cansecurity/blob/master/lib/declarative.js#L96 In that case, I actually take the result. For example, my code might be var str = "user.id === req.user || user.role === 'admin'"; var authorized = vm.runInNewContext(str,{user:{id:"10",name:"John"},user:{role:"member",id:"10"}, req:{user:"20"}}); console.log(authorized); // spits out false, because user.id !== req.user, and user.role !== "admin"
has comment: http://stackoverflow.com/comment/43238380
has comment: http://stackoverflow.com/comment/43238789
upvote count: 7
answers question: http://stackoverflow.com/q/27394399
has comment: http://stackoverflow.com/comment/43239772
type: Answer
has comment: http://stackoverflow.com/comment/43236456

http://stackoverflow.com/q/27473953
has body: I know there is this repository for binding an event handler as first to be executed. I would like to achieve the same with pure JavaScript, but I read here that it ain't possible to check for the event-listeners being attached to an element. If so, is there another way to do this (preferably cross-browser down to IE9)? My usecase for this is to execute a event-handler before another one which I can't control as it is added by a JavaScript-framework. There might be better work-arounds for my specific case, but I would like to know, if there is a general solution to this problem.
type: Question
duplicate of: http://stackoverflow.com/q/5143817
has title: Change order of event-handler-execution with pure JavaScript
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27474196
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5143817

http://stackoverflow.com/comment/43205542
type: QuestionComment
has text: $timeout does not support .flush. Check your console log for errors. It is supported in ngMock - is that what you are using?
score: 0
comment on: http://stackoverflow.com/q/27377688
type: Comment

http://stackoverflow.com/comment/43271661
has text: You should change the question to include only the HTML response.
type: Comment
comment on: http://stackoverflow.com/q/27413602
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43177345
has text: Yes, I just realized I accidentally checked that box when it came up. Now I don't know where to undo it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27362556

http://stackoverflow.com/a/27461218
accepted answer of: http://stackoverflow.com/q/27461083
answers question: http://stackoverflow.com/q/27461083
has comment: http://stackoverflow.com/comment/43359311
type: Answer
downvote count: 0
score: 1
has body: To make a div that stays above all the others you can use the following code: body {position: relative;} .infront { position: absolute; height: 100%; width: 100%; background: rgba(0,0,0,0.5); z-index: 999; } As css, and the following html code after the opening &lt;body&gt;-tag: &lt;div class="infront"&gt;&lt;!-- your content --&gt;&lt;/div&gt; My guess is, that your nav bar stays white, because you have nested the overlaying loading box somehow in your content area, or positioned your nav bar with position: absolute which makes it stay in front of the other divs. To avoid this I have added z-index: 999; which creates kind of a depth of field and lets the div with the higher z-index stay above the others. If you need more precise help it's always helpful to post the code snippets you are using as well! For further information feel free to ask. Best regards, Marian.
has comment: http://stackoverflow.com/comment/43359877
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/43146554
score: 0
comment on: http://stackoverflow.com/a/27345107
type: AnswerComment
type: Comment
has text: please check your html is not a messy one. seems like your html is not well structured.

http://stackoverflow.com/comment/43360650
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27461924
has text: Thanks, but no. It wouldn't match partial strings like AB123 that I want to match too.
type: AnswerComment

http://stackoverflow.com/comment/43172633
type: QuestionComment
has text: It is frustrating when someone votes to close a question without an explanation or constructive criticism.
comment on: http://stackoverflow.com/q/27359591
score: 0
type: Comment

http://stackoverflow.com/comment/43231769
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27392074
type: Comment
has text: Yes, I know, @Eyal. I recommend == for beginners so they don't get confused. Because == always works, === only works for equals.

http://stackoverflow.com/a/27325902
type: Answer
has body: Using the following, I can't see that you need any special handling for different types. You can just read the value property: Get values You may want to check that checkboxes and radios are checked. For that, getting the value can be: if (input.type in {radio:'', checkbox:''}) { if (input.checked) { // get value } } else { // get value }
score: 0
answers question: http://stackoverflow.com/q/27316562

jquery-plugins
tags question: http://stackoverflow.com/q/27470961
tags question: http://stackoverflow.com/q/27399208
type: Tag
tags question: http://stackoverflow.com/q/27354403
tags question: http://stackoverflow.com/q/27457427
tag name: jquery-plugins
tags question: http://stackoverflow.com/q/27446934
tags question: http://stackoverflow.com/q/27459205
tags question: http://stackoverflow.com/q/27388402
tags question: http://stackoverflow.com/q/27434803

http://stackoverflow.com/comment/43373415
type: Comment
has text: Then your other option is to use deferred objects. When a `.done()` promise is passed, run functions that rely on `newHeight`. See the link in my answer.
comment on: http://stackoverflow.com/a/27468911
score: 0
type: AnswerComment

http://stackoverflow.com/a/27364566
has body: There are a few ways to solve this. One is to add a helper like: Template.myTemplate.helpers({ genreNames: function() { var genres = Genres.find({_id: {$in: this.genre}}).fetch(); var names = _.pluck(genres, 'name'); return names.join(', '); } }); And modify your template to look like this: {{#each authors}} &lt;p&gt; Author: {{name}} &lt;/p&gt; &lt;p&gt; Genres: {{genreNames}} &lt;/p&gt; {{/each}} The helper works because it runs inside of the #each so it's context is an author. Alternatively, you can add a transform to your collection or use collection-helpers. That way, you can add a virtual property to all author instances, so you can do things like: Authors.findOne().genreNames().
answers question: http://stackoverflow.com/q/27361522
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43182449
type: Answer
accepted answer of: http://stackoverflow.com/q/27361522
has comment: http://stackoverflow.com/comment/43182012
upvote count: 1
score: 1

http://stackoverflow.com/comment/43236602
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27387535
has text: I don't know if [this SO Post](http://stackoverflow.com/questions/14329691/covert-latitude-longitude-point-to-a-pixels-x-y-on-mercator-projection) will help, but the math behind the Spherical Mercator projection (which the assumption of a spherical geoid), as used on Google Maps, is actually quite straight forward. Over large areas, things that have straight edges on maps, are curved in the real world, but for small areas this shouldn't be a problem. You can use basic trig to actually rotate objects, if you know what your axis of orientation is, naturally.

http://stackoverflow.com/q/27337564
has title: I am attempting to select the correct radio button based on available information in an electronic medical record
has body: Here is my script: The relevant parts of the rest of the code are: This code refers to several tables (oscarDB) to pull the values - I wish to use this information to select the appropriate category for the individual. OSCAR is an opensource emr www.oscarcanada.org Name: DOB: Age: Step 1 Estimate Basal Metabolic Rate ♂ 18-30 =(0.063XActual Wt Kg+2.8957)X240Kcal/d ♂ 31-60 =(0.0484XActual Wt Kg+3.6534)X240Kcal/d ♀ 18-30 =(0.0621XActual Wt Kg+2.0357)X240Kcal/d ♀ 31-60 =(0.0342XActual Wt Kg+3.5377)X240Kcal/d
downvote count: 1
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43136124
has comment: http://stackoverflow.com/comment/43131812
upvote count: 0
has answer: http://stackoverflow.com/a/27340426
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43275115
comment on: http://stackoverflow.com/q/27414823
has text: Yes, you're creating an endless loop in the sense that you are calling/referencing the function in itself. Also, there is no need to rebijd key events for every iteration.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27347626
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27347762
upvote count: 1
tagged with: css
tagged with: text
has title: How to add text to different parts of chart made from css, html, and javascript?
accepted answer: http://stackoverflow.com/a/27347762
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27348069
has answer: http://stackoverflow.com/a/27348069
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
has body: I'd like to add text to three different parts of the below row chart: http://codepen.io/chriscruz/pen/ByjZdp A number at the beginning of where the orange begins a percentage right before the organge ends A number at the end of the entire bar where the gray ends. Something like this: HTML: 50 CSS: .progress { width: 100%; height: 50px; } .progress-wrap { background: #f80; margin: 20px 0; overflow: hidden; position: relative; .progress-bar-state { background: #ddd; left: 0; position: absolute; top: 0; } } Javascript: // on page load... moveProgressBar(); // on browser resize... $(window).resize(function() { moveProgressBar(); }); // SIGNATURE PROGRESS function moveProgressBar() { console.log("moveProgressBar"); var getPercent = ($('.progress-wrap').data('progress-percent') / 100); var getProgressWrapWidth = $('.progress-wrap').width(); var progressTotal = getPercent * getProgressWrapWidth; var animationLength = 2500; // on page load, animate percentage bar to data percentage length // .stop() used to prevent animation queueing $('.progress-bar-state').stop().animate({ left: progressTotal }, animationLength); } I've tried to just insert the numbers after, but I can't seem to make the numbers relative to the position of 'progress-wrap' or 'progress.' See my attempt here: http://codepen.io/chriscruz/pen/MYKoBq

http://stackoverflow.com/q/27375445
tagged with: javascript
score: 0
tagged with: binding
answer count: 1
has title: WinJS Binding globalization
has body: I Need your help. I've started a Web-App using WinJS and WinJS.Binding. Everything works fine except when displaying decimals. Decimals are always be shown in the US Format (e.g. 1,000.23) but I need those displayed in the Format for the current region (e.g. in Germany it should Display 1.000,23). So I tried to use a WinJS.Binding.converter but the problem is, that I already use a two way binding initializer and when I try to use the initializer and the convert it raise an error: WinJS.Binding.ParseError: Invalid binding:'value: dataSource.aDechimalValue Binding.Mode.twoWay Converters.dec'. Expected to be ':;'. Unexpected token: semicolon, expected token: colon, at offset 67 Here the HTML how I set data-win-bind: &lt;input id="aDecimalInput" type="number" data-win-bind="value: dataSource.aDechimalValue Binding.Mode.twoWay Converters.dec" /&gt; So here's my question: How can I display decimal values - or later also Dates - in the Format of the current region? Best regards, Mike
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27504700
type: Question
tagged with: winjs

list
type: Tag
tags question: http://stackoverflow.com/q/27463859
tag name: list
tags question: http://stackoverflow.com/q/27415178

http://stackoverflow.com/q/27359817
has title: Access file locally?
tagged with: javascript
type: Question
tagged with: public-key-encryption
has comment: http://stackoverflow.com/comment/43171806
score: 0
has body: I create a online system (HTML+Javascript+PHP) where users can encrypt and decrypt messages, using opengpg.js. I don't want to store the private key on the server. Do you know if it's possible in any way to store data on the local machine? So that the HTML page can access the file and get the key? About 15 people will use the site, so I can myself configure the clients if it's needed. For example - but this doesn't work: HTML Page (on Internet): Local file (key.js) key = "the-private-key";
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27359988

http://stackoverflow.com/a/27347549
has comment: http://stackoverflow.com/comment/43150516
has body: your question is a little confusing as you say document.getElementById(this.exportbtn6.id).style.visibility="visible"; works fine but this code shows the div, not hides it, and why cannot the same code be used to hide if you use it to show? then your other snippet that supposedly works: jQuery('.expbtn, #this.exportbtn6.id').css('visibility',"visible"); cannot work because #this.exportbtn6.id will not resolve to the variable's content inside the double quotes, so i am pretty sure this line will not do anything. The way to do this correctly is jQuery('#' + this.exportbtn6.id + '.expbtn').hide(); but i cannot tell for sure as the question is not clear. If my understanding of your question is correct, the above line will do the trick. Keep in mind that the value of "this" will differ based on context, so it maybe that you are referencing the wrong "this".
score: 0
has comment: http://stackoverflow.com/comment/43150038
has comment: http://stackoverflow.com/comment/43150878
answers question: http://stackoverflow.com/q/27347175
type: Answer
has comment: http://stackoverflow.com/comment/43151086
has comment: http://stackoverflow.com/comment/43150325

http://stackoverflow.com/a/27360685
type: Answer
answers question: http://stackoverflow.com/q/27359654
has body: I think you are confusing the use of JS and PHP - they are not equivalent in a html page. Your {{ render(controller('communauterBundle:notificationIv:nb_invitation')) }} is not going to "refresh" itself just because you make an ajax call to the controller. If you really want this to refresh then maybe something like index.html &lt;div id="alert"&gt;&lt;/div&gt; controller return JsonResponse(array('message' =&gt; $message )) i'm not familiar with jQuery ajax syntax but basically you make a GET ajax and replace the html value in your div#alert with whatever your ajax returns. Something like (correct me for syntax) script.js $.ajax({ url: "{{path('nb_invitation')}}",//even though you can use js routing in symfony, much cleaner }).done(function(response) { $.getElementById('alert').html(response.message) }); I know syntax is not exact but that would be the idea
score: 0

http://stackoverflow.com/comment/101163923
has text: Related: https://stackoverflow.com/questions/38947554 and https://stackoverflow.com/questions/1533568
comment on: http://stackoverflow.com/q/27417938
score: 0
type: Comment
type: QuestionComment

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/27366522

http://stackoverflow.com/q/27369804
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27371433
answer count: 1
has title: Getting TypeError: undefined is not a function AngularJS
has comment: http://stackoverflow.com/comment/43191522
favorite count: 0
has comment: http://stackoverflow.com/comment/43191422
tagged with: angularjs
upvote count: 2
downvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43191807
has answer: http://stackoverflow.com/a/27371433
type: Question
has comment: http://stackoverflow.com/comment/43191477
tagged with: javascript
has body: on my site, i currently have a modal that is opened. when the user clicks on the button to close the modal, it calls: $scope.hideModal = function(modalId) { angular.element(modalId).hide(); DatabaseService.updateDB(); }; DatabaseService is a seperate .js class that contains methods to make read/changes to the database var _updateDashboardInterstitialPromoDbService = function(){ //code to update the database } When I run my site, the modal closes successfully, but i see an error in my console: TypeError: undefined is not a function at h.$scope.hideModal How do I resolve this typeerror to successfully call the function to update my database? Here's my ModalCtrl.js 'use strict'; var DashboardCtrl = [ '$scope', 'DashboardInterstitialPromoService', function ($scope, DashboardInterstitialPromoService) { $scope.hideModal = function(modalId) { angular.element(modalId).hide(); DatabaseService.updateDB(); }; ]; Here's my DatabaseService.js: 'use strict'; var databaseService = angular.module('database.service', ['ngResource']); databaseService.factory('DatabaseService', [ function() { var _updateDB = function(){ //stuff to update db }; return {updateDB: _updateDB}; }]);

http://stackoverflow.com/q/27419253
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43312220
tagged with: watir
has title: Ruby with Watir: Handling javascript popup window
score: 0
tagged with: popupwindow
has answer: http://stackoverflow.com/a/27435662
tagged with: ruby
has body: I have a problem with watir and javascript popup window here's my test script require 'watir' browser = Watir::Browser.start "/url/" browser.link(:text, /Add New Blog/).wait_until_present browser.link(:text, /Add New Blog/).click // Here is where the javascript window popup window = browser.ie.Document.ParentWindow browser.window(:title, /Blog/) do browser.text_field(:id, /text title of Blog/).set 'Watir' browser.select_list(:id, /dropdownlist type/).select ("News") browser.button(:value, /Save/).click end The problem is after window popup shows, it's unable to locate the element of the text_field in window Blog. I also have try this but it says that => in 'window': wrong number of arguments (2 for 1) (ArgumentError) browser.window(:title =&gt; "annoying popup").use do browser.button(:id =&gt; "close").click end Any solution? and btw Im using ruby 1.9.3. Appreciate your help.TQ
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/27450003
has title: How to extract object values from localstorage to each row in JavaScript
score: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: local-storage
accepted answer: http://stackoverflow.com/a/27451494
type: Question
has body: I want to loop through my locally stored objects(JSON.stringify) and then print them out to each row(html). Each row takes one object and prints the values to each column in that row. I don't know if this helps but there it is it might help you have a better understanding of what i'm trying to explain. var table2 = document.getElementById('table'); for(var l = 0; l &lt; localStorage.getItem("Rows"); l += 1) { var tableinLoadRow = document.getElementById('table').insertRow(l); for(var t = 0; t &lt; 9; t += 1) { var tableinLoadCell = tableinLoadRow.insertCell(t); } for(x in localStorage) { var obj = JSON.parse(localStorage.getItem(x)); for(i in obj) { if(i === "ModelMake") { table2.rows[l].cells[0].innerHTML = obj[i]; } } } } I can't put the whole code application's code because it's more than 200 lines i don't think anybody would want to go through all of that.
has answer: http://stackoverflow.com/a/27451494
answer count: 2
possible better answer: http://stackoverflow.com/a/27450530
tagged with: javascript
has answer: http://stackoverflow.com/a/27450530

http://stackoverflow.com/comment/43162570
type: AnswerComment
has text: Hi, thanks for your code. I chose the @thefourtheye question because it have a interesting explication. May you see again my question? I edited it with more details... (because your solutions doesn't work with my code :S)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27353765

http://stackoverflow.com/a/27337430
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27337364
has body: Provided that you have set up ng-app, here's the reason: in Angular 1.3+ you can't define controllers like that anymore. You need the whole thing: app.controller(.... It all comes down to how you create controllers. Luckily the fix is the way you should be writing your controllers (though you can opt into the old behavior). When I’ve taught AngularJS in the past, I’ve created controllers using global functions as that makes the story simple. Usually when I’ve taught it before, I’m trying to help people understand the concepts, not the best practices. Starting with AngularJS 1.3, this isn’t the default behavior. Read more about it here: http://wildermuth.com/2014/11/11/Angular_1_3_and_Breaking_Change_for_Controllers
type: Answer
upvote count: 1

http://stackoverflow.com/q/27440477
answer count: 1
tagged with: parsing
has answer: http://stackoverflow.com/a/27484617
tagged with: viewmodel
has title: Javascript JSON Parsing from ViewModel in MVC "Unexpected Token &"
tagged with: model-view-controller
type: AnsweredQuestion
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/43320840
score: 0
accepted answer: http://stackoverflow.com/a/27484617
has body: There are a lot of questions hanging around on this of which I've already tried all the answers I can find. I am brand new to Javascript/JSON and I cannot for the life of me figure out what is going wrong here. So, in my controller I have this: var mapVM = new MapVM(); var vehicleVM = Mapper.Map&lt;List&lt;Vehicle&gt;, List&lt;VehicleVM&gt;&gt;(vehicles).ToList()); //Automapper here ^ var jsonVehicleVM = JsonConvert.SerializeObject(vehicleVM); mapVM.Vehicles = jsonVehicleVM; //At this point mapVM.Vehicles is perfect JSON and displays in Visual Studio in JSON View return View(mapVM); In the view, I have this: var jsonString = @Model.Vehicles; var vehicles = JSON.parse(jsonString); But it looks like: var jsonString = [{&amp;quot;ShortReg&amp;quot;:&amp;quot;*Android Phone&amp;quot;,&amp;quot;Reg&amp;quot;:&amp;quot;*Android - Kate (Galaxy S3)&amp;quot;,&amp;quot;LatestLoca.......... ETC Now, I'm guessing it's throwing a fit because of those &quot; bits in there. I've tried the whole .replace() thing, didn't work. I am frustrated because I'd rather be able to run a loop in javascript on the items than having to write @: for every new line of C# code I'm looping through if I want it to output to the page.

http://stackoverflow.com/comment/43171171
has text: Since you're talking about using the same chart, you may be looking for the [composite chart](https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#composite-chart). You mention the second axis this would be [compositeChart.rightY](https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#rightyyscale) and various other methods with "right" in them.
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/27337026
type: Comment

http://stackoverflow.com/comment/43127159
comment on: http://stackoverflow.com/a/27334403
has text: Thanks for your answer, but timed loop or any kind of polling will exhaust the server if there are a lot of users who comment on the same post
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43270181
has text: It opens multiple tabs? Um it only opens one for me in Chrome. I tested it on 2 different PC's
comment on: http://stackoverflow.com/q/27412608
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27474569
has comment: http://stackoverflow.com/comment/43385401
tagged with: ruby
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43383690
has body: Here's a piece of code (based on an example at W3Schools) that uses Javascript to update a page on a regular basis: Timer test The time now is Is there an equivalent in pure Ruby/Rails that would update the "timeNow" span element on a regular schedule?
upvote count: 1
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/43383460
type: Question
has answer: http://stackoverflow.com/a/27474610
accepted answer: http://stackoverflow.com/a/27474610
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has title: Rails equivalent of setInterval?

http://stackoverflow.com/q/27362589
tagged with: getter-setter
has comment: http://stackoverflow.com/comment/43180160
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: How to define a constructor function that makes objects with getters and setters?
has answer: http://stackoverflow.com/a/40481499
tagged with: object
has body: I'm working on creating an object definition to encapsulate several properties. I have 4 requirements for this object: more than one instance can be created at any time only properties defined on the object can be set/get the object must be stringify-able (just the properties and associated values) the stringified version must be parse-able and return the object This is a simplified version of what I have so far: function Car() { var _make; Object.defineProperty(this, 'make', { get: function() { return _make; }, set: function(make) { _make = make; } }); Object.preventExtensions(this); } I'm unsure if this is the simplest approach for defining an object with getters and setters. Is there an alternative to using Object.defineProperty, or is this the new norm? This approach also requires me to write my own stringify method (see below) since calling JSON.stringify will strip off functions, and this will strip off make. Is there an alternative to writing my own? Can I change my object definition somehow? Car.prototype.stringify = function () { return JSON.stringify({ make: this.make}); } Additionally, I must supply an optional constructor arg to be able to instantiate a Car from a JSON object: function Car(car) { var _make; if(car !== undefined &amp;&amp; car != null) { _make = car.make; } ... } Again, is this the best approach to meet all the requirements?
score: 2
has comment: http://stackoverflow.com/comment/43180228
tagged with: definition
type: Question
has comment: http://stackoverflow.com/comment/43180794
has comment: http://stackoverflow.com/comment/43180735
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: defineproperty
has comment: http://stackoverflow.com/comment/43180009
has comment: http://stackoverflow.com/comment/43177424
has comment: http://stackoverflow.com/comment/43177296

http://stackoverflow.com/comment/43248613
comment on: http://stackoverflow.com/a/27401812
score: 0
type: Comment
has text: Thanks a lot for the explanation with the example. I'm asking to understand this more clearly. Can I use this to generate an ad block ? Can I use this code to provide the publisher to something like this ?
type: AnswerComment

http://stackoverflow.com/comment/43268657
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27409997
has text: How can I initiate my application in html tag and let the maximum portion of code possible in the external javascript file?

http://stackoverflow.com/comment/43302891
type: QuestionComment
comment on: http://stackoverflow.com/q/27428457
type: Comment
has text: Well, I'll be! Looks like it applies to all HTML tags as well. Thanks, you've taught me something new. I would caution you that not all browsers are standards-compliant, but as long as you have stronger server-side validation, you should be good.
score: 1

http://stackoverflow.com/comment/43123344
has text: And please don't link to w3schools. While the fixed many of their problems over the time, they are still full of flaws and inaccuracies.
type: AnswerComment
comment on: http://stackoverflow.com/a/27332966
type: Comment
score: 0

http://stackoverflow.com/q/27388252
tagged with: angularjs
linked to: http://stackoverflow.com/q/1510165
has body: I have to add a PayPal donate button to the middle of an AngularJS donation form, so nesting the PayPal generated form tags within the donation form tags. The donation form is processed by an old version (1.12) of jQuery Validate, so no access to the .rules() functions. I found a way past the validation requirements with this answer (commented out code below), but the problem is the submitHandler takes an argument of 'form' which is always the parent form element (the full donation form). Ideally, I'd like to disable jQuery validate all together once PayPal is selected. Here is the function I call when the user chooses 'credit card' vs 'PayPal' and it is correctly going into the else when PayPal is selected. $scope.payByCreditCard= function(cc_true) { if(cc_true){ $scope.creditCardDetails = true; $scope.submit_text = "Submit Donation"; $scope.method_type = "donate"; } else { $scope.creditCardDetails = false; $scope.submit_text = "Continue Donation on Paypal"; $scope.method_type = "startDonation"; // var settings = $('#donationForm').validate().settings; // delete settings.rules; // $("*").removeClass("required"); } }; And the jQuery Validate calls with submit handler: $('#donationForm').validate({ rules: { otherDonationAmount: { money: true, required : true } }, errorPlacement : function(error, element) { if (element.attr('id') == 'donationAmount') { error.insertAfter(element.parent()); } else { error.insertAfter(element); } }, submitHandler: function(form) { $('#donation-errors').remove(); window.scrollTo(0, 0); $("#donationForm").hide(); $("#donationForm").before('&lt;div class="well donation-loading" style="text-align:center;"&gt;' + This may take a few seconds. Do not leave the page or click the back button.' + '&lt;/div&gt;'); } }); What's happening is I disable the validation, but then when I click the PayPal donate button, the submitHandler function is triggered and it tries to process the whole donation form, rather than following what's in the PayPal genera…
tagged with: paypal
has title: Dynamically remove submitHandler from jQuery Validate to allow normal PayPal 'donate' button action
type: AnsweredQuestion
tagged with: jquery-validate
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27389297
accepted answer: http://stackoverflow.com/a/27389297

http://stackoverflow.com/comment/43516133
has text: if there is no solution then is there is any other charts like morris are availabe to put above json data on bar chart?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27455597

d3.js
tags question: http://stackoverflow.com/q/27325096
tags question: http://stackoverflow.com/q/27405493
tags question: http://stackoverflow.com/q/27350813
tags question: http://stackoverflow.com/q/27416253
tags question: http://stackoverflow.com/q/27437077
tags question: http://stackoverflow.com/q/27344688
tags question: http://stackoverflow.com/q/27369426
tags question: http://stackoverflow.com/q/27426692
tags question: http://stackoverflow.com/q/27462576
tags question: http://stackoverflow.com/q/27473163
tags question: http://stackoverflow.com/q/27332249
tags question: http://stackoverflow.com/q/27430389
tags question: http://stackoverflow.com/q/27372550
tags question: http://stackoverflow.com/q/27460094
tags question: http://stackoverflow.com/q/27383179
tags question: http://stackoverflow.com/q/27430226
tags question: http://stackoverflow.com/q/27322817
tags question: http://stackoverflow.com/q/27424386
tags question: http://stackoverflow.com/q/27343402
tags question: http://stackoverflow.com/q/27412113
tags question: http://stackoverflow.com/q/27348554
tags question: http://stackoverflow.com/q/27417516
tags question: http://stackoverflow.com/q/27390460
tags question: http://stackoverflow.com/q/27463520
tags question: http://stackoverflow.com/q/27328180
tags question: http://stackoverflow.com/q/27342821
tags question: http://stackoverflow.com/q/27317086
tags question: http://stackoverflow.com/q/27470907
tags question: http://stackoverflow.com/q/27407415
tags question: http://stackoverflow.com/q/27417768
tags question: http://stackoverflow.com/q/27360506
tags question: http://stackoverflow.com/q/27419045
tags question: http://stackoverflow.com/q/27421404
tags question: http://stackoverflow.com/q/27429632
type: Tag
tags question: http://stackoverflow.com/q/27353018
tags question: http://stackoverflow.com/q/27424036
tags question: http://stackoverflow.com/q/27334753
tags question: http://stackoverflow.com/q/27401386
tags question: http://stackoverflow.com/q/27457695
tags question: http://stackoverflow.com/q/27465378
tags question: http://stackoverflow.com/q/27345856
tags question: http://stackoverflow.com/q/27472547
tags question: http://stackoverflow.com/q/27460534
tags question: http://stackoverflow.com/q/27469675
tags question: http://stackoverflow.com/q/27326827
tags question: http://stackoverflow.com/q/27373771
tags question: http://stackoverflow.com/q/27432515
tags question: http://stackoverflow.com/q/27319099
tags question: http://stackoverflow.com/q/27403744
tags question: http://stackoverflow.com/q/27349841
tags question: http://stackoverflow.com/q/27424226
tags question: http://stackoverflow.com/q/27446655
tags question: http://stackoverflow.com/q/27337359
tags question: http://stackoverflow.com/q/27336550
tags question: http://stackoverflow.com/q/27314557
tags question: http://stackoverflow.com/q/27420887
tags question: http://stackoverflow.com/q/27449360
tags question: http://stackoverflow.com/q/27411919
tags question: http://stackoverflow.com/q/27452531
tags question: http://stackoverflow.com/q/27473364
tags question: http://stackoverflow.com/q/27411506
tags question: http://stackoverflow.com/q/27377190
tag name: d3.js
tags question: http://stackoverflow.com/q/27389091
tags question: http://stackoverflow.com/q/27424992
tags question: http://stackoverflow.com/q/27347798
tags question: http://stackoverflow.com/q/27409977
tags question: http://stackoverflow.com/q/27414485
tags question: http://stackoverflow.com/q/27468066
tags question: http://stackoverflow.com/q/27417345
tags question: http://stackoverflow.com/q/27396688
tags question: http://stackoverflow.com/q/27387104
tags question: http://stackoverflow.com/q/27429362
tags question: http://stackoverflow.com/q/27337026
tags question: http://stackoverflow.com/q/27319304
tags question: http://stackoverflow.com/q/27362470
tags question: http://stackoverflow.com/q/27315634
tags question: http://stackoverflow.com/q/27346327
tags question: http://stackoverflow.com/q/27322849

http://stackoverflow.com/a/27411813
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43294797
accepted answer of: http://stackoverflow.com/q/27411662
score: 1
has comment: http://stackoverflow.com/comment/43296378
answers question: http://stackoverflow.com/q/27411662
has body: You could do it with a CSS pseudo class. (I've added in opacity just as part of the demo): Home Page
has comment: http://stackoverflow.com/comment/43269005

http://stackoverflow.com/comment/43413778
has text: @StodgyWaif your original code lists the images already - `foreach ($imgs as $img){ echo " "; }`. That bit will replace the ` ` elements in @ramirio's HTML section.
type: AnswerComment
comment on: http://stackoverflow.com/a/27465176
score: 0
type: Comment

autocomplete
tags question: http://stackoverflow.com/q/27385539
tags question: http://stackoverflow.com/q/27466871
tags question: http://stackoverflow.com/q/27453722
type: Tag
tags question: http://stackoverflow.com/q/27332786
tags question: http://stackoverflow.com/q/27433471
tags question: http://stackoverflow.com/q/27437748
tags question: http://stackoverflow.com/q/27416594
tags question: http://stackoverflow.com/q/27368004
tags question: http://stackoverflow.com/q/27341248
tags question: http://stackoverflow.com/q/27426210
tag name: autocomplete
tags question: http://stackoverflow.com/q/27329894
tags question: http://stackoverflow.com/q/27342428
tags question: http://stackoverflow.com/q/27377568
tags question: http://stackoverflow.com/q/27357489
tags question: http://stackoverflow.com/q/27351927
tags question: http://stackoverflow.com/q/27393649
tags question: http://stackoverflow.com/q/27406216

http://stackoverflow.com/q/27371965
type: Question
tagged with: javascript
has body: So i'm using tinymce4 with RoxyFileBrowser in laravel php framework with this configuration {{ HTML::script('js/tinymce/tinymce.min.js') }} &lt;script type="text/javascript"&gt; tinymce.init({ selector: "textarea", theme: "modern", skin: 'light', plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor colorpicker textpattern" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons | fontselect fontsizeselect", image_advtab: true, templates: [ {title: 'Test template 1', content: 'Test 1'}, {title: 'Test template 2', content: 'Test 2'} ], file_browser_callback: RoxyFileBrowser }); function RoxyFileBrowser(field_name, url, type, win) { var roxyFileman = '{{ asset('js/tinymce/plugins/fileman/index.html?integration=tinymce4') }}'; if (roxyFileman.indexOf("?") &lt; 0) { roxyFileman += "?type=" + type; } else { roxyFileman += "&amp;type=" + type; } roxyFileman += '&amp;input=' + field_name + '&amp;value=' + document.getElementById(field_name).value; tinyMCE.activeEditor.windowManager.open({ file: roxyFileman, title: 'File Manager', width: 800, height: 480, resizable: "yes", plugins: "media", inline: "yes", close_previous: "no" }, { window: win, input: field_name }); return false; } &lt;/script&gt; and there is some weird issue about using filemanager to put images, in tinymce4 you click the insert image button and then click folder with magnifying glass icon beside source textbox to call roxyfilebrowser and then select the images and it will return image path to source textbox Things got weird from here, for example, in my source textbox there image path is /js/tinymce/plugins/fileman/Uploads/Images/20…
tagged with: roxy-fileman
upvote count: 3
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Laravel + tinymce4 + RoxyFileBrowser
tagged with: php
tagged with: laravel
score: 3
downvote count: 0
tagged with: tinymce-4

http://stackoverflow.com/a/27430575
score: 2
answers question: http://stackoverflow.com/q/27430432
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27430432
type: AcceptedAnswer
downvote count: 0
has body: I think that I'm not understanding completely to you. Maybe this the next link can help you. You have some errors, check the solution. $(document).ready(function(){ var $span = $('span'); function min() { var number = parseInt($span.html()); return number - 30; } function add() { var number = parseInt($span.html()); return number + 31; } $("#container").click(function(){ $('span').text(min()); checkTime(); }); $("#box").click(function(){ $('span').text(add()); checkTime(); }); function checkTime() { debugger var time = parseInt($span.html()); if (time &lt;= 0) { alert("AAAAA"); }; } }); Please next time publish your problem in JSfiddle or similar.
type: Answer

http://stackoverflow.com/q/27470290
type: Question
has body: I have a confirmation dialog that's made using JavaScript library, I want to make it appear when the user tries to delete a row from gridview. The thing with this library is that it doesn't use confirm function in JavaScript instead it shows a custom popup, once the user clicks Yes it executes a call back function, once the user clicks No it executes another call back function. When using this library with server side event, the server side event doesn't wait for the confirmation as it's not the javascript confirm function, so how do I make the server side code wait from a result of the call back in my JS alert if yes or no? I am new to development in general so thanks for any ideas.
tagged with: javascript
score: 0
answer count: 1
tagged with: asp.net
has answer: http://stackoverflow.com/a/27470312
type: UnansweredQuestion
has title: ASP.NET & Javascript confirmation dialog

http://stackoverflow.com/comment/43168620
comment on: http://stackoverflow.com/q/27356447
type: Comment
type: QuestionComment
has text: I tried and and installed a new app with "jquery.mobile.theme-1.4.3.min.css" file in assets folder. Result was same, no css design.
score: 0

http://stackoverflow.com/a/27455273
has body: Hi I am not sure I understand the question. By default they will have an order they are added in. It's no issue to get the correct index in a loop. foreach($_POST["texts"] as $index =&gt; $text){ $db -&gt; insert("table", $text, $index) } Why can't you simply do the index like this Your data will be like this by default array( 0 =&gt; 'some_text', 1 =&gt; 'some_text', 2 =&gt; 'some_other_text', 3 =&gt; 'some_text' Your loop will generate this $index = 0; $text = 'some_text'; //----------------- $index = 1; $text = 'some_text'; //----------------- $index = 2; $text = 'some_other_text'; //----------------- $index = 3; $text = 'some_text'; //----------------- Maybe I'm missing something but seems pretty straight forward to use the numbered index in the foreach loop. UPDATE after talking in the comments I would do something like this ( have not tested this code ) Javascript: var index = 0; function addFile(){ var input=document.createElement("input"); input.type="file"; input.name="inp_file_" + index; form.appendChild(input); ++index; } function addText(){ var input=document.createElement("input"); input.type="text"; input.name="inp_text_" + index; form.appendChild(input); ++index; } In PHP side: //merge $_POST and $_FILES ~ //I don't feel like sorting that out as it should be easy to do for you, also you may //be doing other things with the $_FILES array, but what you want is something like this // for the input array. // one last note as I saw you said you tried merging the $_FILES into the $_POST array, it's generally a bad practice to modify the $_POST array, and is better to create a new array with the data you want. $input = array( 'inp_text_0' =&gt; 'some_text', 'inp_text_2' =&gt; 'some_other_text', 'inp_file_1' =&gt; 'filepath.txt' ); foreach ($input as $key =&gt; $value ){ if( preg_match('/^inp_(?P&lt;type&gt;text|file)_(?P&lt;index&gt;[0-9]+)$/', $key, $match) ){ $db -&gt; insert("table", $value, $match['index'], $match['type']); } } For the Regx (?P&lt;name&g…
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43349641
has comment: http://stackoverflow.com/comment/43348329
has comment: http://stackoverflow.com/comment/43348428
has comment: http://stackoverflow.com/comment/43349577
has comment: http://stackoverflow.com/comment/43349842
has comment: http://stackoverflow.com/comment/43348841
answers question: http://stackoverflow.com/q/27455157
has comment: http://stackoverflow.com/comment/43348440
has comment: http://stackoverflow.com/comment/43348353
has comment: http://stackoverflow.com/comment/43348498

http://stackoverflow.com/a/27407502
type: Answer
has body: It appears that only the first element in the array is actually being converted into a jQuery object in your code. Here's what's happening: vanilla-JS .map passes three arguments to the specified callback function: the current element, the index, and the array. If the callback function takes only one argument, the second and third are ignored. However, jQuery's $ actually allows two arguments: a selector, and a context (container element). So your code is passing (as the second argument) the array index as a context, resulting in an empty jQuery object -- except for the first element in itemsHiddenToFocusTribute, which has index 0 which is interpreted as no context at all. You can fix this with an anonymous function that only passes the selector string to $: function hideItemsWithIDs(ids) { ids.map(function (i) { return $(i); }).forEach(hideItem); } http://jsfiddle.net/mblase75/e23qgad5/ However, a more jQuery-friendly way would be to create a single jQuery object of all the desired elements and loop through them using .each: function hideItem(i,item) { return $(item).hide(); } function hideItemsWithIDs(ids) { $(ids.join()).each(hideItem); } http://jsfiddle.net/mblase75/mm2L4xn1/ This is probably more efficient, too, since you're calling $ just once instead of array.length times.
score: 2
has comment: http://stackoverflow.com/comment/43262277
downvote count: 0
has comment: http://stackoverflow.com/comment/43259742
has comment: http://stackoverflow.com/comment/43261959
has comment: http://stackoverflow.com/comment/43260160
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43260114
accepted answer of: http://stackoverflow.com/q/27407205
answers question: http://stackoverflow.com/q/27407205

http://stackoverflow.com/comment/43094150
type: QuestionComment
comment on: http://stackoverflow.com/q/27316888
score: 0
has text: here is the source code of the script: http://nopaste.info/ca0c118591.html
type: Comment

http://stackoverflow.com/comment/43095832
score: 0
has text: And where do you define `vehicleId` ??? If you have posted all relevant code, i guess your issue would have been fixed in seconds
comment on: http://stackoverflow.com/q/27318094
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43345742
type: Comment
comment on: http://stackoverflow.com/a/27453406
has text: on hover the css of other image is not changing ie display:none to display:block
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43425707
comment on: http://stackoverflow.com/a/27437820
has text: This seems to be most relevant... I downloaded the library and it seems to at least be outputting something on all browsers now... However, the output is a long number string (1420005600000). Not really sure where this is coming from. Any thoughts?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27453406
answers question: http://stackoverflow.com/q/27453379
has comment: http://stackoverflow.com/comment/43345634
accepted answer of: http://stackoverflow.com/q/27453379
has comment: http://stackoverflow.com/comment/43345773
has comment: http://stackoverflow.com/comment/43345642
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/43345807
type: Answer
has comment: http://stackoverflow.com/comment/43345742
has body: See output below use after() function to insert after that particular item see Documentation $(document).ready(function() { $("img").each(function() { if($(this).prop('height')&gt;100 &amp;&amp; $(this).prop('width')&gt;100) { $(this).addClass( "myClass" ); $(this).after('&lt;img src="https://cdn3.iconfinder.com/data/icons/iconic-1/32/share-128.png" /&gt;'); } $('.myClass').hover(function(){ $(this).next().show(); },function(){ $(this).next().hide(); }); }); }); .myclass:hover{ opacity: 0.7; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="check"&gt; &lt;img src='http://media-cdn.tripadvisor.com/media/photo-s/05/e4/f7/89/little-venice.jpg'&gt; &lt;img src='http://media-cdn.tripadvisor.com/media/photo-s/05/e4/f7/89/little-venice.jpg'&gt; &lt;img src='http://media-cdn.tripadvisor.com/media/photo-s/05/e4/f7/89/little-venice.jpg'&gt; &lt;/div&gt;

http://stackoverflow.com/q/27322113
tagged with: javascript
type: Question
score: 0
answer count: 1
has title: In jqgrid, how can I load data by condition?
tagged with: jquery
has answer: http://stackoverflow.com/a/27429942
has body: $("#list").jqGrid({ url: "assets/PHP/userManager/user-read.php", datatype: "json", mtype: "GET", colNames: ["UserId", u, "User_Group_Id"], colModel: [ { name: "UserId", hidden: true }, { name: "UserName", width: 270, align: 'center', stype: 'text' }, { name: "User_Group_Id", hidden: true} ], height: "87%", pager: "#pager", rowNum: 30, sortname: "UserId", sortorder: "asc", viewrecords: true, gridview: true, autoencode: true, multiselect: true, caption: "User List" }); $(".ui-jqgrid-titlebar").hide(); $("#pager_right").hide(); $("#pager_center").width(220); $(".ui-pg-input").height(13); $("#list").navGrid( "#pager", { search: true, add: false, edit: false, del: false, refresh:true, searchoptions: {left: '30%'} }); $("#search_list").click(function(){ $("#searchmodfbox_list").css( "left", "30%" ); }); This is the jqgrid I'm using in my code, and I create some buttons. I need a method or event from jqgrid that I can click the button and call that method, then it will load data with all data contain a pattern. For example, I have a button called "student", when I click that it will filter all the data which the role field is student, so the grid will show me all the students.
accepted answer: http://stackoverflow.com/a/27429942
type: AnsweredQuestion
tagged with: jqgrid

http://stackoverflow.com/a/35790513
has comment: http://stackoverflow.com/comment/111556981
has comment: http://stackoverflow.com/comment/111555236
answers question: http://stackoverflow.com/q/27358966
score: 46
upvote count: 46
has comment: http://stackoverflow.com/comment/98245201
has body: In case you are in control of the server that sends the content of the iframe, you can set the setting for X-Frame-Options in your web server. Configuring Apache To send the X-Frame-Options header for all pages, add this to your site's configuration: Header always append X-Frame-Options SAMEORIGIN Configuring nginx To configure nginx to send the X-Frame-Options header, add this either to your http, server or location configuration: add_header X-Frame-Options SAMEORIGIN; No configuration This header option is optional, so if the option is not set at all, you will give the option to configure this to the next instance (e.g., the visitors browser or a proxy) Source: X-Frame-Options
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/80637507

http://stackoverflow.com/comment/43244979
type: AnswerComment
type: Comment
has text: Thank you very much. It is very much appreciated. May you please briefly explain to me where my problem was in my previous code? Once again, thank you so much for your assistance.
comment on: http://stackoverflow.com/a/27399588
score: 0

http://stackoverflow.com/comment/43367848
has text: What do `routes/index` and `routes/users` return?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27465850
score: 0

http://stackoverflow.com/a/27321581
has comment: http://stackoverflow.com/comment/43172387
has comment: http://stackoverflow.com/comment/43108181
has body: Just change audio.controls = true; See http://jsfiddle.net/bhaxt194/
upvote count: 0
answers question: http://stackoverflow.com/q/27320852
has comment: http://stackoverflow.com/comment/43102913
type: Answer
has comment: http://stackoverflow.com/comment/43106089
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/43108092

http://stackoverflow.com/a/27444211
has comment: http://stackoverflow.com/comment/43327519
answers question: http://stackoverflow.com/q/27443978
has body: Start by decoding the image which is base64-encoded using either a custom function or an external library. You can then write a suitable string replace method to apply to the decoded svg file. But one question remains: what have you tried?
type: Answer
score: 0

http://stackoverflow.com/comment/43178061
type: AnswerComment
comment on: http://stackoverflow.com/a/27362592
score: 0
type: Comment
has text: I think the `*`is a red herring. Perhaps it's being added in the console. Try this: `data[0]._data.DisplayName`

http://stackoverflow.com/comment/43216868
has text: `.getScript ()` is async by default
comment on: http://stackoverflow.com/a/27384022
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43241245
score: 0
type: Comment
has text: Thanks for checking the perfs. I will indeed use an object by adding a letter to the UID returned, so there is no confusion between a stringified int and a int.
comment on: http://stackoverflow.com/a/27378845
type: AnswerComment

http://stackoverflow.com/q/27426662
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27428656
has comment: http://stackoverflow.com/comment/43298016
has body: I'm trying to automatically scroll the contents of my page whenever a new item is added to a list. At first, I tried using afterAdd in the foreach binding, since it seemed to be what I was looking for. So I did something like this: Here is a fiddle with the code If you try that, you will notice what to me is some very weird behavior. For every call, knockout seems to be recreating the whole template from scratch again. So in the first 'add', one element is added. On the second add, the first and second are added again, and so on. I could not make that work no matter what I tried, but this version using afterRender worked: The difference is that instead of getting the element directly, I'm getting an array of all DOM elements. You can test the behavior in the fiddle too. If you keep adding items, when the screen reaches the bottom, it will start to scroll to the newly added element. Why can't I use afterAdd for this? What exactly is happening there with the crazy behavior?
type: UnansweredQuestion
has title: Foreach binding with 'afterAdd' causes the whole template to draw again on insertions
downvote count: 0
score: 1
tagged with: knockout.js
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43298245

http://stackoverflow.com/comment/43371115
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27467746
type: Comment
has text: 1. Put break point in chrome debugger in line **if (data === "0") {** and check what it does.

http://stackoverflow.com/comment/43344339
has text: Is it something to do with calling the setCurrentUser from a different controller? Its mentioned in this tutorial: https://medium.com/opinionated-angularjs/techniques-for-authentication-in-angularjs-applications-7bbf0346acec But iv followed it
comment on: http://stackoverflow.com/a/27451745
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27372048
accepted answer of: http://stackoverflow.com/q/27371257
answers question: http://stackoverflow.com/q/27371257
upvote count: 1
score: 1
has body: There is no specific method for capturing browser Close Event. You can only capture on unload of the current page. Which also works when you try to refresh or reload the page.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/27326141
type: Answer
has body: An alternative that doesn't rely on knowing classnames in the HTML is to get the information from the editing plugin. var fields = grid.findPlugin('rowediting').editor.form.getFields(); var total = 0; for (var i=0, n=fields.getCount(); i&lt;n; i++) { var qty = parseFloat( fields.getAt(i).getValue() ); total += isNaN(qty) ? 0 : qty; }
has comment: http://stackoverflow.com/comment/43121519
score: 0
answers question: http://stackoverflow.com/q/27325399

http://stackoverflow.com/q/27345839
upvote count: 18
linked to: http://stackoverflow.com/q/8974375
has answer: http://stackoverflow.com/a/27345933
type: AnsweredQuestion
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27345933
type: Question
has answer: http://stackoverflow.com/a/61288288
tagged with: encryption
possible better answer: http://stackoverflow.com/a/62434520
score: 18
has title: Node.js encrypts large file using AES
has answer: http://stackoverflow.com/a/62434520
tagged with: node.js
answer count: 3
linked to: http://stackoverflow.com/q/60369148
has body: I try to use following code to encrypt a file of 1 GB. But Node.js abort with "FATAL ERROR: JS Allocation failed - process out of memory". How can I deal with it? var fs = require('fs'); var crypto = require('crypto'); var key = "14189dc35ae35e75ff31d7502e245cd9bc7803838fbfd5c773cdcd79b8a28bbd"; var cipher = crypto.createCipher('aes-256-cbc', key); var file_cipher = ""; var f = fs.ReadStream("test.txt"); f.on('data', function(d) { file_cipher = file_cipher + cipher.update(d, 'utf8', 'hex'); }); f.on('end', function() { file_cipher = file_cipher + cipher.final('hex'); });
tagged with: javascript

http://stackoverflow.com/a/27461972
has body: You can first use $.extend method to copy properties, and then you need iterate through properties and create dynamic setters. For example like in below code: var source = { a: 'a', b: 'b' }; var result = $.extend({}, source); Object.keys(source).forEach(function(key) { result['_set' + key[0].toUpperCase() + key.slice(1)] = function(value) { alert(this.key); this[key] = value; } }); Check the working demo below. var source = { a: 'a', b: 'b', test: 'test' }; var result = $.extend({}, source); Object.keys(source).forEach(function(key) { result['_set' + key[0].toUpperCase() + key.slice(1)] = function(value) { this[key] = value; } }); alert([ result.a, result.test ]); result._setA('a1'); result._setTest('test1'); alert([ result.a, result.test ]); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27461905
answers question: http://stackoverflow.com/q/27461905
type: Answer
has comment: http://stackoverflow.com/comment/43360203

http://stackoverflow.com/q/27359276
has answer: http://stackoverflow.com/a/27359480
has body: Is there any way to save HTML Form schema to JSON? E.g. when I have something like this &lt;form&gt; First name:&lt;br&gt; &lt;input type="text" name="firstname"&gt; &lt;br&gt; Last name:&lt;br&gt; &lt;input type="text" name="lastname"&gt; &lt;/form&gt; How i can achieve somehting like this: [ { field: 'input', type: 'text', name: 'firstname' }, { field: 'input', type: 'text', name: 'lastname' }, ] I dont mean that it has to be exact output as above, but how I can achieve something similar?
type: Question
accepted answer: http://stackoverflow.com/a/27359480
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/12905849
tagged with: http://stackoverflow.com/tag/html
has title: Save HTML form schema to JSON
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/5508871
tagged with: forms

http://stackoverflow.com/comment/43220783
has text: @meagar I used the first snippet, not the second.
type: Comment
comment on: http://stackoverflow.com/a/27385487
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43199357
type: AnswerComment
type: Comment
has text: updated to allow any type of URL; using a scheme, without a scheme and also cid urls
comment on: http://stackoverflow.com/a/27374349
score: 0

http://stackoverflow.com/q/27428647
tagged with: jquery
has comment: http://stackoverflow.com/comment/46797103
favorite count: 0
duplicate of: http://stackoverflow.com/q/203198
tagged with: http://stackoverflow.com/tag/html
has body: I hope not repeat the topic, I don't find a post about it... I'm developing a webapp for FirefoxOS. I have a issue where I want to show more items when I click a button, and a item from those new items (another link) would be able to be click too and do what we want (call console in the example). I have two tags in HTML: One // if you click in this "one" link, you will see some text in console.log. Two // if you click in this "two" link, you will charge on UI some new text and buttons. Then, in JS file I have: $('one').click(function(){ console.log("one"); }); function showItemsFromDB(element){ document.getElementById('show_text').innerHTML += " "+ " "+ "Number: "+ element.key+ " Frecuency: " + element.value.frecuency + " "+ "ONE"+ " "; } $('two').click(function() { showItemsFromDB(element); }); If I click in the first link , I could see in console.log the text "one". OK!! When I click the second one , in the UI I can see the new items (text about the key number and frecuency and a link). If I click in this new link (which is a copy of ), it doesn't do anything...why?? Thanks in advance
answer count: 0
has comment: http://stackoverflow.com/comment/43298702
type: UnansweredQuestion
tagged with: firefox-os
upvote count: 1
has title: I can't click the buttons which I've charged in a innerHTML call
downvote count: 1
has comment: http://stackoverflow.com/comment/43298734
type: Question
score: 0
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/43298710
tagged with: javascript

http://stackoverflow.com/comment/43197343
comment on: http://stackoverflow.com/a/27373357
type: AnswerComment
score: 0
has text: interesting, this is the exact same answer as the other ones.
type: Comment

http://stackoverflow.com/q/27431445
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/27435260
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
type: UnansweredQuestion
has body: Simple function to get and load data from server: function getdata(stepNumber){ return $.get("./api/data_count.php", {stepNumber: stepNumber}) .fail(function (textStatus, errorThrown){ console.error("Error ! Unable to get step " + number + " count." + "Error: " + errorThrown + ", Status: " + textStatus); }); } Using .done differed method to assign data to knockout observable: getdata(1).done(function(data){ self.dataCount($.parseJSON(data)); }); through following html: &lt;td&gt;&lt;span data-bind = "text: dataCount"&gt;&lt;/span&gt;&lt;/td&gt; All is working well with the code except that it takes around 15 seconds for query to return this count and I am not sure how to display a loading image or message with in following span while the response is awaited. &lt;span data-bind = "text: dataCount"&gt;&lt;/span&gt;
has title: Display loading image in get method with knockout bindings

http://stackoverflow.com/comment/43203131
comment on: http://stackoverflow.com/q/27376525
score: 0
type: Comment
type: QuestionComment
has text: Please write pseudo code, step by step of what you expect it to do.

http://stackoverflow.com/q/27363727
has comment: http://stackoverflow.com/comment/43181719
tagged with: jquery
has comment: http://stackoverflow.com/comment/43199214
favorite count: 0
has title: How to optimize jQuery event handlers for speed
has comment: http://stackoverflow.com/comment/43288110
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43179367
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27364987
has body: I'm trying to speed up the javascript execution in our app. It looks like I've 900+ event listeners bound - var listenerCount = 0; var ael = Node.prototype.addEventListener; Node.prototype.addEventListener = function() { listenerCount++; ael.apply(this, arguments); } And I understand that this will be effecting performance. Is it possible to speed things up by adjusting the way I register listeners? For example if I try and register on events on the same element (with different selectors), will that be more efficient. Eg changing $('#sidebar').find('select').on('click', 'option', handler1); $('#sidebar').find('.className').on('click', 'a', handler2); for $('#sidebar').on('click', 'select option', handler1); $('#sidebar').on('click', '.className a', handler2); Generally speaking I'm interested in the time it takes to register everything rather than the time it to actually run the handler (and I'm aware that different selectors perform differently). I'd probably swap an extra 10-50ms when the event is actually fired for 1-5ms reduction in registering the event - I want the app to load fast! I was thinking of writing something that will do the selector matching so as to reduce the number of events actually registered, but I can't find anyone else doing anything similar (which makes me think it's probably dumb) - var sideBarDomEvents = (function(){ var clickEvents = [], my = { init: function() { $sidebar = $('#sidebar'); $sidebar.on('click', function(e){ for (var i=0; i &lt; clickEvents.length; i++) { if (clickEvents[i]['target'] == $(e.target) { clickEvents[i]['handler'](e); } } }); }, registerClickEvent: function($target, handler){ // This only works if the target is the inner most element - bubbling isn't supported! clickEvents.push({'target':$target, 'handler': handler}); } } return my; })(); I'm really not sure which way to go here - I don't even know where to measure this stuff (I certainly haven't noticed anything in Chrome's profile or timeline that relates). An…
type: Question
tagged with: performance
score: -2
tagged with: javascript
linked to: http://stackoverflow.com/q/12824549
has comment: http://stackoverflow.com/comment/43179392
answer count: 1
tagged with: events

http://stackoverflow.com/comment/43324039
comment on: http://stackoverflow.com/q/27442008
score: 0
type: QuestionComment
has text: Careful, none of your iframe elements has "blocktext" for ID (only class name for your last 'p' tag)... 'a' is therefore yet undefined.
type: Comment

http://stackoverflow.com/comment/43383396
type: AnswerComment
has text: @baoo Thanks, One more question: supposing I have several images inside that cell (2) and I want only to delete the one with `href="remove"`, How to do it? As I understand it is deleting all contents inside cell... But how to be more specific and delete only image?
type: Comment
comment on: http://stackoverflow.com/a/27474358
score: 0

http://stackoverflow.com/q/27459368
has comment: http://stackoverflow.com/comment/43423801
accepted answer: http://stackoverflow.com/a/27469059
type: Question
has comment: http://stackoverflow.com/comment/43355678
tagged with: javascript
has answer: http://stackoverflow.com/a/27469059
tagged with: shopify
answer count: 1
has comment: http://stackoverflow.com/comment/43369356
has title: How to make Slider AutoPlay in atlantic theme of shopify?
favorite count: 0
has comment: http://stackoverflow.com/comment/43355651
downvote count: 5
type: AnsweredQuestion
upvote count: 0
score: -5
has body: The below code is for Slider in site.js.. SlideshowView = (function(_super) { __extends(SlideshowView, _super); function SlideshowView() { return SlideshowView.__super__.constructor.apply(this, arguments); } SlideshowView.prototype.el = $('.slideshow'); SlideshowView.prototype.initialize = function() { var _this = this; this.slideshow = $('.slideshow'); this.slides = this.slideshow.find('.slide'); this.jumpLinksWrap = $('.jump-to-slide'); this.setup(); return Window.resize(function() { return _this.slideshow.css({ height: _this.slides.filter('.active').height() }); }); }; SlideshowView.prototype.events = { 'click .next': 'rotate', 'click .prev': 'rotate', 'click .jump-to-slide li:not(.active)': 'rotate' }; SlideshowView.prototype.setup = function() { var i, _fn, _i, _len, _ref, _slide, _this = this; this.slides.first().addClass('first'); this.slides.last().addClass('last'); _ref = this.slides; _fn = function() { var slide; slide = _slide; if (Settings.slideshowPagination &amp;&amp; _this.slides.length &gt; 0) { _this.jumpLinksWrap.append($('&lt;li&gt;')); } if (i === 0) { slide = $(slide); return slide.imagesLoaded(function() { return slide.fadeTo('200', 1, function() { var height; height = slide.height(); slide.css('z-index', 2000).addClass('active'); return slide.parent().css('height', height); }); }); } }; for (i = _i = 0, _len = _ref.length; _i &lt; _len; i = ++_i) { _slide = _ref[i]; _fn(); } this.jumpLinks = this.jumpLinksWrap.find('li'); this.jumpLinksWrap.find('li:first').addClass('active'); if (this.slides.length === 1) { return this.slideshow.find('.next, .prev, .jump-to-slide').remove(); } }; SlideshowView.prototype.rotate = function(e) { var currentJumpLink, currentSlide, currentSlidePosition, direction, fadeSpeed, isFirst, isLast, jumpLinks, jumpLinksWrap, jumpPosition, upcomingJumpLink, upcomingSlide, upcomingSlidePosition, _i, _len, _ref, _this = this; direction = ($(e.currentTarget)).attr('class'); currentSlide = this.$el.find('.slide.active'); curre…

http://stackoverflow.com/q/27413644
has title: Import keywords into ace editor highlighter in webpy server (python)
has answer: http://stackoverflow.com/a/27516511
has comment: http://stackoverflow.com/comment/43461898
score: 0
tagged with: syntax-highlighting
type: Question
has comment: http://stackoverflow.com/comment/43570062
tagged with: javascript
answer count: 1
tagged with: ace-editor
type: UnansweredQuestion
has body: I am using the Javascript Ace text editor and need to load keywords into the (DynHighlightRules) to provide highlighting of the imported keywords. I have highlights working from static keywords in the editor.getSession().setMode("ace/mode/highlightRules") , but I need to import new rules after the editor is rendered. I found a great solution which works perfectly in an Apache server but not in the Web.py python server. I believe this is due to the template page not being at the root level of the server. Has anyone deployed the Ace editor in Webpy and solved this issue?
tagged with: python
has comment: http://stackoverflow.com/comment/43315845
tagged with: web.py

http://stackoverflow.com/comment/43149463
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27347227
has text: What exactly is your question?

http://stackoverflow.com/a/27401986
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43249192
has comment: http://stackoverflow.com/comment/43249564
downvote count: 1
has comment: http://stackoverflow.com/comment/43248861
has comment: http://stackoverflow.com/comment/43249277
has comment: http://stackoverflow.com/comment/43249689
has comment: http://stackoverflow.com/comment/43249738
score: 0
has body: Use this. aspx: Create a hidden field to store the value. &lt;input type="hidden" id="txtHidden" runat="server" /&gt; javascript code: function GetSex() { var sex = EIDAWebComponent.GetSex(); alert(sex); if(sex == 'M') document.getElementById("txtHidden").value= "Male"; else if(sex == 'F') document.getElementById("txtHidden").value = "Female"; else if(sex == 'X') document.getElementById("txtHidden").value = "Unknown"; else document.getElementById("txtHidden").value = "none"; } Call from ASP.NET code: ScriptManager.RegisterStartupScript((Page)(HttpContext.Current.Handler), typeof(Page), "GetSex", "GetSex();", true); String value = txtHidden.Value;
has comment: http://stackoverflow.com/comment/43249016
answers question: http://stackoverflow.com/q/27401809
has comment: http://stackoverflow.com/comment/43249599

http://stackoverflow.com/a/27350322
type: Answer
has comment: http://stackoverflow.com/comment/43155095
accepted answer of: http://stackoverflow.com/q/27350270
downvote count: 1
answers question: http://stackoverflow.com/q/27350270
score: -1
has comment: http://stackoverflow.com/comment/43155112
upvote count: 0
type: AcceptedAnswer
has body: The function parseWord(data) never gets called. If you want parseWord(data) to run if the ajax request is successful, you have to do something like this: $.ajax({ url: apiURL, type: "GET", dataType: 'json', success: function parseWord(data) { $('#syno').text(data.noun.ant); } }); I would suggest you take a look at the documentation on this

http://stackoverflow.com/a/27396719
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27395605
has body: I appointed three points, all three in the middle of the screen (x: 0.5). The reason for three points is that the rest of the page continues to paint the nearest point's color and it will be gradient if you assign two. I put the first two points near each other so that the gradient effect wont show: linearGradient: { x1: 0.5, y1: 0.5, x2: 0.5, y2: 0.51, x3: 0.5, y3: 1 }, stops: [[0, 'rgb(255, 255, 255)'], [1, 'rgb(200, 200, 255)'], [2, 'rgb(200, 200, 255)']] Here's the fiddle: http://jsfiddle.net/4rTBY/625/
answers question: http://stackoverflow.com/q/27395605
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27474592
answers question: http://stackoverflow.com/q/27474546
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27474546
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43491566
has body: whatNeed will always contain the initial value when called outside of your callback as the console.log will be called first since the value event handler is asynchronous.

http://stackoverflow.com/comment/43108578
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27324716
has text: It would help if you'd post exactly what's in the string.

http://stackoverflow.com/comment/43154998
comment on: http://stackoverflow.com/q/27349813
type: Comment
type: QuestionComment
score: 0
has text: If you are doing it like the other example you provided then you will need to clone the image being hovered and then set the clone to `position: absolute;` and then set `top` and `left` to its current top, left position in relation to the parent container. Alternatively you could lay it out differently with css so that it is already position absolutely.

http://stackoverflow.com/a/27318103
score: 1
has comment: http://stackoverflow.com/comment/43096556
answers question: http://stackoverflow.com/q/27318062
has comment: http://stackoverflow.com/comment/43097040
upvote count: 1
has comment: http://stackoverflow.com/comment/43095734
has comment: http://stackoverflow.com/comment/43096772
has body: You can do it this way supposing arr is the input result = []; // array arr.forEach(function(o) { // go through elements for (var i = 0; i &lt; o.frames.length; i++) { // make a since we need to get two objs per element var obj = {}; // an object which will be over written for every iteration obj[o.id] = o.frames[i]; // set property name and value result.push(obj); // finally push it in the array } });
downvote count: 0
has comment: http://stackoverflow.com/comment/43096244
has comment: http://stackoverflow.com/comment/43096143
has comment: http://stackoverflow.com/comment/43095624
type: Answer

http://stackoverflow.com/q/27420524
type: AnsweredQuestion
upvote count: 0
has body: I've spent several hours trying to change the zoom level of a google map, using an onClick javascript function. I think my var map is inside the initialize function of the map, that's why it doesn't work, but I'm not sure. Thank you for your precious help. Here we go: 1) My initialize function (with galeries corresponding to the data retrieved for the markers) function initialize() { var styles = [ { stylers: [ { hue: "#486FD5" }, { saturation: 10 }, { lightness: 20 }, { gamma: 1.1 } ] },{ featureType: "road", elementType: "geometry", stylers: [ { lightness: 40 }, { visibility: "simplified" } ] },{ featureType: "road", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; var mapOptions = { zoom: 6, center: new google.maps.LatLng(46.8,1.7), mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: false, scrollwheel: false, styles: styles } var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); setMarkers(map, galeries); } function setMarkers(map, locations) { var image = '/wordpress/wp-content/uploads/logo-25.png'; for (var i = 0; i &lt; locations.length; i++) { var galeries = locations[i]; var myLatLng = new google.maps.LatLng(galeries[1], galeries[2]); var infoWindow = new google.maps.InfoWindow(); var marker = new google.maps.Marker({ position: myLatLng, map: map, icon: image }); (function(i) { google.maps.event.addListener(marker, "click", function() { var galeries = locations[i]; infoWindow.close(); infoWindow.setContent( "&lt;div id='boxcontent'&gt;&lt;a href='"+galeries[3]+"'&gt;&lt;strong style='color:black'&gt;"+ galeries[0] +"&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;"+ galeries[4] +"&lt;/div&gt;" ); infoWindow.open(map, this); }); })(i); } } google.maps.event.addDomListener(window, 'load', initialize); 2) My function called with onClick (all comments corresponding to KO solutions): function zoom() { //map_canvas.setCenter(marker.getPosition()); //map.setZoom(map.getZoom() + 1); //map.setZoom('3'); //$('#map_canvas').gmap(…
type: Question
has title: Addressing a google map to change setZoom by clicking on an external link
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/27425307
accepted answer: http://stackoverflow.com/a/27425307
answer count: 1
downvote count: 1
favorite count: 0

http://stackoverflow.com/a/27315643
upvote count: 0
has body: Create unique class value for each button created so you can reference it in jquery. On your example, both are defined with 'send'. You can add another class value inside class attibute for both buttons and set a unique value like: &lt;button class ="send button_1" type="submit"&gt;SEND&lt;button&gt; &lt;button class ="send button_2" type="submit"&gt;SEND&lt;button&gt; Aditionally, you can use unique id to jquery take specific actions.
score: -1
answers question: http://stackoverflow.com/q/27315482
downvote count: 1
type: Answer

http://stackoverflow.com/comment/43449667
comment on: http://stackoverflow.com/q/27406427
score: 0
has text: Due to recent new requirements to the project, the coding problem is now different; A JSP if-else-statement should no longer be used. Instead, the solution should be pure Javascript. Thank you for putting effort into this.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43161985
type: QuestionComment
comment on: http://stackoverflow.com/q/27350110
type: Comment
has text: you need to include the response headers at the server as well. i.e the server should also respond with the correct headers. CORS should be enabled both on the client as well as the server.
score: 1

http://stackoverflow.com/comment/43114927
score: 0
type: Comment
has text: `[{"unit_id":"13","unit_title":"Testsdsdf","unit_max_occupancy":"3","unit_no":"1","unit_no_adults":"1","unit_no_children":"1","unit_no_extrabed":0,"unit_mealtype":"Half Board","unit_fullboard_adult":"6000.00","unit_fullboard_child":"4000.00","unit_halfboard_adult":"1800.00","unit_halfboard_child":"1200.00","room_total":"81600.00","all_room_price":"81600.00","extra_bed_price":"4.00","meal_price":6600,"saving_amount":16320,"discounted_bedroom_price":65280},`
type: AnswerComment
comment on: http://stackoverflow.com/a/27324434

http://stackoverflow.com/comment/43252854
comment on: http://stackoverflow.com/a/27403734
type: AnswerComment
has text: It does look a little intimidating at first but once you add the proper scripts all that needs to be done is add the appropriate tags to your HMTL element. If you'd like, I could give you an example of how I use it later this afternoon once I have access to my code that I have.
type: Comment
score: 1

http://stackoverflow.com/q/27404713
type: Question
tagged with: jsonp
accepted answer: http://stackoverflow.com/a/27542590
answer count: 1
tagged with: javascript
score: -1
has body: I was wondering if somebody could give me some guidance. I am trying to get blockchain.info server answers me back with the current block number and the hash of it but honestly I have no idea how to do it. I wanted to do it using html &amp; javascript and I was reading that I have to use JSONP or CORS for it to work but I still don't have an idea of how to make it work. If you could help me out I would really appreciate it.
tagged with: bitcoin
has answer: http://stackoverflow.com/a/27542590
downvote count: 1
favorite count: 0
upvote count: 0
tagged with: blockchain
type: AnsweredQuestion
has title: How can I fetch some block explorer data from blockchain.info?

http://stackoverflow.com/a/27407743
answers question: http://stackoverflow.com/q/27407449
accepted answer of: http://stackoverflow.com/q/27407449
score: 0
type: AcceptedAnswer
has body: Try using this instead of Number.isNaN(): typeof(midday) === 'number' isNaN() doesn't check if the var is a number, it checks if the var can be converted to a number who isn't a NaN, so, if you ended up with a scenario like this: isNaN('') You would get that '' is not a NaN, breaking your code... More about: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN
type: Answer

http://stackoverflow.com/q/27438258
duplicate of: http://stackoverflow.com/q/151850
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/27438316
linked to: http://stackoverflow.com/q/8108184
favorite count: 0
accepted answer: http://stackoverflow.com/a/27438316
possible better answer: http://stackoverflow.com/a/27438326
has title: Is there a reason to not assign a variable in the while block declaration?
has comment: http://stackoverflow.com/comment/43320718
has answer: http://stackoverflow.com/a/27438326
tagged with: node.js
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/43318360
has comment: http://stackoverflow.com/comment/43317991
type: Question
linked to: http://stackoverflow.com/q/151850
has comment: http://stackoverflow.com/comment/43320736
tagged with: javascript
has comment: http://stackoverflow.com/comment/43317875
has comment: http://stackoverflow.com/comment/43323535
has body: Whenever I do something like this... var obj; while (obj = doSomething()) { // something with obj } JSHint tells me warning 84| Expected a conditional expression and instead saw an assignment.. However, doing obj = doSomething() returns the value that doSomething() returns during assignment, so it makes sense to write a while loop in this fashion. Is there a specific reason that JSHint warns me, and more importantly, are there reasons to not do this? Or can I tell JSHint to ignore those lines for that specific warning?

http://stackoverflow.com/comment/43210584
has text: Check out the answers here http://bit.ly/1yytAuw
comment on: http://stackoverflow.com/q/27379627
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27352377
has comment: http://stackoverflow.com/comment/43585190
upvote count: 1
has comment: http://stackoverflow.com/comment/43159736
tagged with: sockets
has comment: http://stackoverflow.com/comment/43160177
tagged with: node.js
favorite count: 0
downvote count: 0
type: UnansweredQuestion
tagged with: tcp
has comment: http://stackoverflow.com/comment/43159669
has comment: http://stackoverflow.com/comment/43159630
tagged with: sails.js
has comment: http://stackoverflow.com/comment/43160581
has answer: http://stackoverflow.com/a/47533423
score: 1
has title: How to create a TCP server using Sails.js?
type: Question
has comment: http://stackoverflow.com/comment/43159576
has comment: http://stackoverflow.com/comment/43174963
answer count: 1
has comment: http://stackoverflow.com/comment/43159874
tagged with: javascript
has body: So I'm using Sails.js, and when I run sails lift it works properly in serving the website. However, how can I create a TCP server that also runs when I sails lift and constantly listens for raw TCP messages from clients? I have found this simple TCP server example for Node.js (which obviously will work for Sails): var net = require('net'); var server = net.createServer(function(socket) { socket.write('Echo server\r\n'); socket.pipe(socket); }); server.listen(1337, '127.0.0.1'); How can I integrate this into Sails? Do I need to modify the app.js file (which is what I presume gets run when sails lift is entered)? Any ideas?

http://stackoverflow.com/comment/43293374
comment on: http://stackoverflow.com/q/27425528
score: 0
type: Comment
type: QuestionComment
has text: If i set visibility to hidden or display to none it hides the table header as well. The header is the whole purpose of the hidden div. i leave the header visible to produce a table with a header that never moves.

http://stackoverflow.com/comment/43089347
comment on: http://stackoverflow.com/q/27314435
has text: its the entire div "test"
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27353301
has body: Use e.currentTarget in jquery $("#parent").not($('.kids')).click(function(e) { console.log(e.currentTarget); });
upvote count: 1
has comment: http://stackoverflow.com/comment/43160095
answers question: http://stackoverflow.com/q/27353225
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/111556981
type: AnswerComment
has text: For Apache add the options inside the <directive> tag for your website, most probably a config file inside /etc/apache2/sites-enabled/
type: Comment
comment on: http://stackoverflow.com/a/35790513
score: 0

http://stackoverflow.com/q/27465754
has answer: http://stackoverflow.com/a/27465928
favorite count: 0
type: UnansweredQuestion
score: -4
has body: I am trying to slide up and remove a div from within a parent but i am having a hard time figuring this out. Here is my code if someone can help please? var c = a.next(".a").nextSibling(".fav_added"); c.length &amp;&amp; c.slideUp(11200, function() { $(this).remove() }) i have added .nextSibling but this has not worked. i only want to remove and slideup .fav_added from within .a
has comment: http://stackoverflow.com/comment/43367630
type: Question
downvote count: 4
upvote count: 0
tagged with: javascript
tagged with: jquery
has title: slideup function and remove child element from parent div
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css

http://stackoverflow.com/comment/43159133
type: Comment
comment on: http://stackoverflow.com/q/27352590
type: QuestionComment
has text: Very basic: `$http.get("/users").success(function(data) { $scope.users=data; });` The users data is in json with key value pairs for first_name and last_name among others.
score: 0

http://stackoverflow.com/q/27392087
has comment: http://stackoverflow.com/comment/43232053
tagged with: regex
score: 4
has comment: http://stackoverflow.com/comment/43231864
has answer: http://stackoverflow.com/a/27392289
has comment: http://stackoverflow.com/comment/43231939
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43231935
has comment: http://stackoverflow.com/comment/43231970
type: Question
upvote count: 4
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27392289
favorite count: 0
has title: How to strip obfuscated email headers
has comment: http://stackoverflow.com/comment/43231763
has body: I'm trying to write a regex spam filter that will block subjects like these: Subject: ..B..R..E_G-U E_T..___W..A..T..C..H-E S -_A T-___C H_E-A..P___P R-I_C E! . -G_U..C..C_I..-..W_A_T C-H E_S---..A..T __C-H..E A P_--..P_R..I C..E ..C_H..O_P..A_R D---W-A T-C_H E S -- A_T.._-C..H-E A P_--P..R..I C_E! I was able to come up with: w([^a-zA-Z0-9]){1,3}a([^a-zA-Z0-9]){1,3}t([^a-zA-Z0-9]){1,3}c([^a-zA-Z0-9]){1,3}h([^a-zA-Z0-9]){1,3}e([^a-zA-Z0-9]){1,3}s([^a-zA-Z0-9]){1,6} to trap the standard variations on "watches", though I doubt that it will catch them if they start spelling with Unicode. Not to mention that it is not only non-elegant, it's so ugly my cat tried to bury it! What is a better way? It looks like Mozilla is using Javascript formatted regex -- http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

http://stackoverflow.com/a/27378845
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27376166
has comment: http://stackoverflow.com/comment/43241245
type: Answer
has body: Answering the question Using Heap profiling tools in chrome, giving an array a huge size for little content does not seems to cause problems or a peak in heap allocation. That's confirmed here as "Sparse Arrays vs. Full Arrays", and confirmed with this jsperf. In substance : sparse arrays are slow, but not expected to be slower than objects properties. Anyway, i'd suggest you use objects as it's more intuitive : Answering your particular case Best way would be to use an object (javascript equivalent to an "associative array") as pointed out in comment. There is many ways to do it but to keep the syntax you used as much as possible, i'd do it like this : var finishFunctions = {}; finishfunctions [transferUid.toString()] = function(){/*callbacks*/} And then your callback : filetransfersfinished(uid){ finishfunctions[uid.toString()](); } Note: With this method, you could use any convenient format for your uid, not just numbers. If it's of any value for you.
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/27376166

http://stackoverflow.com/comment/43206248
type: QuestionComment
has text: This is all wrong. *(Hint: In the face of a JavaScript block that nests 9 levels of curly braces it's generally a pretty safe bet to say that it's all wrong.)* You are in need of a promise library that handles all those asynchronous calls for you. The attempt you make here can never work.
comment on: http://stackoverflow.com/q/27377614
score: 0
type: Comment

http://stackoverflow.com/comment/43319452
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27439720
type: AnswerComment
has text: I've seen the method with AJAX to call Python, but I don't really understand how to dynamically change my page's elements from my Python.

http://stackoverflow.com/comment/43090730
comment on: http://stackoverflow.com/a/27315240
score: 0
type: AnswerComment
type: Comment
has text: where are the data come from? user input, or originally from server?

http://stackoverflow.com/q/27375928
upvote count: 1
has answer: http://stackoverflow.com/a/27376075
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43204330
has body: I am using the following function to use content and it seems to work fine in the fiddle but when i put it in my wordpress theme it doesn't work: Here is the link to my page and i am trying to put the goggle in the information icon on the right hand side jQuery: jQuery(document).ready(function($){ $('#toggle-view li').click(function () { var text = $(this).children('div.panel'); if (text.is(':hidden')) { text.slideDown('200'); $(this).children('span').html('-'); } else { text.slideUp('200'); $(this).children('span').html('+'); } }); });
has comment: http://stackoverflow.com/comment/43202736
has comment: http://stackoverflow.com/comment/43201840
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43201751
has comment: http://stackoverflow.com/comment/43202918
score: 0
has comment: http://stackoverflow.com/comment/43201741
answer count: 1
has comment: http://stackoverflow.com/comment/43201724
has comment: http://stackoverflow.com/comment/43203201
favorite count: 0
type: UnansweredQuestion
has title: Can't get toggle with jQuery to work in wordpress
has comment: http://stackoverflow.com/comment/43202381
has comment: http://stackoverflow.com/comment/43202057
has comment: http://stackoverflow.com/comment/43201853
has comment: http://stackoverflow.com/comment/43201871
tagged with: wordpress

http://stackoverflow.com/a/31420081
has body: To Use task dependencies, you should rewrite this: gulp.task('dev', [ 'build-dev' ], function() { return gulp.run([ 'connect' ]); }); to this: gulp.task('dev', [ 'build-dev', 'connect' ]);
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27358371
score: -3
has comment: http://stackoverflow.com/comment/52357316
downvote count: 3

http://stackoverflow.com/q/27453441
has comment: http://stackoverflow.com/comment/43345168
possible better answer: http://stackoverflow.com/a/27453720
has answer: http://stackoverflow.com/a/27453720
type: AnsweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/27453480
has body: What I'm looking to do is not write JavaScript in the source of the website. But use an addon/extension to type JavaScript in a browser console and see the results in the browser. Kind of like JSFiddle, but for your own sites.
type: Question
has comment: http://stackoverflow.com/comment/43345192
score: -2
answer count: 2
tagged with: firefox-addon
upvote count: 0
accepted answer: http://stackoverflow.com/a/27453480
tagged with: javascript
favorite count: 0
has title: Is there a Firefox addon to test JavaScript in browser?

http://stackoverflow.com/a/27401671
answers question: http://stackoverflow.com/q/27401605
has comment: http://stackoverflow.com/comment/43248141
has comment: http://stackoverflow.com/comment/43248106
has body: To add, for example, click events to custom loaded items, use this: $(body).on( 'click', 'YOUR_DYNAMIC_SELECTOR', function(){ DO_ALL_THIS } )
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43248184

http://stackoverflow.com/a/27367499
answers question: http://stackoverflow.com/q/27367235
type: Answer
has body: As you can see in the html source, each li element contains two images: a low-res and a high-res one. The low-res image is visible, because it loads faster. When the high-res image is loaded, it's display property is set to 'none', and the high-res image is shown. I think some sort of lazyload plugin would do the trick.
score: 0

http://stackoverflow.com/comment/43391911
type: AnswerComment
comment on: http://stackoverflow.com/a/27441207
score: 0
type: Comment
has text: Check now.I dont have php installed hence i can't test the code.But should work fine now.It was due to the way i had accessed the value of the editor element."document.getElementById('editor').innerHtml" was changed to "document.getElementById('editor').value".

http://stackoverflow.com/comment/43200130
type: QuestionComment
has text: @faby I put the alert (and console.log()) inside the success of find and updateAttributes
comment on: http://stackoverflow.com/q/27374616
score: 0
type: Comment

http://stackoverflow.com/q/27368384
tagged with: hid
has answer: http://stackoverflow.com/a/27369125
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43189956
has title: chrome.hid.send fails because device was lost?
has comment: http://stackoverflow.com/comment/43189041
type: Question
has body: I get failures on both Macs and PCs when using the chrome.hid API. I can also get successes on both Macs and PCs in a version of the device firmware that always responds with full 64B messages. The only issue is, I can't control the size of the responses. Mac Transmitting a message that expects a response fails. In one test, no message got through until about three or so 5s spaced attempts. It was only the third attempt that actually set chrome.lastError however. Transmitting a message that expects no response fails. PC Transmitting a message that expects a response fails. Transmitting a message that expects no response fails. The messages that come back from this device to the notebook are not necessarily 64B long (58B actually) if that helps any. The messages being sent to the device are exactly the device's maxOutputReportSize which is 64. Debug log for PC running Windows 7 My chrome debug log shows the following (see here on how to enable logging and where to retrieve the logs): [21648:18680:1208/133736:VERBOSE1:hid_connection_win.cc(86)] HID transfer failed: The device is not connected. (0x48F) [21648:18240:1208/133740:WARNING:raw_channel_win.cc(471)] WriteFile: The pipe is being closed. (0xE8) [21648:18240:1208/133740:WARNING:channel.cc(525)] Failed to send message to remove remote message pipe endpoint ack (local ID 1, remote ID 1) [8068:21088:1208/133805:VERBOSE1:ipc_sync_channel.cc(386)] Canceling pending sends The device is very much connected and there is no way for me to currently every get an onDisconnect event to know otherwise.
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43189714
tagged with: google-chrome-app
score: 0
accepted answer: http://stackoverflow.com/a/27369125

http://stackoverflow.com/comment/43406201
comment on: http://stackoverflow.com/a/27435588
has text: @hny2015 it's just that the `a` tag was not a direct child of the `div` (replaced `/` with `//`). Consider accepting the answer, thanks.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43404726
comment on: http://stackoverflow.com/a/27451383
type: Comment
score: 1
has text: i also use this solution and work perfectly on my website, Google don't say nothing about this but i think that is implicit... ;-) sorry for the english !
type: AnswerComment

http://stackoverflow.com/comment/43174297
comment on: http://stackoverflow.com/q/27359692
has text: no i want to show the events of only the user that is currently logged in.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43245077
has text: @PashaTurok check this out, and see what I mean, the right solution: http://jsfiddle.net/6ctd2hqs/1/
comment on: http://stackoverflow.com/a/27399396
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43097073
comment on: http://stackoverflow.com/a/27318847
score: 0
type: AnswerComment
type: Comment
has text: More info on bitwise AND assginment operator here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators#Bitwise_AND_assignment

http://stackoverflow.com/comment/43361616
has text: Apologies for commenting without trying. They are indeed interchangeable. Looking at it and your comment about your solution being the only valid one, can you explain why removing the optional marker on cl-1 and replacing {1,5} by {0,5} wouldn't work?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27462234

http://stackoverflow.com/q/27414701
tagged with: webgl
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43273688
favorite count: 0
has comment: http://stackoverflow.com/comment/43299280
has comment: http://stackoverflow.com/comment/43309905
tagged with: three.js
has title: WebGL / Three.js - Particles colored by texture flicker erratically while moving camera
has comment: http://stackoverflow.com/comment/43274123
has comment: http://stackoverflow.com/comment/43274314
type: AnsweredQuestion
has body: Here's a jsfiddle I put together showing the problem of particles "flickering" while being colored using a texture and while the camera is moving. Update: There should be no animation or movement happening on the particles. If when you click and drag on the viewport and the particles are flickering or changing colors at all then you are seeing the issue. This is a problem I've tested and seen on both firefox and chrome with mac OS 10.9 and windows 7. The particles are not overlapping or clipping in any way. If the particles are animated with a regular shader the flickering does not happen. It's only when the particles are colored using a texture (in this case using THREE.WebGLRenderTarget), is the flickering evident. It is done this way in order to capture previous frames and store them in a buffer (that could then be used in more advanced ways not shown in the jsfiddle example). It actually seems like the fragment shader might be mistakenly grabbing a neighbor pixel, instead of it's target, but I'm not certain - and that doesn't make much sense, because the target coordinates are only generated on init(), and they don't change after that. The target pixel coordinates for each particle are passed as a vertex attribute to the fragment shader 1-1 unaltered (as a varying but with no varying value). uniform sampler2D colorMap; // The texture being used to color each particle varying float v_geoX; // x,y coordinates passed as varyings varying float v_geoY; void main() { // Normally pulling the correct color, but this seems to get confused during camera movement. gl_FragColor = texture2D(colorMap, vec2(v_geoX, v_geoY)); } Anyone have any ideas on how to do this without the flickering? When I apply this technique to larger and faster animations the problem only seems to get worse. It's happening on all browsers I've checked so far.
has answer: http://stackoverflow.com/a/27439675
accepted answer: http://stackoverflow.com/a/27439675
score: 1
has comment: http://stackoverflow.com/comment/43274406
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43275942
has comment: http://stackoverflow.com/comment/43273994
tagged with: javascript

http://stackoverflow.com/comment/43297984
comment on: http://stackoverflow.com/a/27428287
type: AnswerComment
type: Comment
has text: And is user id is username?
score: 0

http://stackoverflow.com/q/27324239
linked to: http://stackoverflow.com/q/3358209
tagged with: download
type: AnsweredQuestion
has body: i need to pass a record or list of records as a post param to a download action... is that even possible?
accepted answer: http://stackoverflow.com/a/27325308
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27325308
score: 0
answer count: 1
has title: ExtJS/JavaScript - how to post list of grid records to download url?

http://stackoverflow.com/q/27329966
has body: I have a $interval function inside a function tied to my controller scope that looks like this: $interval(function () { if($scope.tocadoColour = 'red') { $scope.tocadoColour = 'black'; } else { $scope.tocadoColour = 'red'; } }, 300); I was expecting the variable $scope.tocadoColour to alternate between 'red' and 'black' on every interval but from putting in a couple of console.logs I can see that it's only ever going into the first part of the if statement. Can anyone tell me why?
upvote count: 1
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27329998
tagged with: angularjs
has title: angular $interval - accessing variables outside of the function
has answer: http://stackoverflow.com/a/27329998
downvote count: 0
score: 1
type: Question
type: AnsweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/43288110
type: Comment
score: 1
comment on: http://stackoverflow.com/q/27363727
type: QuestionComment
has text: @vsync I came to the conclusion that things are slow by measuring the time it takes them to occur. I want to speed them up because that will improve user experience, and ultimately profitability. Our javascript application is slow.

http://stackoverflow.com/a/27416929
answers question: http://stackoverflow.com/q/27416760
downvote count: 0
has body: Way with reduce, maybe the shortest one [1,2,3].reduce(function(m,i) { return m.concat([i,i]); }, []); and ES6 version [1,2,3].reduce((m,i) =&gt; m.concat([i,i]), []);
upvote count: 8
score: 8
type: Answer

http://stackoverflow.com/q/27442664
has title: Highlight an element on hover
favorite count: 0
tagged with: google-chrome
has body: I want to highlight an element on hover, and only that element. This should mimic the behaviour of hovering over an element with chrome dev tools when you have the magnifying glass selected. It's for a chrome extension I'm making. I think I need a JS solution, as the pseudo :hover in css seems to apply to all elements in the background, i.e. container elements, so I'd need to prevent event bubbling in css, which as far as I can tell you can't do. I have tried $('body').children().mouseover(function(e){ $(".hova").removeClass("hova"); $(this).addClass("hova"); }).mouseout(function(e) { $(this).removeClass("hova"); }); -css- .hova { background-color: pink; } and jquery's hover(), both always selects the container too. I have also tried with css opacity, incase the background was covered, but it seems it always selects the parent element. I want the furthest child down the DOM that I am hovering over. I'm sure there's some simple solution out there, maybe its over complicating as its in a chrome extension... I'm not sure
has answer: http://stackoverflow.com/a/27442869
type: AnsweredQuestion
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/43324728
tagged with: javascript
tagged with: jquery
score: 4
possible better answer: http://stackoverflow.com/a/27443037
linked to: http://stackoverflow.com/q/1731280
has answer: http://stackoverflow.com/a/27442875
accepted answer: http://stackoverflow.com/a/27442875
answer count: 3
tagged with: google-chrome-extension
upvote count: 4
tagged with: css
has answer: http://stackoverflow.com/a/27443037

http://stackoverflow.com/comment/43305575
comment on: http://stackoverflow.com/q/27430861
score: 0
has text: {comments: [{'content': 'lskjdlksdj', replies: [{}], [{}] }]}
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27342685
has answer: http://stackoverflow.com/a/27342761
has body: I am trying to disable a number of buttons on the onload of a page, but to enable on the click of the 'start game button'. I have got the buttons disabled by adding an attribute to html but I am unable to get the buttons enabled on he click of the start button. If anyone can take a look the the code and see what is wrong with it then it will be much appreciated. Christmas Assignment Card Game Computer Player Start Game Higher Equal Lower Draw your card Reset Score
has answer: http://stackoverflow.com/a/27342741
has answer: http://stackoverflow.com/a/27343139
has title: Disabling buttons using onload funtion, javascript
tagged with: button
tagged with: javascript
has answer: http://stackoverflow.com/a/27343529
favorite count: 0
has answer: http://stackoverflow.com/a/27343172
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
has answer: http://stackoverflow.com/a/27342833
upvote count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27456477
downvote count: 1
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/27342772

http://stackoverflow.com/comment/43216421
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27383224
has text: For a long-lived connection, yes. I could send messages back from the background with `message["action"] = "doStuffCallback"`, but I don't think it's a good solution.

http://stackoverflow.com/comment/43294557
comment on: http://stackoverflow.com/a/27424726
has text: I mean when we type something that the pointer I mean it curser, I tried your code but curser not coming!! My requirement is that in page load I am populating some content into text area, and after that it should fire a click or onchange event without user interaction!!
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/q/27465378
accepted answer: http://stackoverflow.com/a/27465632
type: Question
has body: I'm using a d3.js force layout graph to display js objects. Every object corresponds to a node in the graph, and each node is represented in the DOM by an SVG &lt;g&gt; element. I have everything working fine, except for replacing a node object with a new, updated object. When I attempt to do this, d3 seems to be removing the old &lt;g&gt; and it's contents and adding a new one with the old data. Ideally, I'd like to have d3 simply update the existing elements for that object with the new data. Demo: http://jsfiddle.net/d3query/xf66gxo8/1/ Clicking on the update button should replace the last node with different data. This works if I update the object's properties: dataset[index].name = 'four'; but not if I replace the object outright: dataset[index] = { id: oldnode.id, name: 'four' };
score: 1
has answer: http://stackoverflow.com/a/27465632
answer count: 1
downvote count: 0
has title: How to replace nodes in a d3 force layout?
tagged with: javascript
favorite count: 0
type: AnsweredQuestion
tagged with: d3.js
upvote count: 1

http://stackoverflow.com/q/27335186
accepted answer: http://stackoverflow.com/a/27345255
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: object
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
tagged with: transparency
has body: I'm experimenting with three.js. Based on several tutorials I've created a small script that loads an object from obj file, puts a texture on it and provides some interactive features like camera control and collision detection when the cursor moves over the object on screen. I know how i can change the transparency of the whole object, but now I'm looking for a way to make the loaded object partially transparent depending on the cursors position. If the ray of the cursor intersects the object, all triangles nearby the collision point should get a higher transparency so that i can see other objects inside or behind this object. Is there a way to do this? Anybody knows a tutorial which shows a solution for the implementation with three.js? For any help or approach I would be grateful.
has title: Make on object partially transparent using three.js
tagged with: three.js
has answer: http://stackoverflow.com/a/27345255

http://stackoverflow.com/comment/43205453
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27376992
has text: Hope it works .. because i dont have any blackberry device for test :(

http://stackoverflow.com/q/27317215
has title: Moment.js parsing text as date doesn't seem to match locale
tagged with: momentjs
has comment: http://stackoverflow.com/comment/43198463
has answer: http://stackoverflow.com/a/27317492
type: Question
accepted answer: http://stackoverflow.com/a/27317492
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/27317525
has body: String 12.01.2015 e.g. in Germany stands for Jan 12 2015. But the following code doesn't work as expected: moment.locale('de'); moment('12.01.2015').toString(); // "Tue Dec 01 2015 00:00:00 GMT+0100" moment('12.01.2015').fromNow(); // "in einem Jahr" (==&gt; locale setting is OK) In locale/de.js there's the following: longDateFormat : { ... L : 'DD.MM.YYYY', ... } Why isn't the string parsed as I think it should?
has comment: http://stackoverflow.com/comment/43110119
answer count: 2
has comment: http://stackoverflow.com/comment/43095828
downvote count: 0
tagged with: javascript
favorite count: 0
upvote count: 3
has answer: http://stackoverflow.com/a/27317525

http://stackoverflow.com/comment/43660557
type: Comment
has text: That people with a mouse and touch is a minority (at this moment) is quite some common sense. At least here in the Netherlands. I know exactly 0 people with a screen that supports touch and are commonly used with a mouse. From the people that I know almost everyone has a smartphone, and almost everyone has a desktop or normal laptop (without touch). Doesn't mean they don't exist. Just means they are a minority. Like IE7 users that I also don't support.
type: AnswerComment
comment on: http://stackoverflow.com/a/27612273
score: 0

http://stackoverflow.com/a/27395840
type: Answer
has body: I have updated the fiddle: http://jsfiddle.net/s1dcps6q/4/ here is the code, this does what I wanted it to and wanted to share with anyone who comes across this challenge. I made modifications to swatkins code above: $(document).ready(function(){ $(".selctor").click(function () { var i=$(this).attr("rel"); console.log(i); var eventsArray=document.getElementsByClassName("eventer"); eventSelctd=(eventsArray[i]).outerHTML; console.log("selected event is" + " " + eventSelctd); if (typeof(Storage) != "undefined") { localStorage.setItem("schedule "+ i, eventSelctd); //console.log("local Storage should read " + eventSelctd); } else { document.getElementById("#result").innerHTML = "Sorry, your browser does not support Web Storage..."; } }); $("#buttn").click(function () { var storaged = Object.keys(localStorage).length; console.log("test: " + storaged); for( var i=0; i&lt;storageLength; i++ ) { var key = localStorage.key(i); var value = localStorage[key]; $("#result").append(value); } }); $("#buttn2").click(function(){ localStorage.clear(); $("#result").html(''); console.log("Storage is cleared"); }); });
answers question: http://stackoverflow.com/q/27325349
score: 0

http://stackoverflow.com/comment/43157707
has text: 9/10 times you can just set your img tag to the image's path on the remote site and it will show up. of course, you need to know the path of the image and what video it's associated with, but if you're grabbing videos already, you can handle images... you should also check that you don't violate a policy by deeplinking or exporting their thumbnails.
type: QuestionComment
comment on: http://stackoverflow.com/q/27351568
score: 0
type: Comment

http://stackoverflow.com/a/27326087
type: Answer
has comment: http://stackoverflow.com/comment/43114427
has comment: http://stackoverflow.com/comment/43128278
has body: As you have jQuery as tag I think following solution could work for you. You can determine the Nth record using position() in an xsl:for-each loop. As example for N = 3: XSLT: &lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" /&gt; &lt;xsl:template match="TestXML"&gt; &lt;ul&gt; &lt;li&gt;N : Test&lt;br/&gt;NTLIST &lt;xsl:for-each select="NTList/NT"&gt; &lt;ul&gt; &lt;li&gt; &lt;xsl:if test="position() &gt;=3"&gt; &lt;xsl:attribute name="class" select="'toggle'"/&gt; &lt;/xsl:if&gt; &lt;xsl:value-of select=" if(position() &amp;lt; 3) then concat(local-name(), ' (', position(),')') else concat(local-name(), ' (+More)')"/&gt; &lt;ul&gt; &lt;xsl:if test="position() &gt;=3"&gt; &lt;xsl:attribute name="class" select="'hidden'"/&gt; &lt;/xsl:if&gt; &lt;xsl:for-each select="*"&gt; &lt;li&gt; &lt;xsl:value-of select="."/&gt; &lt;/li&gt; &lt;/xsl:for-each&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/xsl:for-each&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/xsl:template&gt; &lt;/xsl:transform&gt; When applied to your input XML produces the ouput (relevant part): &lt;ul&gt; &lt;li&gt;N : Test&lt;br/&gt;NTLIST &lt;ul&gt; &lt;li&gt;NT (1) &lt;ul&gt; &lt;li&gt;NT1 Test 1&lt;/li&gt; &lt;li&gt;NT2 Test 1&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;ul&gt; &lt;li&gt;NT (2) &lt;ul&gt; &lt;li&gt;NT1 Test 2&lt;/li&gt; &lt;li&gt;NT2 Test 2&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;ul&gt; &lt;li class="toggle"&gt;NT (+More) &lt;ul class="hidden"&gt; &lt;li&gt;NT1 Test 3&lt;/li&gt; &lt;li&gt;NT2 Test 3&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; Following CSS hides the lists that have class hidden and removes the bulletpoints from the list elements: ul { list-style-type:none; } .hidden { display:none;) } And following jQuery: $(".toggle").on("click", function () { $(…
has comment: http://stackoverflow.com/comment/43148575
score: 0
has comment: http://stackoverflow.com/comment/43147635
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27325733
accepted answer of: http://stackoverflow.com/q/27325733

http://stackoverflow.com/q/27370103
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: On my website http://www.jeremiahlangner.com, when the menu is collapsed, the menu toggle button does not appear, nor does the menu expand when it is clicked. After replacing the code a few times, checking the order of how the javascript is loaded, and checking my css, I have still been unable to ascertain what is causing the problem. Can anyone offer any insight as to why it is still not functioning correctly? Code is as follows: <?php wp_nav_menu( array( 'menu' => 'primary', 'theme_location' => 'primary', 'depth' => 2, 'container' => 'div', 'container_class' => 'collapse navbar-collapse', 'container_id' => 'bs-example-navbar-collapse-1', 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker()) ); ?>
has comment: http://stackoverflow.com/comment/43192133
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/43267517
has answer: http://stackoverflow.com/a/27370357
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: wordpress
upvote count: 1
has comment: http://stackoverflow.com/comment/43267042
has title: Bootstrap 3 Collapse Menu is not expanding in Wordpress
score: 1
has comment: http://stackoverflow.com/comment/43264661
type: Question
answer count: 1

http://stackoverflow.com/a/27388300
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/46056549
has comment: http://stackoverflow.com/comment/43277333
has body: There's no native or universal way as far as I know. I prefer to write .clone method for my pseudo classes and use it: Person.prototype.clone = function() { var clone = new Person() clone.name = this.name; } You could loop through own properties of the object to clone them while not copying stuff inherited from other objects: for(var i in this) { if(this.hasOwnProperty(i)) { clone[i] = this[i]; } } This will copy everything that was added to your object after instantiating (eg. won't copy the prototype properties which were already added by calling new Person. Object.getPrototypeOf thanks to Bergi This method allows you to retrieve the prototype of any object. So instead of new Name you can use: var clone = Object.create(Object.getPrototypeOf(this)) That's an universal solution which can save you lot of work. You must then proceed with copying own properties using for(var i in ...). Object.create (supported since node V8) (MDN) Finally, you could create a person that inherits from the original object: var clone = Object.create(this); That can be useful in special cases, but normally I wouldn't recommend it. .toSource (Node.js module) (MDN) It's also interesting to know that you can ( in certain browsers firefox only) override method .toSource which is defined for all objects, even the native ones: In certain cases, you might want to do: Person.prototype.toSource = function() { //Assuming name can be given in constructor return "new Person("+this.name.toSource()+")"; } Further reading Aside from the linked docs, I found this nice article about javascript object inheritance: Prototypal Inheritance - How To Node - NodeJS
score: 2
has comment: http://stackoverflow.com/comment/43265945
answers question: http://stackoverflow.com/q/27388077
has comment: http://stackoverflow.com/comment/43277880
has comment: http://stackoverflow.com/comment/43277441
downvote count: 0

http://stackoverflow.com/q/27413764
type: AnsweredQuestion
upvote count: 9
score: 9
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/27413831
tagged with: javascript
has comment: http://stackoverflow.com/comment/43271683
tagged with: express
tagged with: routes
has title: ExpressJs not loading CSS on certain routes
answer count: 1
has comment: http://stackoverflow.com/comment/43271695
favorite count: 0
accepted answer: http://stackoverflow.com/a/27413831
has body: I've been working with the MEAN stack and I ran into this issue where my CSS wouldn't load properly on some pages. Try the following two links to compare/understand: https://edmtl.herokuapp.com/song https://edmtl.herokuapp.com/song/ Layout.jade: doctype html html head title= title meta(name="viewport" content="width=device-width, initial-scale=1.0") link(rel='stylesheet', href='css/bootstrap.css') link(rel='stylesheet', href='css/style.css') app.js: var song = require('./routes/addSong'); app.use('/song', song); routes/addSong.js: var express = require('express'); var router = express.Router(); var db = require('mongoose-simpledb').db; /* GET home page. */ router.get('/', function(req, res) { res.render('addSong', {title: 'Add A Song'}); }); router.post('/createNew', function(req,res){ var song = new db.Post({ name: req.body.songname, artist: req.body.artist.split(","), remix: req.body.remix, genre: req.body.genre, url: req.body.url, description: req.body.description, blogger: req.body.blogger }); song.save(function (err,song){ if(err) return console.error(err); res.send(song); }); }); router.get('/:songid', function(req,res){ db.Post.find({_id: req.param('songid')}, function(err, song){ if (err) return console.error(err); res.render('song', {title: song.name, songInfo: [song]}); }); }); module.exports = router; addSong.jade: extends layout block content center div(style="text-align: left; width: 600px") form(method='POST' action='/song/createNew') div label(for='songname') Song Name: input(type='text' name='songname') div label(for='artist') Artist: input(type='text' name='artist') div label(for='remix') Remixed By: input(type='text' name='remix') div label(for='genre') Genre: ul li input(type="checkbox" name="genre" value="Dubstep") span Dubstep li input(type="checkbox" name="genre" value="Chill Out") span Chill Out li input(type="checkbox" name="genre" value="Progressive House") span Progressive House li input(type="checkbox" name="genre" value="Deep House") span…
tagged with: url-routing

http://stackoverflow.com/a/52153656
answers question: http://stackoverflow.com/q/27327768
has body: In order to jVectorMap to take full height and width, then add outer div container to the map. Also set width and height Outer container. &lt;div class="map-container"&gt; &lt;div id="world-map" class="jvmap-smart"&gt;&lt;/div&gt; &lt;/div&gt; Next add css styles. .map-container{ height: 300px; } .jvmap-smart{ width: 100%; height: 100%; } @media only screen and (min-width: 576px) { .map-container{ height: 350px; } } @media only screen and (min-width: 768px) { .map-container{ height: 400px; } } @media only screen and (min-width: 992px) { .map-container{ height: 500px; } } @media only screen and (min-width: 1200px) { .map-container{ height: 600px; } } To know more about jVectorMap refer this link https://smarttutorials.net/how-to-create-make-responsive-world-map-jvectormap-using-jquery/
type: Answer
score: 0

http://stackoverflow.com/a/27400823
has body: You dont have to create a view for it. Add a "login" method in your UserController and return a JSON result class UserController{ def login(){ //Your code... render result as JSON } } If you are using SpringSecurity make sure that the login method is accesible for non-authenticated users.
has comment: http://stackoverflow.com/comment/43250630
upvote count: 2
answers question: http://stackoverflow.com/q/27400628
has comment: http://stackoverflow.com/comment/43251575
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/29055251
answers question: http://stackoverflow.com/q/27472449
score: 0
has body: Not sure if I got your idea right but something like this should solve your problem (in case you have a "parent" property in the products JSON you're getting from the server): function processResult(result) { if (typeof(result.parent) !== 'undefined') { // see if the element has a parent var newDiv = 'markup goes here'; // if some of the markup would be reused you can create a new function for this $('#galleryitem' + result.parent).append(newDiv); // just make sure the parent is already there } else { var newDiv = '&lt;div id="galleryitem' + result.id + '" class="galleryitem"&gt;'; // default behavior that you alreay had // code skipped for brevity $('#gallery').append(newDiv); } } P.S. You should work on your code formatting -- it can be much easier to read if formatted well.
type: Answer

http://stackoverflow.com/comment/43293355
type: Comment
has text: And, as suggets, always, ALWAYS, avoid the use of jQuery toggle method.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27425448

chart.js
tags question: http://stackoverflow.com/q/27439658
tags question: http://stackoverflow.com/q/27355499
tags question: http://stackoverflow.com/q/27323474
tags question: http://stackoverflow.com/q/27455604
type: Tag
tags question: http://stackoverflow.com/q/27350786
tags question: http://stackoverflow.com/q/27345685
tags question: http://stackoverflow.com/q/27437883
tag name: chart.js
tags question: http://stackoverflow.com/q/27347798
tags question: http://stackoverflow.com/q/27425544
tags question: http://stackoverflow.com/q/27334757

http://stackoverflow.com/comment/43377555
score: 0
type: Comment
type: QuestionComment
has text: @user3080993 its not invalid in HTML5.
comment on: http://stackoverflow.com/q/27445613

http://stackoverflow.com/q/27321481
has answer: http://stackoverflow.com/a/27321708
downvote count: 0
has title: Angularjs select2 Ajax binding
favorite count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43165072
tagged with: select
type: Question
has body: I am using AngularJs + Select2. I am trying to get the data from remote. Below is my code HTML : &lt;div class="col-md-4 left"&gt; &lt;input type="text" style="width:300px" ui-select2="multi" ng-model="multi2Value" multiple="multiple" /&gt; &lt;/div&gt; JS : [UPDATED] $scope.multi = { ajax: { headers: { 'Content-Type': 'application/json' }, url: "http://localhost:63591/Lookup?lookup=Lookup&amp;key=acc", data: function (term, page) { return {}; }, results: function (data, page) { console.log(data); return {results: data.LookupValue}; } } And my response will be { "LookupValue" : [ "AAAA","BBBB","CCC" ] } But in the console i am seeing the response. But it is not loading into the select dropdown. What went wrong in my code. Can anyone plz help me ? Thanks
tagged with: javascript
score: 4
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/27439529

http://stackoverflow.com/a/27394038
score: 0
downvote count: 1
type: Answer
has body: What you are doing might create an accessibility violation. Take a look at this http://www.w3.org/TR/UNDERSTANDING-WCAG20/consistent-behavior-unpredictable-change.html Of course, there are scenarios where setting focus like that IS appropriate behavior and this might be one of those. Can you share your code?
upvote count: 1
answers question: http://stackoverflow.com/q/27365903

http://stackoverflow.com/comment/43276410
type: Comment
type: QuestionComment
has text: Try to use [this](http://stackoverflow.com/questions/14796087/filter-results-6-through-10-of-100-with-ng-repeat-in-angularjs) filter.
comment on: http://stackoverflow.com/q/27416315
score: 0

http://stackoverflow.com/q/27462773
tagged with: jsonp
tagged with: cors
has comment: http://stackoverflow.com/comment/43362056
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/27464737
has title: JSONP working in Chrome but not in Firefox/IE?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43362236
linked to: http://stackoverflow.com/q/1640391
type: Question
has body: I'm developing a mobile site and I'm using JSONP requests via jQuery to contact the data server to retrieve info for displaying on the mobile site. I was told not to use a PHP script as a proxy since it would cause extra unnecessary load on the mobile server (millions of users) and to strictly do this client-side. I'm using the following code: var get_vars = '&amp;callback=?&amp;var=here'; $.ajax({ url: "http://server.com/script?" + get_vars, type: "GET", dataType: 'jsonp', //xhrFields: { withCredentials: true }, //crossDomain: true, success: function(data){ console.log(data) } }); The server uses cookie authentication to determine if the user is logged in before returning data. Strangely enough, this code worked once on Firefox. Subsequent reloads/refreshes of the page resulted in the credentials not being verified by the server. At first I thought it was due to some changes to my code but after testing it in Google Chrome, it works 100% of the time. There are no JS errors displayed in the console for Firefox/IE either. I made sure this wasn't a caching issue and also tried this on another machine with Firefox, to no avail. This issue also happens on Windows Phone and the latest version of Internet Explorer on Windows 8. I'm assuming it must be cookie-related and somehow the credentials aren't being passed to the remote server. As for trying to use CORS... I tried it (as you can see the commented out bits, plus I tried adding $.support.cors = true), and couldn't get it to work. I kept getting the "cross domain unauthorized" error, despite having the server send out the following headers: Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: * Anyone have any clue what could be causing this? I'd like to get this working with JSONP since it is working in Chrome already. Extra notes: It appears another developer isn't having the same issues as me. He is reporting that it's working in Firefox 100% of the time. I even tried the following: Loading up Firefo…

http://stackoverflow.com/comment/43289052
comment on: http://stackoverflow.com/q/27422940
type: Comment
type: QuestionComment
has text: Works for a single if/else statement
score: 0

replace
tags question: http://stackoverflow.com/q/27457359
tags question: http://stackoverflow.com/q/27440437
tags question: http://stackoverflow.com/q/27432589
tags question: http://stackoverflow.com/q/27315474
tags question: http://stackoverflow.com/q/27353094
tags question: http://stackoverflow.com/q/27434437
tags question: http://stackoverflow.com/q/27452280
tags question: http://stackoverflow.com/q/27472010
type: Tag
tag name: replace
tags question: http://stackoverflow.com/q/27450572

http://stackoverflow.com/comment/43340132
comment on: http://stackoverflow.com/a/27450530
type: AnswerComment
has text: `localStorage` is simply key/value storage. You can use the verbose methods ( `localstorage.getItem()` and `localStorage.setItem()` ) or more directly: (`localStorage.foo = 5;` or `localStorage.Rows = JSON.stringify( someArrayOrObject );`)
score: 0
type: Comment

http://stackoverflow.com/q/27447694
has answer: http://stackoverflow.com/a/27449818
favorite count: 0
has body: I am trying to build an app that uses drag-and-drop behaviour, and the component being dragged needs to be cloned elsewhere in the DOM. Since the component is already mounted, trying to mount it again causes the browser to hang. Trying to use cloneWithProps results in a Cannot read property 'defaultProps' of undefined error. Here's a testcase: var TestCase = React.createClass({ getInitialState () { return { draggingItem: null } }, render () { return <ExampleComponent onClick={this.setDraggingItem} /> {this.state.draggingItem} }, setDraggingItem (component) { // This gives `Cannot read property 'defaultProps' of undefined` //React.addons.cloneWithProps(component) // This crashes the browser //this.setState({ draggingItem: component }) } }) var ExampleComponent = React.createClass({ render () { return Hello World }, handleOnClick (event) { this.props.onClick(this) } }) React.render(<TestCase />, document.body) Of course I could simply clone component.getDOMNode() in setDraggingItem, but it really seems like rendering the component or calling cloneWithProps should work?
has answer: http://stackoverflow.com/a/27451091
possible better answer: http://stackoverflow.com/a/27449818
upvote count: 2
has title: Clone a component that has already been mounted
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27451091
type: Question
tagged with: reactjs
answer count: 2
score: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43294754
has text: i've updated my answer to include my best guess on how you'd handle the `Promise` return object.
type: Comment
comment on: http://stackoverflow.com/a/27416158
score: 0
type: AnswerComment

http://stackoverflow.com/a/27428092
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43297851
downvote count: 0
has body: the slider has its own change event fiddle $(document).ready(function() { var sizes = ["0", "1", "2", "3", "4", "5", "5", "6", "7"]; $("#slider").slider({ orientation: "vertical", range: "min", animation:false, min: 0, max: 8, value: 0, slide: function(event, ui) { $('.convert').val(sizes[ui.value]); }, change:function(){ //called onchange alert("slider changed"); } }); });
answers question: http://stackoverflow.com/q/27427957

http://stackoverflow.com/comment/43096901
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27318606
has text: Ah, thats a really nice solution. But how would you add more functionality to the button? Thanks a lot!

http://stackoverflow.com/a/27465206
has body: Create a function that will do the string manipulation for you. Next, set up a listener on your input box to listen for a key down. That key down event should trigger your function, passing the value of your input box, and in turn setting the value to the newly spaced out string.
answers question: http://stackoverflow.com/q/27465135
type: Answer
score: 0

http://stackoverflow.com/a/27464580
has body: Your string concatenation in your append function is a little off. Try something like this: for (var i =0 ;i&lt;resultArray.length;i++){ $.ajax({url:"getExpenseInfo.php",type:"POST",data : { 'expenseId' : resultArray[i]["expenseId"] },success:function(expense){ expense = $.parseJSON(expense); $("#mainDiv").append("&lt;div class=\"row\"&gt;"+expense[expenseName]+"&lt;/div&gt;"); }}); }
answers question: http://stackoverflow.com/q/27464545
type: Answer
score: 0

http://stackoverflow.com/comment/43157478
score: 0
type: Comment
type: QuestionComment
has text: nope. what ever you are asking looks like a KEYLOGGER.
comment on: http://stackoverflow.com/q/27351628

http://stackoverflow.com/q/27451400
has comment: http://stackoverflow.com/comment/43341404
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43341512
has comment: http://stackoverflow.com/comment/43341432
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
has body: I am very confused as to why I am getting this error in the console. I have read all the dos and as far as I know I am doing this right. On my page I have a &lt;div id="aisis-writer"&gt;&lt;/div&gt; where I want my react element tied to. I have then created a simple React component that renders nothing: var AisisWriter = React.createClass({ getInitialState: function(){}, componentDidMount: function(){}, render: function(){ return null; } }); React.render( &lt;AisisWriter /&gt;, document.getElementById('aisis-writer') ); Very basic. When I load the page I see: Uncaught Error: Invariant Violation: _registerComponent(...): Target container is not a DOM element. So I think, ok maybe I misspelled something here, so in the console I do: document.getElementById('aisis-writer'); And I get back: &lt;div id="aisis-writer"&gt;&lt;/div&gt; So am I completely missing something? Why am I getting this error?
type: UnansweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27456695
has title: ReactJs 0.12 Target container is not a DOM element
upvote count: 3
has answer: http://stackoverflow.com/a/30817589
type: Question
tagged with: reactjs
tagged with: javascript
has comment: http://stackoverflow.com/comment/43341501

http://stackoverflow.com/q/27394793
type: Question
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43237147
tagged with: javascript
has answer: http://stackoverflow.com/a/27395281
tagged with: jquery
favorite count: 0
tagged with: bootstrap-datepicker
has body: I'm using bootstrap-datepicker with the following code: $('#approved-date').datepicker({ autoclose: true, }); On Firefox browse, when I was typing date like "12/10/2 ", it gives errors: The date is chosen automatically when typing like this: How can I turn off the automation of selected date when typing?
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
has title: Date Picker Bootstrap errors when input date (FireFox)
score: 1
has comment: http://stackoverflow.com/comment/43236664

http://stackoverflow.com/comment/43362238
comment on: http://stackoverflow.com/q/27462985
score: 0
type: Comment
type: QuestionComment
has text: And what problem is this attempt meant to be solving?

http://stackoverflow.com/a/27475237
downvote count: 0
has body: Instead of $.get( 'url/to/myfunctions', eval ); try $.get( 'url/to/myfunctions', function(code) { eval(code); } ); This way the eval function is going to be executed within the same scope as the rest of your code, rather than within the scope of jQuery. After the code has been fetched and executed, you can continue with the execution of the rest of your code: $.get( 'url/to/myfunctions', function(code) { eval(code); callback(); }); function callback() { // Your code goes here } Explanation For the purpose of the explanation, let's use this simplified model of the environment, in which your code is being executed: // JQuery is defined in the global scope var $ = { get: function( url, fn ) { var responses = { "url/to/myfunctions": "try {\ if(graphie) log('Graphie is visible.');\ } catch (e) {\ log('Graphie is not visible. (' + e + ')');\ }" }; fn( responses[url] ); } }; (function() { // Graphie is defined in a local scope var graphie = {}; (function() { // Your code goes here $.get( "url/to/myfunctions", eval ); $.get( "url/to/myfunctions", function(code) { eval (code); } ); })(); })(); The output: &lt;ol id="output"&gt;&lt;/ol&gt; &lt;script&gt; function log(msg) { var el = document.createElement("li"); el.appendChild(document.createTextNode(msg)); output.appendChild(el); } &lt;/script&gt; As you can see, the function passed to $.get gets executed inside its body. If you only pass eval to $.get, then you don't capture the local variable graphie, which is then invisible to the evaluated code. By wrapping eval inside an anonymous function, you capture the reference to the local variable graphie, which is then visible to the evaluated code.
has comment: http://stackoverflow.com/comment/43389679
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/43409357
upvote count: 3
has comment: http://stackoverflow.com/comment/43409872
answers question: http://stackoverflow.com/q/27431196
has comment: http://stackoverflow.com/comment/43409319
has comment: http://stackoverflow.com/comment/43408015
has comment: http://stackoverflow.com/comment/43387085

http://stackoverflow.com/a/27455350
accepted answer of: http://stackoverflow.com/q/27453232
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27453232
has body: You can type cast like this: var buffered_canvas = /** @type {HTMLCanvasElement} */ (document.createElement("canvas")); See the bottom of this page. You can use this along with the regular type annotation, like this. /** @type {HTMLCanvasElement} */ var buffered_canvas = /** @type {HTMLCanvasElement} */ (document.createElement("canvas")); If WebStorm follows the same annotation conventions as Closure this should work. having trouble finding any real specification of things like HTMLElement and what properties it has or method signatures for createCanvas and what type it returns. MDN is good, you can also look at WHATWG and W3C for standards.
type: Answer
upvote count: 7
has comment: http://stackoverflow.com/comment/43350769
score: 7

http://stackoverflow.com/q/27464599
has comment: http://stackoverflow.com/comment/43366005
type: Question
has comment: http://stackoverflow.com/comment/43365561
has comment: http://stackoverflow.com/comment/43365397
tagged with: javascript
has title: angularJS variable in div
answer count: 2
has comment: http://stackoverflow.com/comment/43365620
downvote count: 0
has comment: http://stackoverflow.com/comment/43366426
has answer: http://stackoverflow.com/a/27464650
favorite count: 0
has comment: http://stackoverflow.com/comment/43365660
has comment: http://stackoverflow.com/comment/43365587
tagged with: angularjs
upvote count: 2
has body: I have a problem actually with a view from my AngularJS web app. So I have this in my view: 0 Joueurs en ligne In my controller I added this: $scope.users = 10; But the problem is that the data-to="{{ users }}" in the div, don't seem to work.. When I try to replace data-to="{{ users }}" with a static value like: data-to=10; it's working. Am I doing something wrong ? Here is the directive of the counter directive('xeCounter', function(){ return { restrict: 'EAC', link: function(scope, el, attrs) { var $el = angular.element(el), sm = scrollMonitor.create(el); sm.fullyEnterViewport(function() { var opts = { useEasing: attrDefault($el, 'easing', true), useGrouping: attrDefault($el, 'grouping', true), separator: attrDefault($el, 'separator', ','), decimal: attrDefault($el, 'decimal', '.'), prefix: attrDefault($el, 'prefix', ''), suffix: attrDefault($el, 'suffix', ''), }, $count = attrDefault($el, 'count', 'this') == 'this' ? $el : $el.find($el.data('count')), from = attrDefault($el, 'from', 0), to = attrDefault($el, 'to', 100), duration = attrDefault($el, 'duration', 2.5), delay = attrDefault($el, 'delay', 0), decimals = new String(to).match(/\.([0-9]+)/) ? new String(to).match(/\.([0-9]+)$/)[1].length : 0, counter = new countUp($count.get(0), from, to, decimals, duration, opts); setTimeout(function(){ counter.start(); }, delay * 1000); //alert(to); --> Printing {{users}} sm.destroy(); }); } }; }). I added the alert(to); to check if the value was correctly sent but I get the {{users}} instead of the value..
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43365571
has comment: http://stackoverflow.com/comment/43365604
has comment: http://stackoverflow.com/comment/43365974
has comment: http://stackoverflow.com/comment/43365747
score: 2
has comment: http://stackoverflow.com/comment/43365539
has comment: http://stackoverflow.com/comment/43365413
has answer: http://stackoverflow.com/a/29689389

http://stackoverflow.com/comment/43104803
comment on: http://stackoverflow.com/q/27319230
score: 0
type: Comment
type: QuestionComment
has text: Or could we add some code to the JavaScript code that copies the billing fields to the shipping fields to fire off something to the SmartyStreets/LiveAddress code?

http://stackoverflow.com/q/27415178
tagged with: list
has comment: http://stackoverflow.com/comment/43275780
type: Question
has body: function onClickNew(objectName){ alert(run); var run; if(run) { alert("already run"); } else { var objectName = new test(); run = 1; alert(run); } } function test(){ if(document.getElementById("selectL").childNodes.length===0) { this.list = {}; document.getElementById("test").innerHTML = ""; this.list['test1']= new mutation("test1", 2, {"damage":{"freq":2, "size":"d6"}}); this.list['test2']= new mutation("test2", 1, {"range":"long"}); this.list['test1'].level=5; this.addOptions(); } else { for(var strName in this.list) { alert(strName); } this.updateList(); } } I am calling the onClickNew() function with an HTML button, but I need to be able to access the object it creates after it is created. I am unsure of how to do this. I am trying to build a program that tracks abilities and keeps them up to date, but unfortunately once the list is created, i don't know how to get back at it to work with it. How do I do it????
tagged with: javascript
has title: access dynamic JS object in HTML
has comment: http://stackoverflow.com/comment/43275461
score: 0
has comment: http://stackoverflow.com/comment/43274448
answer count: 0
has comment: http://stackoverflow.com/comment/43274404
type: UnansweredQuestion

http://stackoverflow.com/a/27460413
type: Answer
answers question: http://stackoverflow.com/q/27457208
score: 0
has body: Please use some CSS, that inline style code gets so confusing. If you want to do it the nice way do something like this: #facebook { background: url("http://www.habbohut.com/_images/_content/_habbohut/facebook_sign2.png") no-repeat; width: 231px; height: 231px; margin-top: -12px; margin-right: -60px; } #facebook:hover { background: url("http://www.habbohut.com/_images/_content/_habbohut/facebook_sign.png") no-repeat; } &lt;div id="facebook"&gt;&lt;/div&gt;

http://stackoverflow.com/q/27375635
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43201265
tagged with: ajax
has body: In our RESTful API, we use RQL to parse URL-s and build query out of it. This is an example of a query: http://www.example.com/resource?resource.name~=%Some name% which translates to a LIKE operator. Then, in our frontend, we implement a search field, of which change triggers an ajax request to: 'http://www.example.com/resource?resource.name~=%' + query + '%' Of course, there is a bug - each special combination with "%" gets translated server-side to a character, resulting in query returning no results. How to solve it? I tried to encodeURIComponent the whole stuff after ? but it gets even worse, for example resource.name~%3D%25befr%25 which "befr" as query string. I have no other ideas how to solve this issue.
has comment: http://stackoverflow.com/comment/43201295
has comment: http://stackoverflow.com/comment/43201237
has comment: http://stackoverflow.com/comment/43201560
favorite count: 0
has comment: http://stackoverflow.com/comment/43201547
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/43201600
type: AnsweredQuestion
tagged with: urlencode
score: 1
has answer: http://stackoverflow.com/a/27375712
possible better answer: http://stackoverflow.com/a/27375754
has title: Sending "%" to an API with JavaScript
type: Question
has answer: http://stackoverflow.com/a/27375754
answer count: 2
accepted answer: http://stackoverflow.com/a/27375712
tagged with: restful-url

http://stackoverflow.com/comment/86742192
type: Comment
comment on: http://stackoverflow.com/a/27397318
has text: @Lux.Capacitor I'm a bit confused here, how would the constructor approach avoid binding the event function on every `render`. Perhaps someone can point me at some relevant, contemporary-version example? e.g. for this [related question](https://stackoverflow.com/questions/49863427/react-js-event-binding-in-render). The CodePen by @ZenMaster still binds the function inside of `render`.
score: 0
type: AnswerComment

template-engine
tags question: http://stackoverflow.com/q/27326367
tag name: template-engine
type: Tag

http://stackoverflow.com/q/27377168
has body: Is there any method to check if the mail (in a registration form) exist in my database while i'm writing it (before i click submit buttom). This is my javascript function it work well when I click submit button: &lt;script type="text/javascript"&gt; $(document).ready(function(){ //newly added $('#_submit').click(function() {alert('in'); var emailVal = $('#mail').val(); // assuming this is a input text field $.post('checkemail.php', {'mail' : emailVal}, function(data) { if(data=='exist') return false; else $('#form1').submit(); }); }); }); &lt;/script&gt; but I want to verify the mail before I submit (without I click any button)
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43203947
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43203971
possible better answer: http://stackoverflow.com/a/27377214
has answer: http://stackoverflow.com/a/27377214
has answer: http://stackoverflow.com/a/27450270
has comment: http://stackoverflow.com/comment/43204341
score: 0
tagged with: php
type: AnsweredQuestion
has title: Check existing mail with ajax and PHP
accepted answer: http://stackoverflow.com/a/27450270

http://stackoverflow.com/comment/43290164
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27423978
has text: Check the network tab in your browser, does it give an error message or it stays at pending? What server are you running?
score: 0

http://stackoverflow.com/comment/43293437
has text: You have to use AJAX. Please read this: https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started
comment on: http://stackoverflow.com/a/27424781
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/103044927
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27407217
has text: Furthermore, it seems to me that the best solution for people is to update their view logic (or other logic) to handle the end date which appears to be +1 day. See https://github.com/fullcalendar/fullcalendar/issues/3679 for elaboration.
type: AnswerComment

http://stackoverflow.com/q/27332580
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
downvote count: 2
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27332594
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/27332708
has answer: http://stackoverflow.com/a/27332596
has body: I'm new to JS and trying to make an input field that that only appears when the user types anywhere on the page. Currently, the appearing of the input field works but once it's visible, the user still has to click into the field to type in it. I would like it to work like: User presses "S" Field appears with "S" typed in it. Any help would be much appreciated! http://codepen.io/jeremypbeasley/pen/RNrore var searchArea = $(".search"); searchArea.hide(); $(document).ready(function() { $( "body" ).keydown(function() { searchArea.show(); searchArea.elements['input'].focus(); console.log("worked!"); }); });
answer count: 3
has title: How to focus a hidden input field

http://stackoverflow.com/q/27363952
has comment: http://stackoverflow.com/comment/43180060
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43180131
type: Question
upvote count: 4
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: sorting
score: 4
has answer: http://stackoverflow.com/a/27364395
has answer: http://stackoverflow.com/a/27364519
has comment: http://stackoverflow.com/comment/43180102
has body: I need to sort an array of objects providing a dictionary with keys and their order. Just like this: var data = [ { "name": "a", "age": 1, "money": 4 }, { "name": "f", "age": 4, "money": 1 }, { "name": "c", "age": 2, "money": 3 }, { "name": "a", "age": 0, "money": 1}, { "name": "f", "age": 4, "money": 3 }, { "name": "c", "age": 1, "money": 4 }, { "name": "c", "age": 3, "money": 1 } ]; var data = data.multiSort({ name: "asc", age: "desc", money: "desc" }); console.log(data); /* { "name": "a", "age": 1, "money": 4 }, { "name": "a", "age": 0, "money": 1}, { "name": "c", "age": 3, "money": 1 } { "name": "c", "age": 2, "money": 3 }, { "name": "c", "age": 1, "money": 4 }, { "name": "f", "age": 4, "money": 3 }, { "name": "f", "age": 4, "money": 1 } */ I'm totally stuck and I don't get how to achieve this. Lots people point out this simple piece of code but I do not understand how it is supposed to achieve what I'm trying to do. https://github.com/Teun/thenBy.js This is the code I have right now. I know I'm pretty far from the solution, but I'd appreciate any help to understand how to get there since I need to improve a lot on javascript. Array.prototype.multiSort = function(sorters){ function getNextSorter(sorters, currentSorterKey) { var sortersKeys = Object.keys(sorters); if(!currentSorterKey) currentSorterIndex = 0; else currentSorterIndex = sortersKeys.indexOf(currentSorterKey) + 1; var key = sortersKeys[currentSorterIndex]; var order = sorters[key]; } function compare(a, b, key, order) { var a = a[key]; var b = b[key]; //if both numbers compare them as numbers and not as strings var numericA = parseFloat(a); var numericB = parseFloat(b); if(!isNaN(numericA) &amp;&amp; !isNaN(numericB)) { a = numericA; b = numericB; } //if different compare them with the given order if(a != b) return (order == "asc") ? a - b : b - a; //else compare next key as specified in sorters (if next key is present!) else //how to recursively call to get the next compare function? } //how to call…
has title: Sort by multiple keys and multiple orders in javascript
accepted answer: http://stackoverflow.com/a/27364395
has comment: http://stackoverflow.com/comment/43179905
possible better answer: http://stackoverflow.com/a/27364519

http://stackoverflow.com/q/27328347
tagged with: html5-canvas
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27328460
accepted answer: http://stackoverflow.com/a/27328460
has body: I've drawn two circles on the canvas (one with a velocity and one with some controls) and I've been trying to draw an image on each of them, but I have no clue how to do this. I've uploaded the images. Anyone know how? Also, does someone know why my velocity x keys for the red circle aren't working? Code: http://jsbin.com/vawitiziro/4/edit
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
has title: How to draw images on circles
tagged with: javascript
upvote count: 2

http://stackoverflow.com/a/27354728
has body: Here a working FIDDLE. Too much eventlisteners and some logical errors. New jQuery code: $("#Dropdown1, #Dropdown2").change(function(){ if($("#Dropdown1").val() == 'A'){ if($('#Dropdown2').val() == '1'){ $('#txt1').val('10.00'); $('#txt2').val('15.00'); }else if($('#Dropdown2').val() == '2'){ $('#txt1').val('45.00'); $('#txt2').val('23.00'); }else { $('#txt1').val('30.00'); $('#txt2').val('53.00'); } } if($("#Dropdown1").val() == 'B'){ if($('#Dropdown2').val() == '1'){ $('#txt1').val('11.00'); $('#txt2').val('17.00'); }else if($('#Dropdown2').val() == '2'){ $('#txt1').val('23.76'); $('#txt2').val('46.00'); }else { $('#txt1').val('33.00'); $('#txt2').val('53.76'); } } if($("#Dropdown1").val() == 'C'){ if($('#Dropdown2').val() == '1'){ $('#txt1').val('20.00'); $('#txt2').val('17.00'); }else if($('#Dropdown2').val() == '2'){ $('#txt1').val('23.76'); $('#txt2').val('40.00'); }else { $('#txt1').val('37.00'); $('#txt2').val('43.76'); } } subtotal(); }); EDIT: Forgot the subtotal function: function subtotal(){ var a = document.getElementById("txt1").value; var b = document.getElementById("txt2").value; var stotal = parseInt(a)+ parseInt(b); $('#total').val("$" + stotal); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27354488

http://stackoverflow.com/q/27424572
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27424783
accepted answer: http://stackoverflow.com/a/27424783
has title: Set style if not done already
has body: If scrollTop has a certain value I want to set a style. If the style is set already the code should not run again. How can I implement that in a efficient way? $(window).scroll(function() { var scrollTop = $(window).scrollTop(); if (scrollTop &gt;= winH) { $('box').css({ 'position':'absolute', 'top': winH }); } });
has comment: http://stackoverflow.com/comment/43291249
has comment: http://stackoverflow.com/comment/43291041

http://stackoverflow.com/q/27419048
score: 3
tagged with: convention
has comment: http://stackoverflow.com/comment/43281374
upvote count: 3
has comment: http://stackoverflow.com/comment/43281342
has answer: http://stackoverflow.com/a/27425783
has title: What is the javascript convention for libraries / classes when the name starts with a number?
has comment: http://stackoverflow.com/comment/43300752
has comment: http://stackoverflow.com/comment/43282212
type: UnansweredQuestion
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43293055
has body: In javascript the name of a variable can't start with a number. However, we're working under a name that starts with a number, for example, 1world. In C++ or C# I would prefix a C for a class or N for the namespace: C1world or N1world. Is there a convention in javascript to deal with this?
favorite count: 0
has comment: http://stackoverflow.com/comment/43293091
type: Question

http://stackoverflow.com/comment/43397019
comment on: http://stackoverflow.com/a/27477544
has text: That doesn't seem to solve my issue, it just switches truthy and falsy branches.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43244531
comment on: http://stackoverflow.com/a/27398952
has text: Ok, you missed the concatenation symbol. Anyway it always prints `Mozilla/5.0 (Windows NT6.1; Win64; x6 [...]`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27359448
tagged with: angularjs
has title: How does it make sense to use the variable name used to name a function inside that same function?
upvote count: 2
tagged with: ngresource
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27359587
has comment: http://stackoverflow.com/comment/43171315
type: Question
has answer: http://stackoverflow.com/a/27359592
has comment: http://stackoverflow.com/comment/43171292
answer count: 2
has comment: http://stackoverflow.com/comment/43171386
possible better answer: http://stackoverflow.com/a/27359587
has comment: http://stackoverflow.com/comment/43171190
has comment: http://stackoverflow.com/comment/45133237
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43171257
favorite count: 0
has comment: http://stackoverflow.com/comment/43171169
has comment: http://stackoverflow.com/comment/43171282
accepted answer: http://stackoverflow.com/a/27359592
has body: In this snippet, from the Angular documentation on $resource, the name of the function is user and inside the function they are using a variable of the same name. var User = $resource('/user/:userId', {userId:'@id'}); var user = User.get({userId:123}, function() { user.abc = true; user.$save(); }); How does that make sense? And what are the rules around this?

http://stackoverflow.com/comment/43160942
comment on: http://stackoverflow.com/q/27353541
score: 0
type: Comment
type: QuestionComment
has text: @Sarah I posted it as an answer.

http://stackoverflow.com/q/27329521
score: 0
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27329641
tagged with: http://stackoverflow.com/tag/json
tagged with: highcharts
answer count: 1
tagged with: javascript
has body: Dates are driving me nuts. I have a form that generates an object on submission: formContents.date is "2011-02-25" var dateObject = new Date(formContents.date); So now dateObject is a JS object (Wed Feb 25 2011 08:00:00 GMT+0800 (HKT)) When I send this over as JSON to my server and then retrieve it again the response that I get back is now a string. "Wed Feb 25 2011 08:00:00 GMT+0800 (HKT)" If I plug this string directly into HighCharts it doesn't work - HighCharts seems to require that all dates be in the form: Date.UTC(2011, 02, 25) Is JSON not able to send JS objects or something? How do I make sure that my response is Date.UTC(2011, 02, 25) So that HighCharts can understand it?
has title: How to properly deal with date objects in JSON and HighCharts?
has comment: http://stackoverflow.com/comment/43166973

http://stackoverflow.com/comment/43330252
type: AnswerComment
has text: I would be inclined to use `$("body").on('change', '.selects', function() {` ... this will handle dynamically added elements more efficiently.
type: Comment
comment on: http://stackoverflow.com/a/27445666
score: 0

http://stackoverflow.com/comment/43266624
comment on: http://stackoverflow.com/a/27410998
type: Comment
has text: This worked!! thanks @robert i should have asked if someone knew of a better way of doing this! thanks man!
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43278080
type: Comment
has text: I've edited answer with possible solution for accessing the value. But note your should **NEVER** render controls (`HiddenFor()`, `TextBoxFor()` etc) in a `foreach` loop like this
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27417196

http://stackoverflow.com/comment/43536767
type: QuestionComment
has text: Ah, I didn't realize I could answer my own question.
comment on: http://stackoverflow.com/q/27454211
score: 0
type: Comment

http://stackoverflow.com/comment/43346737
type: QuestionComment
has text: Glad I was able to be of help and just submitted the info of the comments and the detail of the adjustment as an answer.
comment on: http://stackoverflow.com/q/27434803
type: Comment
score: 0

http://stackoverflow.com/comment/43370445
has text: You will have to parse the HTML to find URLs for external resources. [Use the search](https://stackoverflow.com/search?q=%5Bjava%5D+parse+html).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27467332

http://stackoverflow.com/a/27456615
score: 0
has body: this refers to the object obj when you pass this in a function: var obj = { name : 'object', itis : function(){ return this.name; } } obj.itis();//'object'
type: Answer
answers question: http://stackoverflow.com/q/27456494

http://stackoverflow.com/a/27414138
type: AcceptedAnswer
has body: I found a work around that solved my problem. Instead of displaying the table with a google-apps script inserted directly on the page I put my code in an .xml file hosted on my Google Drive then inserted it as a gadget on my page. Here is the same table from above only in gadget (.xml) form, which now displays the HTML properly on the Google Site page. <?xml version = "1.0" encoding="UTF-8" ?>
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27387709
answers question: http://stackoverflow.com/q/27387709
upvote count: 1

http://stackoverflow.com/comment/43170406
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27359123
has text: Why would you use `forEach` and `push` when `map` does exactly the same thing? And why would you use `valueYes[index]` when you already have it in `item`?

http://stackoverflow.com/q/27397327
has title: Iframe content to store in textarea
has body: Is there a way to retrieve the content from iframe and store it in textarea using pure JavaScript?? I have retireve the content from iframe using following code: function getIframeContent(){ var frameObj = document.getElementById(frameId); var frameContent = frameObj.contentWindow.document.body.innerHTML; alert("frame content : "+frameContent); } Now how to store it in the textarea??
tagged with: javascript
duplicate of: http://stackoverflow.com/q/1642447
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27398150
has comment: http://stackoverflow.com/comment/43242144
linked to: http://stackoverflow.com/q/1642447
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/43248862
type: UnansweredQuestion

http://stackoverflow.com/a/27456473
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27445749
answers question: http://stackoverflow.com/q/27445749
has body: on fullcalendar.js after line 4810 I have have manually add this event. $(node).mouseenter(function() { view.trigger('dayMouseenter', null, date, $(node)); });
score: 0

http://stackoverflow.com/q/27364532
answer count: 2
tagged with: google-maps
has answer: http://stackoverflow.com/a/27364898
has comment: http://stackoverflow.com/comment/43181202
has title: Label is displayed above the markers - MarkerWithLabel
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27364898
has comment: http://stackoverflow.com/comment/43182801
tagged with: google-maps-markers
has comment: http://stackoverflow.com/comment/43181459
has comment: http://stackoverflow.com/comment/43180960
has comment: http://stackoverflow.com/comment/43182544
favorite count: 0
has answer: http://stackoverflow.com/a/27386460
upvote count: 1
has body: Javascript (see MarkerWithLabel docs) var marker1 = new MarkerWithLabel({ position: homeLatLng, draggable: true, raiseOnDrag: true, map: map, labelContent: "$425K", labelAnchor: new google.maps.Point(22, 0), labelClass: "marker", // the CSS class for the label labelStyle: {opacity: 0.75} }); CSS: .marker { color: #fff; font-size: 16px; line-height: 23px; min-width: 36px; text-align: center; white-space: nowrap; } See the screenshot please - https://i.sstatic.net/YM0Uq.jpg Labels are always in front of a markers. JSFIDDLE Is it possible to fix it? Thank you.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43190364
score: 1
has comment: http://stackoverflow.com/comment/43180895
accepted answer: http://stackoverflow.com/a/27386460
type: Question

http://stackoverflow.com/a/27349380
accepted answer of: http://stackoverflow.com/q/27347331
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43175691
answers question: http://stackoverflow.com/q/27347331
has body: Have a look at my answer I just gave in a similar question about Angular: Angular and Laravel In the text, just mentally replace Angular with Backbone. How to pass the route from Laravel to Backbone: The base view, that is returned from Laravel for the '/' route needs to have something like this somewhere in its &lt;head&gt; before backbone.js is included: &lt;script&gt; var myRoute = "{{ $route }}"; &lt;/script&gt; This blade template creates a Javascript variable. Then, after you declared your routes in Backbone, add this: Backbone.history.start(); // You should already have this line, so just add the next one App.nav.navigate(myRoute); This should do the trick.
type: Answer
has comment: http://stackoverflow.com/comment/43231080
has comment: http://stackoverflow.com/comment/43230044
score: 0
has comment: http://stackoverflow.com/comment/43180166

http://stackoverflow.com/q/27315057
has answer: http://stackoverflow.com/a/27315220
favorite count: 0
has comment: http://stackoverflow.com/comment/43090088
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/43090176
tagged with: php
has comment: http://stackoverflow.com/comment/43089958
has comment: http://stackoverflow.com/comment/43090053
has body: Below is the array which contains 8 elements .i want to break this into a group of first 4 then 4 and next 4 and so on if it contains more elements.I want to do this using javascript or jquery. need help ["30", "1", "asad", "23", "31", "1", "amit", "45"] Want to Break into this format [30]=&gt;['30','1','asad,'23''] [31]=&gt;['31','1','amit','45'] after getting these comma separated values how to store that in php variable so as to insert multiple values one after the other.
type: Question
downvote count: 4
upvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27315240
has comment: http://stackoverflow.com/comment/43090134
answer count: 3
has comment: http://stackoverflow.com/comment/43090031
has comment: http://stackoverflow.com/comment/43090245
has answer: http://stackoverflow.com/a/27315259
has title: I have an array of elements.Want to break into group with the first value as the key.

http://stackoverflow.com/comment/43243810
comment on: http://stackoverflow.com/a/27399157
has text: its now working for me . error :500 TypeError: Property 'query' of object #<IncomingMessage> is not a function
score: 0
type: AnswerComment
type: Comment

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/27396688
tags question: http://stackoverflow.com/q/27337026
tags question: http://stackoverflow.com/q/27454473
type: Tag
tags question: http://stackoverflow.com/q/27345856

http://stackoverflow.com/a/27441697
has body: Or you can wrap your item value into an object angular.module("displayText", []) .controller("submitText", function($scope) { $scope.outputArr = []; $scope.print = function() { $scope.outputArr.push({ text : $scope.inputText }); }; }); Submit {{entry.text}}
answers question: http://stackoverflow.com/q/27441405
type: Answer
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/43190136
score: 0
has text: You have a server-side object (a class or something) that has data, and you are binding a collection of them to a control that acts like a repeater for many instances of the object. You're saying you only need one of those objects, though. Either find a way to create a unique ID or selector for the one label you want so you can select it with Javascript, or stop using the DataList entirely and get the one instance of the data you need on the server side and expose it in the markup. You can just do document.getElementById("fname").value = <% myInstance.artikli_na_skladistu.skladista.Adresa %>
comment on: http://stackoverflow.com/a/27369001
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27417569
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/27417499
type: Answer
has comment: http://stackoverflow.com/comment/43278510
has body: Hi for you to be able to save it on your database you have to store it inside a form and have a submit button to trigger the saving. model NameSpaceForYourModel Employee @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.Region, htmlAttributes: new { @class = "control-label col-md-2" }) @if (User.IsInRole("RiyadhAdminAssistant")) { @Html.TextboxFor(m=>m.Riyadh) } @if (User.IsInRole("JeddahAdminAssistant")) { @Html.TextboxFor(m=>m.Jeddah) } @if (User.IsInRole("AlAhsaAdminAssistant")) { @* AlAhsa *@ @Html.TextboxFor(m=>m.Alahsa) }

http://stackoverflow.com/comment/43319093
type: Comment
comment on: http://stackoverflow.com/a/27428374
has text: hi. yes mask is actually a function and when that view loads i can see this mask on the text box. i had such an interesting problem: 1st scenario: when i first don't fill that box and click the button it posts the form and gives an error like "enter your number" and then when i enter the number and click the button it post the form, it was ok. 2nd scenario: when the view loads for the first time and i enter the number correctly and then click the submit button it don't react.
score: 0
type: AnswerComment

http://stackoverflow.com/a/27371885
has comment: http://stackoverflow.com/comment/43196030
has comment: http://stackoverflow.com/comment/43196469
has comment: http://stackoverflow.com/comment/43196430
has comment: http://stackoverflow.com/comment/43196383
downvote count: 0
has comment: http://stackoverflow.com/comment/43196429
type: Answer
has comment: http://stackoverflow.com/comment/43196164
has comment: http://stackoverflow.com/comment/43196801
has body: Notifying a million of anything is a lot of packets and if the thing you're notifying occurs a lot, that's a lot of a lot and it's even more than a lot to try to show on screen. The usual first things to consider are: How real-time do these notifications really have to be? Can you batch up 60 seconds or longer of notifications into one packet per user per notification period? Does every user really have to see every single change from every other user. You know there's absolutely no way that any user interface can present the state of a million other users. So, I'd argue that every user doesn't have to know about the state of every other user. Maybe if there's 1-50 other users, but not if there's a million. Can you algorithmically determine which users state a given user might be interested in and only broadcast to them. For example, can you keep them up to date only on other users that are geographically near them? Can you have a user interface where the user tells you which other users they want to track so you only update those? Or perhaps some combination of users they tell you about and users who are geograpnhically interesting to them. The point is that you can't watch a million users anyway so you're going to have to invent a UI that shows a lot less than that anyway. You can always have a UI that will fetch the state of other users upon demand if the client doesn't already have that state, so you don't have to keep the state for all million users in each client (since it can't possibly all be shown at once anyway). If the user browses to see some things they don't already have, you just fetch it from the server via the socket or ajax call. Oh, and at the scale you're talking about, you are probably going to need to have your user's connections spread out among several servers so you're going to have to handle that complexity too.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43195292
answers question: http://stackoverflow.com/q/27371554

http://stackoverflow.com/q/27374340
has body: I'm using the semantic-ui framework to create a simple search form that uses auto-complete information generated by calling an api via an ajax request. The server endpoint generates a simple JSON array e.g. http://data.nzor.org.nz/names/lookups?query=lu gives ["Lubbockia","Lubbockia aculeata","Lubbockia squillimana","Lucanidae"] I can see the search making the request but I'm not sure how to get the results to display. I have created a jsfiddle at http://jsfiddle.net/6ojkdvnn/4/ $(document) .ready(function () { $('.ui.search') .search({ apiSettings: { url: 'http://data.nzor.org.nz/names/lookups?query={query}' }, debug: true, verbose: true }); }); I have tried various options but have now stripped it back to the basic settings above so as not to confuse the matter. The documentation is pretty good (http://semantic-ui.com/modules/search.html) but I can't quite see how to make it work. I'd prefer not change the api response if it can be helped.
score: 3
has answer: http://stackoverflow.com/a/29171013
upvote count: 3
type: Question
has answer: http://stackoverflow.com/a/27374425
tagged with: javascript
answer count: 3
has title: Auto-complete or type-ahead search box using the semantic-ui framework and an ajax request
downvote count: 0
has answer: http://stackoverflow.com/a/32937262
favorite count: 0
tagged with: semantic-ui
type: UnansweredQuestion

http://stackoverflow.com/a/27470667
accepted answer of: http://stackoverflow.com/q/27469885
answers question: http://stackoverflow.com/q/27469885
has comment: http://stackoverflow.com/comment/43431137
type: AcceptedAnswer
downvote count: 0
score: 1
has body: There are a few ways to solve this. It depends on how you want to use the actual module. Only one instance for every socket, or one for each socket. I suggest you make your module return a constructor instead of an object literal, like below: module.exports = function(socket) { var socket = socket; this.refresh = function (msg) { socket.emit('refresh', { message: msg }); } this.lock = function (msg) { socket.emit('lock', { message: msg }); } } Then you can create new objects containing the actual socket. var Period = require('./server/functions/period.js'), period = new Period(socket); One solution would probably be to do this with every connecting socket. var periodModule = require('./server/functions/period.js'), io.on('connection', function(socket){ var period = new periodModule(socket); //make a call period.refresh(); }); You could also pass the io object in to your module to get the broadcasting interface as well. module.exports = function(socket, io) { var socket = socket, io = io; this.broadcastSomething = function(..) { io.emit('data', { data: 'data'}); } this.refresh = function (msg) { socket.emit('refresh', { message: msg }); } this.lock = function (msg) { socket.emit('lock', { message: msg }); } }
has comment: http://stackoverflow.com/comment/43376479
type: Answer
has comment: http://stackoverflow.com/comment/43431791
has comment: http://stackoverflow.com/comment/43376900
upvote count: 1
has comment: http://stackoverflow.com/comment/43376543

http://stackoverflow.com/comment/43151703
comment on: http://stackoverflow.com/q/27348514
has text: It looks like you might want to be using an array and not an object here...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/57102403
comment on: http://stackoverflow.com/q/27323031
score: 1
has text: If you are using babel then you can also simply mock modules with [babel-plugin-rewire](https://www.npmjs.com/package/babel-plugin-rewire) instead of a dedicated webpack or browserify loader.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27368048
has comment: http://stackoverflow.com/comment/43190119
has comment: http://stackoverflow.com/comment/43190158
type: Answer
has comment: http://stackoverflow.com/comment/43188707
upvote count: 10
accepted answer of: http://stackoverflow.com/q/27367289
answers question: http://stackoverflow.com/q/27367289
has body: tl;dr; — 3-way data-binding does not work with ControllerAs syntax. The bindTo method requires $scope. You can use AngularFire with ControllerAs syntax, but you can't use it with ControllerAs with $bindTo. $bindTo has a hard dependency on $scope and it will break without it. If you want an example of using AngularFire with ControllerAs syntax, check out this Plunker demo. angular.module('app', ['firebase']) // constant for the Firebase we're using .constant('FBURL', 'https://<your-firebase>.firebaseio.com/todos') // return the Firebase ref as a service .service('Ref', ['FBURL', Firebase]) // return the Todos from Firebase by returning the // array from the factory .factory('Todos', function(Ref, $firebase) { return $firebase(Ref).$asArray(); }) // inject the Todos and assign them to "this" // for the ControllerAs syntax .controller('MainCtrl', function(Todos) { this.todos = Todos; });
type: AcceptedAnswer
downvote count: 0
score: 10
has comment: http://stackoverflow.com/comment/43190663

http://stackoverflow.com/comment/43119031
has text: when value in textbox changes ? you need to use `onkeyup` or similar approaches
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27330512
score: 1

http://stackoverflow.com/comment/43166418
comment on: http://stackoverflow.com/a/27356943
type: Comment
has text: Acutally i m using check box with image like thumb if user click on yes then value return will 1 and if user click on thumb again then value will return 0
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43205683
type: QuestionComment
has text: Have you checked whether `$wnd.$("#" + id)` is providing access to the field you need?
comment on: http://stackoverflow.com/q/27375857
score: 0
type: Comment

http://stackoverflow.com/a/27397391
answers question: http://stackoverflow.com/q/27397275
has comment: http://stackoverflow.com/comment/43242569
has comment: http://stackoverflow.com/comment/43241932
has comment: http://stackoverflow.com/comment/43241037
has body: I think I've come up with a easy solution for you. $('#radio1').click(function() { $('#res').html(""); $('#res').load("index.html #target"); //where Target stands for the DIV inside the html file }); $('#radio2').click(function() { $('#res').html(""); $('#res').load("index.html #target"); }); Let me know if helped you, happy scripting! UPDATE In case you want to use a var instead of specifying the proper div ID or the html file you could use $('#res').load(htmlVar".html #"+divVar); But since you're using ID's you have to use the # before the ID of the div. For more info visit: http://api.jquery.com/load/ (Loading Page Elements).
downvote count: 0
has comment: http://stackoverflow.com/comment/43243179
type: Answer
has comment: http://stackoverflow.com/comment/43243080
score: 1
upvote count: 1

http://stackoverflow.com/q/27322149
has comment: http://stackoverflow.com/comment/43106612
linked to: http://stackoverflow.com/q/26226583
tagged with: javascript
score: 4
tagged with: braintree
upvote count: 4
linked to: http://stackoverflow.com/q/10677491
linked to: http://stackoverflow.com/q/17460123
has answer: http://stackoverflow.com/a/27325071
accepted answer: http://stackoverflow.com/a/27325071
answer count: 1
downvote count: 0
tagged with: meteor
tagged with: asynchronous
has title: Meteor Braintree -- Create Client Token via Meteor Method
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
type: AnsweredQuestion
has body: I'm trying to get Braintree Payments working in a Meteor app. I'm stuck at trying to return the result of generating a token (server side, via a Meteor Method) to be used client side. I've tried this: /server/braintree.js Meteor.methods({ createClientToken: function() { var token = gateway.clientToken.generate({ customerId: this.userId }, function(err, response) { clientToken = response.clientToken return clientToken } ) console.log(token) return token } }) which returns true. I've also tried this: Meteor.methods({ createClientToken: function() { var clientToken gateway.clientToken.generate({ customerId: this.userId }, function(err, response) { clientToken = response.clientToken } ) console.log(clientToken) return clientToken } }) Which returns undefined. The function(err, response) is being called asynchronously, yes? If so, that would be the explanation of the problem. Seems that trying to return a value from an asynchronous function is a bit of a pain point in Javascript. I've read a number of SO answers on it (like this one, this one and this one) but none have seemed to lead me in the right direction. Also, I believe I may need to be using Meteor's wrapAsync method, correct? I've tried this (and found this and this relevant SO questions on it), but still can't seem to get things right. Grateful for any feedback. Update: For a working approach to integrating Braintree with Meteor, check out the example repo (many thanks @Nick Tomlin for this)
linked to: http://stackoverflow.com/q/6847697
linked to: http://stackoverflow.com/q/12569712
type: Question

http://stackoverflow.com/comment/43195033
score: 0
type: Comment
type: QuestionComment
has text: I would use promises to chain a sequence of operations. `operation1.then(operation2).then(operation3)`.
comment on: http://stackoverflow.com/q/27370896

http://stackoverflow.com/comment/43249025
score: 0
has text: oh, and this too, should be : `.push({ISBN: this.val});`
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27402139

http://stackoverflow.com/comment/43226839
score: 1
type: Comment
has text: Clicking the button will refresh the page (because it will submit the form). Add `type="button"` to the button.
comment on: http://stackoverflow.com/q/27389425
type: QuestionComment

http://stackoverflow.com/a/27367053
score: 4
has body: The abstract operation ToBoolean converts its argument to a value of type Boolean according to Table 11: Undefined false Null false Boolean The result equals the input argument (no conversion). Number The result is false if the argument is +0, -0, or NaN; otherwise the result is true. String The result is false if the argument is the empty String (its length is zero); otherwise the result is true. Object true 0 will return false. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
answers question: http://stackoverflow.com/q/27366961
upvote count: 4
has comment: http://stackoverflow.com/comment/43186136
downvote count: 0
has comment: http://stackoverflow.com/comment/43186168
type: Answer

http://stackoverflow.com/comment/43304775
comment on: http://stackoverflow.com/q/27431762
type: Comment
type: QuestionComment
has text: *sigh* stop trying to parse html with regex...
score: 3

http://stackoverflow.com/comment/43109349
type: QuestionComment
comment on: http://stackoverflow.com/q/27324802
score: 1
has text: @Tvaroh I don't know; it seems strange.
type: Comment

http://stackoverflow.com/a/27315335
type: Answer
has comment: http://stackoverflow.com/comment/43093275
has comment: http://stackoverflow.com/comment/43093693
has body: IndexedDB is an object-oriented database, not a relational database. The closest analog to SQL tables is object stores, created with IDBDatabase.createObjectStore. Object stores don't have a fixed schema, so a call to IDBObjectStore.put can accept objects with any fields so long as the object has a keyPath field or the keyPath is made optional by setting {autoIncrement: true}. By default, you can only query for documents using the keyPath. To query documents using other fields, an index must be created using IDBObjectStore.createIndex This is an excerpt from an application that looks up contacts using a prefix of number or name. dbReq.onupgradeneeded = function (event) { var db = event.target.result, objectStore = db.createObjectStore('calls', {keyPath: 'timestamp'}), contactStore = db.createObjectStore('contacts', {autoIncrement: true}); objectStore.createIndex('number', 'number', {unique: false}); contactStore.createIndex('number', 'number'); contactStore.createIndex('name', 'name', {unique: false}); objectStore.createIndex('timestamp', 'timestamp', {unique: true}); }; Find by prefix: findPrefix: function(prefix, fn) { var transaction = this.db.transaction(['contacts', 'calls']), contactStore = transaction.objectStore('contacts'), callStore = transaction.objectStore('calls'), numberIndex = callStore.index('number'), nameIndex = contactStore.index('name'), key = IDBKeyRange.bound(prefix, prefix + '\uffff'), times = 0, result = [], consume = function(records) { result = result.concat(records); if (++times === 2) { /* Remove duplicate numbers: names and numbers may have the same value*/ var numbers = {}; result = result.filter(function(contact) { if (!numbers[contact.number]) { return (numbers[contact.number] = true); } return false; }); fn(result); } }; this.consumeCursor(numberIndex.openCursor(key, 'nextunique'), consume); this.consumeCursor(nameIndex.openCursor(key), consume); } More on IndexedDB
accepted answer of: http://stackoverflow.com/q/27314334
upvote count: 5
has comment: http://stackoverflow.com/comment/43092100
has comment: http://stackoverflow.com/comment/43093398
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43092742
answers question: http://stackoverflow.com/q/27314334
has comment: http://stackoverflow.com/comment/43092872
has comment: http://stackoverflow.com/comment/43093087

http://stackoverflow.com/comment/43251205
type: QuestionComment
score: 3
has text: that's a browser cache problem... if it's sensitive, then output the page with no-cache headers.
comment on: http://stackoverflow.com/q/27403062
type: Comment

http://stackoverflow.com/a/27321852
has body: Fast solution: $('select[name="teas"]').on('change', function (e) {...}).trigger('change');
answers question: http://stackoverflow.com/q/27321527
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43103054
upvote count: 2

http://stackoverflow.com/comment/43253261
type: AnswerComment
comment on: http://stackoverflow.com/a/27403836
score: 0
type: Comment
has text: Correct. See the note in the answer about using server side code.

http://stackoverflow.com/q/27439655
type: UnansweredQuestion
has body: I've made a program in Python 2.7 with a wxWidgets GUI. Now, I want to improve it by making a web GUI, make it multi-platform and port it in Python 3.4. For this purpose, I have to make Javascript and Python communicate (i.e : I want my Python to react on some event on the page and I want my page to react on some Python actions). I don't really know how to do it, and I don't even know if it's possible. I've find some libraries, but some are just for Python 2 (pyjamas), and some don't provide what I search, or I don't search enough ^^ (web2py, turbogear, cherrypy). I would like to find a complete library that ease this communication, and that is rather known and supported, with a compete documentation. Maybe, there are other ways to do such a web GUI, but I don't find them. Thanks !
tagged with: python
downvote count: 2
has answer: http://stackoverflow.com/a/27439720
type: Question
score: -2
tagged with: javascript
has title: How to make a web GUI for Python 3 (Javascript communications)?
upvote count: 0
answer count: 1
tagged with: user-interface
tagged with: web
favorite count: 0
tagged with: python-3.x

appium
tags question: http://stackoverflow.com/q/27406450
tag name: appium
type: Tag

http://stackoverflow.com/comment/43378570
type: Comment
comment on: http://stackoverflow.com/a/27471955
has text: I see, tyvm! So, there is no native function to accomplish this in an array?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43142143
type: QuestionComment
has text: Thanks for the hint, i knew about the getElementById but the lecturers just wrote document... etc in the examples.
comment on: http://stackoverflow.com/q/27343018
score: 0
type: Comment

http://stackoverflow.com/q/27326681
accepted answer: http://stackoverflow.com/a/27328410
has title: Passing objects from servlets to client side(javascript)
tagged with: javascript
tagged with: servlets
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43112410
tagged with: jsp
favorite count: 0
has answer: http://stackoverflow.com/a/27328410
has body: I'd like to know what is the best way to pass data from servlet to js code. The only solution that came up to my mind is to serialize object to json string, then pass it as an request attribute to jsp page and then get it in js code and deserialize. Is there a better approach to do this?
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: java
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43112945
type: Question

http://stackoverflow.com/a/27324841
answers question: http://stackoverflow.com/q/27324822
has body: It is. What you see is the index / name of property in the string. Indexing the string like "abc"[0] results in a. You may index an object with the property name too. var x = { foo: "hi" }; console.log(x["foo"]); The loop just goes through all members of the object.
type: Answer
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/43157754
score: 0
has text: @323go ohh thanks for this information but is there any hack to get it work on android cordova mobile app
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27351466

http://stackoverflow.com/comment/43373969
type: QuestionComment
has text: Jukka: Oh I would very much like to fix the markup, but that'd be a lot of work. It's a good advise for most cases, but in this case I want to avoid manipulating the text as far as possible.
comment on: http://stackoverflow.com/q/27446141
score: 0
type: Comment

http://stackoverflow.com/a/27432011
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/27431912
accepted answer of: http://stackoverflow.com/q/27431912
upvote count: 3
has body: this.element is a native DOM element, accessed via JavaScript, not jQuery, so the .attr() jQuery funciton will not work on it. Try ... $(this.element).attr("id");
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/27420356
has body: Since you are populating data from outside of Angular world, you just need to kick off digest loop manually once you are done: if (data.length &gt; 0) { for (var v = 0; v &lt; data.length; v++) { $rootScope.Favorites.push(data[v]); } $rootScope.$apply(); }
has comment: http://stackoverflow.com/comment/43283501
score: 0
answers question: http://stackoverflow.com/q/27420266
type: Answer

http://stackoverflow.com/q/27406202
tagged with: select
upvote count: 1
has answer: http://stackoverflow.com/a/27406238
has body: I have a dropdown menu and when "Internal" is selected I want to hide certain text (The id="hide-this" part). Why isn't my code working? Also, this needs to be executed with Javascript! HTML Affiliate Type: Internal External Network Restrict access to web Restrict access to app Javascript var sel = document.getElementById('affiliate_type'); if (sel.options[sel.selectedIndex].value == 'internal') { document.getElementById('hide-this').style.display = 'none'; }
type: Question
has title: Getting Select Option Value with Javascript
score: 1
has comment: http://stackoverflow.com/comment/43257196
accepted answer: http://stackoverflow.com/a/27406238
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/a/27388685
has comment: http://stackoverflow.com/comment/43225576
score: 1
upvote count: 1
has body: From the slick.js usage docs: Add slick.css in your &lt; head > &lt;link rel="stylesheet" type="text/css" href="slick/slick.css"/&gt;
answers question: http://stackoverflow.com/q/27388630
has comment: http://stackoverflow.com/comment/43226951
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43226130
accepted answer of: http://stackoverflow.com/q/27388630
has comment: http://stackoverflow.com/comment/43225526
has comment: http://stackoverflow.com/comment/43225487
type: Answer
has comment: http://stackoverflow.com/comment/43225641

http://stackoverflow.com/comment/43296865
score: 0
has text: Thanks for the heads up. However, this still doesn't work for me and it doesn't work for me in your jsfiddle example either. jsfiddle doesn't even appear to support jquery 1.4.2. Just to clarify, I need that alert to show when "testing the call" is added to the empty text field.
type: Comment
comment on: http://stackoverflow.com/a/27427559
type: AnswerComment

http://stackoverflow.com/a/74096275
type: Answer
answers question: http://stackoverflow.com/q/27379232
has body: I'm a bit late coming to this party but I recently had this issue with Html.EditorFor. What fixed it for me was to simply switch to TextBoxFor. So instead of: @Html.EditorFor(model => model.ParticipantNumber, new { @class = "ParticipantNumber", disabled = "disabled", id="ParticipantNumber" }) Change it to: @Html.TextBoxFor(model => model.ParticipantNumber, new { @class = "ParticipantNumber", disabled = "disabled", id="ParticipantNumber" })
score: 0

http://stackoverflow.com/q/27443476
has comment: http://stackoverflow.com/comment/43326100
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43326076
tagged with: javascript
has comment: http://stackoverflow.com/comment/43436989
has comment: http://stackoverflow.com/comment/43326037
has comment: http://stackoverflow.com/comment/43326565
has answer: http://stackoverflow.com/a/27443548
favorite count: 0
has comment: http://stackoverflow.com/comment/43326419
upvote count: 0
has title: Passing data from one page to another
has comment: http://stackoverflow.com/comment/43326432
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43326765
has comment: http://stackoverflow.com/comment/43326172
score: -1
has body: Pls can anybody give me the clue of how to pass data from one page(test1.html) to another page(test2.html) and then later pass the previous 2 pages(test1 and test2.html) to a new page called last.html using javascript not php cos it is a local app. tanx
type: Question

http://stackoverflow.com/a/27400129
has comment: http://stackoverflow.com/comment/43246221
type: Answer
has comment: http://stackoverflow.com/comment/43246374
has comment: http://stackoverflow.com/comment/43253933
has body: No. Ajax requests do not come from the server. They come from the client. If you want to expose data on B to the Internet, then you would need the Ajax request to be made to A and then have A proxy the data from B.
score: 1
has comment: http://stackoverflow.com/comment/43245645
has comment: http://stackoverflow.com/comment/43245833
has comment: http://stackoverflow.com/comment/43245724
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/43245955
has comment: http://stackoverflow.com/comment/43245464
answers question: http://stackoverflow.com/q/27400091

http://stackoverflow.com/a/27365312
score: 0
has comment: http://stackoverflow.com/comment/43182640
has body: There's a Jquery method for almost every nested elements interation you can imagine... In you case, the most suitable would be jQuery's .parentsUntil(). As the name states, it will select every parent until a selector condition is met. As an optional second parameter, you can filter the results, narrowing the selection to just the type of element that you want. So, you would have something like: $(this).parentsUntil("#nav &gt; ul", "li").addClass("active"); This would target every parent li until it reaches the top most ul.
type: Answer
answers question: http://stackoverflow.com/q/27364607

http://stackoverflow.com/q/27342164
has comment: http://stackoverflow.com/comment/43140052
type: UnansweredQuestion
type: Question
tagged with: date
has answer: http://stackoverflow.com/a/27342212
answer count: 1
tagged with: javascript
score: 0
has title: Creating a date object from users input
has body: Trying to create a date object from a users inputted date of birth, then getDay from this date they enter: MONTHS = 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'; //months var dateString = prompt('Enter your birth date in the form dd mmm yyyy','26 APR 1988'); //get users date of birth var substrings = dateString.split(' '); var day = substrings[0]; var month = substrings[1]; var year = substrings[2]; var pos = MONTHS.indexOf(MONTHS); if (pos &gt;= 0) { } alert(MONTHS.indexOf(month)/3); var daysOfWeek = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; var daysOfWeek = new Date('day','month','year'); document.writeln(daysOfWeek.getDay());{ I'm not sure what to put in the new date object, i've tried a few things, am I totally off track?

http://stackoverflow.com/q/27432875
score: 1
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27432950
favorite count: 0
tagged with: scope
has body: I am trying to activate slicknav on a jquery object I build on the fly. This works lovely: (function($){ var mobilemenu={ slicknavEngage: function(){ $(mobileMenuIdentifier).slicknav(); } } var rebuildmenu={ start:function(){ var $menuParent = //some stuff I need to build menu $menuCategories = //more stuff I need for new menu $newMenu = $('&lt;div&gt;').attr('id','new-menu'); //my new menu object $menuCategories.each(function(i){ //build my new menu }); $newMenu.appendTo('body'); mobilemenu.slicknavEngage(); } } $(document).ready(rebuildmenu.start); })(jQuery); But I want to be able to set the mobile menu identifier as a config variable at the top of the closure like this, unfortunately it doesn't work, but I have ran console.log from many positions and the proper variable is always shown, why is it not working this way?? This is just a small portion of the script, as many other config variables have to be set so I want to be able to set this one also. What could be wrong? (function($){ //global to this closure var mobileMenuIdentifier = '#new-menu'; var mobilemenu={ slicknavEngage: function(){ $(mobileMenuIdentifier).slicknav(); } } var rebuildmenu={ start:function(){ var $menuParent = //some stuff I need to build menu $menuCategories = //more stuff I need for new menu $newMenu = $('&lt;div&gt;').attr('id',mobileMenuIdentifier); //my new menu object with the id set by variable - doesn't work! $menuCategories.each(function(i){ //build my new menu }); $newMenu.appendTo('body'); mobilemenu.slicknavEngage(); } } $(document).ready(rebuildmenu.start); })(jQuery);
tagged with: slicknav
accepted answer: http://stackoverflow.com/a/27432950
type: AnsweredQuestion
has title: Why won't slicknav engage on my jquery object with an ID set by a variable?

http://stackoverflow.com/comment/43095641
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27318006
type: Comment
has text: Where does `initializeApp` go? in the `lib` particle, or the routes particle?

http://stackoverflow.com/comment/74252636
type: AnswerComment
comment on: http://stackoverflow.com/a/31768275
type: Comment
has text: Just out of curiosity: do you still use LiveHTTPHeaders or have you found one that doesn’t throw this error?
score: 1

http://stackoverflow.com/a/27466079
has comment: http://stackoverflow.com/comment/43368195
type: Answer
has body: I think this FileZilla changes linebreaks as default and this cause the problem, follow this link to change this behaviour and test again: How can I stop Filezilla changing my linebreaks?
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/27465996

http://stackoverflow.com/q/27420130
has comment: http://stackoverflow.com/comment/43283329
tagged with: javascript
has title: I am having issues setting up cookies
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/28692458
linked to: http://stackoverflow.com/q/6417140
answer count: 1
favorite count: 0
tagged with: cookies
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/1458724
has body: Im making a mock online ordering site and it requires multivalued cookies but my code wont save anything. The cookie is supposed to contain the product name, price, and quantity. Any help would be appreciated. function setCookie(cName, cValue, expDate, cPath, cDomain, cSecure) { if (cName &amp;&amp; cValue != "") { var cString = cName + "=" + escape(cValue); cString += (expDate ? ";expires=" + expDate.toGMTString(): ""); cString += (cPath ? ";path=" + cPath : ""); cString += (cDomain ? ";domain=" + cDomain : ""); cString += (cSecure ? ";secure" : ""); document.cookie = cString; } } function setField(cName, fName, fValue, expDate, cPath, cDomain, cSecure) { if (cName &amp;&amp; fName &amp;&amp; fValue != "") { var subkey = fName + "=" + escape(fValue); var cValue = null; var cookies = document.cookie.split("; "); for (var i = 0; i &lt; cookies.length; i++) { if (cookies[i].split("=")[0] == cName) { cValue = cookies[i].slice(cookies[i].indexOf("=") + 1); break; } } if (cValue) { var foundField = false; var subkeys = cValue.split("&amp;"); for (var i = 0; i &lt; subkeys.length; i++) { if (subkeys[i].split("=")[0] == fName) { foundField = true; subkeys[i] = subkey; break; } } if (foundField) cValue = subkeys.join("&amp;") else cValue += "&amp;" + subkey; } else { cValue = subkey; } var cString = cName + "=" + cValue; cString += (expDate ? ";expires=" + expDate.toGMTString(): ""); cString += (cPath ? ";path=" + cPath : ""); cString += (cDomain ? ";domain=" + cDomain : ""); cString += (cSecure ? ";secure" : ""); document.cookie = cString; } }
score: 3

http://stackoverflow.com/comment/43216651
comment on: http://stackoverflow.com/q/27381735
has text: That depends on slider component used. If you have already implemented one, we can probably help you.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27386913
has comment: http://stackoverflow.com/comment/43221895
score: 0
answers question: http://stackoverflow.com/q/27386659
has comment: http://stackoverflow.com/comment/43223149
has comment: http://stackoverflow.com/comment/43221993
has body: In this case your table doesn't exist when you try to bind the click event to it. So we fix that first. Then we change previous() to prev() and we have it working! $('#search').on('click', function() { $('#searcharea').html(' Some Text Blah Blah Blah Blah '); }); $(document).on('click', '#myTable input', function (event) { var prevCell = $(this).closest('td').prev('td').text(); alert(prevCell); });
type: Answer
has comment: http://stackoverflow.com/comment/43222003
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43221965
has comment: http://stackoverflow.com/comment/43222161

http://stackoverflow.com/comment/43242253
type: Comment
type: QuestionComment
has text: You should probably re-apply the widget when the data changes. listen to "add" and "change" events, and call `editable` again.
score: 0
comment on: http://stackoverflow.com/q/27382437

http://stackoverflow.com/comment/43350386
type: AnswerComment
type: Comment
has text: nice try sir but as I said on my previous statement the reason why i Include the row['id'] is that I will be using it for different functions. so I think my php query is correct but my problem is the value that my code is getting is the option value not the text value
comment on: http://stackoverflow.com/a/27456360
score: 0

http://stackoverflow.com/comment/43359384
comment on: http://stackoverflow.com/q/27461508
type: Comment
type: QuestionComment
score: 0
has text: Oh I see I need return parseInt();

http://stackoverflow.com/q/27372682
has comment: http://stackoverflow.com/comment/43196403
has comment: http://stackoverflow.com/comment/43196625
tagged with: javascript
duplicate of: http://stackoverflow.com/q/13369829
score: 0
has title: Is there any way to AccessAll the search history of Browser with out using any API
has comment: http://stackoverflow.com/comment/43196444
tagged with: jquery
has comment: http://stackoverflow.com/comment/43196422
tagged with: asp.net
has comment: http://stackoverflow.com/comment/43196512
linked to: http://stackoverflow.com/q/13369829
has body: my question is How can i access all the history of Browser without using any API ? I search out lot to get answer of this Question but i Didn't get proper answer so please give me suggestion or reference ..
has comment: http://stackoverflow.com/comment/43196591
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: c#

http://stackoverflow.com/a/27356637
type: Answer
has body: Maven WAR Overlays could solve the problem. If you have two maven web projects, and one of your Web Project depends on the other's you could declare the dependent project as a dependency and do an overlay. Reference: http://maven.apache.org/plugins/maven-war-plugin/overlays.html
answers question: http://stackoverflow.com/q/27356410
score: 0

http://stackoverflow.com/comment/43317664
comment on: http://stackoverflow.com/a/27437956
has text: Updated plunker and answer
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27420264
upvote count: 1
type: AcceptedAnswer
has body: You can use a non-word boundary \B: \B#([a-zA-Z\u0400-\u04ff][a-zA-Z\d\u0400-\u04ff]*) An other possible way consists to capture all that you want to avoid in a capture group placed before your target, example: (pattern for links)|#([a-zA-Z\u0400-\u04ff][a-zA-Z\d\u0400-\u04ff]*) So with this pattern, if the group 1 exists, the replacement is $1, if it doesn't, use the replacement you want. (don't forget that now the hashtag is the capture group 2)
accepted answer of: http://stackoverflow.com/q/27419833
type: Answer
answers question: http://stackoverflow.com/q/27419833
downvote count: 0
score: 1

http://stackoverflow.com/q/27388645
has title: Bind rangy highlight to another element
tagged with: rangy
type: UnansweredQuestion
type: Question
has body: I'm trying to implement highlight-based comments similar to the ones on Medium.com where a users can highlight some text and associate a comment with that text. Using Rangy, I can use the elementProperties onclick callback to get the highlight id, which I can then use to toggle the associated comment and make it appear "active." What I can't figure out is how to do the opposite - click on the comment and add a class to the associated highlight element(s) to give them an "active" appearance. Alternatively, is there a way to apply one highlight at a time based on the highlight id instead of using deserialize and applying all previous highlights? I guess I could parse the serialized comments and search for the id I'm looking for in the string, but I figured there must be a cleaner way that I can't find in the docs. Any ideas?
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27389542

http://stackoverflow.com/q/27317110
favorite count: 0
tagged with: android
tagged with: css
tagged with: cordova
has title: Jquery mobile page disappear after image displayed with css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27360919
upvote count: 1
has body: I'm trying to use the file transfer with Jquery mobile and cordova on android, i use this tutorial to practice: http://blog.revivalx.com/2014/05/03/tutorial-camera-cordova-plugin-for-ios-and-android/ After selecting the picture, this function is call on success: function onPhotoDataSuccess(imageURI) { navigator.notification.alert("onPhotoDataSuccess Image URI: "+imageURI, function() {}); var cameraImage = document.getElementById('image'); cameraImage.style.display = 'block'; cameraImage.src = imageURI; } The notification show me the good file URI, so i presume it's ok, but when the application come back to the webview, the whole "page" and it's content disappear from the screen and another page appears, this page is the launcherpage that is displayed untill the device is ready, when it's ready, i change the page to login page. Loading... So i tried and changed this function with this code: function onPhotoDataSuccess(imageURI) { navigator.notification.alert("onPhotoDataSuccess Image URI: "+imageURI, function() {}); $('#image').attr({ src: imageURI, style: "display:block;width:100%;" }); } But i have the same result, there is no duplicate ids, i don't really understand why it's doing that. Here is the html code: TEST Capture Photo From Photo Library Title TEST EDIT I've noticed that when the launcherPage is displayed after the picture selection, if i tap my phone's back button, it displays the picture page correctly with the selected image included... EDIT 2 When i comment the launcherPage from the html code, after the picture selection, it displays the login page...
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27355060
has title: How to set the default value to the dropdown?
type: Question
score: -2
tagged with: javascript
has body: How to set the default value to dropdown menu? NAME* Retail
upvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27355105
tagged with: angularjs
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/comment/43193686
type: Comment
has text: I'm not sure stopping event propagation is the route to go, or the route I should take. Isn't there a way with JS to return the menu to it's default state? Something like `onClick='everything returns to normal';` ?
type: QuestionComment
comment on: http://stackoverflow.com/q/27370995
score: 0

http://stackoverflow.com/comment/43346656
score: 0
type: Comment
type: QuestionComment
has text: What is it that you're wanting to do inside of this loop?
comment on: http://stackoverflow.com/q/27317716

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/27405642

http://stackoverflow.com/a/27387913
score: 1
answers question: http://stackoverflow.com/q/27387589
downvote count: 0
has body: How about a recursive function? function loadImages($folder) { $files = glob($folder); foreach( $files as $file ) { if(is_dir($file)) { loadImages($file); } else { $images[] = $file; // add some file type validation here } } return $images; } $images = json_encode(loadImages($startFolderPath)); I'm on an iPad so I can't test it.
type: Answer
upvote count: 1

http://stackoverflow.com/q/27396791
has comment: http://stackoverflow.com/comment/43296670
answer count: 1
downvote count: 0
tagged with: templating
has comment: http://stackoverflow.com/comment/43261224
favorite count: 0
has comment: http://stackoverflow.com/comment/43390991
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43241666
tagged with: node.js
has answer: http://stackoverflow.com/a/27424101
score: 1
has body: I'm not sure how to phrase the question so please feel free to recommend edits for the title, but I have a couple of general (but hopefully specific enough) security questions about a few web development practices I've encountered. There are templating systems like EJS that allow code to be run on the client-side. If a web app allows users to upload JS and HTML files to the server to be served to the public, what are some (if any) of the security concerns? Note that uploaded JS/HTML files will only be served publicly by being placed in an appropriate folder, i.e. an assets folder. If a templating system is not allowed but the user is still allowed to upload any arbitrary JS/HTML file, what security concerns remain? Some assumptions: a Node.js server with some MVC framework Sensitive datasets are stored on the server but can only be accessed directly by the Node.js server A user can only access a dataset by requesting for it, and an admin can approve/reject the request Not worried about social engineering attacks such as phishing (looking more for attacks that compromise the data) If this is too general, let me know how I can clarify. I'm only looking for a push in the right direction.
upvote count: 1
type: Question
tagged with: javascript
tagged with: security
has title: Web security of arbitrary JS/HTML uploads

http://stackoverflow.com/q/27421236
answer count: 1
has title: How to replace page content on forced reload?
tagged with: javascript
has body: I have a page called index.html which has &lt;div id ="header"&gt; and &lt;div id = "midSection" in it. Header has navigation elements and when user clicks on them i load different .php documents into midSection using JQuery (AJAX calls). One of the .php documents has registration form, and on submit click i successfully post data into DB. I did prevent standard actions, so when when data is submitted no default redirects are happening. What i'm trying to do is when data is posted to redirect user to index.html (force refresh), but header changed into another div (for example headerOnLogin). Is there anyway to do so? else { $.post($("#regForm").attr("action"), $("#regForm :input").serializeArray(), function(info){ //php script returns this key if data is inserted into database successfully if (info == 4521789524355214852) { //RELOAD PAGE, REPLACE HEADER IN INDEX.HTML } else{ $("#errorArea").empty(); $("#formPseudoContainer").effect('shake', 750 ); $("#errorArea").fadeOut('15000', function() { }); $("#errorArea").fadeIn('15000', function() { }); $("#errorArea").text(info); setTimeout(function() { $("#errorArea").empty(); }, 5000); } }); } $("#regForm").submit(function() { // prevents redirecting to another page after submitting form return false; });
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27421464
tagged with: jquery
has comment: http://stackoverflow.com/comment/43285146
type: Question
accepted answer: http://stackoverflow.com/a/27421464
has comment: http://stackoverflow.com/comment/43285075
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/43286355
score: 0

http://stackoverflow.com/comment/43326332
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27443511
type: AnswerComment
has text: Hello mate, first of all thank you so much for the incredibly speedy response. I've done that, but I appear to get an error (red underlined on the bracket of nRow and the error "Expected Identifier") ? As in "(nRow" <-- that bracket

http://stackoverflow.com/comment/43106585
score: 0
type: Comment
type: QuestionComment
has text: That was it! thanks! If you convert you comment to an answer I'll accept it.
comment on: http://stackoverflow.com/q/27323050

http://stackoverflow.com/comment/43145460
type: Comment
comment on: http://stackoverflow.com/a/27336951
has text: For the first you can modify it to fit your needs, I don't entirely understand what you're doing. For the breaking rule, I mean trying to look at the things in props.children and check what component they're an instance of, or other hacky things that aren't documented.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43398468
has text: Not really, I am describing a situation where I have a custom config and I want to know if it is OK to redefine the property in a child class to extend the super-classes' config. I cannot find documentation describing my scenario.
comment on: http://stackoverflow.com/q/27450515
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43369073
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27466364
has text: It's much easier to set properties than to use setAttribute, e.g. `newA.id = 'twitter';`. ;-)
score: 0

http://stackoverflow.com/comment/43346244
comment on: http://stackoverflow.com/q/27450382
has text: You have a bunch of null bytes at the end of your string. There must be a bug in your `decryptQuery` implementation or in the data in are decrypting.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27449905
has answer: http://stackoverflow.com/a/29242592
type: Question
tagged with: swipe
tagged with: javascript
score: 0
has title: hammer.js 2.0 not returning event options when using jquery plugin?
answer count: 1
tagged with: jquery
has body: I am using hammer.js to navigate a rotating menu using panstart/panend. I need to get the distance of the pan and this works correctly when using the following code (and logs distance/deltax/direction as expected): var myElement = document.getElementById('footer'); var mc = new Hammer(myElement); mc.on("panstart panend", function(ev) { console.log(ev.type); if(ev.type=='panend') { console.log('distance: ' + ev.distance); console.log('delta x: ' + ev.deltaX); console.log('direction: ' + ev.direction); } }); However when i use the following code (with the hammer jquery script included) then i get the ev.type logged correctly but the distance/deltax/direction are all undefined: $('#wrapper').hammer().on("panstart panend", "#footer", function(ev){ console.log(ev.type); if(ev.type=='panend') { console.log('distance: ' + ev.distance); console.log('delta x: ' + ev.deltaX); console.log('direction: ' + ev.direction); } }); I can't see why this would be the case as the code is identical and it's firing the correct ev.type event when using jquery. Can anyone explain how I get the distance etc when using jquery (I need to use it on dynamically added elements hence why i'm using the jquery plugin)? Thanks everyone, Dave
tagged with: swipe-gesture
tagged with: hammer.js
type: UnansweredQuestion

http://stackoverflow.com/a/36708904
score: 10
has comment: http://stackoverflow.com/comment/86985280
answers question: http://stackoverflow.com/q/27321472
upvote count: 10
has body: You can solve this by checking whether the link will open or not. Here is my code function open_whatsapp(){ $.ajax({ type: 'HEAD', url: 'whatsapp://send?text=Hello%20World!', success: function() { window.location='whatsapp://send?text=Hello%20World!'; }, error: function() { alert("Whatsapp not installed"); } }); } Share with Whatsapp
type: Answer
downvote count: 0

http://stackoverflow.com/q/27338842
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27338866
tagged with: php
has comment: http://stackoverflow.com/comment/43134314
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43134286
has title: JQuery/Ajax post to php breaks JQuery/Js code?
has comment: http://stackoverflow.com/comment/43134300
tagged with: post
type: Question
upvote count: 1
has body: var hiScore = 0; var userip; function onGameOver(){ if (-1 &lt; score &amp;&amp; score &lt; 6) { doStuff(); } if (5 &lt; score &amp;&amp; score &lt; 9) { doStuff2(); } if (8 &lt; score &amp;&amp; score &lt; 15) { doStuff3(); } if (14 &lt; score &amp;&amp; score &lt; 21) { doStuff4(); } if (20 &lt; score &amp;&amp; score &lt; 27) { doStuff5(); } if (26 &lt; score &amp;&amp; score &lt; 31) { doStuff6(); } if (30 &lt; score &amp;&amp; score &lt; 36) { doStuff7(); } if (35 &lt; score &amp;&amp; score &lt; 51) { doStuff8(); } if (50 &lt; score &amp;&amp; score &lt; 69) { doStuff9(); } PostTo(); } function PostTo() { $.ajax({ url:'Score.php', type:'post', data:{hiScore:hiScore, userip:userip}, success:function(data){ alert('Success'); } }); } the $.ajax part of the code seems to break the js code. I've no idea why. Maybe I'm using it wrong. here is the php as well. &lt;?php $hiScore = $_POST['hiScore']; $userip = $_POST['userip']; $file = fopen('file.txt','w+'); fwrite($file, $hiScore.'\t'.$userip); fclose($file); ?&gt; Any idea what is going on? The code starts working again perfectly after I remove the post code. How it breaks: obviously there is more to the code its a game simply put the game doesn't start it just "breaks". Code edited It still isn't posting to the file.txt file. Thanks to baao for pointing out mistakes!
accepted answer: http://stackoverflow.com/a/27338866
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27345037
has title: Retrieving Javascript value from Page 1 to Page 2
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has body: I'm facing a problem where my AJAX function needs to send a value from page 1 and in page 2 where the function catches and store it. Here's my page one AJAX function : top.location.href = 'http://www.something.com/redirect.php?email=' + $('#email').val(); So the value of the email is "$('email').val(); Here in my second page, I'm using this AJAX function : $(document).ready(function(){ $("#iframe").load(function(event){ var email = $('#email').val(); $('#frame1').contents().find('#iddatabase').val(email); $('#frame1').contents().find('#fgr').submit(); redirect(); }); The problem is the AJAX value in the second page is missing and i need help on fixing it.
has comment: http://stackoverflow.com/comment/43145528
has answer: http://stackoverflow.com/a/27345178
accepted answer: http://stackoverflow.com/a/27345178
tagged with: javascript
has comment: http://stackoverflow.com/comment/43145612
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/45616562
has text: @emilySmitley ah, gotcha. Answer coming...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27454229
score: 0

http://stackoverflow.com/comment/43394643
has text: You could have an input field in a `foreignObject` element.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27470907

http://stackoverflow.com/comment/43099762
has text: do you have any ideas?
comment on: http://stackoverflow.com/q/27320095
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27384156
answer count: 1
has answer: http://stackoverflow.com/a/27386579
downvote count: 0
has body: I want to use Datepicker(from Jquery) on django in this way: Through the "views.py" i'm sending a list of dates from mysql DB. I want to display a message when a date that a user had chosen is equal to one of the dates i have in the DB. How can i make this happen? (with Django, Jquery and AJAX) My code so far: {% block head %} {% endblock %} {% block body_block %} Choose Date {% for date in dates %} ............... Thanks.
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: datepicker
tagged with: python
has title: Using Datepicker (from Jquery) in django
type: UnansweredQuestion
upvote count: 1
tagged with: django
linked to: http://stackoverflow.com/q/10310124
score: 1
type: Question
linked to: http://stackoverflow.com/q/1531272

http://stackoverflow.com/a/27331269
answers question: http://stackoverflow.com/q/27331107
score: 0
type: Answer
has body: This is all the code : document.write("The range is between 3 and 18"); because minimum is when all the randoms are 1 so it would be x = min(random_int(1,6)) = 1 y = min(random_int(1,6)) = 1 z = min(random_int(1,6)) = 1 so a = 1 + 1 + 1 = 3 and maximum will be like this : x = max(random_int(1,6)) = 6 y = max(random_int(1,6)) = 6 z = max(random_int(1,6)) = 6 so a = 6 + 6 + 6 = 18

http://stackoverflow.com/q/27410655
score: 1
tagged with: selenium
upvote count: 1
tagged with: timecop
type: Question
has comment: http://stackoverflow.com/comment/43286794
tagged with: javascript
has comment: http://stackoverflow.com/comment/43283806
has comment: http://stackoverflow.com/comment/43282655
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43278257
has title: Webdriver in Python - Executing Function from External Script
has body: How do I execute a function located in an external JavaScript using webdriver in python? The JavaScript is used to overwrite JavaScripts internal DateTime object to give an altered browser time for unit testing. I like to use sinonfaketimers.js for this purpose. (But would also go with alternatives like TimeShift.js) Links: http://sinonjs.org/docs/#clock , https://github.com/plaa/TimeShift-js So I wrote the following python code, which calls the JavaScript itself but not the respective function: driver = webdriver.Firefox() driver.get("http://google.com") driver.execute_script(open("./sinon_timers.js").read()) # some code here to test shift in time driver.quit() As far as I understand this matter correctly all I need to do in order to make this work is to run the respective JavaScript function with the correct arguments. I assume passing the arguments could be done by building a suitable string like: driver.execute_script("function('" + argument_var + "');") The actual function inside the JavaScript sinon_timers.js is: sinon.timers = { setTimeout: setTimeout, clearTimeout: clearTimeout, setImmediate: (typeof setImmediate !== "undefined" ? setImmediate : undefined), clearImmediate: (typeof clearImmediate !== "undefined" ? clearImmediate: undefined), setInterval: setInterval, clearInterval: clearInterval, Date: Date }; The full length script can be found at sinonjs.org: http://sinonjs.org/releases/sinon-timers-1.12.1.js But I am not sure about the syntax of calling the function sinon.timers in sinon_timers.js. How do I do that? UPDATE: Sainath Motlakunta suggested a solution. Unfortunately it doesn't work. But maybe we are closer a step to cracking the puzzle: driver = webdriver.Firefox() driver.get("https://duckduckgo.com") driver.execute_script(open("./sinon_timers.js").read()) # &lt;- is this line important? driver.execute_script("var clock = sinon.useFakeTimers(12345);") driver.quit() This yields: selenium.common.exceptions.WebDriverException: Message: sinon is no…
type: UnansweredQuestion
tagged with: sinon
tagged with: python
answer count: 0

http://stackoverflow.com/q/27470578
has comment: http://stackoverflow.com/comment/43376110
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43376046
answer count: 1
has answer: http://stackoverflow.com/a/27470692
accepted answer: http://stackoverflow.com/a/27470692
has title: Angularjs interceptor causes error
tagged with: angularjs
has body: Im trying to create an interceptor for my sample angular.js app. Here's my config code: .config(function ($routeProvider, $httpProvider) { $routeProvider .when('/', { templateUrl: 'views/main.html', controller: 'MainCtrl' }) .otherwise({ redirectTo: '/' }); $httpProvider.interceptors.push('failedRequestInterceptor'); }); and my interceptor angular.module('sandboxApp').factory('failedRequestInterceptor', function ($q) { return { 'response': function (config) { console.log("test"); } } }); it displays "test" string in my console, but immidiatly after that i got error "response is undefined" and application fail's to load. Perhaps this has something to do with using yeoman and tools included with it, here is exact error text from console : Error: response is undefined handleRequestFn/&lt;@http://localhost:9000/bower_components/angular/angular.js:16002:11 processQueue@http://localhost:9000/bower_components/angular/angular.js:13137:27 scheduleProcessQueue/&lt;@http://localhost:9000/bower_components/angular/angular.js:13153:27 $RootScopeProvider/this.$get&lt;/Scope.prototype.$eval@http://localhost:9000/bower_components/angular/angular.js:14353:16 $RootScopeProvider/this.$get&lt;/Scope.prototype.$digest@http://localhost:9000/bower_components/angular/angular.js:14169:15 $RootScopeProvider/this.$get&lt;/Scope.prototype.$apply@http://localhost:9000/bower_components/angular/angular.js:14457:13 done@http://localhost:9000/bower_components/angular/angular.js:9614:36 completeRequest@http://localhost:9000/bower_components/angular/angular.js:9804:7 requestLoaded@http://localhost:9000/bower_components/angular/angular.js:9745:1 return logFn.apply(console, args);
type: AnsweredQuestion

http://stackoverflow.com/a/27473935
has comment: http://stackoverflow.com/comment/43383287
has body: Generally speaking, the answer to your question Can I call an initialized object again is yes! You have many options. If you insist to use the same function again, then one option would be to add a second parameter filefetched to ajaxmenu you do not need the var instance = this; pass a true when calling the ajaxmenu from itself, to skip the fetching: ajaxmenu(file, true); Full code: function ajaxmenu(file, filefetched){ if (!filefetched){ $.get(file, function( data ){ $(data).appendTo(document.body) ajaxmenu(file, true); }); } this.menu = $('#menuid') // uses jQuery this.menu.css({width: '100px'}) //do something else fancy with $menu } var menu = new ajaxmenu('menu.htm', false); Another option (without a self-call) would be to use the callbacks that jQuery offers with the get function and do your change to the menu in the done event, that is executed once the get function completes. This way you don't need the recursive call: function ajaxmenu(file){ $.get(file, function( data ){ $(data).appendTo(document.body) }) .done(function() { this.menu = $('#menuid') // uses jQuery this.menu.css({width: '100px'}) //do something else fancy with $menu }); } var menu = new ajaxmenu('menu.htm'); This also simplifies the code a lot, because you don't need branches (and/or recursive calls) and it is much more readable and so better maintainable. Generally on recursive calls: you always need a condition to stop the recursion to prevent an infinite loop. One possibility would be using a parameter that is change on every new recursive call: function process(data, n) { // process data // iterate again or stop recursion if (n &gt; 0) { process(data, n - 1); } // done =&gt; n = 0 } // start process(data, 5); Another option would be using a global variable and track it's state, but this generally indicates a bad design and it is not recommended: // global variable var n = 5; function process(data) { // process data // iterate again or stop recursion if (n &gt; 0) { n = n - 1; process(data…
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27473677
has comment: http://stackoverflow.com/comment/43383316
type: Answer
has comment: http://stackoverflow.com/comment/43383864
upvote count: 1

http://stackoverflow.com/comment/43336236
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27448153
has text: Just to be sure, you have that code wrapped in a doc-ready function, yes? His sample works fine for me...

http://stackoverflow.com/q/27354455
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: We have made some changes on our homepage and it all went fine until we clicked to get to the homepage... Which is somehow different. Example: http://www.testsite.net &lt;- this one is fine with the jQuery and Javascript together. Example: http://www.testsite.net/index.php &lt;- this one doesn't work with jQuery and Javascript together. I have no idea why it doesn't work only on index.php... My question is, why doesn't this work? Is there something special I need to know? Do you have any suggestions? A workaround maybe? I can post some code but it's kind of a pain to do that because it's quite alot. If you want some code, please state what kind of code you need... Any more information needed? Feel free to ask. Thanks in advance!
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/43162810
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27354682
has title: Magento homepage has conflict only on the index.php
tagged with: magento
has comment: http://stackoverflow.com/comment/43163184
tagged with: javascript

http://stackoverflow.com/q/27356447
has answer: http://stackoverflow.com/a/27356902
has body: Not sure if what I had in mind is possible or not, but why now. I have a MVC4 Master page as follows RYTE HCMS <link href="<%: Url.Content("~/favicon.ico") %>" rel="shortcut icon" type="image/x-icon" /> <%: Scripts.Render("~/bundles/modernizr") %> <asp:ContentPlaceHolder ID="Header" runat="server"> <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> <% Html.RenderPartial("LoginUserControl"); %> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="MainContent" runat="server" /> <script src="<%=Url.Content("~/Scripts/jquery-1.11.1.min.js")%>"> <script src="<%=Url.Content("~/Scripts/jquery.mobile-1.4.5.min.js")%>"> <asp:ContentPlaceHolder ID="ScriptsSection" runat="server" /> I want to load and apply CSS/JQuery in the Android WebView. I want to keep the files in android mobile app and apply them as the page loads inside the webView. If I don't load these files in specific order the design breaks. The reason I want to do this to make sure user don't feel its a web app. At present at each refresh/reload it takes about 1-2 seconds for jquery mobile and css to load. Since MVC4 pages are compiled on remote server, Is it possible?
has comment: http://stackoverflow.com/comment/43166958
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43168620
tagged with: android
tagged with: css
tagged with: asp.net-mvc-4
has answer: http://stackoverflow.com/a/27356863
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43166501
has comment: http://stackoverflow.com/comment/43165569
tagged with: jquery
has comment: http://stackoverflow.com/comment/43167841
has comment: http://stackoverflow.com/comment/43165876
has title: How to apply Css/JQuery files to an external page inside Android WebView

http://stackoverflow.com/q/27347810
has answer: http://stackoverflow.com/a/27347902
tagged with: pug
accepted answer: http://stackoverflow.com/a/27347902
answer count: 1
tagged with: javascript
has title: Including javascript in node js project jade template
tagged with: express
downvote count: 3
tagged with: node.js
favorite count: 0
upvote count: 0
score: -3
type: AnsweredQuestion
has body: I'm trying to include javascript on a page written in jade template. I wrote it like this : script(src='/public/javascripts/scr1.js') and the script is in that directory. and in the script I wrote alert("doesnt work"); and I see it doesnt go into the script Anyone knows how to properly inlcude js? Thank you!
type: Question

http://stackoverflow.com/a/27414367
has body: You've probably solved this by now, but you are correct that you want to use formatSelection. Be default, the selected object's text property is used, but you want the id property instead. The id property is the &lt;option&gt; element's value. $('#select2').select2({ formatSelection: function(object) { return object.id; } }); jsfiddle
upvote count: 1
has comment: http://stackoverflow.com/comment/43315476
has comment: http://stackoverflow.com/comment/93945510
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27413260
answers question: http://stackoverflow.com/q/27413260
type: AcceptedAnswer

http://stackoverflow.com/a/27471616
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27471510
upvote count: 2
type: AcceptedAnswer
has body: Yes, your code runs just fine and does what's expected: "use strict"; let foo; { let myPrivateVariable = 'x'; foo = function(bar) { return myPrivateVariable + bar; }; } console.log(foo('y')); // xy console.log(myPrivateVariable); // error Tested with node v0.11.12, with the --harmony flag. The whole point of IIFEs is to emulate block scoping, so, yes, let makes this trick not necessary anymore.
type: Answer
answers question: http://stackoverflow.com/q/27471510
score: 2

http://stackoverflow.com/comment/43334430
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27447548
has text: can you please create a little demo on plunker?

http://stackoverflow.com/q/27318715
answer count: 1
tagged with: blob
tagged with: javascript
has body: I have this string %22%00%41%00%22%00%09%00%22%00%42%00%22%00 which is the UTF-16LE equivalent of "A"\t"B". (The \t is a Tab char.) I am trying to construct a Blob and then a URL for it, but the output isn't decoded to proper entities. var blob=new Blob([stringHere],{type:'text/csv;charset=UTF-16LE;'}); var blobUrl=URL.createObjectURL(blob); Is there anyway to tell the Blob the string encoding so that it looks properly when opened in Excel (in this particular case)? I need UTF-16LE, otherwise using UTF-8 will result in Excel no parsing the .csv file properly. Thanks.
type: AnsweredQuestion
score: 2
downvote count: 0
favorite count: 0
tagged with: utf-16
type: Question
has answer: http://stackoverflow.com/a/27323820
upvote count: 2
accepted answer: http://stackoverflow.com/a/27323820
has title: Blob URL with UTF-16LE encoding

http://stackoverflow.com/a/27333882
has comment: http://stackoverflow.com/comment/43125477
has body: Why not adding the info to a cookie via reponse in your image-serving controller? If you name the cookie in a way that would "link" it to a specific set of images you wouldn't need to hassle with "how can i read headers of an image?"
score: 0
answers question: http://stackoverflow.com/q/27333812
type: Answer

http://stackoverflow.com/a/27399028
answers question: http://stackoverflow.com/q/27398959
type: Answer
has body: Try this: JSFIDDLE $('#abcd').find('.myclass:not(:first)').remove()
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/43243613
score: 4

http://stackoverflow.com/a/27372114
type: Answer
upvote count: 1
has body: Try using -ms-transform in addition to your other rules, see below... ...be aware that -ms-transform is the only form of this property that is recognized by Windows Internet Explorer 9.. http://msdn.microsoft.com/en-us/library/ie/jj127312%28v=vs.85%29.aspx
score: 1
answers question: http://stackoverflow.com/q/27372005
downvote count: 0

http://stackoverflow.com/q/27400960
favorite count: 0
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: filereader
answer count: 4
has answer: http://stackoverflow.com/a/27402364
has title: Javascript dynamically show local file
downvote count: 0
type: UnansweredQuestion
has body: I have a local text file which is kept changing by other programs. I want to write a html and javascript based web page to show the content of file dynamically. I have searched in google and found that most solutions require to get this text file via html element. I wonder if there is a way to get the file via a fixed path(lets say it is a string of the file directory) in javascript. I am using Javascript fileReader. Any help will be appreciated.
score: 1
has answer: http://stackoverflow.com/a/27401557
has answer: http://stackoverflow.com/a/27400994
type: Question
linked to: http://stackoverflow.com/q/371875
tagged with: javascript
has answer: http://stackoverflow.com/a/27401080

http://stackoverflow.com/a/29269503
score: 1
answers question: http://stackoverflow.com/q/27471952
upvote count: 1
type: Answer
has body: See the answer here - it's not present in V21 as the style guidelines have changed: No App Icon on ActionBar
downvote count: 0

http://stackoverflow.com/comment/43149256
type: Comment
has text: Thanks! Should I add this just after? $('.success').fadeIn(1000);
comment on: http://stackoverflow.com/a/27347184
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43524105
type: Comment
has text: yes, it is ok to call `drupal_add_js()` multiple times in the same function.
score: 1
comment on: http://stackoverflow.com/a/27481539
type: AnswerComment

http://stackoverflow.com/comment/43202493
type: QuestionComment
comment on: http://stackoverflow.com/q/27375057
score: 0
has text: Hi seems to work in the JSfiddle weird, except for the ppure Javascript part, not sure to set onLoad in JSfiddle http://jsfiddle.net/Jason1975/xz636ghm/
type: Comment

http://stackoverflow.com/a/27534485
answers question: http://stackoverflow.com/q/27428752
has body: You just need to add the bar stacking method to plotOptions, in chartConfig.options: plotOptions: { bar: { stacking: 'normal' } } When this value is null (or not specified), the stack values are disabled. Here is a working demo: http://jsfiddle.net/scfy8w53/
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27428752

http://stackoverflow.com/comment/43312340
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27435398
type: AnswerComment
has text: Thanks, question was put on hold as "off-topic" so I imagine I should return with more specific questions. I'll learn from those sites which you and others suggested and see how they can help. I'll post specific questions if any are are unanswered by the linked sites.

http://stackoverflow.com/q/27410340
score: 0
answer count: 2
tagged with: sencha-touch-2
accepted answer: http://stackoverflow.com/a/27483201
has comment: http://stackoverflow.com/comment/43283593
has title: Up method is not working correctly in Sencha Touch
has body: I am working with Sencha Touch and I have the next codeline var formpanel = button.getParent().getParent().down('formpanel'); //working correctly but tricky I am using two "getParent()" because the "up" method is not working for me var formpanel = button.up('formpanel'); //No-working and the view items: [ { xtype: 'toolbar', title: 'test', docked: 'top', items: [{ xtype: 'button', iconCls: 'info', style:{ 'margin-left': '75em' } }] }, { xtype: 'formpanel', layout: 'hbox', scrollable: null, items: [] } Any clue? Thanks
has comment: http://stackoverflow.com/comment/43283299
has comment: http://stackoverflow.com/comment/43283043
has answer: http://stackoverflow.com/a/27441443
has comment: http://stackoverflow.com/comment/43291917
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27441443
has comment: http://stackoverflow.com/comment/43267927
has answer: http://stackoverflow.com/a/27483201
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43281686
tagged with: extjs

http://stackoverflow.com/comment/43348670
score: 0
has text: By the way, you don't need to escape the double quotes. When and if you stringify this object, that will be done for you.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27454931

http://stackoverflow.com/comment/43374827
has text: What extension are you using?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27469865
type: QuestionComment

http://stackoverflow.com/comment/43144390
type: Comment
comment on: http://stackoverflow.com/q/27344193
has text: @ianaya89 I need see my new Items created when "Browser Upload".
score: 0
type: QuestionComment

http://stackoverflow.com/a/27353357
type: Answer
answers question: http://stackoverflow.com/q/27353179
score: 0
has body: function run(){ var v1 = document.getElementById("val").value; var v2 = document.getElementById('input1').value; if (v1=="1") {window.open("URL" + v1 + "/" + v2, '_blank');} else if (v1=="2") {window.open("URL" + v1 + "/" + v2, '_blank');} else {alert("");} return false; } Just remove the inner function() bracket in your run() function.

http://stackoverflow.com/q/27345645
accepted answer: http://stackoverflow.com/a/27345696
tagged with: arrays
tagged with: javascript
answer count: 6
score: 0
has body: I have an array of array stored. I need to extract the particular value from this arrays. e.g allarray contain the list of arrays allarray= [Array[3],Array[3],Array[3]] are three arrays present in that. 0:Array[3] 0:"a1" 1:"b1" 2:"c1" 1:Array[3] 0:"a2" 1:"b2" 2:"c2" 3:Array[3] 0:"a3" 1:"b3" 2:"c3" I need to extract this c1,c2 and c3 from the above arrays and display in the alert box. Can anyone tell me how i can do that? i tried with $.each but unfortunately doesn't work. Can anyone?
has answer: http://stackoverflow.com/a/27346444
has comment: http://stackoverflow.com/comment/43146574
tagged with: jquery
has title: How to extract value from an array of array
has answer: http://stackoverflow.com/a/27345885
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27345801
has comment: http://stackoverflow.com/comment/43146581
has answer: http://stackoverflow.com/a/27345849
has comment: http://stackoverflow.com/comment/43146580
has answer: http://stackoverflow.com/a/27345701
has answer: http://stackoverflow.com/a/27345696
has answer: http://stackoverflow.com/a/27345801
type: Question

http://stackoverflow.com/a/27403644
type: Answer
has body: try this function changeValue(){ var sbox = document.getElementById("id_barang"); document.getElementById('harga_satuan').value = sbox.options[sbox.selectedIndex].value; }; and call function like this echo "&lt;select class='form-control' id='id_barang' name='id_barang' onchange='changeValue()'&gt;";
answers question: http://stackoverflow.com/q/27403527
score: 0
has comment: http://stackoverflow.com/comment/43253713

http://stackoverflow.com/a/27448755
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27448655
has body: The doSomething method doesn't exist in your object: var LibraryName = { someValue: 0, firstFunc: function (stuff) { this.someValue = 99; this.secondFunction(); }, secondFunction: function () { this.doSomething(this.someValue); }, doSomething: function (val) { console.log('dosomething'); } }; P.s. using this can be tricky if you reference your methods. Read here. JSFIDDLE.
score: 1
downvote count: 0

http://stackoverflow.com/q/27321580
tagged with: javascript
tagged with: image
accepted answer: http://stackoverflow.com/a/27321717
downvote count: 4
upvote count: 0
answer count: 1
tagged with: variables
favorite count: 0
tagged with: size
tagged with: http://stackoverflow.com/tag/html
has title: Javascript variables use in HTML
has comment: http://stackoverflow.com/comment/43102454
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27321717
score: -4
type: Question
has body: I want to use "screen.availWidth" and "screen.availHeight" to change the size of a image. How can I do it? Here is my code I want that that work. &lt;img src="logoDK.png" alt="" width="screen.availWidth/1.9" height="screen.availHeight/3.84"&gt; Thanks for your help.
has comment: http://stackoverflow.com/comment/43102414

http://stackoverflow.com/comment/43296945
score: 0
type: Comment
type: QuestionComment
has text: Sorry, my bad, you're calling the function within a formula, not directly from JS.
comment on: http://stackoverflow.com/q/27427492

http://stackoverflow.com/q/27421437
has comment: http://stackoverflow.com/comment/43285457
has title: Displaying Labels on Stacked Bar
tagged with: stacked-area-chart
score: 0
has comment: http://stackoverflow.com/comment/43285610
tagged with: bar-chart
answer count: 1
linked to: http://stackoverflow.com/q/1174298
has comment: http://stackoverflow.com/comment/43285288
tagged with: jquery
has comment: http://stackoverflow.com/comment/43285330
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43285848
type: Question
has answer: http://stackoverflow.com/a/27421913
has body: I would like to display labels on each stacked bar like blue on blue bar, yellow on yellow bar and so on. Here's my code in JSFiddle: [1]:http://jsfiddle.net/Sa_2019/n7r57pv7/ Here is my Code : &lt;div id="placeholder" style="width:600px;height:300px;"&gt;&lt;/div&gt; var data = [ {label: 'foo', color:'red', data: [[1,300], [2,300], [3,300], [4,300], [5,300]]}, {label: 'bar', color:'blue', data: [[1,800], [2,600], [3,400], [4,200], [5,0]]}, {label: 'baz', color:'yellow', data: [[1,100], [2,200], [3,300], [4,400], [5,500]]}, ]; $.plot($("#placeholder"), data, { series: { stack: 1, bars: { show: true, lineWidth: 1, barWidth: 0.8, order: 1, fill: true }, yaxis : { min : 0, tickLength: 0 } , xaxis: { tickLength: 0, axisLabel: "Date", axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelFontFamily: 'Arial', axisLabelPadding: 3, color: "#838383", timeformat: "%b/%y" } } }); Any idea please. Thank you
tagged with: javascript
has comment: http://stackoverflow.com/comment/43285515

http://stackoverflow.com/q/27368083
tagged with: orientdb
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: waterline
has title: How to use OrientDB in a SailsJS App
type: Question
tagged with: sails.js
tagged with: javascript
upvote count: 1
accepted answer: http://stackoverflow.com/a/28754421
answer count: 1
favorite count: 0
has body: I am new to NodeJS and SailsJS, was working with Rails or PHP before. I want to use SailsJS together with OrientDB. What would be the best approach? I found two options so far, but the amount of information isn't that great (yet). Go with Waterline and this sails adapter for orientdb Go one level deeper and use the binary adapter from nodejs Any help, tips, hints would be greatly appreciated. I am a bit lost but very excited to understand more about these great tools. Thanks!
has answer: http://stackoverflow.com/a/28754421

http://stackoverflow.com/q/27428375
tagged with: vb.net
type: AnsweredQuestion
upvote count: 5
has answer: http://stackoverflow.com/a/27429934
type: Question
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
has body: Problem I'm trying to upload file using XMLHttpRequest and it seems to work only with small file (such as under 2MO of size). I tried many things so far and came to code shown at the end of the post. But, there is nothing to do; I keep getting the ::ERR_CONNECTION_RESET error. It is not a code issue as under 2MO files are getting unploaded correctly... What am I forgetting? I know this is probably a IIS or web.config issues but I can put my finger on it by googling this problem. Error given by Chrome POST WEBSITEANDSERVICEURL/Service/MyService.asmx/UploadFilesWithAJAX net::ERR_CONNECTION_RESET handleFileSelect x.event.dispatch v.handle Javascript HTML Markup <asp:FileUpload ID="files" runat="server" multiple="true" /> MyService.asmx <ScriptService()> _ <ToolboxItem(False)> _ <WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ Public Class AJAXServices : Inherits WebService <WebMethod(EnableSession:=True)> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Xml)> _ Public Function UploadFilesWithAJAX() ' Some code which work fine, I'm sure of it. End Function End Class Web.config <system.web> <httpRuntime maxRequestLength="2097151" executionTimeout="180" /> </system.web>
favorite count: 0
tagged with: asmx
linked to: http://stackoverflow.com/q/4548305
possible better answer: http://stackoverflow.com/a/27432296
tagged with: xmlhttprequest
accepted answer: http://stackoverflow.com/a/27429934
has answer: http://stackoverflow.com/a/27432296
tagged with: asp.net
has title: XMLHttpRequest ::ERR_CONNECTION_RESET while uploading large (2 Mo & More) files

http://stackoverflow.com/comment/43409695
has text: its handled in the builder here: https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/vendor/assets/javascripts/gmaps/google/builders/marker.coffee#L56 since you have a custom builder, you can override the function and remove this line
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27458649

http://stackoverflow.com/q/27315235
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/43091039
answer count: 1
accepted answer: http://stackoverflow.com/a/27315538
has title: Need to be converted these two JavaScript functions into jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43090715
has body: Here is sample of two JavaScript functions, addRow which adds table row and deleteRow which deletes checked row of a table. How can I convert it into jQuery? function addRow(tableID) { var table = $("#dataTable");//document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell1 = row.insertCell(0); var element1 = document.createElement("input"); element1.type = "checkbox"; element1.name="chkbox"; element1.onclick= function () {toggleCheckbox(this)}; cell1.appendChild(element1); var cell2 = row.insertCell(1); cell2.innerHTML = document.getElementById("fname").value; var cell3 = row.insertCell(2); cell3.innerHTML = document.getElementById("lname").value; } function deleteRow(tableID) { try { var table = document.getElementById(tableID); var rowCount = table.rows.length; for(var i=0; i&lt;rowCount; i++) { var row = table.rows[i]; var chkbox = row.cells[0].childNodes[0]; if(null != chkbox &amp;&amp; true == chkbox.checked) { table.deleteRow(i); rowCount--; i--; } } }catch(e) { alert(e); } }
has answer: http://stackoverflow.com/a/27315538
type: Question

http://stackoverflow.com/comment/43239792
has text: @anguLaravel, no, it won't mutate the original array.
type: AnswerComment
comment on: http://stackoverflow.com/a/27396779
score: 0
type: Comment

http://stackoverflow.com/comment/43300914
comment on: http://stackoverflow.com/q/27429663
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27358842
tagged with: jquery
duplicate of: http://stackoverflow.com/q/20360101
score: 0
possible better answer: http://stackoverflow.com/a/27359101
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has title: jquery mobile: drop down options populated through javascript is not being shown as a selectable drop-down its plainly rendering.PFA
favorite count: 0
linked to: http://stackoverflow.com/q/20360101
has comment: http://stackoverflow.com/comment/43205036
has body: this is how its rendering. here is what i used this is how i need on document ready im calling populate function and passing class name 'fromTime' to it.its just rendering it plainly not the options in the select box. function populate(selector) { var select = $(selector); var selectBox = $(" "); var hours, minutes, ampm ; for(var k = 700; k <= 2300; k += 100){ var i=0; for(var j=0;j<=45;j+=15){ i=k+j hours = Math.floor(i / 100); minutes = i % 100; if(minutes>10){ minutes=minutes+""; }else{ minutes=0+""+minutes; } ampm = hours % 24 < 12 ? 'AM' : 'PM'; hours = hours % 12; if (hours === 0){ hours = 12; } var valueString=hours + ':' + minutes + ' ' + ampm; select.append($(' ') .attr('value', i) .text(valueString)); } } } here is html code Long list: Start Time
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43177969
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/27358961
accepted answer: http://stackoverflow.com/a/27358961
has answer: http://stackoverflow.com/a/27359101
has comment: http://stackoverflow.com/comment/43175575
tagged with: jquery-mobile
tagged with: javascript

http://stackoverflow.com/a/27436525
has comment: http://stackoverflow.com/comment/43313816
score: 0
answers question: http://stackoverflow.com/q/27435891
has comment: http://stackoverflow.com/comment/43314026
type: Answer
has comment: http://stackoverflow.com/comment/43314144
has body: I give an idea only as it is your work. You need an array to perform sorting, and then sort it ,finally print the result in order.

http://stackoverflow.com/q/27377688
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27378272
has comment: http://stackoverflow.com/comment/43206216
has comment: http://stackoverflow.com/comment/43208759
has comment: http://stackoverflow.com/comment/43205570
has body: I looked at this post: Can you resolve an angularjs promise before you return it? I'm trying to apply it to my code, and it seems to not be working. Here's my code: var myPromise = $timeout(function () { ... }, 1000); myPromise.then(function () { ... }); // the code in here runs $timeout.flush(); // this causes the promise to become resolved and the code in the 1st then above to run. // I expect this code to run immediately, since the promise is already resolved - but it doesn't myPromise.then(function () { ... }); Note: this code is running inside a karma test function, so $timeout should work normally... unless it has issues with resolved promises?
has title: AngularJS - can you chain then() to previously resolved promises?
linked to: http://stackoverflow.com/q/20555472
tagged with: promise
has comment: http://stackoverflow.com/comment/43205693
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/27396302
has comment: http://stackoverflow.com/comment/43205999
has comment: http://stackoverflow.com/comment/43205542
score: 0
has comment: http://stackoverflow.com/comment/43209608
answer count: 2

http://stackoverflow.com/q/27319547
has title: is there a non-recursive feature implemented in `async`?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43098769
has answer: http://stackoverflow.com/a/27319720
tagged with: stack
has body: I need to process a quite large quantity of entries (tens of thousands) with functions such as async.each or async.eachSeries or async.whilst. Almost reduntant to say that I have to use async because I am going to call some queries for each entry, making the code asynchronous. Unfortunately, using async's functions, the call stack gets consumed pretty fast, leading to RangeError: Maximum call stack size exceeded. Is there a way to tweak async in order to prevent this problem? An iterative implementation would solve the problem. Any alternative library that takes this problem into account? here is an example code snippet that show the problem: async = require('async'); a = [] for(i = 0; i &lt; 10000000; i++) { a[i] = i; } async.eachSeries(a,function(element,callback) { console.log(element); callback(); },function(err){ if(err){ console.log("error:",err); } console.log("finished."); });
type: Question
has comment: http://stackoverflow.com/comment/43098615
answer count: 1
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/33923
tagged with: asynchronous
tagged with: node.js

http://stackoverflow.com/comment/43209896
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27380361
type: QuestionComment
has text: Try some logic: how you click on inner link, if it's wrapped with another link, how you click outer link if it contains another link. It's not Inception...

http://stackoverflow.com/a/27393400
has body: Is faster and more reliable. Loading via PHP can be definetely slower. Especially when there are multiple other PHP requests.
upvote count: 1
answers question: http://stackoverflow.com/q/27393340
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43235059

http://stackoverflow.com/a/27360792
answers question: http://stackoverflow.com/q/27360492
has body: Better use ECMAScript 5.1 helpers for better understanding what your code makes: function addDataFromJSON(json) { //just check that data is array var data = json && Array.isArray(json.data) ? json.data : []; data.forEach(function(rowObject) { //every loop will create a row var tr = document.createElement('tr'); Object.keys(rowObject).forEach(function(cellKey) { //every loop will create a cell var td = document.createElement('td'); td.innerText = rowObject[cellKey]; tr.appendChild(td); }); table.appendChild(tr); }); } var table = document.querySelector('#table'); var jsonData = { "data": [{ //this is row "id": 1, // this is a cell value "name": "Company A", "departments": [ "Software", "Recruitment", "Consulting" ], "locations": [ "Sheffield", "Rotherham", "London", "New York" ] }, { //this is one more row "id": 2, "name": "Company B", "departments": "", "locations": [ "Hillsborough", "City Centre", "Crystal Peaks" ] }] }; function addDataFromJSON(json) { //just check that data is array var data = json && Array.isArray(json.data) ? json.data : []; data.forEach(function(rowObject) { //every loop will create a row var tr = document.createElement('tr'); Object.keys(rowObject).forEach(function(cellKey) { //every loop will create a cell var td = document.createElement('td'); td.innerText = rowObject[cellKey]; tr.appendChild(td); }); table.appendChild(tr); }); } addDataFromJSON(jsonData); table, td { border: 1px solid #ccc; border-spacing: 0; border-collapse: collapse; } td { padding: 5px; }
score: 0
type: Answer

http://stackoverflow.com/q/27378413
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: iframe
answer count: 2
has answer: http://stackoverflow.com/a/27378454
tagged with: css
linked to: http://stackoverflow.com/q/7495277
score: 0
has title: How stick Iframe on top of current page?
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43206211
has body: I want lo load dropdown menu from other application and want to make it as a header with iframe. Surely, dropdown menu can be expanded and thus become larger. Usual iframe provides a scroll which allows to see all contents of iframe but it looks not good for me. I want to stick iframe on top of web page such that expanded menu items will be rendered on top of page contents. I don't want scrolls and I don't want rubber iframe. Rubber iframe may take a large amount of screen space. Absolute positioning and z-index didn'd do the trick. Is there any other ways to solve this problem? My html is the following: Your body content
has answer: http://stackoverflow.com/a/27378505
has comment: http://stackoverflow.com/comment/43206298

http://stackoverflow.com/q/27339852
has answer: http://stackoverflow.com/a/27339911
tagged with: javascript
has comment: http://stackoverflow.com/comment/43136265
has title: How is this code getting rid of duplicate array elements?
favorite count: 0
accepted answer: http://stackoverflow.com/a/27339900
linked to: http://stackoverflow.com/q/840781
has answer: http://stackoverflow.com/a/27339900
downvote count: 0
has body: I've been teaching myself OOJS by creating a blackjack game. Everything is going great, but since I randomly create cards, sometimes I create and then deal the same card twice in a round. I'm trying to avoid that by writing some logic that gets rid of duplicate cards. So I found this discussion. https://stackoverflow.com/a/840849/945517 and the code below: function eliminateDuplicates(arr) { var i, len=arr.length, out=[], obj={}; for (i=0;i&lt;len;i++) { obj[arr[i]]=0; } for (i in obj) { out.push(i); } return out; } var a=[]; var b=[]; a[0]="fish"; a[1]="fishes"; a[2]="fish"; a[3]="1"; a[4]="fishes"; b=eliminateDuplicates(a); console.log(a); console.log(b); I understand what's going on in general and on almost every line except: for (i=0;i&lt;len;i++) { obj[arr[i]]=0; } It seems like it's looping through the array and setting the key of obj to zero. What's going on here and how does this help get rid of duplicate entries in the array being passed at the start? Thanks!
has comment: http://stackoverflow.com/comment/43148357
possible better answer: http://stackoverflow.com/a/27339911
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
upvote count: 1

http://stackoverflow.com/comment/43290337
type: QuestionComment
has text: use javascript debugging and find the error then we can solve the problem , and it is probably a tiny mistake or error.
comment on: http://stackoverflow.com/q/27423978
score: 0
type: Comment

http://stackoverflow.com/q/27392020
has answer: http://stackoverflow.com/a/27392074
has body: I have a question regarding a problem I've having with my Javascript coding. The code is as follows: function PizzaSize(form) { if (form.size.value = "medium") { alert("A medium size pizza has been selected.") } if (form.size.value = "large") { alert("A large size pizza has been selected.") } } Size Selection Medium Large So, when one of these radio buttons is clicked I direct it to run the following function: However, when I test the code in a browser, it doesn't work right. When I click the "Medium" radio button, I get a message stating "A medium size pizza has been selected." When I click OK on the message, the radio button value then changes so it selects a large size pizza instead, and then I get a message saying "A large size pizza has been selected." Does anyone know how I can fix this problem? I'd like to keep the function, but hopefully modify it so that it works correctly instead of how it's working as of now. Any help would be appreciated.
favorite count: 0
accepted answer: http://stackoverflow.com/a/27392056
has answer: http://stackoverflow.com/a/27392313
has comment: http://stackoverflow.com/comment/43231629
possible better answer: http://stackoverflow.com/a/27392074
has answer: http://stackoverflow.com/a/27392227
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43231639
downvote count: 2
has title: If Statements not working correctly with Javascript Radio Button
type: Question
score: -2
has answer: http://stackoverflow.com/a/27392056
tagged with: radio-button
upvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43249062
has text: Is this triggered before the 'close' event ?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27401893

http://stackoverflow.com/comment/43240783
type: QuestionComment
type: Comment
has text: I don't know why your using a timeout (yes we know `$timeout` is an ng component; why are you using it?). I don't know what `$defer` is either nor why your need it because a breeze query returns a `$q` promise. Maybe you're missing a `$rootScope.$apply` somewhere?
comment on: http://stackoverflow.com/q/27372326
score: 0

http://stackoverflow.com/comment/43445792
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27384088
has text: Thanks so much for the clear, straightforward response! This helped a lot!
type: Comment

http://stackoverflow.com/comment/43209020
score: 0
comment on: http://stackoverflow.com/a/27364086
type: AnswerComment
has text: Actually that code is a part of whole code, I'll try whole code in JSFiddle and will post results....
type: Comment

http://stackoverflow.com/comment/43323179
score: 0
comment on: http://stackoverflow.com/a/27441876
type: Comment
has text: I have a menu which includes images and the menus are fixed, and I want to hide the images when I scroll down. that is what i want. The above code is not related to what I want
type: AnswerComment

http://stackoverflow.com/q/27450376
has body: I have managed to implement a simple JavaScript dragging effect to create "panel windows" inside a webpage, in which I can drag the object from any corner or position. I have only used the onmousedown (to indicate a possible dragging), onmousemove (to perform dragging) and onmouseup (to stop dragging) events. It works well except when I drag the object too near an edge and move the mouse even at a normal speed. When I move the mouse towards an area outside the object, the dragging fails until I move again to the object's area, and I have to click the object to stop dragging it. It's like the mouse is too fast, but obviously it doesn't happen in native application windows because they are better implemented. What checks could I add to my current code so it doesn't fail as much? It currently seems to support a little bit of this problem by somehow handling the onmouseout event, but when it happens the window shakes to return the mouse pointer to the object area, and it doesn't look so good. JavaScript Simple Dragging Effect JavaScript Simple Dragging Effect Drag Me
answer count: 1
has title: Improving JavaScript Dragging Effect
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27450504
tagged with: drag
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/43258715
type: QuestionComment
comment on: http://stackoverflow.com/q/27405903
score: 0
has text: this seems screwey to me `ng-class="{open : {{variableName}}}"` ng-class needs an expression which requires {{ variableName }} or something like that, right? what should { open: {{variableName}}} be doing? if you remove that it seems like your toggle should work.
type: Comment

http://stackoverflow.com/a/27349337
downvote count: 0
has comment: http://stackoverflow.com/comment/43174896
has body: At least to the first part of your question (module A always using the latest version of module B), you could always specify the dependency in your package.json with a major version wildcard: { "dependencies": { "moduleB": "*" } } Which would then allow you to always npm update to the latest version. (This would, however, potentially have the effect of introducing changes that break backwards compatibility in your module as npm uses Semantic Versioning.) As for running npm update automatically, I have to ask - why is this necessary? What would be the benefit to users of your module? You should be, at the very least, "curating" updates to your dependencies to ensure no breaking changes are introduced. If you did set up a full automatic pipeline for updating dependencies (from npm updateing dependencies to git taging new versions to npm versioning these new versions to npm publishing these new versions, for example), you're sort of leaving users of your module out in the cold should any of these steps break compatibility with their code. (Also, if this automatic dependency updating never breaks your module, then what is your module adding? Is it even doing anything non-trivial with the dependencies?) It might seem cumbersome, but it's a better practice to update your dependencies with some craft and intention. See Semantic Versioning for more info.
upvote count: 2
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27349204
score: 2
accepted answer of: http://stackoverflow.com/q/27349204

http://stackoverflow.com/q/27322474
type: UnansweredQuestion
tagged with: facebook
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/43140049
has comment: http://stackoverflow.com/comment/43104436
score: 1
has title: Programmatically scrape Facebook meta tags
type: Question
has comment: http://stackoverflow.com/comment/43104133
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/43146422
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
favorite count: 0
has comment: http://stackoverflow.com/comment/43178347
has body: I am making a "generate your ___ name" generator and am having trouble with the facebook share portion. Basically the user fills out a form then gets results. My first idea was to have the results in an iframe which would have a unique URL because of the GET parameters, which generated the correct facebook share info. The problem with that was the link shared would go directly to the "results" iframe. I decided instead to keep it all on one page, and submit the form via POST, reload the page and show the results. If there is no POST data, it shows the default page. My problem now is re-scraping the Facebook data in order to share the correct "generated" image. (Programmatically, not at https://developers.facebook.com/tools/debug/). I found the script below which is supposed to do that, but haven't had any luck. Does anybody know of an alternative way of doing this that would show the correct "generated" image in facebook but also link back to the original page so that others can then generate their own name? This is an example here that does it, but I haven't been able to reverse-engineer what they are doing: http://www.zimbio.com/generator/d_rN-Gyttd2/What's+Your+'Game+of+Thrones'+Warrior+Name &lt;meta property="og:title" content="TITLE"/&gt; &lt;meta property="og:description" content="DESCRIPTION" /&gt; &lt;meta property="og:url" content="URL" /&gt; &lt;meta property="og:image" content="IMAGE URL"/&gt; &lt;meta property="fb:app_id" content="FB APP ID" /&gt; &lt;script&gt; $.post( 'https://graph.facebook.com', { id: 'URL HERE', scrape: true }, function(response){ console.log(response); } ); &lt;/script&gt;
answer count: 0

http://stackoverflow.com/a/27405351
accepted answer of: http://stackoverflow.com/q/27405242
downvote count: 0
has comment: http://stackoverflow.com/comment/43255987
has comment: http://stackoverflow.com/comment/43257212
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43256644
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27405242
has body: Instead of javascript, you could use the browsers built in regex pattern matcher: &lt;input id='phone' pattern="/^\(?\d{3}\D*\d{3}\D*\d{4}$/"&gt;&lt;/input&gt; and..... "output" is not defined: var output; Then you use it: $("#phone").val(output); //What's the value of "output" here? : undefined Plus.... if you check the input every time you change its value, you will be checking it also when you type the first number. That will not match your regex, so it removes it.... Edit: Check this code: http://jsfiddle.net/hza0wex5/5/ It will only format the number if the input has at least 10 characters
type: Answer

http://stackoverflow.com/comment/43204360
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27373990
has text: Thanks, it makes a lot clearer
score: 0

http://stackoverflow.com/comment/43122122
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27332015
type: Comment
has text: The "greeting" is a simplification for a much more complex directive in my real app, where I need to be able to format tooltip/popover messages nested several directives deep from an outer controller/template. Do you know where I can read more about the Proxy object idea? It was glossed over pretty quickly in the video. Also, if you could, please take a look at the guestbook app in my answer and fork/modify it to how you think it should be. Thanks for the video link, it is definitely worth a watch.

http://stackoverflow.com/comment/43393603
has text: Right. What's the final goal? You want to be able to set your own style *above* the TERRAIN map with your own button?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27448020

http://stackoverflow.com/q/27399612
has body: I have a textfield which should allow pasting only numbers in Struts 2. I tried using onPaste attribute in textfield but it throws below exception org.apache.jasper.JasperException: /WEB-INF/**.jsp Attribute onPaste invalid for tag textfield according to TLD Is there anyway to do above function without paste event?
answer count: 1
tagged with: jsp
tagged with: jquery
has comment: http://stackoverflow.com/comment/57510010
has title: How to use JavaScript paste event to allow numbers in Struts 2
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43245582
has answer: http://stackoverflow.com/a/27401751
tagged with: java
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: struts2
accepted answer: http://stackoverflow.com/a/27401751
score: 0

http://stackoverflow.com/comment/120750981
type: Comment
comment on: http://stackoverflow.com/a/30654451
score: 1
type: AnswerComment
has text: @evandrix edited this answer and Pique's answer. They were seemingly trying to combine them (why??) and ended up making them identically broken. Those edits need to be reverted.

http://stackoverflow.com/a/27451300
has comment: http://stackoverflow.com/comment/43350767
downvote count: 0
upvote count: 2
has body: pseudocode: for each letter in word: if letter is vowel, and previous letter is not vowel or this is the first letter, increment numSyllables if numSyllables is 0, set numSyllables to 1 You can use a boolean as a flag to determine whether the previous letter was a vowel or not. To loop through each letter in a word: var word = "test", i; for(i = 0; i &lt; word.length; i++) { console.log(word[i]); }
has comment: http://stackoverflow.com/comment/43342035
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43351005
has comment: http://stackoverflow.com/comment/43341714
answers question: http://stackoverflow.com/q/27451194
type: Answer
accepted answer of: http://stackoverflow.com/q/27451194
score: 2

http://stackoverflow.com/comment/106049319
type: QuestionComment
has text: this jar needs to be present in the dependencies.
comment on: http://stackoverflow.com/q/27425472
score: 0
type: Comment

http://stackoverflow.com/q/27383696
has title: Make generated divs that are created every few seconds fall down screen
has comment: http://stackoverflow.com/comment/43216227
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: So I'm working in Adobe Edge for school atm, and I'm trying get divs that are being created every 2 seconds to fall down the screen. Bear with me, I'm new to javascript :) This is the code to generate the div, but I have no idea how to target a div after and make it fall down. I've tried using a setTimeout and target elements with id=block but it only makes the first div generated fall down the screen. SpawnBlock(); function SpawnBlock() { UpdateBlock(); setTimeout(SpawnBlock, 2000); } function UpdateBlock() { var block = document.createElement("div"); block.style.width = "20px"; block.style.height = "20px"; block.style.background = "white" block.style.top = "100px"; block.style.left = Math.random() * 460 + "px"; block.style.position = "absolute"; block.id = "block"; //block.speed = 0.5; sym.$("Stage").append(block); } sym.$("Stage") is the div assigned by Adobe Edge in which I'm working. After this I'll have to add collision to a ball that follows my mouse cursor and can jump ( think of the Winterbells game ). This is what I have so far: http://student.howest.be/pieter-jan.vandenb1/crossdodger/Game.html
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/27384234
type: Question
score: 1
has comment: http://stackoverflow.com/comment/43216724
tagged with: adobe-edge

http://stackoverflow.com/q/27377445
has answer: http://stackoverflow.com/a/27378868
accepted answer: http://stackoverflow.com/a/27378868
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: asp.net
favorite count: 0
has title: Changing css on dropdown list click
has comment: http://stackoverflow.com/comment/43205197
has comment: http://stackoverflow.com/comment/43204695
tagged with: css
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I am trying to change the CSS stylesheet on my website so that the background colors can be changed. It worked with buttons but when i tried to put it in a dropdown list, it doesn't apply the css sheet switch. Can anyone help me out? var style_cookie_name = "style"; var style_cookie_duration = 30; function switch_style(css_title) { var i, link_tag; for (i = 0, link_tag = document.getElementsByTagName("link"); i < link_tag.length; i++) { if ((link_tag[i].rel.indexOf("stylesheet") != -1) && link_tag[i].title) { link_tag[i].disabled = true; if (link_tag[i].title == css_title) { link_tag[i].disabled = false; } } set_cookie(style_cookie_name, css_title, style_cookie_duration); } } function set_style_from_cookie() { var css_title = get_cookie(style_cookie_name); if (css_title.length) { switch_style(css_title); } } function set_cookie(cookie_name, cookie_value, lifespan_in_days, valid_domain) { var domain_string = valid_domain ? ("; domain=" + valid_domain) : ''; document.cookie = cookie_name + "=" + encodeURIComponent(cookie_value) + "; max-age=" + 60 * 60 * 24 * lifespan_in_days + "; path=/" + domain_string; } function get_cookie(cookie_name) { var cookie_string = document.cookie; if (cookie_string.length != 0) { var cookie_value = cookie_string.match( '(^|;)[\s]*' + cookie_name + '=([^;]*)'); return decodeURIComponent(cookie_value[2]); } return ''; } Thema 1 Thema 2
has comment: http://stackoverflow.com/comment/43204775
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43341834
comment on: http://stackoverflow.com/q/27451110
has text: What is printed in console?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27330815
has answer: http://stackoverflow.com/a/34070311
type: Question
has body: I need to run a slideshow using cycle2 for images from a particular folder. Below is my markup and php: <?php $dir = 'img/'; $files = scandir($dir); foreach($files as $file) { if($file !== '.' && $file !== '..'){ $tag = ' '; echo $tag; } } ?> Start and the function..... function slideshow() { $('.cycleShow').cycle(); } When executed, the images loads into the div. but no slideshow on click of button.
has comment: http://stackoverflow.com/comment/43119522
has comment: http://stackoverflow.com/comment/43119549
score: 0
has comment: http://stackoverflow.com/comment/43119870
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has title: Cycle2 not running
tagged with: php
type: UnansweredQuestion

http://stackoverflow.com/q/27383875
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/27384088
has title: Can a Model in Ampersand.js (or Backbone.js) be in multiple Collections simultaneously?
tagged with: ampersand.js
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/27384088
type: AnsweredQuestion
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
has body: Basically, I want to know if Collections work more like folders (they “physically contain” Models), or playlists (they contain a reference to Models). If they work like folders, is there a convention for emulating the playlist functionality? FWIW, I’m not modeling playlists — I’m just using them as a metaphor. I found several questions with titles that appeared to be similar to this question. But when I investigated, I couldn’t find a clear answer to my question.

http://stackoverflow.com/comment/43094267
has text: @Alvin: see my response, it works like a chamrm
score: 0
comment on: http://stackoverflow.com/q/27317193
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27328879
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27328746
type: AcceptedAnswer
downvote count: 0
has body: The className property on a dom element returns the complete className; that is, if some element has multiple classes (e.g. &lt;div class="herp derp"&gt;&lt;/div&gt;), then className = "herp derp". If you want to call changeColor on each of these multiple classes, try something like this: // first, change the order of the arguments on the changeColor function so we can pre-apply the color argument function changeColor(color, classname) { var curN = n[classname]; for(var i = 0; i &lt; curN; i ++) { elms[classname][i].style.backgroundColor = color; } } Now, we can change how we call changeColor // now, where you previously called changeColor, do something like this this.className.split(" ").forEach(changeColor.bind(null, "transparent")); // we now will call changeColor on all of the classes of this with the appropriate color ("transparent" or "#dbdbdb")
type: Answer
accepted answer of: http://stackoverflow.com/q/27328746

http://stackoverflow.com/comment/43335030
has text: But you are creating `editor` and its properties *before* the DOM finished loading.
comment on: http://stackoverflow.com/q/27447728
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43164364
type: Comment
has text: I think you might have just had the same brainwave I have just had... xD
comment on: http://stackoverflow.com/a/27355568
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43371080
type: Comment
type: AnswerComment
has text: BTW, it's that inverted behaveiour of your if
comment on: http://stackoverflow.com/a/27467746
score: 0

http://stackoverflow.com/comment/43294904
type: AnswerComment
has text: Thanks a lot Jack. Really obliged with your help.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27425297

http://stackoverflow.com/q/27420838
tagged with: universal-analytics
favorite count: 0
upvote count: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/33143882
type: Question
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/43284508
downvote count: 0
answer count: 1
has body: I captured a hit that i am sending to Universal Analytics. /collect?v=1&amp;_v=j31&amp;a=1233968061&amp;t=item&amp;cu=SEK&amp;_s=3&amp;dl=siteaddress&amp;de=UTF-8&amp;dt=online shop&amp;sd=24-bit&amp;sr=1920x1200&amp;vp=1903x1065&amp;je=1&amp;jid=&amp;cid=97152128.1418127174&amp;tid=UA-Test-1&amp;gtm=GTM-Test&amp;cm1=desktop&amp;z=1167078446 (is just a part of it) Does anyone know what the "a" parameter represents? I could not find anything in the Protocol Parameter Reference about it.
tagged with: javascript
has title: Google analytics collect parameter "a"
score: 2
has answer: http://stackoverflow.com/a/33143882

http://stackoverflow.com/q/27472390
type: Question
has title: Find all elements in an Angular directive
tagged with: angularjs-directive
has body: I am trying to implement something similar to an accordion in pure Angular. I have a list of FAQs, with the answers hidden (via css display: none;). I want it to work so that when you click on a question, then answer appears. If you click on the question again, the answer hides again. That all works fine using the following directive: .directive('toggleOpen', function toggleOpen() { return { restrict: 'A', link: function (scope, element, attrs) { element.bind('click', function () { if(element.parent().children().hasClass('open')) { element.parent().children().removeClass('open'); } else { element.parent().children().addClass('open'); } }); } } }); So the reason there's a bunch of parent().children() nonsense is the part I couldn't get working. Let's say you have 2 Questions, 1 and 2. When the page loads, both answers are hidden. User clicks question 1, and answer 1 unhides. Currently, when you click question 2, answer 2 unhides, which is also correct - but I only ever want ONE answer open at a time. So if answer 1 is showing and the user clicks question 2, I want answer 1 to hide, and answer 2 to show. I have a css class 'open' I am applying to unhide answers. So basically - how can I find ALL elements having the class 'open' and remove it, then apply it to the element the user clicked on? Is there a "pure" angular way to do this? TIA
tagged with: javascript
has answer: http://stackoverflow.com/a/27472724
has comment: http://stackoverflow.com/comment/43379664
answer count: 1
has comment: http://stackoverflow.com/comment/43407965
tagged with: angularjs
tagged with: css
has comment: http://stackoverflow.com/comment/43402182
accepted answer: http://stackoverflow.com/a/27472724
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/43254779
score: 1
type: Comment
type: QuestionComment
has text: The problem is that the load of Google inside jsfiddle is denied by X-Frame-Options, because Google does not permit cross-origin framing.
comment on: http://stackoverflow.com/q/27404223

http://stackoverflow.com/a/27566596
answers question: http://stackoverflow.com/q/27389074
has body: We added this functionality, but it will only be available with Java 8u40. The exact syntax is java.awt["Color(int, int, int)"] (the signature is part of the last name component, consistent with how it works on method names). You can try it out with early access releases of 8u40 at this time (it's scheduled for release in March 2015).
score: 4
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/a/27323535
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: http://jsfiddle.net/g09g35xa/6/ Here's a method that seems to work. Highlight the string you want and when you click the button it will alert the index of that highlighted word in the div. Markup: The quick brown quick fox jumps over the lazy dog And the JS: function getSelectedHTML() { try { if (window.ActiveXObject) { var c = document.selection.createRange(); return c.htmlText; } return getSelection().getRangeAt(0).toString(); } catch (e) { if (window.ActiveXObject) { return document.selection.createRange(); } else { return getSelection(); } } } function surroundSelectedElement() { var nNd = document.createElement("span"); nNd.setAttribute("id","actualSelectedElement"); var w = getSelection().getRangeAt(0); w.surroundContents(nNd); } $(function() { // save originalHtml to reset later var originalHtml = $("#theDiv").html(); $("#findIndex").click( function() { // get the selected string var selectedText = getSelectedHTML(); if(selectedText === '') return; // surround the selected area with a span, id = actualSelectedElement surroundSelectedElement(); // build Regex to find all occurrences of string that was selected var re = new RegExp(selectedText, "g"); // replace instances of string with span tags, class = selectedText $("#theDiv").html($("#theDiv").html().replace(re, "" + selectedText + "")); // the actual one selected is contained within a span with id=actualSelectedElement, so get all spans with class=selectedText and find the index of the one with the extra span actualSelectedElement var index = $('span.selectedText').index($('span#actualSelectedElement span.selectedText')); alert(index); // reset the html back to original $("#theDiv").html(originalHtml); }); });
answers question: http://stackoverflow.com/q/27322148
accepted answer of: http://stackoverflow.com/q/27322148

http://stackoverflow.com/q/27400635
answer count: 0
score: 1
has body: I am working on a Java web application which involves certain server side resources being allocated in a per session basis, and such allocation is marked as a session attribute. In order to facilitate a new feature, it is required to each page a different session, i.e. they shall not share the same session. Right now this has to be done by asking the user to explicitly create new session in their browsers or change its configuration. Is it possible to implemented with javascript or jQuery such that a new window is displayed with a different session every time? If javascript or jQuery cannot achieve such effect, any other alternative? The server side does not need to know the new session ID or anything related to it, and the primary client browser would be IE (version 8 or newer) so it does not matter if the solution is browser dependent. All I am asking is to achieve the same effect as the following, without having the users actually do so:
upvote count: 1
has title: Is it possible to create new session with javascript or jQuery?
type: Question
tagged with: session
tagged with: javascript
has comment: http://stackoverflow.com/comment/43246503
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/43246756
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2257631
has comment: http://stackoverflow.com/comment/43246722
has comment: http://stackoverflow.com/comment/82268703

http://stackoverflow.com/a/27331198
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27330955
type: AcceptedAnswer
has body: The issue is that function passed as the first argument of setTimeout executed out of digest cycle and view not updated. Better to use $timeout service of the setTimeout function: By the way, for me looks better solution with applying limitTo filter and increment limit with $interval: angular.module('myApp', []) .controller('MyCtrl', function($scope, $interval) { $scope.list_of_data = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']; $scope.limit = 0; $scope.start = function() { $interval(function() { $scope.limit += 1; }, 1000, $scope.list_of_data.length); }; }); press me {{d}}
downvote count: 0
has comment: http://stackoverflow.com/comment/43120316
accepted answer of: http://stackoverflow.com/q/27330955

http://stackoverflow.com/comment/43345063
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27434041
has text: As for sample rate, our source is sampling at 32000 and the AudioContext reports a sample rate of 41100. I don't hear any artifacts on the buffer boundaries, but it's not hi fidelity audio. It's a proof of concept software radio using an RTL device, and we're just streaming mono.
type: Comment

http://stackoverflow.com/q/27471908
duplicate of: http://stackoverflow.com/q/14028959
has answer: http://stackoverflow.com/a/27471965
has answer: http://stackoverflow.com/a/27471923
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43378436
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43378434
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43378435
has title: Why var value not show in id element?
favorite count: 0
linked to: http://stackoverflow.com/q/14028959
has body: Why var value not show in id element ? I try many time but not work , How can i do that ? &lt;script&gt; var xxxx = "test"; //alert(xxxx); document.getElementById("here").innerHTML = xxxx; &lt;/script&gt; &lt;span id="here"&gt;&lt;/span&gt;

http://stackoverflow.com/a/27463755
has comment: http://stackoverflow.com/comment/43364139
type: Answer
answers question: http://stackoverflow.com/q/27453421
score: 0
has body: In very many cases a leak in the native memory has a leaked object in js memory. So with a very high probability after fixing all the js leaks in your app you will have no leaks in the native memory. See the answer Tool to track down JavaScript memory leak

http://stackoverflow.com/a/27383500
accepted answer of: http://stackoverflow.com/q/27383252
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: Okay. So the thing is: If you only want to install the dependency locally, then run: npm install gulp-uglify, and it will create a folder called node_modules, in which you will find the required module. If instead, you want to install the package globally, then you have to run: npm install -g gulp-uglify, that will allocate the package on your OS, and you will be able to use it anywhere (not only on that folder). The option --save-dev (that will be npm install --save-dev gulp-uglify) will also update your package.json file and it will be added as a dev dependency, which is your app manifesto. That means, on that file you will have declared all the dependencies that you will need on your project, and they will be installed just by running npm install. In order to create the package.json file, you have to run npm init. More info can be found here. Or this other post. Hope this helps!
type: Answer
answers question: http://stackoverflow.com/q/27383252

http://stackoverflow.com/comment/44470991
score: 0
has text: Did you manage to work this out at all?
comment on: http://stackoverflow.com/q/27382876
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27386980
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43277012
downvote count: 0
answers question: http://stackoverflow.com/q/27383953
type: Answer
has body: @GJK, Thanks for the answer, I solved the problem by dropping semantic-ui built-in tab functionality and using ember query params instead. {{#link-to 'index' (query-params tab="hot") class="right item"}}Hot{{/link-to}} {{#link-to 'index' (query-params tab="all") class="right item"}}All{{/link-to}} &lt;div class="ui bottom attached active tab segment"&gt; {{article-list articles=articles}} &lt;/div&gt; I have only one div.tab.segment without data-tab attributes, and tab items are links with query params. export default Ember.ArrayController.extend({ queryParams: ['tab'], tab: hot, articles: function() { return this.get('model'); }.property('model') }); export default Ember.Route.extend({ queryParams: { tab: { refreshModel: true } }, model: function(params) { return this.store.find('article', { tab: params.tab }); } }); This looks neat, and query params have the extra feature to link to specific tab. Let me now what you think.

http://stackoverflow.com/a/27471582
type: Answer
has body: inside polymer elements you use this.$.id to select your things inside the element
upvote count: 1
answers question: http://stackoverflow.com/q/27471381
downvote count: 0
score: 1

http://stackoverflow.com/comment/43170201
type: Comment
comment on: http://stackoverflow.com/a/27358821
score: 0
type: AnswerComment
has text: I am using notepad++ so how to trace the error with it

http://stackoverflow.com/comment/43254888
type: Comment
type: QuestionComment
has text: I'm confused, are you looking for importer or exporter? because you mention both in the question... In any case please have a look in three.js editor (http://threejs.org/editor) which has a menu with both import and export as well. test if its work for you and if so, the editor code is public so you can easily take the relevant code for yours
score: 0
comment on: http://stackoverflow.com/q/27403515

http://stackoverflow.com/a/27318989
upvote count: 0
answers question: http://stackoverflow.com/q/27318669
score: -1
downvote count: 1
type: Answer
has body: What you have in your question is a 'good' way to structure your script, effectively taking your functions out of the direct global scope. If you had a script with a method: function A() { //Important code. } And at some point you add another plugin/different script file further down that page the uses A() that also declares a method A(): function A() { //Do something else } Then code will use the second definition of A and not call your important code. Tracking this down can be tricky. By using the prototypal code in your question you are kind of 'namespacing' your code and drastically reducing the chances of an accidental collision on method names, as the only item you put in the global scope is the 'object' name.

http://stackoverflow.com/comment/43247070
type: AnswerComment
score: 0
type: Comment
has text: Yes, I was looking for the option to rate your comment which solved my issue. Sadly I don't have enough reputations to rate I believe. Anyway I will mark the answer which you gave first as the correct one.
comment on: http://stackoverflow.com/a/27398021

http://stackoverflow.com/q/27377923
tagged with: ajax
has comment: http://stackoverflow.com/comment/43205245
has answer: http://stackoverflow.com/a/27378472
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/20433655
has comment: http://stackoverflow.com/comment/43206437
type: Question
duplicate of: http://stackoverflow.com/q/20433655
tagged with: javascript
score: 0
has body: Trying to obtain the response from a GET services the ajax function always run into error section. &lt;!DOCTYPE html&gt; &lt;!-- jquery --&gt; &lt;link rel="stylesheet" href="jquery/jquery-ui.css"&gt; &lt;script src="jquery/jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script src="jquery/jquery-ui.js"&gt;&lt;/script&gt; &lt;!-- bootstrap --&gt; &lt;link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"&gt; &lt;link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css"&gt; &lt;script src="bootstrap/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $.ajax( { url: "http://localhost:8080/POC-WebApplication/obtenerusuarios", type: "GET", dataType: "jsonp", success: function(data, textStatus, jqXHR) { alert("success"); }, error: function(data, textStatus, jqXHR) { alert("FAIL!!!!\ndata: "+data+"\ntextStatus: "+textStatus+"\njqXHR: "+jqXHR); } }); &lt;/script&gt; When the browser executes the code I got this results: data: [object Object] textStatus: parserror jqXHR: Error: jQuery1111.....3111 was not called I tried with dataType: "json" but I got this error in the chrome debug console: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. and the alerts print: data: [object Object] textStatus: error jqXHR: Error: ****EDITED**** I solved it using this chrome app: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi I encourage everyone with the same problem as me to use it.
has title: ajax fails obtaining the JSON string from GET service
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/27472724
has body: you could do it all with template logic, no directive needed:
score: 1
accepted answer of: http://stackoverflow.com/q/27472390
upvote count: 1
answers question: http://stackoverflow.com/q/27472390
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43403165
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43249789
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27401011
has text: you are using get parameters with form using post method. That is part of the problem change your php code to use $_GET['username'] or $_REQUEST['username'] and you will see what I mean. I will try and help more later.

http://stackoverflow.com/comment/43249016
score: 0
comment on: http://stackoverflow.com/a/27401986
type: AnswerComment
has text: @user2510547: I have corrected the answer. check it.
type: Comment

http://stackoverflow.com/comment/43145317
has text: It seems to be 100% working : http://jsfiddle.net/wm5mopgw/ . Why the downvotes ?
type: Comment
comment on: http://stackoverflow.com/a/27344067
score: 0
type: AnswerComment

http://stackoverflow.com/q/27448973
tagged with: unbind
has comment: http://stackoverflow.com/comment/43336751
tagged with: bind
has body: I'm using 2 jquery codes on my website. first code is : function bottom_open() { $('.cartouche_bottom').css('position','absolute').animate({ top :$(".top_table").height() - 1, }); $('.bottom_close').show(); //$('.layout_bottom').stop().animate({height :0}); } and the second one is : function bottom_close() { $('.cartouche_bottom').css('position','fixed').animate({ top : cartouche_bottom_position }); $('.bottom_close').hide(); } } what I'm trying to do is when first function is executed (by a click function), unbind the function, and when the second function is then executed, rebind the 1st function. I can't find a way of doin it. here is what I've tried : function bottom_cartouche(){ var cartouche_bottom_position = $(window).height() - $('.top_table').height() - $('.layout_bottom').height(); /FIRST ACTION, when ".cartouche_bottom_inside" is clicked, execute function bottom_open() and then unbind bottom_open(). So if we click again on ".cartouche_bottom_inside" bottom_open() will not be executed./ $('.cartouche_bottom_inside').click(function(){ bottom_open(); $(this).off('click'); }); /then SECOND ACTION, when ".bottom_close" is clicked exectude the second function bottom_close() and rebind first function bottom_open(). So if we click again on ".cartouche_bottom_inside", bottom_open() will be executed/ $('.bottom_close').click(function(){ bottom_close(); $('cartouche_bottom_inside').on('click'); }); function bottom_open() { $('.cartouche_bottom').css('position','absolute').animate({ top :$(".top_table").height() - 1, }); $('.bottom_close').show(); //$('.layout_bottom').stop().animate({height :0}); } function bottom_close() { $('.cartouche_bottom').css('position','fixed').animate({ top : cartouche_bottom_position }); $('.bottom_close').hide(); } } Here is an explaination : FIRST ACTION, when ".cartouche_bottom_inside" is clicked, execute function bottom_open() and then unbind bottom_open(). So if we click again on ".cartouche_bottom_inside" bottom_open() will not be e…
has answer: http://stackoverflow.com/a/27449074
type: Question
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/27449023
tagged with: jquery
has answer: http://stackoverflow.com/a/27449118
score: 0
has comment: http://stackoverflow.com/comment/43336845
answer count: 3
has title: jquery on and off function after click
type: UnansweredQuestion

http://stackoverflow.com/q/27383772
type: Question
has answer: http://stackoverflow.com/a/27383959
tagged with: javascript
tagged with: jquery
answer count: 3
has title: How can I dyamically load multiple scripts by order?
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43216136
favorite count: 0
has comment: http://stackoverflow.com/comment/43217204
has answer: http://stackoverflow.com/a/27384022
upvote count: 2
type: AnsweredQuestion
tagged with: lazy-loading
has body: I'm lazy loading various scripts depending on what page I'm on. Up till now, I've only loaded one per page. Now that I'm starting to clean up and reduce the number of scripts, I have to lazy load two scripts (or more) scripts for the same page. One script is dependent of the other so I need to load these in correct order. What is the best way to achieve this? My code: // Plupload must load before imageHandling.js jQuery(document).ready(function() { //Conditional load load_script('.image-drop-box','vendor/plupload/plupload.full.min.js'); load_script('.image-drop-box','imageHandling.js'); }); // Script loader // .exists() is a custom func that checks if an element exists on page function load_script(element, js) { $(element).exists(function(){ var script = document.createElement('script'); var footer = document.getElementById('footer'); script.type = 'text/javascript'; script.src = '/js/'+ js; footer.appendChild(script); }); }
possible better answer: http://stackoverflow.com/a/27383892
has answer: http://stackoverflow.com/a/27383892
accepted answer: http://stackoverflow.com/a/27384022

http://stackoverflow.com/a/27414777
answers question: http://stackoverflow.com/q/27414772
has comment: http://stackoverflow.com/comment/43275391
score: 0
has body: You need to replace .child()with .find('td') or .children(): if (screen.width &lt; 320) { $(".slider-navigation-thumbs table tr").each(function(){ var tdsnumber = $(this).children().length; if (tdsnumber &gt; 3) { $(this).find('td').last().hide(); } }); }
has comment: http://stackoverflow.com/comment/43275197
has comment: http://stackoverflow.com/comment/43274940
type: Answer

http://stackoverflow.com/comment/43126010
type: QuestionComment
has text: @vishalsharm No, you're manipulating Hidden Fields and your answer assumes a postback.
comment on: http://stackoverflow.com/q/27332689
score: 0
type: Comment

http://stackoverflow.com/comment/43422352
has text: @DaveAlger Glad you got it working. Stack Overflow may only be for *programming* questions, but sometimes the much easier solution is to use an existing tool rather than programming your own!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27431850

http://stackoverflow.com/comment/43374216
has text: rigth way, thanks. But some problem: if comment window.location.reload(); - all good, but i need to reload. when reload is working - $.post never executes (does not write to the database or other actions)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27469590
type: Comment

http://stackoverflow.com/a/27369989
has comment: http://stackoverflow.com/comment/43192339
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/43191770
downvote count: 0
answers question: http://stackoverflow.com/q/27369982
has comment: http://stackoverflow.com/comment/43196506
type: Answer
has comment: http://stackoverflow.com/comment/43192055
has body: Because each is not a method of Array. Unless you've added such a function to Array's prototype. You might be after forEach. 'a b c'.split(' ').forEach(function (n, i) { console.log(i, n) }); Output: 0 "a" 1 "b" 2 "c"

http://stackoverflow.com/q/27335950
tagged with: javascript
tagged with: jquery
has body: So I'm just trying to get a response every time the extension button is clicked. So like with AdBlock how this comes down But instead I'm just trying to do a console.log() every time the button is clicked without any visible popups. I've tried this so far chrome.extension.onMessage.addListener( function(request, sender, sendResponse) { switch (request.directive) { case "popup-click": // execute the content script chrome.tabs.executeScript(null, { // defaults to the current tab file: "real.js", // script to inject into page and run in sandbox allFrames: true // This injects script into iframes in the page and doesn't work before 4.0.266.0. }); sendResponse({}); // sending back empty response to sender break; default: // helps debug when request directive doesn't match alert("Unmatched request of '" + request + "' from script to background.js from " + sender); } } ); Then my real.js console.log("Yo"); But sadly I only get a Yo when it launches. Any ideas?
score: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/43131475
has title: Can't shoot a response every time extension button is clicked
has comment: http://stackoverflow.com/comment/43191551
has answer: http://stackoverflow.com/a/27375129
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/43191538
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43191599
has comment: http://stackoverflow.com/comment/43191579
linked to: http://stackoverflow.com/q/23316974
accepted answer: http://stackoverflow.com/a/27375129
answer count: 1

http://stackoverflow.com/comment/43439442
type: Comment
comment on: http://stackoverflow.com/a/27446989
has text: You should perform toPixels on max and on min and next deduct calculated values. Example: http://jsfiddle.net/pq2a4xn7/1/
score: 0
type: AnswerComment

http://stackoverflow.com/q/27342732
tagged with: google-chrome
has body: I have a transformation for my banner element which resizes the image a little on scrolling, see here The code for the transformation is as follows: $(window).scroll(function(){ var x = $(this).scrollTop(), transY = (x * 0.5), scale = 1 + (x * 0.0003), transform = 'translateY('+transY+'px) scale('+scale+') translate3d(0,0,0)'; $('#myCarousel .carousel-inner').css({ opacity: 1 - (x * 0.0008), WebkitTransform: transform, MozTransform: transform, msTransform: transform, transform: transform }); }); My problem is, whilst the animation runs perfectly smooth in firefox, I get a flickering / visible resizing effect in chrome. Is there anything I should change in the css to get it running smoothly in chrome, or is this browser just not capable to do an easy transformation?
type: Question
answer count: 2
tagged with: javascript
has title: Transformation flickers in chrome
tagged with: jquery
has answer: http://stackoverflow.com/a/27343005
accepted answer: http://stackoverflow.com/a/27342780
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27343005
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27342780

http://stackoverflow.com/q/27454288
tagged with: imagemap
score: 1
type: Question
has title: Text on top of image map
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27454758
linked to: http://stackoverflow.com/q/27451159
has comment: http://stackoverflow.com/comment/43347398
favorite count: 0
has body: Currently, I have an image with a image map. Is there a way for me to write some JavaScript code that will use the area name as a variable to display what is actually on it? All the text and area names are inside a data array already. For example, if this area is named Area1, it'll have the text Text1 inside, and etc. Why would I want to do this? It's easier for me to print it out with the names on it. Edit: Example of image map &lt;img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap"&gt; &lt;map name="planetmap"&gt; &lt;area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun"&gt; &lt;area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury"&gt; &lt;area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus"&gt; &lt;/map&gt;
has comment: http://stackoverflow.com/comment/43346795
has comment: http://stackoverflow.com/comment/43346874
has comment: http://stackoverflow.com/comment/43347425
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27454758
tagged with: css
downvote count: 0
has comment: http://stackoverflow.com/comment/43346852
type: AnsweredQuestion

http://stackoverflow.com/comment/75864096
type: Comment
comment on: http://stackoverflow.com/a/27415188
score: 4
has text: If you just want a big message you can simplify by putting all the css in one line like @PaulS. , e.g. console.log("%cHi from dnldr", "font-size: 100px;" )
type: AnswerComment

http://stackoverflow.com/comment/43266003
score: 0
type: Comment
type: AnswerComment
has text: The expression `"1" + "11" * 1` doesn't evaluate to `12` but `111`; eventhough the multiplication turns `"11"` to `11`, the first operand is still a string so the `11` will be turned back to a string.
comment on: http://stackoverflow.com/a/27409908

http://stackoverflow.com/q/27473092
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/43380822
has comment: http://stackoverflow.com/comment/43380868
has body: I have an ajax call. This script is working fine when I put it in one file with the form that will be loaded with the script. $(document).ready(function () { $("#uploadbutton").click(function () { var referenceNumber = document.getElementById('referenceNumber').value; $.ajax({ type: "POST", url: "selectReferenceOrder.php", data: 'referenceNumber='+referenceNumber, cache: false, //data: $('form').serialize(), success:function(html) { document.getElementById('outputReference').innerHTML = html; alert('referenceNumber'); } }); }); }); However, when I try to put it in an external file, it doesn't give me anything. The script of this ajax is functioned as the script that will post the form into the php file. Reference: &lt;input type="text" id="referenceNumber" /&gt; &lt;input type="button" id="uploadbutton" value="SEARCH"/&gt; I have tried many ways of doing this, but it still doesn't work: &lt;input type="submit" value="SEARCH" onclick="collectActed()" /&gt; function collectActed () { var referenceNumber = document.getElementById('referenceNumber').value; $.ajax({ type: "POST", url: "selectReferenceOrder.php", data: 'referenceNumber='+referenceNumber, cache: false, success:function(html) { document.getElementById('outputReference').innerHTML = html; } }); } Please, help.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43380781
tagged with: php
has comment: http://stackoverflow.com/comment/43380953
has comment: http://stackoverflow.com/comment/43380847
has title: Ajax Function in External File
has comment: http://stackoverflow.com/comment/43380985
type: Question
has answer: http://stackoverflow.com/a/27473232
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43346940
comment on: http://stackoverflow.com/a/27452975
score: 0
type: AnswerComment
type: Comment
has text: If you want it to log one every second, replace the `1000` to `i*1000` as I noted in that comment.

http://stackoverflow.com/a/27334391
has body: In jquery $(document).ready(function(){ var element = $('.post.apple'); //show element and reposition it element.css({ 'right' : '0', 'left' : 'auto' }).show(); //wrap the element in new container element.wrap('&lt;div class="container"&gt;&lt;/div&gt;'); }); You can test it on this jsfiddle http://jsfiddle.net/xdvmwxfL/17/
has comment: http://stackoverflow.com/comment/43125914
score: 0
answers question: http://stackoverflow.com/q/27334033
type: Answer

http://stackoverflow.com/comment/43317044
comment on: http://stackoverflow.com/q/27438526
type: Comment
type: QuestionComment
has text: Please get the code at least to a point where it can be parsed?
score: 0

http://stackoverflow.com/comment/43217397
type: AnswerComment
has text: @Natasha, how come you're using `this.name` in one place and `d.name` in another? They're supposed to be the same thing.
comment on: http://stackoverflow.com/a/27372991
type: Comment
score: 0

titanium
type: Tag
tag name: titanium
tags question: http://stackoverflow.com/q/27367976
tags question: http://stackoverflow.com/q/27420224
tags question: http://stackoverflow.com/q/27415087

http://stackoverflow.com/a/27455449
answers question: http://stackoverflow.com/q/27455405
score: 0
type: Answer
has body: Since Laravel is a server-side technology, you would probably want some sort of javascript library to achieve that functionality--unless you're willing to use forms that look like tables or tables with form elements inside them. You might also have some luck with contenteditable attributes and events. HTML doesn't have an editable form out of the box that automatically interacts with the backend (Laravel in your case). It depends on what you want to use the tables for; if your tables have a lot of data, you might later want sorting or pagination and that's something javascript table libraries are useful for. If your tables are simple or exist mainly for style purposes, you might be able to get away with not using javascript much or at all. It would be fairly unusual to go this route, though, and probably take a little longer to get a working prototype.

http://stackoverflow.com/comment/43384679
type: AnswerComment
score: 0
type: Comment
has text: @Gabriel the script is causing an infinite loop, also the "IF" clause is allowing any category page link to be redirected instead of just that one page.
comment on: http://stackoverflow.com/a/27473354

http://stackoverflow.com/a/27410780
type: Answer
accepted answer of: http://stackoverflow.com/q/27410367
has comment: http://stackoverflow.com/comment/43293952
has comment: http://stackoverflow.com/comment/43268050
has comment: http://stackoverflow.com/comment/43346018
answers question: http://stackoverflow.com/q/27410367
has body: The JavaScript and CSS files for Chosen should be included on the page when the page first loads. When the user clicks the button, make an Ajax call to include the partial. In the success callback for the AJAX request, initialize the Chosen plugin code for the dropdown lists that were just injected in the page. Your are correct that duplicate JS and CSS files will get loaded, which is definitely something you don't want. $.ajax(...) .done(function(data) { $("#foo") .html(data) .find("select") .each(function() { $(this).chosen({...}); }); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43335519
score: 0

http://stackoverflow.com/comment/43350691
type: Comment
type: QuestionComment
has text: Thanks, I am googling how to create jquery plugins right now - but are these jquery plugins tied to the jquery versions available? I am still at a loss as to why the code didnt work with the newer jquery version, even though I included his jquery.mobile.customized file
comment on: http://stackoverflow.com/q/27456656
score: 0

http://stackoverflow.com/comment/43235405
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27393882
has text: your child step screens/templates can share the parents controller where you can define the current step in.

http://stackoverflow.com/q/27415431
has comment: http://stackoverflow.com/comment/43274874
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27415490
type: UnansweredQuestion
tagged with: php
tagged with: css
has body: I am trying to add a jquery hover effect to the images on my site, i would like the image to become opaque on mouseover, and back to full opacity on mouseout. The problem that i am encountering is that the images are being populated on my page by PHP and i do not know what selector to use to get the effect that i want. Here is the HTML &lt;div id='gridcontainer'&gt; &lt;?php $counter = 1; //start counter $grids = 2; //Grids per row global $query_string; //Need this to make pagination work /*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts*/ query_posts($query_string . '&amp;caller_get_posts=1&amp;posts_per_page=12'); if(have_posts()) : while(have_posts()) : the_post(); ?&gt; &lt;?php //Show the left hand side column if($counter == 1) : ?&gt; &lt;div class="griditemleft"&gt; &lt;div class="postimage"&gt; &lt;?php the_content('Read the rest of this entry &amp;raquo;'); ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php //Show the right hand side column elseif($counter == $grids) : ?&gt; &lt;div class="griditemright"&gt; &lt;div class="postimage"&gt; &lt;?php the_content('Read the rest of this entry &amp;raquo;'); ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php $counter = 0; endif; ?&gt; &lt;?php $counter++; endwhile; endif; ?&gt; &lt;/div&gt; AND THIS IS HOW THE HTML SHOWS UP IN FIREBUG (SHOWS THE IMAGE TAGS) &lt;div id="gridcontainer"&gt; &lt;div class="griditemleft"&gt; &lt;div class="postimage"&gt; &lt;p&gt; &lt;a href="http://margierodrigues.com/taliecarterbeauty/wp-content/uploads/2014/12/lash_3.gif"&gt; &lt;img class="alignnone size-medium wp-image-108" width="300" height="300" alt="lash_3" src="http://margierodrigues.com/taliecarterbeauty/wp-content/uploads/2014/12/lash_3-300x300.gif"&gt; &lt;/a&gt; &lt;/p&gt; &lt;/div&gt; can anyone offer any insight?
score: 1
has answer: http://stackoverflow.com/a/27415504
has title: jQuery selectors nested within several DIVs and PHP code
type: Question
has comment: http://stackoverflow.com/comment/43275602
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27364238
has answer: http://stackoverflow.com/a/27369050
has body: Say I have a lambda in TypeScript: myArray.forEach(o =&gt; o.x = this.x); The value of this becomes window instead of the calling object. What I'd really like to do is: myArray.forEach(o =&gt; { o.x = this.x; }.bind(this)); But I don't see that as an option in TypeScript. How can I override this in a TypeScript lambda body?
tagged with: typescript
has comment: http://stackoverflow.com/comment/43184939
tagged with: function-binding
type: Question
has comment: http://stackoverflow.com/comment/48979526
has comment: http://stackoverflow.com/comment/43180633
has comment: http://stackoverflow.com/comment/43180615
downvote count: 0
tagged with: javascript
score: 4
upvote count: 4
has title: Bind "this" to TypeScript Lambda
has comment: http://stackoverflow.com/comment/43180317
tagged with: this
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43180553
type: UnansweredQuestion

http://stackoverflow.com/q/27412072
has title: How do I make a form submit only for the word of my choosing
score: -5
has answer: http://stackoverflow.com/a/27412512
has comment: http://stackoverflow.com/comment/43268448
has body: I have a login page. I want the form to validate the form to allow the form to submit if I only enter a specif word for the username and a different word, of my choosing, for the password. I do not wish to use a sql database. I want it to validate to a specific word that I pre-set it to. If it is right I would like it to redirect me to my index.htm page once I hit submit. But if it is wrong I would like it to clear the text fields. What code do I use to do this. Here is a basic layout of my code: html Login Username: Password: Login js evaluateInput = function(){ inputBox = document.getElementById("username"); if(inputBox.value == "<insert password here>"){ }else } }{ inputBox = document.getElementById("password"); if(inputBox.value == "<insert password here>"){ }else } }
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43269329
downvote count: 5
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
has comment: http://stackoverflow.com/comment/43268598
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43268519
tagged with: authentication
has comment: http://stackoverflow.com/comment/43269042

http://stackoverflow.com/comment/43398567
type: AnswerComment
score: 0
has text: When moving an dot in the one Chart that exact Dot shall be moved in the other Chart Aswell. The Charts are identical and all show the same Informations but in other scalings of x and y axis.
type: Comment
comment on: http://stackoverflow.com/a/27473976

http://stackoverflow.com/comment/43114756
type: Comment
score: 2
comment on: http://stackoverflow.com/q/27327932
type: QuestionComment
has text: I think questions about code that works are generally asked on [codereview](http://codereview.stackexchange.com).

http://stackoverflow.com/a/27390743
answers question: http://stackoverflow.com/q/27390534
has comment: http://stackoverflow.com/comment/43229573
has comment: http://stackoverflow.com/comment/43229647
score: 0
type: Answer
has body: Assuming that JQuery has been properly loaded. A page can't be manipulated safely until the document is "ready." Make sure the JS code is running once the DOM is ready: &lt;script type="text/javascript"&gt; $(function() { // add this document.getElementById('trimest').disabled=true; $('input:radio[name="group1"]').change(function() { console.log('radio button clicked'); // do you see this? if ($(this).val() === 'mensuelle') { // append stuff document.getElementById('trimest').disabled=true; document.getElementById('mois').disabled=false; } else { document.getElementById('trimest').disabled=false; document.getElementById('mois').disabled=true; } }); ); // and this &lt;/script&gt; See http://learn.jquery.com/using-jquery-core/document-ready/ What does your console say?

http://stackoverflow.com/comment/43324305
score: 0
type: Comment
has text: Have you check the http://jsbin.com/fokajo/3/ ? the element #menu2 is hiddem as load the page, because offsetTopLimit = 0; change it as you have to.
type: AnswerComment
comment on: http://stackoverflow.com/a/27441737

http://stackoverflow.com/comment/43297042
type: QuestionComment
has text: I did something similar not long ago and simply using the onClick with a window.open it triggered the download of the file a NodeJS Express server. What is happening if you try yourself ?
comment on: http://stackoverflow.com/q/27427507
score: 0
type: Comment

http://stackoverflow.com/q/27367667
has title: Group Array into a more complex Array
favorite count: 0
has body: I create an array of Objects from a database query and call the array jobListRecords. There are multiple records in the array created that have the same "customerID" and "name". I would like to create a new array that has one record for each customer with a new field , "jobArray", that contains another array of all of that customers services. (see sortCustomer array down below) An example of the initial array: jobListRecords = [ { "customerID" : "1", "name" : "Larry Bird", "serviceID" : "101", "serviceName" : "Dog Walking" }, { "customerID" : "2", "name" : "Andrew Luck", "serviceID" : "202", "serviceName" : "Baby Sitting" }, { "customerID" : "2", "name" : "Andrew Luck", "serviceID" : "101", "serviceName" : "Dog Walking" } ] Desired Result sortCustomer Example: sortCustomer = [ { "customerID" : "1", "name" : " Larry Bird", "jobArray" : [ { "serviceID" : "101", "serviceName" : "Dog Walking" } ] }, { "customerID" : "2", "name" : "Andrew Luck", "jobArray" : [ { "serviceID" : "202", "serviceName" : "Baby Sitting" }, { "serviceID" : "101", "serviceName" : "Dog Walking" } ] } Is their a simple or efficient way of solving this without having to iterate through all the data 3+ times. Thank You for your time, below is one of the several things I tried. I tried solving this using one example I found but it grouped all the serviceIDs together which is not what I need. Example that DID NOT work that I tried. jobListGrouped = _ .chain(jobListRecords) .groupBy('customerID') .map(function(value, key) { return { CustomerID: key, services: _.pluck(value, 'serviceID') } }) .value();
tagged with: object
type: AnsweredQuestion
downvote count: 0
tagged with: underscore.js
score: 1
has answer: http://stackoverflow.com/a/27367868
accepted answer: http://stackoverflow.com/a/27367868
type: Question
upvote count: 1
answer count: 1
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/q/27364186
upvote count: 4
has body: I am using the rotten tomatoes API, which is fairly straight forward. The following is my basic code: var apikey = "xxxxx"; function queryForMovie(query) { queryUrl = "http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=" + apikey + "&amp;q=" + encodeURI(query); $.ajax({ url: queryUrl, dataType: "jsonp", success: queryCallback }); } function queryCallback(data) { var el = $('#movie-listings'); $.each(data.movies, function(index, movie) { el.append('img src="' + movie.posters.original + '" alt="' + movie.title + '"'); }) }; $(document).on("load", queryForMovie("Star Wars")); However, this gives back a very small image. What would be a good way to get a larger sized image, while limiting requests where possible?
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43180247
has title: Getting decent sized pictures using the rottentomatoes API
has comment: http://stackoverflow.com/comment/43180462
accepted answer: http://stackoverflow.com/a/29889941
has comment: http://stackoverflow.com/comment/43180341
type: AnsweredQuestion
score: 4
has comment: http://stackoverflow.com/comment/43180376
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29889941

http://stackoverflow.com/comment/43359601
type: QuestionComment
has text: i dont understand ur scenario...
score: 0
comment on: http://stackoverflow.com/q/27461491
type: Comment

http://stackoverflow.com/comment/43284489
comment on: http://stackoverflow.com/a/27420412
type: AnswerComment
score: 0
type: Comment
has text: This **1.** does not cover array of keys **2.** matches spurious beginning of the string (e.g. `"fdgdsfgguserslist/data"`)

http://stackoverflow.com/comment/123655626
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27323864
has text: This doesn't round to the nearest date, it floors to the current date and is equivalent to just setting the hours, minutes, etc. to 0. Messing around with the timezone offset is inefficient and only necessary because the algorithm effectively zeros the UTC date, so the offset has to be add to zero the local date.

http://stackoverflow.com/a/27383892
downvote count: 0
has comment: http://stackoverflow.com/comment/43217190
has comment: http://stackoverflow.com/comment/43217187
score: 3
has body: there is a jquery plugin with callback. you could use that, the call back function will be triggered after loading the first script, this plugin uses lazyloading system jquery loadscript plugin usage $.loadScript( url [, callback()] ) or var s= ["http://firstLink", "http://secondLink"]; function get_script(){ if(scripts.length==0) return; var x = s.pop(); $.ajax({ url: x, dataType: "script", async:true, success: function(){ get_script(); }, error: function(){ //console.log( x+ 'failed' ); } }); } get_script(); even though second one looks lengthy, i prefer that.(just a personal opinion, correct me if there is a better option)
has comment: http://stackoverflow.com/comment/43223163
has comment: http://stackoverflow.com/comment/43217018
upvote count: 3
has comment: http://stackoverflow.com/comment/43217366
has comment: http://stackoverflow.com/comment/43216891
type: Answer
answers question: http://stackoverflow.com/q/27383772

http://stackoverflow.com/a/59587665
has comment: http://stackoverflow.com/comment/113393298
has body: var arr = [{id:1, name:'name'},{id:2, name:'name'},{id:3, name:'name'}]; var index = 1; var result = Array.prototype.concat(arr.slice(0, index), arr.slice(index + 1, arr.length)); It merges left and right part of the array, the delimiter here is the element you want to delete.
answers question: http://stackoverflow.com/q/27396698
score: 0
type: Answer

http://stackoverflow.com/comment/43157544
type: Comment
comment on: http://stackoverflow.com/q/27351466
has text: then it sounds like the videos are defective by design for external embeds...
score: 0
type: QuestionComment

http://stackoverflow.com/a/27416158
has body: If the library you are using is the official 10gen library, then you can't simply output collection.find() without unwinding it. The easiest way to do that for smaller datasets is collection.find().toArray(function(err, results) { if (err) { // do something error-y } else { res.send( results ); } }); If you post more of your code, and tag your question with the libraries you are using, you'll be able to get more targeted help. If the library you are using returns a promise, this is probably how you'd unwind it: collection.find().then(function(results){ res.send(results); }).catch(function(err){ console.error(err); });
has comment: http://stackoverflow.com/comment/43276516
downvote count: 0
has comment: http://stackoverflow.com/comment/43276411
has comment: http://stackoverflow.com/comment/43294754
type: Answer
answers question: http://stackoverflow.com/q/27415712
score: 1
has comment: http://stackoverflow.com/comment/43295106
upvote count: 1

http://stackoverflow.com/comment/43264633
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27410116
score: 0
has text: That should not be the problem, function declarations (those without `var`) are evaluated first.

http://stackoverflow.com/q/27435834
tagged with: jquery
tagged with: ajax
answer count: 2
has title: ajax custom dialog box upon success
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43312605
has body: I've coded a custom dialog/modal box as follows: Howdy, I'm a dialog box < div> Close It is currently triggered by a button with the javascript code as follows: …where our trigger button has the data-attribute data-dialog="somedialog". However, now I want to call this custom dialog only when my AJAX returns successful and pass in the message from AJAX into the dialog's text. How do I actually do that? ajax call:
score: 1
has comment: http://stackoverflow.com/comment/43312667
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27435992
has answer: http://stackoverflow.com/a/28112714
has comment: http://stackoverflow.com/comment/43312638
tagged with: javascript

http://stackoverflow.com/a/27466853
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27466751
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: The configuration option has a timeout property that may help you query : { method : "GET", isArray : false, timeout:5000, //In millisecond }, You can use the $http.defaults configuration to override this at global level. See documentation on $http or $resource https://code.angularjs.org/1.3.3/docs/api/ng/service/$http When the timeout lapses the underlying resource promise will be rejected and you willland on error callback
answers question: http://stackoverflow.com/q/27466751

http://stackoverflow.com/comment/43218626
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27378497
has text: I know it is a bit broad, always a challenge to keep it out of the weeds of my specific situation. Your high-level overview I think will point me in the right direction. If I get a working sample I'll update with a link.

http://stackoverflow.com/q/27360243
type: Question
has comment: http://stackoverflow.com/comment/43173262
has comment: http://stackoverflow.com/comment/43172976
has comment: http://stackoverflow.com/comment/43173017
has comment: http://stackoverflow.com/comment/43173013
upvote count: 1
has comment: http://stackoverflow.com/comment/43173298
has comment: http://stackoverflow.com/comment/43173351
has title: Why is it called isolate scope and not isolated scope?
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43172863
has comment: http://stackoverflow.com/comment/43173358
has comment: http://stackoverflow.com/comment/43172836
answer count: 0
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43173157
tagged with: angularjs
has body: Isolate is a verb so to say "an isolate scope" is like saying "an eat apple". Why is it called isolate scope and not isolated scope?

http://stackoverflow.com/comment/43254547
type: AnswerComment
has text: @Tomalak Maintainability. The main problem in all software - all the time, even from the beginning of computing, is the cost of maintenance - sorry for my English, but I guess you know what I mean. Working in team means: make things as simple as possible if someone has to understand what you've done he'll do it very fast. The code you have to deal with NodeJS/JavaScript/asynchronous principles (all mixed) makes it hard for people to understand what you've done fast. It's not a problem of what you do it's a problem of the tools: NodeJS/JavaScript/asynchronous principles.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27391740

http://stackoverflow.com/q/27406862
accepted answer: http://stackoverflow.com/a/27406915
has title: Selecting divs using attribute conditions Jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: .sameClass{ background-color:#3e6687; width:100px; height:100px; float:left; margin-right: 10px; } #first,#second{ margin-bottom:10px; float:left; } #first{ background-color:#8a94ae; } #second{ background-color:#29375a; } Lets say I have the code above and I want to insert an image dynamically into one of those divs when a button has been clicked. I would like to check if the div has attribute class="sameClass" and attribute data-category="fun". The third condition is that this attribute has to be in div with attribute id="second". I want to do this with jQuery. Can anyone please help me with this.
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27406929
has answer: http://stackoverflow.com/a/27406915
has answer: http://stackoverflow.com/a/27406988
possible better answer: http://stackoverflow.com/a/27406929
answer count: 3
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0

http://stackoverflow.com/q/27425573
score: 1
possible better answer: http://stackoverflow.com/a/36388400
tagged with: http://stackoverflow.com/tag/json
tagged with: webview
upvote count: 1
has body: I received a valid JSON from the server, but Chromium tells me this error: "Uncaught SyntaxError: Unexpected identifier", source: (1) All I know is that when I call the following method: stringBuilder.append("javascript: javascriptBridge.getHandlers().showPost('"); stringBuilder.append(e.getData()); stringBuilder.append("');"); webView.loadUrl(stringBuilder.toString()); Where e.getData() is the valid JSON, it doesn't actually get called on the other side. Something in the JSON is interpreted incorrectly as a javascript function parameter javascriptBridge.registerHandler('showPost', function (data) { alert('showpost'); //this is not called }); It works for other datas and it worked previously even for JSON, that is why it's odd. Any ideas how to fix it? It's probably some character that crashes it.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27425574
answer count: 2
downvote count: 0
favorite count: 0
tagged with: android
has answer: http://stackoverflow.com/a/36388400
has title: Android hybrid app gives me "Uncaught SyntaxError: Unexpected identifier", source: (1)
accepted answer: http://stackoverflow.com/a/27425574
type: AnsweredQuestion

http://stackoverflow.com/comment/43382067
has text: Nice! it works. That was pretty simple hehe. I have a question about accessibility and SEO friendlyness with this solution. I'll wrap the content div(with the top:100%;) around the main tag and footer tag of the page, to control the layout of main content and footer with this absolute process. Do I get any negative effects by doing this approach? Thank you mate:)
comment on: http://stackoverflow.com/a/27473720
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27353486
upvote count: 1
tagged with: php
answer count: 1
has body: /In view */ &lt;?php $nodes = $gw-&gt;searchNodes(); foreach($nodes as $node) { $user= $node-&gt;getpdsout(); foreach($user as $key=&gt;$val){ $ls = $val['elapsed']; print_r($ls);//out put 16.3080555555556 } } ?&gt; //out put :- 16.3080555555556 , but when i passed to google chart it Pass NULL , i.e first value . //Java script file &lt;div class="row"&gt; &lt;div class="span6" &gt; &lt;?php //very useful google chart $this-&gt;widget('ext.Hzl.google.HzlVisualizationChart', array('visualization' =&gt; 'PieChart', 'data' =&gt; array( array('Occupied ', 'Hours per Day'), array('Occupied',$ls),// here got ["Occupied",null],instead of ["Occupied", 16.3080555555556] array('Not Occupied', 16.3080555555556), array('Occupied', 5.45388888888889), ), 'options' =&gt; array('title' =&gt; 'Occupancy Sensor'))); ?&gt; &lt;/div&gt; &lt;/div&gt; out put log using fire bug:- google.visualization.arrayToDataTable([["Occupied ","Hours per Day"],["Occupied",null],["Not Occupied",16.308055555556],["Occupied",5.4538888888889]]);
has title: when pass an array element in yii google chart it , it pass null intead of values
tagged with: yii
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27353636
downvote count: 0
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/q/27424836
has title: How to properly set up brain.js Neural Network
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has body: I am using the Auto MPG training set from http://archive.ics.uci.edu/ml/datasets/Auto+MPG My code is: 'use strict'; var brain, fs, normalizeData, trainNetwork, _; _ = require('lodash'); brain = require('brain'); fs = require('fs'); trainNetwork = function(trainNetworkCb) { var net; net = new brain.NeuralNetwork(); return fs.readFile('./data/autodata.csv', function(err, fileData) { var fileString, lines, trainingData; if (err) { return trainNetworkCb(err); } fileString = fileData.toString(); lines = fileString.split('\n'); trainingData = lines.splice(0, lines.length / 2); trainingData = _.map(trainingData, function(dataPoint) { var normalizedData, obj; normalizedData = normalizeData(dataPoint); obj = { input: normalizedData, output: { continuous: normalizedData.continuous } }; delete obj.input.continuous; return obj; }); net.train(trainingData, { log: true, logPeriod: 100, errorThresh: 0.00005 }); return trainNetworkCb(null, net); }); }; trainNetwork(function(err, net) { if (err) { throw err; } return fs.readFile('./data/autodata.csv', function(err, fileData) { var fileString, lines, testData; if (err) { return trainNetworkCb(err); } fileString = fileData.toString(); lines = fileString.split('\n'); testData = lines.splice(lines.length / 2); testData = _.filter(testData, function(point) { return point !== ''; }); testData = _.map(testData, function(dataPoint) { var normalizedData, obj; normalizedData = normalizeData(dataPoint); obj = { output: { continuous: normalizedData.continuous }, input: normalizedData }; delete obj.input.continuous; return obj; }); return _.each(testData, function(dataPoint) { var output; output = net.run(dataPoint.input); console.log(output); console.log(dataPoint); return console.log(''); }); }); }); normalizeData = function(dataRow) { var cylinders, dataSet, model_years, origins, row; dataSet = dataRow.split(','); dataSet = _.map(dataSet, function(point) { return Number(point); }); row = {}; cylinders = [5, 3, 6, 4, 8]; _.each(cylinders, func…
has answer: http://stackoverflow.com/a/27596780
type: Question
score: 4
answer count: 1
accepted answer: http://stackoverflow.com/a/27596780
upvote count: 4
tagged with: neural-network
tagged with: javascript
tagged with: brain.js

http://stackoverflow.com/comment/43221049
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27385679
type: Comment
has text: You mean write it under the tag on my html page? like <script codeHere .. I tried that, but came into trouble when trying to use the tags . Also i really want some variables that are located in the fragment.. Or did i not understand you correctly?

http://stackoverflow.com/q/27444404
has comment: http://stackoverflow.com/comment/43329539
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27445866
upvote count: 0
type: UnansweredQuestion
has body: Code var readAll = function () { $.ajax( { url: _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getByTitle('PhoneBook')/items/" + "?$select=Id, Title, pb_FirstName, pb_PhoneNumber" + "&$orderby=Title,pb_FirstName, pb_PhoneNumber", type: "GET", headers: { "accept": "application/json;odata=verbose", }, success: function (data) { var _table = $('.table'); var data = data.d.results; for (var i = 0; i < data.length; i++) { _table.append(" "); _table.append(" "); _table.append(" " + data[i].Title + " "); _table.append(" " + data[i].pb_FirstName + " "); _table.append(" " + data[i].pb_PhoneNumber + " "); _table.append(' '); _table.append(" "); _table.sort(function (a, b) { return parseFloat(a.Title) - parseFloat(b.pb_FirstName) }); } }, error: function (err) { alert(JSON.stringify(err)); } } ); }; $(document).ready(function () { readAll(); }); I have a list that is shown in a HTML table. So now i build a HTML Search box. So when i click a name in the Search box, it should show me the name. How should I do that? And how can I sort the data by names? Sorry for my misspelling
type: Question
score: -2
has title: Render data by typing in my search box
downvote count: 2

http://stackoverflow.com/a/27324849
score: 2
has comment: http://stackoverflow.com/comment/43109135
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43109037
type: Answer
has body: Your functionString contains exactly the string "function (message) { console.log(message); }" Evaluating it as-is does present JavaScript engine with incorrect syntax (there is no name for this function). JavaScript expects construct like function &lt;name&gt;(&lt;params&gt;) { }. Alternatively, you can use anonymous function (i.e. no name present), but only as a parameter or in a context of evaluating expression. The minimal typical evaluating expression would be (function() {})() If you want to get fancy, !function() {} is also ok - the exclamation mark in front turns it into boolean expression that requires function evaluation before negating the output. So, in your example this will work: eval("("+functionString+")('abc')"); because then you do anonymous function call - something JavaScript can live with. Alternatively, you can also use just brackets, then you need to assign the result to something you can use later: var foo = eval("("+functionString+")"); foo('ddd'); Here is a little proof / playground to learn about it: http://jsfiddle.net/Exceeder/ydann6b3/
accepted answer of: http://stackoverflow.com/q/27324716
has comment: http://stackoverflow.com/comment/43109308
downvote count: 0
answers question: http://stackoverflow.com/q/27324716

http://stackoverflow.com/q/27448209
tagged with: javascript
has comment: http://stackoverflow.com/comment/43336344
possible better answer: http://stackoverflow.com/a/27452275
type: Question
has body: Would anyone happen to know of a quick way to move the contents of one cell into another in Google Sheets. All of the cells will remain static, so I don't have to worry about additional rows or columns being added to my sheet. I have tried to getCell(), just like the getLastColumn() function, but getCell() doesn't seem to be a valid function. Code that I currently have: var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = event.source.getActiveSheet(); var r = event.source.getActiveRange(); if(s.getName() == "Sheet4" &amp;&amp; r.getColumn() == 15 &amp;&amp; r.getValue() == "GO" ) { var row = r.getRow(); var numColumns = s.getLastColumn(); var targetSheet = ss.getSheetByName("Sheet4"); ss.getSheets()[1].getRange("A48:A48").copyTo(ss.getSheets()[2].getRange("A3:A3"),{contentsOnly:true});
has answer: http://stackoverflow.com/a/27589549
has comment: http://stackoverflow.com/comment/43336226
accepted answer: http://stackoverflow.com/a/27589549
score: 0
answer count: 2
has title: How to move individual cells in Google Sheets
has answer: http://stackoverflow.com/a/27452275
tagged with: google-sheets
type: AnsweredQuestion

http://stackoverflow.com/q/27320333
has comment: http://stackoverflow.com/comment/43102447
tagged with: triggers
has comment: http://stackoverflow.com/comment/43103514
type: Question
has answer: http://stackoverflow.com/a/27320370
tagged with: javascript
has body: Here is my code: &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;button type="button" id="SuperWebF1" title="&lt;?php echo $this-&gt;__('Continue') ?&gt;" class="button"&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Continue') ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt; Here is my JavaScript: &lt;script type="text/javascript"&gt; $.noConflict(); jQuery(document).ready(function($){ $( "#foo" ).on( "click", function() { alert( $( this ).text() ); }); $("#SuperWebF1").click(function(){ if ($('[name="shipping_method"]', window.parent.document).is(':checked')){ billing.save(); parent.jQuery("#LoadingDiv").show().delay(4300).fadeOut(); parent.jQuery("#OutDiv").hide().delay(5000).fadeIn(); parent.jQuery('#OutDiv').removeClass('outerdiv'); parent.jQuery('#OutDiv').removeClass('outerdivNoAdress'); setTimeout(function() { if( $('#DisplayMe').length ){ parent.jQuery('#OutDiv').addClass('OuterDiv1000'); } else { parent.jQuery('#OutDiv').addClass('OuterDiv1000No'); } }, 5100); parent.jQuery('#InnerIframe').removeClass('FrameCSS'); parent.jQuery('#InnerIframe').removeClass('FrameCSSNoAdress'); parent.jQuery('#InnerIframe').addClass('FrameCSS1000'); }else { alert('Моля, изберете начин на доставка!'); } }) }); &lt;/script&gt; How can i make jQuery simulate the click on button #SuperWebF1 when page is loaded, is it possible ? Thanks
has title: How to make jQuery click a button when page is loaded?
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43143093
has text: why I got so many -ve ratings ???
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27343656
type: Comment

http://stackoverflow.com/q/27434686
type: Question
has comment: http://stackoverflow.com/comment/43311357
has comment: http://stackoverflow.com/comment/43310231
has comment: http://stackoverflow.com/comment/43310348
has comment: http://stackoverflow.com/comment/43310376
tagged with: javascript
has comment: http://stackoverflow.com/comment/43310266
linked to: http://stackoverflow.com/q/20544219
has comment: http://stackoverflow.com/comment/43310275
score: 0
has comment: http://stackoverflow.com/comment/43310218
answer count: 1
has comment: http://stackoverflow.com/comment/43311002
has body: I know how to point to an external javascript file using How will you point to an external text (.txt) or csv file? In the code below I am unable to point to test.txt. crossfilter + maps
has title: javascript to external .txt file
has answer: http://stackoverflow.com/a/27434972
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/csv
tagged with: text
has comment: http://stackoverflow.com/comment/43310987

http://stackoverflow.com/a/56229188
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/27440016
score: -1
downvote count: 1
has body: window.onload = function() ... is defining a function. Just call the function right after you close it with window.onload(); Worked for me after many hours

http://stackoverflow.com/a/27373179
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27372774
has body: You should have the calculation in a function that is called whenever the dropdown or the checkbox are changed. You can call the same function when initializing. function subtotal(){ var as = $("#as").val(); var txt1 = $('#sff').val(); var txt2 = $('#osf').val(); var d = 0; if ($('#cbx3').is(":checked")) { d = parseFloat($("#cbx3").val(), 10); var a = parseFloat(as, 10); var b = parseFloat(txt1, 10); var c = parseFloat(txt2, 10); var total = parseFloat(a, 10) + parseFloat(b, 10) + parseFloat(c, 10) + d; $('#st').val(total.toFixed(2)); }; $("#as").on('change',function(event){ subtotal(); } $('#cbx3').click(function(){ subtotal(); });

http://stackoverflow.com/comment/43373956
has text: You can find out the full path of your php file using http://php.net/manual/de/function.realpath.php. So you could also do smth like include realpath(null)."/"relative/path/to/file.ext";
type: Comment
comment on: http://stackoverflow.com/a/27467712
score: 0
type: AnswerComment

http://stackoverflow.com/comment/94684682
has text: @mawg doxygen is the name of the product / program all in lower case and should, in my opinion, be in lower case (I've seen others "correcting" it as well, good luck "correcting" everything).
type: Comment
comment on: http://stackoverflow.com/q/27421974
score: 0
type: QuestionComment

http://stackoverflow.com/a/27460419
has comment: http://stackoverflow.com/comment/43358551
has comment: http://stackoverflow.com/comment/43357970
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43357711
has comment: http://stackoverflow.com/comment/43357838
accepted answer of: http://stackoverflow.com/q/27459205
has comment: http://stackoverflow.com/comment/43358628
type: Answer
answers question: http://stackoverflow.com/q/27459205
has comment: http://stackoverflow.com/comment/43358182
has comment: http://stackoverflow.com/comment/43358162
has comment: http://stackoverflow.com/comment/43358684
has body: That second part isn't a method: it's part of the datepicker constructor. What you need to do is loop through your array and use that constructor each time (but initialize the datepicker before the loop). As for selecting multiple dates, you can't do that by default (only one date can be selected at one time), so you'd have to use a third party plugin. $("#inlineDp").datepicker(); for (var j = 0; j &lt; dateArr.length; j++) { window.setTimeout(function(){ $("#inlineDp").datepicker("setDate", dateArr[j]); }, 500); } (Note that for simplicity, this code does not take into account the problem with timeouts in loops (namely, that they don't work). However, the code in the demo below does (so you should use the code there instead of that from explanatory example above).) Demo
upvote count: 3
has comment: http://stackoverflow.com/comment/43358534
score: 3

http://stackoverflow.com/q/27343789
score: 2
has comment: http://stackoverflow.com/comment/43143076
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43143184
favorite count: 0
has comment: http://stackoverflow.com/comment/43143095
type: Question
has comment: http://stackoverflow.com/comment/43143866
has comment: http://stackoverflow.com/comment/43143463
has body: How to Get number with 2 decimal and not rounding using javascript ? i try http://jsfiddle.net/3AaAx/31/ var i = "1234.666"; var xxx = Math.floor(i * 100) / 100 alert(xxx); AND http://jsfiddle.net/3AaAx/29/ var i = "1234.666"; function myToFixed(i, digits) { var pow = Math.pow(10, digits); return Math.floor(i * pow) / pow; } var xxx = myToFixed(i, 2) alert(xxx); it's work. But when i declare var i = "1234"; i want to get "1234.00" http://jsfiddle.net/3AaAx/30/ http://jsfiddle.net/3AaAx/32/ How to do that ?
has answer: http://stackoverflow.com/a/27343871
has answer: http://stackoverflow.com/a/27344649
upvote count: 2
has title: How to Get number with 2 decimal and not rounding using javascript?
answer count: 2
has comment: http://stackoverflow.com/comment/43143018
has comment: http://stackoverflow.com/comment/43142981
has comment: http://stackoverflow.com/comment/43143111
has comment: http://stackoverflow.com/comment/43143518
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43143377
linked to: http://stackoverflow.com/q/4912788
has comment: http://stackoverflow.com/comment/43144083

http://stackoverflow.com/q/27462247
has answer: http://stackoverflow.com/a/27462324
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: -1
favorite count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/43361119
has comment: http://stackoverflow.com/comment/43360905
has comment: http://stackoverflow.com/comment/43360964
tagged with: forms
has title: confirmation dialog in html with if statement
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43360857
upvote count: 0
has body: I would like to make a confirmation message presented whenever the user want to delete option 1 :If yes then delete student from database and the user should be redirected to index.php option 2: If no, the the user should be redirected to show.php I have tried, but I could not satisfy option 2 what so ever this is my code : Delete record Enter the ID for student you want to delete : Back Update : I have found a solution . For anyone who seeks it . Thanks for your time function delfunction(form) { if (confirm("Are you sure you want to submit the form?")) { form.submit(); } else { window.location = 'show.php'; } } Delete Delete Enter the ID for student you want to delete : Back
tagged with: javascript

http://stackoverflow.com/a/27395568
answers question: http://stackoverflow.com/q/27395483
score: 0
has body: i don't know why you wanna do that. but you can just use php, javascript/jquery together to approach this: &lt;?php if ($_GET["reloaded"] != 1) { echo ' &lt;script&gt; $(function () { window.location.href = "my_page.php?reloaded=1"; }); &lt;/script&gt; '; } ?&gt; explanation: when you load the page for the first time $_GET["reloaded"] is not set, so the javascript is echoed. i used jquery's document ready function here, to be sure that your DOM is fully loaded before it reloads the page. when reloading you set the GET variable reloaded to 1. thus php will not echo the javascript code again on reload.
type: Answer

http://stackoverflow.com/comment/58711481
type: AnswerComment
comment on: http://stackoverflow.com/a/30348131
type: Comment
score: 1
has text: Are you sure this works? I've replied here as well since I can get neither of your examples to work and I'm kinda stuck at the moment: https://github.com/bpampuch/pdfmake/issues/150

http://stackoverflow.com/comment/43377198
type: QuestionComment
comment on: http://stackoverflow.com/q/27470758
has text: look you want to save variable in file from javascript right? .. So you have to use $.ajax or $.post in jquery .. with that you can pass your image details to php .. and in php save variables to the file you want .. now you want to search for how to use ajax with php .. Good luck
score: 0
type: Comment

http://stackoverflow.com/comment/43354098
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27455029
has text: Thank you very much! Short, simple and correct answer! Just as I like it :)

http://stackoverflow.com/comment/96090606
has text: HI vuquanghoang, This topic is very old and little related to your question, so I suggests you to create another topic with some code and live example and also with `highcharts` tag.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27335177
type: Comment

http://stackoverflow.com/comment/43115948
has text: Ah yes RobG I did overlook that. Thank you.
comment on: http://stackoverflow.com/q/27328528
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27399588
answers question: http://stackoverflow.com/q/27383179
type: AcceptedAnswer
has body: You can define the circle group using using g element as shown below and there is no need for creating multiple svg. JSFiddle HTML &lt;svg id="mainSVG" width="600" height="500"&gt; &lt;defs&gt; &lt;g id="mySymbol"&gt; &lt;circle cx="200" cy="70" r="25" fill="red" /&gt; &lt;circle cx="170" cy="80" r="20" fill="red" /&gt; &lt;circle cx="230" cy="80" r="20" fill="red" /&gt; &lt;/g&gt; &lt;/defs&gt; &lt;/svg&gt; Javascript code var dataset = [20, 60, 90, 120]; var display = d3.select("body") .select("#mainSVG") .selectAll("use") .data(dataset) .enter() .append("use") .attr("xlink:href","#mySymbol") .attr("transform", function (i) { i+=50; return "translate(" + i + "," + i + ")";}); Note that there typo in your code. The id mySymbol is misspelled as MySymbol while creating use elements.
upvote count: 5
type: Answer
has comment: http://stackoverflow.com/comment/43244979
has comment: http://stackoverflow.com/comment/43246952
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27383179
score: 5

http://stackoverflow.com/a/27456509
score: 2
accepted answer of: http://stackoverflow.com/q/27456231
has body: You can create a submit button inside of form and hide it. When button pressed outside of form, you trigger button click() inside of form $("#myButton2").on("click", function() { $("#myButton1").click(); }); my checkbox
answers question: http://stackoverflow.com/q/27456231
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/a/27394167
accepted answer of: http://stackoverflow.com/q/27393489
answers question: http://stackoverflow.com/q/27393489
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Found it! I just deleted # in button id and in element_to_pop_up &lt;!-- Button that triggers the popup --&gt; &lt;button id="my-button"&gt;POP IT UP&lt;/button &lt;!-- Element to pop up --&gt; &lt;div id="element_to_pop_up"&gt; hello &lt;/div&gt; and use this css file instead : #element_to_pop_up, .bMulti { background-color: #FFF; border-radius: 10px 10px 10px 10px; box-shadow: 0 0 25px 5px #999; color: #111; display: none; min-width: 450px; min-height: 250px; padding: 25px; } #element_to_pop_up .logo { color: #2B91AF; font: bold 325% 'Petrona',sans; } .button.b-close, .button.bClose { border-radius: 7px 7px 7px 7px; box-shadow: none; font: bold 131% sans-serif; padding: 0 6px 2px; position: absolute; right: -7px; top: -7px; } .button { background-color: #2B91AF; border-radius: 10px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3); color: #FFF; cursor: pointer; display: inline-block; padding: 10px 20px; text-align: center; text-decoration: none; }
type: Answer
upvote count: 1

http://stackoverflow.com/q/27418479
answer count: 2
tagged with: javascript
tagged with: jquery
has title: Showing thumbnail image from image data of json
has comment: http://stackoverflow.com/comment/43283816
has comment: http://stackoverflow.com/comment/43282925
score: 0
has comment: http://stackoverflow.com/comment/43280325
has comment: http://stackoverflow.com/comment/43280132
has answer: http://stackoverflow.com/a/27421516
has comment: http://stackoverflow.com/comment/43280244
possible better answer: http://stackoverflow.com/a/27419489
has answer: http://stackoverflow.com/a/27419489
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27421516
has body: I have a json file with following thumbnail object structure. { "locations":{ "test_1":{ "tel":"+41 58 249 91 91", "thumbnail.ext":"png", "title":"Basel", "mode":"update", "pobox":"P.O. Box 3456", "jcr:created":"Tue Dec 17 2013 13:02:56 GMT+0000", "id":"7a365fda-3e9b-be9e-0e91-a9b72856e6d6", "zip_city":"4002 Basel", "fax":"+41 58 249 91 23", "sort":"1", "maplocation":"47.549435,7.585241", "street":"Viaduktstrasse 42", "jcr:lastModified":"Fri Nov 07 2014 17:28:29 GMT+0000", "thumbnail":{ "jcr:created":"Tue Dec 17 2013 13:02:58 GMT+0000", "jcr:content":{ "jcr:uuid":"ad388a5c-8638-4fed-a668-af2a9e1b173e", ":jcr:data":55007, "jcr:mimeType":"image/png", "jcr:lastModified":"Fri Nov 07 2014 17:28:30 GMT+0000" } } }, "bern":{ "tel":"+41 58 249 76 00", "thumbnail.ext":"png", "title":"Bern", "mode":"update", "pobox":"P.O. Box 112", "jcr:created":"Tue Dec 17 2013 13:02:56 GMT+0000", "id":"bfd2fff6-e769-6d2b-2722-9c09be415e10", "zip_city":"3073 Gümligen-Bern", "fax":"+41 58 249 76 17", "sort":"2", "maplocation":"46.93299,7.513097", "street":"Hofgut", "jcr:lastModified":"Fri Nov 07 2014 17:28:40 GMT+0000", "thumbnail":{ "jcr:created":"Tue Dec 17 2013 13:02:58 GMT+0000", "jcr:content":{ "jcr:uuid":"7880b3ff-7d68-496f-a343-7fcc782eb0fd", ":jcr:data":61817, "jcr:mimeType":"image/png", "jcr:lastModified":"Fri Nov 07 2014 17:28:41 GMT+0000" } } }, "geneva":{ "thumbnail.ext":"png", "title":"Geneva", "tel":"+41 58 249 25 15", "mode":"update", "pobox":"P.O. Box 347", "jcr:created":"Thu Feb 13 2014 13:33:03 GMT+0000", "slingOldResourceType":"launchbase/components/launchbase/customerSpecificCode/__generic/", "id":"85ada88f-20c8-00ef-772d-9f040f978a7d", "zip_city":"1211 Geneva 13", "fax":"+41 58 249 73 13", "sort":"3", "maplocation":"Rue+de+Lyon+111,+1203+Genf,+Schweiz", "street":"Rue de Lyon 111", "jcr:lastModified":"Fri Nov 07 2014 17:28:51 GMT+0000", "thumbnail":{ "jcr:created":"Thu Feb 13 2014 13:33:03 GMT+0000", "jcr:content":{ "jcr:uuid":"d2e9be65-cae3-47ff-bf7c-b4193c4cd48a", ":jcr:…
tagged with: http://stackoverflow.com/tag/json
tagged with: image
type: Question

http://stackoverflow.com/comment/43129090
type: AnswerComment
has text: Cool. Another option would be to inspect the "disabled" attribute on the table, using the .attr() function in Jquery.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27335498

http://stackoverflow.com/q/27332380
has comment: http://stackoverflow.com/comment/43122322
has answer: http://stackoverflow.com/a/27332803
type: Question
has comment: http://stackoverflow.com/comment/43122371
type: AnsweredQuestion
has body: hi friends i am working on small test type module and i want facility like if may be client internet goes offline after test will be continuew without internet, is it possible using php or javascript or any programming language ? same like offline test
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43122299
answer count: 1
accepted answer: http://stackoverflow.com/a/27332803
has comment: http://stackoverflow.com/comment/43122350
tagged with: jquery
has comment: http://stackoverflow.com/comment/43122661
tagged with: php
has title: is it possible to store around 1 mb data in client machine using php or javascript or any other programing language?

http://stackoverflow.com/a/27455235
answers question: http://stackoverflow.com/q/27455157
type: Answer
score: 0
has body: Add a hidden input everytime you add an input to your form and give it the value of a variable that you will increment with each addition: var index = 0; function addHidden(){ var input=document.createElement("input"); input.type="hidden"; input.value=index; input.name="hidden" + (index++); form.appendChild(input); } In PHP side: var $index = 0; foreach($_POST["texts"] as $text){ $db -&gt; insert("table", $text, $_POST["hidden" + ($index++)]); }

http://stackoverflow.com/a/27382825
score: 0
has body: All global variable are set on window object. so you can try the following . window[name] = value;
answers question: http://stackoverflow.com/q/27382701
type: Answer

http://stackoverflow.com/q/27459442
has body: I am developing a guess a number game. The user will guess a number between 1-10. At the start of the application will only show a input box where user will be able to write a number and a Guess button. Like this: https://i.sstatic.net/eH1lw.jpg As the guesses goes on the box will increase its size and go downwards. With every guess the box will be bigger. Like this: https://i.sstatic.net/Pz8Wv.jpg I have figured out another way to do it but it is not working as I actually want it to work. Any suggestions, please help. Guess the Number! Inputs Your Guess: Output
downvote count: 3
score: -3
type: Question
has answer: http://stackoverflow.com/a/27459729
has comment: http://stackoverflow.com/comment/43356070
has comment: http://stackoverflow.com/comment/43355591
has comment: http://stackoverflow.com/comment/43355606
has comment: http://stackoverflow.com/comment/43356288
upvote count: 0
answer count: 1
tagged with: javascript
has title: Suggestion with JavaScript, HTML
has comment: http://stackoverflow.com/comment/43356062
favorite count: 0
has comment: http://stackoverflow.com/comment/43355626
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: input
tagged with: css

http://stackoverflow.com/comment/43337631
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27449417
score: 0
has text: @H.Ferrence You can use the `async: false` option to `$.ajax`. But this is generally considered a bad idea. You should learn to embrace asynchrony, and design your application with it in mind.

http://stackoverflow.com/a/27435903
answers question: http://stackoverflow.com/q/27435485
score: 0
has comment: http://stackoverflow.com/comment/43325395
has comment: http://stackoverflow.com/comment/43358680
has body: Got it ... var range = document.createRange(); var root_node = document.getElementById("test"); range.setStart(root_node.firstChild,0); range.setEnd(root_node.firstChild,3); var newNode = document.createElement("b"); range.surroundContents(newNode); In all of the documentation, they are referencing the "Child" ... this solves that. In the case of your Fiddle, it will wrap the Letter "h" and the two &lt;p&gt; and &lt;/p&gt; tags. Take them out and hel becomes bold. UPDATE: Apparently, whitespace will cause problems ... HTML ... TEST Working here ... jsFiddle Reference ... HERE
has comment: http://stackoverflow.com/comment/43360459
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/27362996
has comment: http://stackoverflow.com/comment/43178512
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43179007
has comment: http://stackoverflow.com/comment/43178337
has comment: http://stackoverflow.com/comment/43178923
has comment: http://stackoverflow.com/comment/43179295
has body: I am using the jQuery Form Post plugin from malsup, with the following code: //Post a form function PostForm(FormID, Target) { var $t = Math.round(new Date().getTime() / 1000); try{ var options = { target: Target, beforeSubmit: function () { jQuery(Target).html(' '); jQuery(Target).slideDown('slow'); }, success: function (html) { setTimeout(function () { jQuery(Target).html(html); jQuery(FormID)[0].reset(); if($('#captcha-gen').length){ $.get('/inc/captcha.php?_=' + $t, function(data){ $('#captcha-gen').html(data); }); } }, 100); }, error: function(e){ var $html = e.responseText; jQuery(Target).html($html); jQuery(Target).slideDown('fast'); if($('#captcha-gen').length){ $.get('/inc/captcha.php?_=' + $t, function(data){ $('#captcha-gen').html(data); }); } setTimeout(function() { jQuery(Target).slideUp('fast'); }, 3500); } }; jQuery(FormID).ajaxSubmit(options); }catch(err){ alert(err.message); } } When I submit my form to /inc/mail.php the actuall PHP code shows in my Target instead of getting processed. How can I fix this issue? All other PHP scripts work as they should, including other ajax pulled php scripts. Here is the mailer code, it's using PHP SMTP <? require("/inc/class.phpmailer.php"); //form validation vars $formok = true; $errors = array(); //sumbission data $ipaddress = $_SERVER['REMOTE_ADDR']; $date = date('m/d/Y'); $time = date('H:i:s'); //form data $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $captcha = $_POST['secAnswer']; $valid = true; if(!is_string($email) || !(strlen($email)>0) || !ValidateEmail($email)){ $valid = false; } if(!is_string($name) || !(strlen($name)>0) || !ValidateText($name)){ $valid = false; } if(!is_string($message) || !(strlen($message)>0) || !ValidateText($message)){ $valid = false; } if(!CheckCAPTCHA($captcha)){ $valid = false; } sleep(1.5); if($valid){ $mail = new PHPMailer(); $mail->IsMail(); // send via SMTP $mail->From = $email; // SMTP username again $mail->AddAdd…
type: Question
has answer: http://stackoverflow.com/a/27363300
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: jQuery Form Posting Issue
answer count: 1
has comment: http://stackoverflow.com/comment/43179150
has comment: http://stackoverflow.com/comment/43178039
accepted answer: http://stackoverflow.com/a/27363300

http://stackoverflow.com/comment/43327718
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27443747
has text: The practice showed that neither tags nor even function's names can't 100% prompt which lib used.

http://stackoverflow.com/q/27321672
downvote count: 0
answer count: 7
favorite count: 0
has answer: http://stackoverflow.com/a/61109714
type: UnansweredQuestion
has body: I'm trying to figure out how to listen for all events on a JavaScript object. I know that I can add individual events with something like this element.addEventListener("click", myFunction); element.addEventListener("mouseover", myFunction); ... I'm trying to figure out if there is a catch-all, I'd like to do something like this: // Begin pseudocode var myObj = document.getElementById('someID'); myObj.addEventListener(/*catch all*/, myFunction); function myFunction() { alert(/*event name*/); } // End pseudocode
has comment: http://stackoverflow.com/comment/133689186
has title: Listen for all events in JavaScript
upvote count: 90
has answer: http://stackoverflow.com/a/58509633
has answer: http://stackoverflow.com/a/27321855
has answer: http://stackoverflow.com/a/27322253
type: Question
has comment: http://stackoverflow.com/comment/92667280
has comment: http://stackoverflow.com/comment/139389252
has comment: http://stackoverflow.com/comment/64908614
tagged with: javascript
has answer: http://stackoverflow.com/a/48388878
score: 90
has answer: http://stackoverflow.com/a/68461531
has answer: http://stackoverflow.com/a/27321965

http://stackoverflow.com/comment/43135689
score: 1
has text: You should search inside your element, not the whole document. Also appending the response to real HTML tag is not a good idea.
type: AnswerComment
comment on: http://stackoverflow.com/a/27339534
type: Comment

http://stackoverflow.com/q/27384431
has answer: http://stackoverflow.com/a/27385338
type: AnsweredQuestion
tagged with: meteor
linked to: http://stackoverflow.com/q/22875857
accepted answer: http://stackoverflow.com/a/27385338
tagged with: cordova
type: Question
tagged with: leaflet
score: 0
has body: In my Meteor/Cordova/famo.us App I need a map that can be rotated with two fingers, zoomed in and out and (ideally) the names (street, city etc.) should stay horizontally aligned. The reason is that I haven't found a (free) map like leaflet.js, Google Maps etc. that can rotate in JS. Google Maps SDK for Android and iOS respectively can do this, but the corresponding plugin (plugin.google.maps) led to trouble with famo.us. The rotation could be done with a famo.us Surface, and I've been told that in leaflet one could pull separately the map tiles and the names (vector/jpeg?). I apprechiate your help.
has title: How to rotate a map in Javascript(Meteor/famo.us)
answer count: 1
tagged with: rotation
tagged with: javascript

http://stackoverflow.com/q/27468070
answer count: 1
has answer: http://stackoverflow.com/a/32581825
has title: Cordova Connecting to device Android 2.1
has comment: http://stackoverflow.com/comment/52944077
tagged with: cordova
tagged with: android
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I try to run a Cordova application on an android 2.1, but I get only the message (Connecting to device) and the application never move to the (device ready) state Do you have any suggestion?
has comment: http://stackoverflow.com/comment/43372162
type: Question
has comment: http://stackoverflow.com/comment/43372074
accepted answer: http://stackoverflow.com/a/32581825
tagged with: javascript
score: 0

http://stackoverflow.com/comment/43298459
comment on: http://stackoverflow.com/a/27427303
score: 0
type: AnswerComment
type: Comment
has text: I think you're right. Sorry for not having been able to help more than that!

http://stackoverflow.com/comment/43219340
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27384978
type: Comment
has text: AND 3) Inside the body I Added the code: But Still doesn't work, it's soo frustrating

http://stackoverflow.com/comment/43190619
score: 0
type: AnswerComment
has text: hey kolby, i tried this but i noticed doing this kills the toggle functionality of the three buttons, which also happens in your example.
type: Comment
comment on: http://stackoverflow.com/a/27369228

http://stackoverflow.com/q/27425615
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27428760
answer count: 1
tagged with: arrays
has body: I'm using MobileFirst Platform 6.3, I'm trying to send the following request: var input = { method : 'post', path : "/create/item.aspx", body: { contentType:'application/json; charset=UTF-8', content: JSON.stringify([{"item": "name"}]) } }; var outputObj = WL.Server.invokeHttp(input); I have minimized the request as much as I can just to simplify the issue, basically having a string that contains an array in body.content causes some unknown behavior and the body doesn't get sent to the backend. I can't modify the backend so wrapping the array or sending a different input structure is not an option. Can someone please explain what's happening to my body content and how can I stop WorkLight from modifying it?
has comment: http://stackoverflow.com/comment/43297591
has title: MobileFirst Platform adapter won't let me send a JSON array in body
tagged with: ibm-mobilefirst
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27428760
tagged with: mobilefirst-adapters
type: Question

http://stackoverflow.com/q/27380383
has answer: http://stackoverflow.com/a/27380703
upvote count: 1
has answer: http://stackoverflow.com/a/27381702
tagged with: javascript
tagged with: jquery
tagged with: sorting
has comment: http://stackoverflow.com/comment/43210318
favorite count: 0
accepted answer: http://stackoverflow.com/a/27380471
answer count: 3
has title: Sorting elements by nested hidden input values
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43210001
downvote count: 0
has answer: http://stackoverflow.com/a/27380471
has body: example DOM: &lt;ul class="children"&gt; &lt;li class="child_container" rel="1803"&gt; &lt;input type="hidden" name="content_child_meta[1803][sort_order]" value="2"&gt; &lt;/li&gt; &lt;li class="child_container" rel="2843"&gt; &lt;input type="hidden" name="content_child_meta[2843][sort_order]" value="1"&gt; &lt;/li&gt; &lt;li class="child_container" rel="3803"&gt; &lt;input type="hidden" name="content_child_meta[3803][sort_order]" value="3"&gt; &lt;/li&gt; &lt;/ul&gt; Trying to sort on &lt;\li> using values in nested inputs. Did try following: var child_container = jQuery("ul"); child_container.find("li.child_container").sort(function (a, b) { return +a.find("input[name$='[sort_order]']").val() - +b.find("input[name$='[sort_order]']").val(); }) .appendTo( child_container ); and few other variations of this, but no luck on this guys getting in line.. Any help?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27380703
score: 1
has comment: http://stackoverflow.com/comment/43210113
tagged with: dom
type: Question

http://stackoverflow.com/a/27462767
upvote count: 1
has comment: http://stackoverflow.com/comment/43362035
has body: Include the file from dist directory in your page and use minify function. For reference see the options and the demo they provide. Below I implemented it into a quick demo that removes the attribute value quotes: $("#input").on("input", function() { $("#output").val(minify($(this).val(), { removeAttributeQuotes: true, collapseWhitespace: true // other options })); }); Input Output
answers question: http://stackoverflow.com/q/27462674
has comment: http://stackoverflow.com/comment/43361965
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27462674
score: 1

http://stackoverflow.com/a/27433855
score: 0
answers question: http://stackoverflow.com/q/27433616
has comment: http://stackoverflow.com/comment/43310124
type: Answer
has body: Try this i do not think you need response if you are in razor. @Html.Raw(RenderJavascriptHashArray("InfoURLs", "InfoURLs")) @{ string RenderJavascriptHashArray (string listName, string hashName) { IEnumerable&lt;KeyValuePair&lt;int, string&gt;&gt; pairs = this.ViewData[listName] as IEnumerable&lt;KeyValuePair&lt;int, string&gt;&gt;; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("var " + hashName + " = new Array();\n"); foreach (KeyValuePair&lt;int, string&gt; pair in pairs) { sb.Append(hashName + "[" + pair.Key.ToString() + "] = \"" + pair.Value + "\";\n"); } return sb.ToString(); } }

http://stackoverflow.com/a/27428122
has comment: http://stackoverflow.com/comment/43305098
answers question: http://stackoverflow.com/q/27427507
type: Answer
accepted answer of: http://stackoverflow.com/q/27427507
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43305887
has body: A possible solution would be to modify your server side to expect something in the header like before, but in case of absence of this header to look into the parameters of the request to see if the value you are looking for is not there instead. It would not change your previous behavior for the other endpoints but it would allow you to download the file with a window.open and a parameter in the url. You can also limit this possibility to the endpoints giving access to files for more security.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27317408
has body: You can pass the req.body to your Car like this var car = new Car(req.body); Here's also a reference: Passing model parameters into a mongoose model
accepted answer of: http://stackoverflow.com/q/27315849
type: Answer
upvote count: 15
downvote count: 0
has comment: http://stackoverflow.com/comment/99713511
score: 15
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27315849

http://stackoverflow.com/q/27397468
downvote count: 0
has comment: http://stackoverflow.com/comment/43240994
favorite count: 0
has body: Besides using iframe, is there method that an external html page can load to a div without affecting the style outside the div? I use jquery load now but if the external html page define style for body, the style for the page outside the designated div is changed. For example, I want to load this page to a div TEST test This page defined style for body and it includes an external css file. (I can't control the content of the page.)
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43242518
has title: Load a html page to a div without affecting the style outside the div
tagged with: css
has answer: http://stackoverflow.com/a/27397544
score: 3
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/43241540
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27397546
answer count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27428158
score: 0
answers question: http://stackoverflow.com/q/27427819
has body: Something like this should work, it will create 2 array(one for each list) stuctured as [id-boolean,id-boolean,id-boolean,id-boolean,]: &lt;script&gt; $(function() { $("#button").click(function() { var listOneArray = []; var listTwoArray = []; $("#listOne input[type='checkbox']").each(function() { var a1 = $(this).attr("id"); var b1 = $(this).prop("checked"); listOneArray.push(a1 + "-" + b1.toString()); }); $("#listtwo input[type='checkbox']").each(function () { var a2 = $(this).attr("id"); var b2 = $(this).prop("checked"); listTwoArray.push(a2 + "-" + b2.toString()); }); $.post("Yourcontroller/YourAction", { list1: listOneArray, list2: listTwoArray }, function (data) { //do whatever with the response }); }); }); &lt;/script&gt;
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27427819
type: Answer

http://stackoverflow.com/q/27331579
tagged with: http://stackoverflow.com/tag/json
type: Question
has title: issue when embedding the both Youtube video url and Vimeo video url from json response in angular js
accepted answer: http://stackoverflow.com/a/27331800
has comment: http://stackoverflow.com/comment/43120955
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27331800
answer count: 1
has body: var app = angular.module('speakout', []).config( function($sceDelegateProvider) { $sceDelegateProvider.resourceUrlWhitelist([ 'self', '*://www.youtube.com/**' ]); $sceDelegateProvider.resourceUrlWhitelist([ 'self', '*://player.vimeo.com/video/**']); }); I am new to angular js. I am trying to append both youtube url and vimeo video url at the same time in my jsp page,but it is working for vimeo and not working for an youtube when i am trying the above code.It is working for individual videos but not both. anyone can help! Thanks!
has comment: http://stackoverflow.com/comment/43120984
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43121289
tagged with: youtube
type: AnsweredQuestion
tagged with: video
has comment: http://stackoverflow.com/comment/64433387

http://stackoverflow.com/a/27367666
score: 0
has body: What if you have a json file with the information of the routes (and if there is not a security issue) and iterate over it to attach routes to the app? e.g. JSON: routes: [ { controller: "Controller1" path: "/path1" templateUrl: 'partials/home/home.html' }, { controller: "Controller1" path: "/path1" templateUrl: 'partials/home/home.html' } ] And then iterate over the contents of the JSON and attach them to $routeProvider.when ? I am not sure if it is a good idea, depends how big would be the JSON file and if you dont want to expose all your routes to a possible attacker.
answers question: http://stackoverflow.com/q/27367396
has comment: http://stackoverflow.com/comment/43188020
type: Answer
has comment: http://stackoverflow.com/comment/43187906
has comment: http://stackoverflow.com/comment/43188241
has comment: http://stackoverflow.com/comment/43188123

http://stackoverflow.com/comment/43149541
score: 1
type: AnswerComment
type: Comment
has text: With `font-size` you can set the font-size used, for example `li { font-size: 18px; }` would set it to 18px for all list items.
comment on: http://stackoverflow.com/a/27343829

http://stackoverflow.com/a/27398952
has comment: http://stackoverflow.com/comment/43246772
type: Answer
answers question: http://stackoverflow.com/q/27398858
has body: It prints false if it's false, execute a verbose and explicit test: alert( 'Your user-agent:\n' + navigator.userAgent + '\n' + (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'match with Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini': 'does not match with Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini' ) );
has comment: http://stackoverflow.com/comment/43243447
has comment: http://stackoverflow.com/comment/43244531
score: 0

http://stackoverflow.com/comment/43234467
has text: You really should have a look at JSONP.
comment on: http://stackoverflow.com/q/27393479
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43369040
comment on: http://stackoverflow.com/q/27465574
has text: Yes, if there's no reference to that reference, or no refererence to that reference, or no reference to that reference, and turtles all the way up. In other words, if there's no live code which references it directly or indirectly, yes. In your case, `test1` is getting declared/set somewhere, such as in a function. So when that function goes out of scope, so will `test1`, and along with it `o`. If `test` is declared at the global scope, then sure, it will never go out of scope, but you're not doing that are you?
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43127422
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27334698
score: 0
has text: I updated my answer to include a solution using a callback.

http://stackoverflow.com/a/27371665
answers question: http://stackoverflow.com/q/27371635
score: 1
downvote count: 0
has body: You can alterate over each and can stroe html in some varaible, see the ouptut and see console var html=""; $("#eventlist").find("span").each(function(){ html+=$(this).parent().html(); }) console.log(html); content1 content1 content1 content1
type: Answer
upvote count: 1

http://stackoverflow.com/q/27314416
has title: using jQuery drag + drop to delete a row from an SQL table
tagged with: php
has body: just a quick question. Im using jQuerys Drag and Drop to print rows from an SQL table into my page like so &lt;?php include 'includes/connect.php'; $query = "SELECT * FROM RSSFeeds"; $results = mysqli_query($connect, $query); while($row = mysqli_fetch_array($results)) { ?&gt; &lt;li class="ui-state-default" data-value=&lt;?php $row['ID']?&gt;&gt; &lt;?php echo $row['name']?&gt; &lt;/li&gt; &lt;?php } ?&gt; This works fine, so my question is, how do I use the drop function to pass the value of the row to a delete function? which would then delete the entry from the database. since simply putting: $(ui.draggable).remove(); merely gets rid of the UI element from the page I'm pretty new to this so if its a dumb question, just say. Any help would be greatly appreciated, many thanks
score: 2
has answer: http://stackoverflow.com/a/27314525
accepted answer: http://stackoverflow.com/a/27314525
type: AnsweredQuestion
tagged with: mysql
type: Question
tagged with: jquery-ui
tagged with: javascript
upvote count: 2
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/27449113
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27448903
type: Answer
accepted answer of: http://stackoverflow.com/q/27448903
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43337019
has comment: http://stackoverflow.com/comment/43337122
has body: This is a bad candidate for AJAX. Although, you technically can return the image data as the AJAX response, you'd have to do something with it: namely, use the File API in JavaScript to create an image on page. That last part is key and why AJAX is particularly unsuited for what you're trying to achieve: you can't open a new tab or window with that image. You can only use it on the current page. The good news is that you're actually making this far more difficult than it needs to be anyways. Just create a standard HTML link around your thumbnail image and set the href to the URL for this action with the id of the image. Then add the attribute target="_blank" to the link, and you'll get a new tab/window with the full-sized image. &lt;a href="@Url.Action("GetHiResImage", "YourController", new { thumbnailID = yourID })" target="_blank&gt; &lt;img ... /&gt; &lt;/a&gt; Change your action to return the image data with proper mime-type and your done.

http://stackoverflow.com/comment/43187075
score: 0
type: Comment
type: QuestionComment
has text: Try using `pizza_calculate = function() { ...your function...}`
comment on: http://stackoverflow.com/q/27367604

http://stackoverflow.com/q/27376522
has answer: http://stackoverflow.com/a/27723916
has comment: http://stackoverflow.com/comment/43202924
has title: Node.js + Socket.io Maximum call stack size exceeded
has answer: http://stackoverflow.com/a/27439791
has answer: http://stackoverflow.com/a/67428044
tagged with: socket.io
has answer: http://stackoverflow.com/a/56749628
type: Question
has answer: http://stackoverflow.com/a/61435986
score: 24
has body: For my Node application, I have a server (app.js) running on Debian serving both html and websocket data using socket.io to my client (index.html). I am attempting to make a turn-based HTML5 multiplayer game. After performing a number of successful data transmissions using socket.emit()/io.emit() and socket.on(), my server crashes on an socket.emit() call with the error "events.js:72 throw er; //Unhandled 'error' event RangeError: Maximum call stack size exceeded". I have quite a few socket.on() event listeners, with each one handling a different function in the game (e.g. roll_dice, end_turn, ready_to_play, etc.). I attempted researching the problem (found a lot of discussion on async loops), but was unable to find how to apply the solutions to my own code. I attached relevant source here. You can also view all the source on my github at: https://github.com/sjmoon0/gameofdeath index.html var socket = io.connect('http://131.178.15.173',{'forceNew':true}); ... //----------------Initialization and Menu functions----------- socket.on('load', function (data) { console.log(data); clientID=data; socket.emit('check_game_started', { un: clientID }); socket.on('last_client_loaded', function(hasStarted){ console.log("Has game started? :"+hasStarted); if(hasStarted==true){ $('#choosecharacter').show(); } }); }); socket.on('client_disconnect', function (data) { console.log(data); }); socket.on('client_counter', function (data) { if(data&lt;5){ console.log(data); incrementLoadBar(data); allowedInGame=true; } if(!allowedInGame){ ... } }); socket.on('game_started', function (data) { console.log(data); $('#welcome').hide(); $('#choosecharacter').show(); }); socket.on('set_user', function(characterName){ chosenCharacter=characterName; }); socket.on('disable_player_choice', function(data){ var id=data.stuff[0].chara; incrementLoadBar(data.stuff[0].numChar); console.log(id +" was chosen"); $('#'+id).hide(); }); //-------------------Gameplay functions socket.on('start_gameplay',functio…
has answer: http://stackoverflow.com/a/57060265
has answer: http://stackoverflow.com/a/29777578
upvote count: 24
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27723916
favorite count: 0
has answer: http://stackoverflow.com/a/52523584
has comment: http://stackoverflow.com/comment/43202762
accepted answer: http://stackoverflow.com/a/27439791
tagged with: node.js
type: AnsweredQuestion
answer count: 9
downvote count: 0
has answer: http://stackoverflow.com/a/68194003

http://stackoverflow.com/comment/43235649
type: QuestionComment
type: Comment
score: 0
has text: @Dgameman1 Well, this depends on if you want all rows or just a subset or one of them. By the way, this ```WHERE 1``` does literally nothing, its like a ```if(true)``` in PHP.
comment on: http://stackoverflow.com/q/27393991

http://stackoverflow.com/comment/43145519
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27345100
has text: This is micro-optimisation. The difference is negligible. You will waste more time in determining the answer to this than you will ever recover in improved performance.

http://stackoverflow.com/q/27426398
answer count: 3
has answer: http://stackoverflow.com/a/52863802
upvote count: 0
has comment: http://stackoverflow.com/comment/43294608
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43294515
has answer: http://stackoverflow.com/a/27426614
has body: I want to trigger a click event on a span but it's not working. I tried both of the following: $('#my_span').click(); $('#my_span').trigger("click"); But then I tried: $('#my_span').focus(); And this worked! Anybody know why? I am not trying to bind a handler, just trying to trigger the click event like an user clicking on that span. Please help.
has answer: http://stackoverflow.com/a/27426679
has title: .click() event operating on ?
downvote count: 1
type: Question
tagged with: javascript
tagged with: event-handling
tagged with: jquery
score: -1
tagged with: jquery-events

http://stackoverflow.com/comment/43154465
type: QuestionComment
has text: Did the rest of the comment make sense? Can you try setting up an example in pure javascript? Actually you might even be able to do it in pure css.
comment on: http://stackoverflow.com/q/27349813
score: 0
type: Comment

http://stackoverflow.com/a/27360910
accepted answer of: http://stackoverflow.com/q/27360429
has comment: http://stackoverflow.com/comment/43174601
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has body: The easiest method of doing this is setting the ClientIDMode to static on the hidden fields and post either 'A' or 'B' in the test variable. Like this: &lt;input id="btnA" type="button" value="A" onclick="test('A');"/&gt; Then in the test-method you get the value from that hidden control (and not in the call itself): $("#hid" + parameterValue).val(); That's one option. You are however in this way limited to the controls you push to the client. But since you're already creating hidden controls in the original request I don't think this'll be an issue.
upvote count: 1
answers question: http://stackoverflow.com/q/27360429

http://stackoverflow.com/q/27373198
has comment: http://stackoverflow.com/comment/43197355
favorite count: 0
has comment: http://stackoverflow.com/comment/43197306
tagged with: haxe
has body: I have chrome 39.0.2171.71, and I have enable source mapping check box enabled, but hx files are empty in debugger, any one can help explain why source mapping does not work? EDIT I am not using a server, I am opening the HTML file directly in chrome In chrome network tab, I can see: (failed) net::ERR_FILE_NOT_FOUND file:///C:/Users/samir.s.MOTAHIDAEDU/Documents/haxe/quiz-generator/bin/file:/C:/Users/samir.s.MOTAHIDAEDU/Documents/haxe/quiz-generator/src/com/quiz/Question.hx I compile the js project, like this: haxe -debug --each -lib createjs -lib Actuate -cp src -js C:/Users/samir.s.MOTAHIDAEDU/Documents/haxe/quiz-generator/bin/Quizgenerator.js -main Main -resource quiz.txt@quiz_text_file -lib random EDIT 2 Where can I set the source map of my project? I think I just have to set the path correctly, I am on Windows 7
score: 2
upvote count: 2
tagged with: flashdevelop
tagged with: google-chrome
type: AnsweredQuestion
tagged with: source-maps
has title: Why source maps does not work?
type: Question
has comment: http://stackoverflow.com/comment/43197116
has answer: http://stackoverflow.com/a/27373949
accepted answer: http://stackoverflow.com/a/27373949
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43270578
type: QuestionComment
has text: Nope, you'd just be declaring empty variables `daR` and `newB`. `end` will only be equal to `endPt(b)`
comment on: http://stackoverflow.com/q/27413143
score: 0
type: Comment

http://stackoverflow.com/comment/43195210
type: AnswerComment
type: Comment
has text: thanks for this @Calummm - I need to &0 to be the original string though rather than replaced with $0. Would this also work on document.body rather than an element with the id of test as I need to search the whole page?
comment on: http://stackoverflow.com/a/27371871
score: 0

http://stackoverflow.com/a/32672929
downvote count: 0
type: Answer
has body: screen.width is the width of the display screen, not the window of the browser excluding the scroll bar. You should use Math.min instead of Math.max since the width without the scroll bar is going to be smaller than the width with scroll bars. Also if there is a browser that does not work properly, you could try getting the width of the body or html tag without clientWidth like this document.documentElement.scrollWidth.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27336047

ratchet
type: Tag
tags question: http://stackoverflow.com/q/27359128
tag name: ratchet

http://stackoverflow.com/comment/43289180
score: 1
comment on: http://stackoverflow.com/q/27405832
has text: I think this is not related to the API but to how Google handles display of businesses on their maps. Will try to find more info.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27406464
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I'm having an issue thinking about the best way to architect a React app with multiple pages/views (still a SAP). Let's say we have a simple app with 4 major sections (pages): dashboard, users, stats, comments. Each section has different components in it (think react components). For example, the comments section would have a hierarchy like so: CommentsSection - CommentsQueue -- Comment --- Text --- Buttons - CommentsApproved --Comment --- Text --- Buttons In a framework like angular for example, the 4 main sections would be split into partials, and loaded in an ng-view upon request, with their respective components inside. When landing on the homepage, the app would only load the dashboard view and upon the user clicking on a nav item, the selected route (i.e. app/users or app/users/:id) would trigger and the app will load the required "template-view-partial" (without a browser refresh). Now in terms of React, how would this occur? it seems like ALL views and ALL their components would need to be available in a browserified JS file and the app can then update the DOM. This seems terribly wrong, as we'd be loading all sections in the first load, even if the user doesn't ever need to get to that section. Granted, we could split it with routes on the server, and only serve the components for the page based on the route, but that would require a browser refresh, where as in Angular for example, it would happen without a browser refresh as the view is loaded asynchronously. The question is, how can this asynchronous loading happen in a React-based app?
has answer: http://stackoverflow.com/a/27409750
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/30380901
has answer: http://stackoverflow.com/a/30380901
type: AnsweredQuestion
has title: React, async loading for multiple sections/views with different components
upvote count: 5
accepted answer: http://stackoverflow.com/a/27409750
type: Question
tagged with: reactjs
answer count: 2
score: 5

http://stackoverflow.com/q/27413143
has answer: http://stackoverflow.com/a/27413270
type: Question
has comment: http://stackoverflow.com/comment/43270724
score: 0
answer count: 2
upvote count: 1
has title: setting single javascript variable with many commas and multiple different objects
downvote count: 1
possible better answer: http://stackoverflow.com/a/27413270
tagged with: javascript
linked to: http://stackoverflow.com/q/3781406
favorite count: 0
has body: CODE DEMO: See Line 34: // Tree creation functions function branch(b) { var end = endPt(b), daR, newB; ... (where endPt(b), daR, newB are variables defined in this function, but omitted for simplicity) What is going on here? Possible solution: I've read this assets var end equals each of these, In JavaScript you can use commas to group any number of expressions into a single statement. This is basically an artifact of the for statement, where multiple assignment expressions are often grouped together in the header. from here: Does that explanation directly apply here?
has comment: http://stackoverflow.com/comment/43270578
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27413172
accepted answer: http://stackoverflow.com/a/27413172

http://stackoverflow.com/q/27457595
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27491682
has body: I have created a facebook app with subscription. When the user opens the app, there is a button called "SUBSCRIBE". When it is clicked, the javascript function completePayment(), is called. The facebook popup with subscribe appears. However, there is a big problem. If I change the og:image URL and set the price to let's say 10.00 USD and the billing period to 1 month and I upload the file to the server and then I click on the SUBSCRIBE button, I can still see the subscription page saying 5.00 USD/week and the image is blank. It's like everything remained the same way that it was when I first set the data, even though I updated all the data from https://www.mydomain.com/_product.php , with the new values. I even logged out and relogged in, and still no changes are reflected. I even emptied the _product.php page and uploaded it to the server and the subscription still works and shows 5.00 USD/week and the image is blank. Any ideas on how to fix this? I have this code on the main page: &lt;a href="#" onclick="completePayment()"&gt; &lt;img src="https://www.**********.com/subscribe.png" alt="Subscribe" title="Subscribe" style="vertical-align: top"/&gt; &lt;script src="https://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; FB.init({ appId:'2***********6', cookie:true, status:true, xfbml:true }); function completePayment(){ var obj = { method: 'pay', action: 'create_subscription', product: 'https://www.mydomain.com/_product.php' }; FB.ui(obj); } &lt;/script&gt; &lt;/a&gt; This is the HTML code from the 'https://www.mydomain.com/_product.php' page: &lt;html&gt; &lt;head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# fbpayment: http://ogp.me/ns/fb/fbpayment#"&gt; &lt;meta property="og:title" content="********* Subscription" /&gt; &lt;meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" /&gt; &lt;meta property="og:description" content="****** Subscription" /&gt; &lt;meta prop…
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
has title: facebook og data not updating
has answer: http://stackoverflow.com/a/27491682
tagged with: facebook

http://stackoverflow.com/comment/43570062
type: QuestionComment
comment on: http://stackoverflow.com/q/27413644
has text: you can use ace.config.set("basePath", "some/path") to change the place ace looks for files
score: 0
type: Comment

http://stackoverflow.com/comment/43339437
has text: What is your concern here? Is this a micro-optimization? It shouldn't be that costly to use a self-restarting $timeout or to stop an $interval and start a new one with a new time value.
score: 1
comment on: http://stackoverflow.com/q/27450263
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27349398
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Rule my 'hover' function with an if statement - jQuery
answer count: 0
score: 0
has body: I need to show an image ('.tirellidrop') with a slide effect, on hover (or mouseover). Then, when the image is shown, if I click on my container, I'll have another slideToggle. Everything works, but when my second slide is visible, I don't want the hover function to work. So: I move the mouse on my element ---> '.tirellidrop' slides out. I click on the element -----> '.ttx_rosso' slides out AND '.tirellidrop' remains visible until I click again on the element. I added a class called "visibile", and I wrote: IF my element does NOT have this class, you can slide my image on hover. Then, if I click on the element and I get my second function, this shouldn't happen again. But it does. if(!$('.ttx_rosso').hasClass('visibile')) { $(".tr_rosso").hover(function () { $(".tirellidrop").slideToggle("400"); }, function () { $(".tirellidrop").slideToggle("400"); }); } $('.tr_rosso').click(function() { $(".ttx_rosso").slideToggle("slow").toggleClass('visibile'); }); Look just at the first red element: http://codepen.io/GCW/pen/myVwXP/
type: Question
has comment: http://stackoverflow.com/comment/43153363
tagged with: javascript
has comment: http://stackoverflow.com/comment/43154728
tagged with: jquery

http://stackoverflow.com/q/27451393
has body: Somebody saw me using the following JQuery code: function showAll(){ $(".button").show(); } function hideAll(){ $(".button").hide(); } And he said that this was a waste of resources. That I should first assign $(".button") to a variable, and then perform the show() and hide() methods on this variable like this: var allButtons = $(".button"); function showAll(){ allButtons.show(); } function hideAll(){ allButtons.hide(); } Both versions work, but what is the performance benefit to this? I believe the benefit is negligible and, moreover, cumbersome because now you have another level of separation between the class name and the variable you're modifying, but does he have a valid point? Is one of the two considered best practice?
tagged with: class
linked to: http://stackoverflow.com/q/11849692
has title: What's the performance benefit of assigning JQuery object to a variable?
has comment: http://stackoverflow.com/comment/43341308
answer count: 1
has comment: http://stackoverflow.com/comment/43342622
accepted answer: http://stackoverflow.com/a/27451552
favorite count: 0
duplicate of: http://stackoverflow.com/q/11849692
has comment: http://stackoverflow.com/comment/43341286
score: -3
type: AnsweredQuestion
downvote count: 3
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/27451552
has comment: http://stackoverflow.com/comment/43341310
upvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27390005
tagged with: javascript
has comment: http://stackoverflow.com/comment/43586866
tagged with: angularjs
type: Question
has title: Cycle2 slider using AngularJS directive
score: 0
tagged with: jquery-cycle2
answer count: 1
has answer: http://stackoverflow.com/a/28337457
type: UnansweredQuestion
has body: I need help for creating a cycle2 slideshow using directive. I found this code on the internet an copied on my local machine to test it, but it doesn't seem to work at all. I get this error: Uncaught ReferenceError: angular is not defined slide.js:1 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.14/$injector/modulerr?p0=myApp&amp;p1=Error%3A%…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.14%2Fangular.min.js%3A17%3A431) angular.js:36 GET https://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140216/jquery.cycle2.js.map 404 (Not Found) cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140216/jquery.cycle2.js.map:1 This is the code: http://codepen.io/funkybudda/pen/oACkf Thank you.

http://stackoverflow.com/comment/43349697
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27453460
has text: Maybe a bit off topic but do you know how I can see where the msbuild does the referencing?
type: AnswerComment

http://stackoverflow.com/comment/43117958
comment on: http://stackoverflow.com/q/27328957
type: QuestionComment
has text: Do you absolutely need to use Regex for making sure user doesn't provide 0 in input? Because that makes the expression complex.
score: 0
type: Comment

http://stackoverflow.com/comment/43109124
has text: Can you not use maxlength along with ng-maxlength this way the violation won't happen on most of the devices
comment on: http://stackoverflow.com/q/27324807
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43128654
comment on: http://stackoverflow.com/q/27335914
has text: You shouldn't be using `$("#image-wrapper").attr('instagram-data', image);`. If you want to attach arbitrary data to an element, use `$('...').data('instagram', image)`. You can't invent attribute names. If you're trying to use data attributes, they have a `data-` *prefix*, not a `-data` *postfix*. It would be `data-instagram`.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/27457132
has answer: http://stackoverflow.com/a/27457366
has answer: http://stackoverflow.com/a/27470964
has comment: http://stackoverflow.com/comment/43351646
type: Question
tagged with: reactjs
answer count: 2
downvote count: 0
tagged with: javascript
has title: React: What happens on consecutive renders where a list shuffles?
tagged with: css-animations
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has body: I am trying to create a list which shuffles randomly with some animation. Here is the fiddle for it where I have used key prop to identify each child. http://jsfiddle.net/1wcpLLg4/ var ListAnimate = React.createClass({ list: [ {id: 1, caption: "Hello"}, {id: 2, caption: "There"}, {id: 3, caption: "Whatsup"}, {id: 4, caption: "Sanket"}, {id: 5, caption: "Sahu"}, ], shuffle: function() { this.list.shuffle(); // Shuffles array! this.forceUpdate(); }, render: function() { return Shuffle {this.list.map(function(el, i){ return {el.caption} {el.id} ; })} ; } }); React.render(<ListAnimate />, document.body); From the React docs about Dynamic Children, it states that key prop is used in order to identify the elements in an array during successive renders. So, that the items which are just re-ordered must not unmount and mount to new position rather they should just be re-positioned but the does not seem to be happening in the fiddle, where the Nodes at the top of the list are always being unmounted and being mounted at a different position. But for the elements at the bottom seems to be working well with animation.
has comment: http://stackoverflow.com/comment/43351503
score: 2

http://stackoverflow.com/comment/51600387
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27314441
score: 0
has text: the 'deferRender' option is what made a difference for us. It's recommended by the dataTables documentation here: http://datatables.net/examples/ajax/defer_render.html

http://stackoverflow.com/a/27390402
has comment: http://stackoverflow.com/comment/43248362
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27388413
answers question: http://stackoverflow.com/q/27388413
has comment: http://stackoverflow.com/comment/43249050
has comment: http://stackoverflow.com/comment/43234495
upvote count: 2
has body: I think I've got it mostly, maybe I'm missing some parts because your code is quite long. You should consider using ids and classes for better readability in all of this. First, SLaks were right about querySelectorAll() returning a nodeList. To iterate through its items, you need to use a for loop, here I changed those parts to: var el = document.querySelectorAll("selectors"); for (i = 0; i &lt; el.length; i++) { el[i].style.display = "none"; } document.getElementById("id").removeAttribute("style"); Then I changed the first selector to just check for the id, as ids must be unique: document.getElementById('abo').addEventListener("change", function () { And finally I changed every if(document.querySelector("#id input[value='ja']:checked")) to if (document.querySelector("#id input[value='ja']").checked) as checked is a boolean property it can be used in an if statement. You can see the whole changed code in updated fiddle. PS: You're victim of learning web coding with jQuery, which makes you unable to understand what really happens. Please continue learning pure JavaScript.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43240803
type: Answer
has comment: http://stackoverflow.com/comment/43240779

http://stackoverflow.com/comment/43438443
comment on: http://stackoverflow.com/a/27434729
has text: I will try your solution later, however it is working now. I will try your solution to find which one is the best approach
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27393420
accepted answer of: http://stackoverflow.com/q/27393364
score: 1
answers question: http://stackoverflow.com/q/27393364
has comment: http://stackoverflow.com/comment/43234088
type: AcceptedAnswer
downvote count: 0
has body: Short answer, no matter where a function is called, this refers to object it is a property of, or the global object is not a property of an object. When you pass the method into a function, that function is no longer a method of an object, but a local variable to the function, in which, in this case anyway, this refers to the document object, since that is the object the document ready event is called on. In modern JavaScript implementations, you can bind the method to the object. Example: $(document).ready(X.yay.bind(X)); Note that this requires IE9 or better. The anonymous function you use is also an acceptable solution, and will work in older versions of IE.
type: Answer
has comment: http://stackoverflow.com/comment/43234064
upvote count: 1

http://stackoverflow.com/a/27375777
downvote count: 1
has body: After you use floating div always hav this empty div which will clear the floating property
score: -1
answers question: http://stackoverflow.com/q/27375452
upvote count: 0
type: Answer

http://stackoverflow.com/q/27347403
tagged with: cordova
type: UnansweredQuestion
tagged with: android
has body: I want to load the Facebook Profile of a specific facebook user inside the native app. I am currently on an Android project and have added InAppBrowser. Linking to my own FB profile with the schema fb://profile/(id) works perfectly fine. As soon as I try to load another persons profile according to this schema the native app opens and I get an error: Error loading the chronic. Why doesnt it work loading other peoples chronic with this schema? Do I have to use a different one? Thanks in advance.
score: 3
has comment: http://stackoverflow.com/comment/77235172
answer count: 0
tagged with: fbconnect
upvote count: 3
type: Question
tagged with: javascript
downvote count: 0
has title: Cordova App load Facebook Profile
favorite count: 0

http://stackoverflow.com/comment/43095707
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27318094
has text: *After* the ajax call happens *before* the load completes. i.e before `success`. You are not taking into account the asynchronous nature of the Ajax call.

http://stackoverflow.com/a/39752923
answers question: http://stackoverflow.com/q/27349535
upvote count: 1
has body: You can use the arguments array, but not callee or caller in strict mode. This is a javascript thing. It doesn't have anything to do with angular, yeoman, minification, heroku or anything else.
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/58536191
type: QuestionComment
has text: Hi, I have the exact same issue, did you manage to make it work?
score: 0
comment on: http://stackoverflow.com/q/27322410
type: Comment

http://stackoverflow.com/comment/43334638
type: QuestionComment
has text: no...I was only wanting to animate the pictures from left to right. I assumed that you could use lazyload to accomplish this task.
type: Comment
comment on: http://stackoverflow.com/q/27446875
score: 0

http://stackoverflow.com/comment/43102327
comment on: http://stackoverflow.com/q/27321251
score: 0
type: Comment
type: QuestionComment
has text: Other than the call for the constructor for the `Object`, none of these even use constructors. A constructor is a method call for an object when it's created, then called when you use `new myObject(...)`

http://stackoverflow.com/q/27369223
has body: When I use this code, a syntax error (unexpected token) pops up. Being new to JavaScript, I can't pinpoint what the issue is. var a = 1; var test = function(){ for(var i = 0; i &lt; 10; i++){ a++; console.log(a); }; do{ a = 2; console.log(a); while(a===2){ a--; console.log(a); }; }; }; function test();
type: Question
has answer: http://stackoverflow.com/a/27369340
upvote count: 0
downvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/43190295
has comment: http://stackoverflow.com/comment/43190256
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: Syntax Error: Unexpected Token in a Loop Program
score: -5

http://stackoverflow.com/comment/43307690
score: 3
comment on: http://stackoverflow.com/q/27433275
has text: `not working` is not a very good description of a problem, aren't you getting any alerts at all, or is it just alerting `undefined` ?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27378947
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has body: i have a iframe what i have included in a div. In this iframe i now have hiden fields. What is the right way to pass the parameter into the hidden field? Thx
linked to: http://stackoverflow.com/q/18446359
type: Question
has comment: http://stackoverflow.com/comment/43208887
tagged with: javascript
tagged with: jquery
has title: Pass Parameters to hidden input fields in a iframe
has comment: http://stackoverflow.com/comment/43207515
score: 0

transclusion
type: Tag
tags question: http://stackoverflow.com/q/27365352
tags question: http://stackoverflow.com/q/27429919
tag name: transclusion

http://stackoverflow.com/q/27419311
has title: Get data from array of object and put it to key value
has body: I want to take that._mCon.usa which have array of object's and put the data like key value in _mUsa object,In the object instance I've name and path ,I try like following and its not working the _mUsa is not filled with data...any idea what im doing wrong here ? _mUsa{ }, for(var i = 0; i &lt;= that._mCon.usa.length; i++) { that._mUsa[that._mCon.usa[i][name]] = that._mUsa[that._mCon.usa[i][path]]; } this is that._mCon.usa with the name and path properties
score: -1
has answer: http://stackoverflow.com/a/27419448
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27419448
upvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/q/27448909
has answer: http://stackoverflow.com/a/27448992
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27449078
answer count: 5
type: UnansweredQuestion
has body: i have a complete html page, but now i have to filter down it to many changes: First i want to remove all the bgcolor and style attributes from the tables and body tags i am trying like this: $('#container').find("table").removeAttr("style"); this is only removing the style from table but how can i remove from all table, tr, td, th and body tags any * kind of attribute is available for this, which can work for this things,
has answer: http://stackoverflow.com/a/27448999
tagged with: css
has title: removing the bgcolor and style attribute from html page
has answer: http://stackoverflow.com/a/27449178
has answer: http://stackoverflow.com/a/27448991
has comment: http://stackoverflow.com/comment/43336737
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/43345055
comment on: http://stackoverflow.com/q/27452174
has text: Is there a way to affect the .redalert color values when the parent is clicked?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27320215
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27321066
score: 1
has comment: http://stackoverflow.com/comment/43099838
type: Question
has comment: http://stackoverflow.com/comment/43100166
answer count: 1
has comment: http://stackoverflow.com/comment/43100068
tagged with: angular-http-interceptors
tagged with: javascript
has body: I am currently working on building a login flow in AngularJS 1.3. My problem is that the promise return from an $http call is not resolving the code inside of its '.then'. I am working to handle error messages that come back from the server, specifically to handle any 401 errors which are returned when the user has input the wrong username or password. However, when a 401 is returned, the .then never resolves itself and the code within them never runs. The relevant code is as follows: The controller for the login form as a login function on its scope, as follows: $scope.login = function() { $scope.authError = null; // Try to login var promise = session.login($scope.user); promise.then(function(loggedIn) { // THIS CODE NEVER RUNS if ( !loggedIn ) { $scope.authError = localizedMessages.get('login.error.invalidCredentials'); } }, function(x) { $scope.authError = localizedMessages.get('login.error.serverError', { exception: x }); }); }; I have a session factory that takes care of the login and other session based needs. The code for login is: login: function(credentials) { var $http = $injector.get('$http'); var url = ENV.apiEndpoint + "/sessions"; var newSession = $http.post(url, credentials); return newSession.then(function(data) { session.set(data.token); //THIS CODE ONLY RUNS ON A SUCCESS RESPONSE if(session.isAuthenticated()) { closeLoginModal(true); } return session.isAuthenticated(); }); } I have placed comments in the code where the problem is. I am at a loss as to why this code isn't working. From my understanding of promises, then 'then' should resolve no matter what the response was, success of error. I have an interceptor running, but I have tried disabling it with no luck to the end result. Am I missing something?
accepted answer: http://stackoverflow.com/a/27321066
has title: Angular $http promise not resolving
has comment: http://stackoverflow.com/comment/43100602
tagged with: angular-http
favorite count: 0
has comment: http://stackoverflow.com/comment/43099896
tagged with: angularjs
upvote count: 2
tagged with: angular-promise
downvote count: 1
has comment: http://stackoverflow.com/comment/43099759

http://stackoverflow.com/q/27397326
type: Question
has answer: http://stackoverflow.com/a/27397493
answer count: 1
tagged with: jsp
tagged with: javascript
has body: I wanna close the pop up child window and reload the parent window after hitting the servlet in java. Is there any example that helps me to do this?
score: 0
favorite count: 0
has title: How to close a windows opener after hitting the servlet
type: UnansweredQuestion
upvote count: 1
downvote count: 1
tagged with: java
tagged with: servlets

http://stackoverflow.com/q/27440961
favorite count: 0
tagged with: php
has comment: http://stackoverflow.com/comment/43321616
has comment: http://stackoverflow.com/comment/43321953
possible better answer: http://stackoverflow.com/a/27441056
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/27441279
downvote count: 0
has body: I struggling with server time. I need timer on my website (count every second) but not client side time but server. But my script operating only with client time: &lt;script&gt; setInterval(function() { var d = new Date(); $('#timer').text((d.getHours() +':' + d.getMinutes() + ':' + d.getSeconds() )); }, 1000); &lt;/script&gt; &lt;label id="timer"&gt;&lt;/label&gt; Script above work fine. How I can integrate server time and update very one second?
has comment: http://stackoverflow.com/comment/43321876
has comment: http://stackoverflow.com/comment/43321920
has answer: http://stackoverflow.com/a/27441056
type: Question
has comment: http://stackoverflow.com/comment/43321852
duplicate of: http://stackoverflow.com/q/7780758
has answer: http://stackoverflow.com/a/27441279
tagged with: javascript
tagged with: jquery
has title: Javascript clock with server time PHP
upvote count: 3
answer count: 2
linked to: http://stackoverflow.com/q/7780758

http://stackoverflow.com/a/27393271
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27393221
answers question: http://stackoverflow.com/q/27393221
has body: In Javascript a concept called "event bubbling" occurs. When you click on an element the events registered to that element occur first. Once they are completed, the event travels to the parent, and so on. You can use this to your advantage in this case, by stopping the event at the "#map" element. Jquery has a handy way of doing this using stopPropagation. Just add this code to your example: $("#map").on('click', function(event){ event.stopPropagation(); });
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/43294856
comment on: http://stackoverflow.com/q/27426539
score: 0
type: Comment
type: QuestionComment
has text: There's not a clean way of doing what you want. It's better to have the server send the value as what you want.

http://stackoverflow.com/comment/43320427
type: AnswerComment
score: 0
type: Comment
has text: Thanks for your quick answer Paul! This solution however does not work on my firefox (verion 34.0.5 for Mac OS X, and version 31.0 for windows), where the tooltip window freezes in the upper left corner of the SVG image. On the other hand it works perfectly on my Chrome 39.0.2171.95, Opera 26.0.1656.32 and Safari 7.1, but I have no clue so far how to fix it for firefox..
comment on: http://stackoverflow.com/a/27435296

http://stackoverflow.com/comment/43305090
type: QuestionComment
comment on: http://stackoverflow.com/q/27431867
has text: you mean the red object to the left of the container ?
score: 0
type: Comment

http://stackoverflow.com/comment/43143599
comment on: http://stackoverflow.com/q/27344096
type: QuestionComment
type: Comment
score: 0
has text: Possible duplicate - http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file

http://stackoverflow.com/comment/43169907
type: QuestionComment
comment on: http://stackoverflow.com/q/27314765
has text: I tried: ATTACH but it is not working. In this case i did not receive error message : Uncaught ReferenceError: attachSequence is not defined.
score: 0
type: Comment

http://stackoverflow.com/a/27358946
type: Answer
score: 1
has body: Both IE and FF (and Chrome) returns date: var inputType = $("input").attr("type"); http://jsfiddle.net/6mnqfhe4/
upvote count: 1
answers question: http://stackoverflow.com/q/27358775
downvote count: 0
has comment: http://stackoverflow.com/comment/43210652

http://stackoverflow.com/comment/43174250
comment on: http://stackoverflow.com/q/27360858
score: 0
type: Comment
type: QuestionComment
has text: here is the part of your big problem : xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("txtHint").innerHTML = xmlhttp.responseText; //after this line we need to add a code for refresh jquery. } } // I'll try to add an answer now.

http://stackoverflow.com/q/27466658
has body: I searched and tried to use what I could find, but I'm stuck. I am attempting to create a script that scans a Google sheet (with about 30 sheets) for values that are newly inputted and are below 60%. I am then looking to have the script e-mail me the data that is in the 2nd column (Student's name), 4th column (teacher's name) of the current row of the data as well as the percentage (test score)that was below 60% (ex. Clarke,John Mrs. Brown 56.64%) . I am new to Java script but have been trying to learn. Here is the script that I have so far. It finds the correct sheet without a problem. It will also email me as well (with the wrong message, but it works none the less). But there are certain things that I am stuck on. Like I know that I have to set up some sort of onEdit trigger so that it only sends the newly inputted score, but I don't know where to put it or how to do that. I also know that the dataRange code that I have seems wrong to me and the if statement also seems wrong. I am not sure how to specify "below 60%". I am a technology teacher and set up a massive data system for our school using Google Drive. I want to have the master data sheet automatically email my principal whenever a student needs help on a specific assessment. Any help you could give me would be much appreciated! Thank you guys so much for all of your time I love spending my time on here learning from everyone. Brandon Here is a link to an example of the data spreadsheet we use Choppy Script Below function sendEmail() { var spreadsheet = SpreadsheetApp.openById('spreadsheet ID'); /// The ID of the data spreadshfeet var sheet = spreadsheet.getSheets(); // gets all sheets var startRow = 3; // Third row of data to process var numRows = 40; // Number of rows to process var dataRange = sheet.getRange(startRow, 10, numRows, 50); // Start row 3 column 10, and stop row 40, column 50 // Fetch values for each row in the Range. var data = dataRange.getValues(); //Browser.msgBox(data) for (i in data) {…
type: Question
has comment: http://stackoverflow.com/comment/43375582
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/43496156
tagged with: javascript
has comment: http://stackoverflow.com/comment/43384493
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27488216
linked to: http://stackoverflow.com/q/14164736
has comment: http://stackoverflow.com/comment/43378790
type: AnsweredQuestion
has title: Trying to make a script that scans a Google Sheet and emails if values are below 60%
has comment: http://stackoverflow.com/comment/43386202
has answer: http://stackoverflow.com/a/27488216

http://stackoverflow.com/q/27361718
has title: Inline CSS set by jQuery 'resize event' gets reset to default once window is done resizing
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
tagged with: backbone.js
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27362649
score: 0
accepted answer: http://stackoverflow.com/a/27362649
answer count: 1
has body: I have a backbone view called HeaderView and I'm trying to update each header's children's padding on resize. The padding only gets updated while I'm resizing, then when I stop resizing the css is set back to it's default as if I did $('element').css('padding-left', ''); var HeaderView = Backbone.View.extend({ initialize: function() { this.$headers = this.$el.find('.myHeaders'); this.resize(); $(window).on('resize.header', _.bind(this.resize, this)); }, resize: function() { this.$headers.each(function() { var l; if ($(this).index() &lt;= 2 ) { l = $(this).offset().left; $(this).find('#child').css('padding-left', l); } }); } });

http://stackoverflow.com/q/27383222
has comment: http://stackoverflow.com/comment/43216668
has comment: http://stackoverflow.com/comment/109015793
has answer: http://stackoverflow.com/a/34391588
has answer: http://stackoverflow.com/a/61627460
has title: Is there a way to keep the file extension of ejs file as .html?
type: Question
has answer: http://stackoverflow.com/a/27385578
tagged with: javascript
score: 4
tagged with: express
upvote count: 4
tagged with: embedded-javascript
tagged with: ejs
has answer: http://stackoverflow.com/a/40419207
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has body: I am developing an expressjs app using ejs templating engine. But i want to use keep the extension of ejs file like home.html instead of using home.ejs. The reason for this i am using visual studio for development and visual studio doesn't support ejs file. so code hinting formatting and highlighting doesn't work. var express = require("express"); var app = express(); app.set("view engine", "ejs");//setting ejs view engine app.set("views", "./views"); app.get("/", function (req, res) { res.render("home"); }); app.listen(3000, function () { console.log("Server is listening on port 3000"); })
answer count: 4
tagged with: node.js

http://stackoverflow.com/q/27463768
type: Question
has answer: http://stackoverflow.com/a/32394536
tagged with: preloading
has title: Preload images asynchronously into the browser cache when the image has to be generated on the server first
has body: been reading stackoverflow for a couple years now, but never posted. Until today - ran into an issue I could not solve by myself and did not find a solution for. The scenario: I have a dynamic webpage which basically shows screenshots of websites. These screenshots are generated on the fly for every new user and their URLs change. I want to preload these images into the browser cache so they're available in 0ms once the user clicks on a link. I don't want the subjective load time of the page increased, so they have to be loaded invisibly in the background. My approach: I used jelastic as my infrastructure to be able to scale later, then installed centOS with nginx, PHP and PhantomJS. I use PHP to query phantomJS to make the screenshots: exec ("phantomjs engine.js ".$source." ".$filez. " > /dev/null &amp;"); The dev/null is used to not increase the load time to the user. I output the links to the browser. So far it works. Now I want to preload these images: for (var i = 0; i &lt; document.links.length; i++) { imgArray[i] = new Image(1,1); imgArray[i].visibility = 'hidden'; imgArray[i].src = (document.links[i].href.substr(7) + ".png"); document.links[i].href = 'javascript: showtouser("' + imgArray[i].src.substr(7) + '");'; } Two things I proably did wrong here: I start the image preloading before the images are generated on the server. I haven't found a way to start the caching only once the image has been generated by phantomJS. Onload event obviously does not work here. I think my approach is not really async and it would increase the subjective loading time felt by the user What am I doing wrong? I'm an ISP guy, I suck at javascript :/
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: asynchronous
score: 2
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/q/27413310
answer count: 1
has answer: http://stackoverflow.com/a/27564117
type: UnansweredQuestion
score: 0
has body: I have a common JS file for my site that uses a lot of jQuery. A form that I'm trying to implement uses prototype.js, so there is a conflict, and I would prefer not to change the namespace in my common JS file. Is it possible to load the form via AJAX and somehow release the "$" so that the form scripts can load properly? What I mean is: ... the HTML page includes a DIV where the form should load: &lt;div id="form-container"&gt;&lt;/div&gt; &lt;script src="myScripts.js"&gt;&lt;/script&gt; ... and myScripts.js file would include this: var request = $.ajax({ url: "form-code.html", beforeSend: function() { $.noConflict(); }, dataType: "html" }); request.done(function(html){ $("#form-container").html(html); }); ... and form-code.html would include: &lt;script src="prototype.js"&gt;&lt;/script&gt; &lt;form&gt; &lt;!-- form code here --&gt; &lt;/form&gt; Any suggestions would be greatly appreciated; thanks!
tagged with: prototypejs
has title: Pass jQuery noConflict() to ajax
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43133440
comment on: http://stackoverflow.com/q/27332909
has text: @torazaburo you should mention that IE will support `document.head` only with version 9 and later.
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/q/27451846
has answer: http://stackoverflow.com/a/27451889
score: 0
has title: How to break code in modules in Node.JS?
tagged with: node.js
accepted answer: http://stackoverflow.com/a/27452075
type: AnsweredQuestion
type: Question
has body: I'm with the following code that needs to be used in two files: var Schema = mongoose.Schema; var InfoSchema = new Schema ({ name: String, email: String, }); var Info = mongoose.model('Info', InfoSchema); I need use the Info variable in my listTerminal.js, and i need use the InfoSchema in my routes.js . I'm new in Node.js, and still confuse me a lot the module.exports. Can anyone give me a light? I was trying to do like this: module.exports = function() { var Schema = mongoose.Schema; var InfoSchema = new Schema ({ name: String, email: String, }); }; Them call in my routes.js and listTerminal.js like this: var mySchema = require('../config/mongo/mySchema'); But is not working, cause in my route.js, i have a route like this: app.post('/person', function(req, res) { var Data = { name: req.body.name, email: req.body.email }; var info = new Info(Data); info.save(function (error, data){ if (error) { console.log(error); } else { console.log('done'); } }); }); And the page shows: Info is not defined How can i call this mySchema.js in another file?? OBS: if i move the myschema.js code to my route.js file, the route.js will work, but i need separate ;[
answer count: 2
has answer: http://stackoverflow.com/a/27452075
possible better answer: http://stackoverflow.com/a/27451889
tagged with: javascript

http://stackoverflow.com/q/27436357
has title: Calculate ISO time difference in momentjs
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29945194
tagged with: javascript
has body: First, I refer : Get the time difference between two datetimes Then, it doesn't work as I'm using iso time format. var now = '2014-12-12T09:30:00.0000000Z'; var then = '2014-12-12T11:00:00.0000000Z'; var timeDuration = moment.utc(moment(now)).diff(moment(then)).format("HH:mm:ss");
type: Question
tagged with: momentjs
linked to: http://stackoverflow.com/q/18623783
score: 0

http://stackoverflow.com/comment/43160049
type: AnswerComment
type: Comment
has text: Still not working.. If you see my Fiddle, the replacement text is displayed but not in the correct place inside the textarea.
comment on: http://stackoverflow.com/a/27353231
score: 0

http://stackoverflow.com/comment/43600985
score: 0
comment on: http://stackoverflow.com/a/27511518
type: AnswerComment
type: Comment
has text: If the browser only fires on `input` and not `keyDown`, then it's virtually impossible to capture all keys. You could get the ones that enter characters or remove them by detecting changes, but you could not get any keys that do not affect input. That means you are at a dead end for some functionality as those OSes go. _If you are going to monitor the input anyway,_ then you don't need to know the key that was pressed. You can detect the change in the input and do something if `input.value.slice(-1) === 'a'` or the like.

http://stackoverflow.com/comment/43168543
type: QuestionComment
comment on: http://stackoverflow.com/q/27357120
score: 0
type: Comment
has text: You use the wrong tool! Instead of trying parse a text version of the documentation, why you don't use the structured version of this same document (i.e. the html version)? You can more easily obtain what you want using the DOM.

http://stackoverflow.com/comment/43111528
has text: @dandavis Document Fragments **are supported** in IE 8.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27324709

http://stackoverflow.com/a/27391024
answers question: http://stackoverflow.com/q/27390942
score: 1
upvote count: 1
has body: Like it's said in the comments, and like cyclops1101 said, you should be initializing the JS file after your script. Happy scripting!
downvote count: 0
type: Answer

http://stackoverflow.com/a/27350683
has comment: http://stackoverflow.com/comment/43156330
has comment: http://stackoverflow.com/comment/43156570
answers question: http://stackoverflow.com/q/27350296
score: 0
type: Answer
has body: That is not how you do it in general. $('.meter').css("width", value + "%"); I do not recognize all of your syntax, but I guess the exact code you are looking for is: $('.meter').css('width', '&lt;%= @project.progress %&gt;%');

http://stackoverflow.com/comment/43298700
score: 0
type: AnswerComment
has text: Thank You. After Digging into it with the visibility option and tweaking this 3500+line program to work with it. I finally got it o work correctly. This did the trick!! Thanks
type: Comment
comment on: http://stackoverflow.com/a/27427984

http://stackoverflow.com/a/27417905
type: Answer
answers question: http://stackoverflow.com/q/27416200
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27416200
has comment: http://stackoverflow.com/comment/43366941
has body: problem is that the first time that page inits will bind imageflip to all ul#iGallery children and on that moment your new images are not loaded so normally in similar cases must bind your function imageflip into ul again. im sure this will solve your problem but here in your case ther's another problem and that's u cant bind imageflip twice because of plugin structure. i fixed your code at codepen "fixed code" but this will only work if didLoadInstagram function trigges.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43370282

http://stackoverflow.com/q/27358065
has comment: http://stackoverflow.com/comment/43168714
tagged with: ruby-on-rails
type: Question
has title: Google Maps not showing in partial view
tagged with: javascript
has comment: http://stackoverflow.com/comment/43168585
score: 0
has comment: http://stackoverflow.com/comment/43169037
tagged with: google-maps
has comment: http://stackoverflow.com/comment/43168894
answer count: 1
has answer: http://stackoverflow.com/a/27434729
tagged with: jquery
has comment: http://stackoverflow.com/comment/43168765
linked to: http://stackoverflow.com/q/16616463
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43169520
has comment: http://stackoverflow.com/comment/43168990
has body: I want to display google maps in partial view which I call it using jQuery. Here is the details: In my dashboard.html.haml: = link_to 'Map', preview_map_static_pages_path, :remote =&gt; true .col-sm-4.col-md-10 #dashboard_preview In my controller: def preview_map respond_to do | format | format.js {render :layout =&gt; false} end end And in my preview_map.js.erb $( "#dashboard_preview" ).html( "&lt;%= escape_javascript( render "map/map" ) %&gt;" ); And my map/_map.html.haml #map-container #map-canvas The problem is the map is not showing when I click = link_to 'Map', preview_map_static_pages_path, :remote =&gt; true. What did I do wrong? Sorry for the bad english. Thanks for your help :)
has comment: http://stackoverflow.com/comment/43169691
has comment: http://stackoverflow.com/comment/43169582

http://stackoverflow.com/comment/43270972
comment on: http://stackoverflow.com/q/27413366
score: 0
type: Comment
type: QuestionComment
has text: *"how it is beneficial to users of these languages"* -- It's not beneficial in JavaScript. It's *very, very bad* in JavaScript.

http://stackoverflow.com/a/27559148
type: Answer
accepted answer of: http://stackoverflow.com/q/27472195
upvote count: 1
has body: So I kinda figured this out, I didn't understand what a #shadow-root is. Its not like an iFrame where it gets its own #document and has a completely different environment to the rest of the site. You can load js into a shadow-root by calling its parent element and then its elements, So say this is my structure: div [id='app'] | #shadow-root | | div [id='content'] then in order to work some magic on the '#content' tag, using jquery you can change it by doing this: $('#app').find('#content').html('hello world') Even if this code is ran from inside the shadow-root
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27472195

http://stackoverflow.com/q/27356569
has comment: http://stackoverflow.com/comment/43171054
has comment: http://stackoverflow.com/comment/43173241
tagged with: button
has comment: http://stackoverflow.com/comment/43166306
has title: 2 windows, 1 button needs to pull new image from LoremPixel
has comment: http://stackoverflow.com/comment/43174876
tagged with: partial-page-refresh
has body: I am building a site called DrawSome, which needs to display 2 random images for people to fuse through drawing. On the picture you see the basic display of the site. I want the user to be able to load 2 new images in the boxes, when clicking on the button. It is important only the image-boxes refreshes, and not the whole site. My idea was to pull the images from lorempixel.com, so I don't have to create a database. Which script do I use to create the refresh in the window only? jQuery? How do I go around making this simple function? So far I only have this, which do not solve my problem. It only pulls the images locally, and do not refresh the image windows. var changeImg = function(){ $('.btn').click(function(){ $('.random_img').css({'content': 'url(images/img' + Math.floor(Math.random()*(3-1+1)+1) +'.jpg)'}); }); }; $(document).ready(changeImg); Hope you consider this rookie question - we all have to start somewhere. All the best, Esben
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43171736
type: Question
has comment: http://stackoverflow.com/comment/43166618
has comment: http://stackoverflow.com/comment/43168325
tagged with: javascript
has comment: http://stackoverflow.com/comment/43166913
has comment: http://stackoverflow.com/comment/43166047
score: 0

http://stackoverflow.com/a/27343483
score: 1
answers question: http://stackoverflow.com/q/27343434
has body: This should work for you: if ( in_array($_GET['content'], array("tree", 3, 4, 5)) ) { $myString = $_GET['content']; echo $myParsedString = htmlentities($myString); } else { echo "nothing to see here"; }
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43271659
has text: related: [Is the 'catch' method name of JS Promises/A+ invalid since it's a JS keyword?](http://stackoverflow.com/q/25774628/1048572)
type: Comment
comment on: http://stackoverflow.com/q/27413715
type: QuestionComment
score: 1

http://stackoverflow.com/q/27418611
tagged with: cryptojs
tagged with: encryption
has title: How to get original string back in CryptoJS using TripleDES?
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27418704
tagged with: javascript
score: 0
has body: I'm trying to encrypt and decrypt in JavaScript using TripleDES.js. Here is my code snippet: Encryption Method: encrypt_string = function (plainData) { var encrypted = CryptoJS.TripleDES.encrypt(plainData, "My Secret Key"); alert("Encrypted: " + encrypted); } Decryption Method: decrypt_string = function (cipherData) { var decrypted = CryptoJS.TripleDES.decrypt(cipherData, "My Secret Key"); alert("Decrypted: " + decrypted); } While passing plainData as Gokul Nath, to encrypt_string(), the alert message shows: U2FsdGVkX1/huVhh9IQhJF72gcs26f1l0+hNSsWEXsc= While passing cipherData as U2FsdGVkX1/huVhh9IQhJF72gcs26f1l0+hNSsWEXsc=, to decrypt_string(), the alert message shows: 476f6b756c204e617468 Question: How to get the original plain data while decrypting?
answer count: 1
tagged with: tripledes
has answer: http://stackoverflow.com/a/27418704

http://stackoverflow.com/q/27450196
answer count: 1
has body: I swear i have seen someone before assign an array split between multiple variables all in one go... Looked structurally something like: ['a','b','c'].blank(),a,b,c; where i have put blank It was some string or array function. I defiantly remember the commas I just never remembered to try and see if the guys code was legit, I've only gone and lost the post. The commas just make me think it sounds dumb thinking about it now but I remember looking at it thinking wow he just exploded/threw the code into a bunch of stuff at once.. I would like to know if there is such a method? If not would there be a more eligant way than what I consider to be the normal way?: function abc(){return ['a','b','c'];} var a,b,c; a=abc(); b=a[1]; c=a[2]; a=a[0];
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27450222
type: Question
has comment: http://stackoverflow.com/comment/43339141
tagged with: function
tagged with: arrays
tagged with: javascript
tagged with: variables
score: 0
has comment: http://stackoverflow.com/comment/43339171
has title: Any way to assign multiple from a function return

http://stackoverflow.com/q/27467647
tagged with: php
linked to: http://stackoverflow.com/q/1960240
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27467746
has title: Validate form, check if user exists, register them. All with Ajax
accepted answer: http://stackoverflow.com/a/27467746
type: Question
has body: My javascript is inside an html file called register.html. The user submits the form. This should then trigger the $('input[name="createacc"]').click(function (e) AJAX then sends those 4 variables to checkuser.php. Checkuser.php should then check to see if the username exists. If it does exist, it should echo 0. If it does not exists, it should echo 1. Register.html then checks to see what checkuser.php echoed. If the echo was "0" then, then an alert box should appear saying username unavailable. If the echo was "1" or anything else, register.html should run $("#registerform").submit(); which then does the php script. This should all happen without leaving the register.html page. I check chrome's built in debugger and I see that if the account exists checkuser.php writes back 0 and if the account doesn't it writes back 1. But for some reason nothing else happens. The account does not register nor do I get an alert box saying the username is unavailable here is my register.html First Name: Username: Password: Confirm Your Password: E-Mail: Here is my javascript Update - I have fixed parts of my code through the help of others below me. My only issue now is that $("#registerform").submit(); doesn't do anything
has comment: http://stackoverflow.com/comment/43370875
tagged with: if-statement
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27467748
tagged with: jquery
has answer: http://stackoverflow.com/a/27467748
tagged with: ajax
has comment: http://stackoverflow.com/comment/43370882
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43370913
has comment: http://stackoverflow.com/comment/43370877

http://stackoverflow.com/a/27473486
type: Answer
has comment: http://stackoverflow.com/comment/43382297
answers question: http://stackoverflow.com/q/27473273
score: 0
has body: If none of the alerts are trigerring, I sugegst you rewrite your setTimeouts. setTimeout and setInterval are rather picky sometimes. try this instead: setTimeout(function(){loadImg("img1.jpg",0)},500); And so on. Basically encapsule the loadImg call in a function. Also, do what the others said :)

http://stackoverflow.com/a/27412347
type: AcceptedAnswer
has body: It returns to it initial state because you are clicking on a submit button. It's default behaviour is to submit the form which refreshed the page. If you want to only change the border-color you need to override that default behaviour. Something like: function valid(e) { document.getElementById("name").style.borderColor = "#ef0000"; e.preventDefault(); } &lt;form method="post" action=""&gt; &lt;input type="text" name="name" id="name"&gt; &lt;input type="submit" onclick="valid(event)" value="click"&gt; &lt;/form&gt;
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/27412283
answers question: http://stackoverflow.com/q/27412283
downvote count: 0
score: 5

http://stackoverflow.com/q/27441803
has answer: http://stackoverflow.com/a/51221292
has answer: http://stackoverflow.com/a/61169382
possible better answer: http://stackoverflow.com/a/37472928
answer count: 19
tagged with: jshint
has answer: http://stackoverflow.com/a/70872427
has answer: http://stackoverflow.com/a/51162738
has answer: http://stackoverflow.com/a/37472928
has title: Why does JSHint throw a warning if I am using const?
has answer: http://stackoverflow.com/a/42097941
has comment: http://stackoverflow.com/comment/117349334
has answer: http://stackoverflow.com/a/52969265
downvote count: 0
has answer: http://stackoverflow.com/a/62420226
score: 396
favorite count: 0
has body: This is the error I get when using const: &lt;error line="2" column="1" severity="warning" message="&amp;apos;const&amp;apos; is available in ES6 (use esnext option) or Mozilla JS extensions (use moz)." source="jshint.W104" /&gt; My code looks like this: const Suites = { Spade: 1, Heart: 2, Diamond: 3, Club: 4 }; The code works fine only JSHint is warning me every time.
has answer: http://stackoverflow.com/a/35365041
upvote count: 396
has comment: http://stackoverflow.com/comment/43323213
accepted answer: http://stackoverflow.com/a/27442276
has answer: http://stackoverflow.com/a/61430235
has answer: http://stackoverflow.com/a/49073204
tagged with: node.js
has answer: http://stackoverflow.com/a/46568081
tagged with: constants
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/61981175
has comment: http://stackoverflow.com/comment/79408154
has answer: http://stackoverflow.com/a/61573424
type: Question
has answer: http://stackoverflow.com/a/52568892
has answer: http://stackoverflow.com/a/58407238
tagged with: jslint
has answer: http://stackoverflow.com/a/47704278
has answer: http://stackoverflow.com/a/27442276
tagged with: javascript
has answer: http://stackoverflow.com/a/66376777

http://stackoverflow.com/comment/43299589
type: Comment
has text: Don't add an answer. Update your question.
score: 0
comment on: http://stackoverflow.com/a/27428864
type: AnswerComment

http://stackoverflow.com/comment/43149967
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27347531
has text: return simple date like 2014/12/20.... and if i can make it work... i will return an json
type: Comment

http://stackoverflow.com/a/27364138
has comment: http://stackoverflow.com/comment/43228421
has comment: http://stackoverflow.com/comment/43228296
has comment: http://stackoverflow.com/comment/43200982
has comment: http://stackoverflow.com/comment/43227695
type: Answer
accepted answer of: http://stackoverflow.com/q/27359868
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27359868
has comment: http://stackoverflow.com/comment/43227604
has comment: http://stackoverflow.com/comment/43227512
has comment: http://stackoverflow.com/comment/43227574
has body: Message acknowledgement is covered here in the socket.io docs. Here's the relevant part of that docs: Sometimes, you might want to get a callback when the client confirmed the message reception. To do this, simply pass a function as the last parameter of .send or .emit. What’s more, when you use .emit, the acknowledgement is done by you, which means you can also pass data along: Server (app.js) var io = require('socket.io').listen(80); io.sockets.on('connection', function (socket) { socket.on('ferret', function (name, fn) { fn('woot'); }); }); Client (index.html) &lt;script&gt; var socket = io(); // TIP: io() with no args does auto-discovery socket.on('connect', function () { // TIP: you can avoid listening on `connect` and listen on events directly too! socket.emit('ferret', 'tobi', function (data) { console.log(data); // data will be 'woot' }); }); &lt;/script&gt; And, another example shown here: Acknowledgment for socket.io custom event
has comment: http://stackoverflow.com/comment/43228242
has comment: http://stackoverflow.com/comment/43227819
has comment: http://stackoverflow.com/comment/43228204
has comment: http://stackoverflow.com/comment/43228037
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27388997
tagged with: javascript
score: 0
answer count: 1
tagged with: parsing
has body: I have having trouble figuring out how I can limit my output. I have to compare values of each attribute within an object, however I only want 1 output per ID. Any thoughts? //example JSON var obj1 = { "Summary" : [ { "ID" : "1234", "Name" : "John", "Status" : "Green", }, { "ID" : "5678", "Name" : "Mike", "Status" : "Green", }, { "ID" : "9012", "Name" : "Tom", "Status" : "Red", } ] }; //my code var attributesvalues = ["Mike", "Green", "Red"]; var sg1 = []; var k; var l; //push name of each attribute value to a new array //one example sg1.push(attributesvalues[0]); //go through each ID, if name value exist, push the #1, if not, push nothing for (k = 0; k &lt; obj1.Summary.length; k++) { for (l in obj1.Summary[k]) { if (sg1[0] == obj1.Summary[k][l]){ sg1.push("1"); } else{ sg1.push(""); } } } output should look like this - I only want 4 values, name + a 1 or "" for each ID(3) sg1 = ["Mike", "", "1", ""] sg2 = ["Green", "1", "1", ""] instead I am getting this - the name + a 1 or "" for each attribute. sg1 = ["Mike", "", "", "", "", "1", "", "", "", ""] sg2 = ["Green", "", "", "1", "", "", "1", "", "", ""] Any additional pointers or tips you could provide would be much appreciated. I am still trying to get the hang of JS.
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Parse JSON, find matches of values and store in array
type: Question
has answer: http://stackoverflow.com/a/27389070
accepted answer: http://stackoverflow.com/a/27389070
tagged with: arrays

http://stackoverflow.com/q/27364607
tagged with: http://stackoverflow.com/tag/html
has body: $(function() { var pgurl = window.location.href.substr(window.location.href .lastIndexOf("/") + 1); $("#nav ul ul li a").each(function() { if ($(this).attr("href") == pgurl || $(this).attr("href") == '') $(this).closest('li').addClass('active'); }); }); here is the js I am using HOME HOW TO DONATE DONATE <----- AND THIS SINCE SHOULD ALSO BE ACTIVE DONATION <----- IF I SELECT THIS CENTER IT SHOULD BE ACTIVE HOW ELSE CAN I DONATE? when I select li without sub-li it works fine. but when I select li that are inside other li, It makes the child li active but not the parent. If I want to make the parent active also, for example, If i select "Donation Center" which is inside "Donate". what should I add or change in order to make the "Donate" li also active?
tagged with: css
has answer: http://stackoverflow.com/a/27365312
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43181298
has comment: http://stackoverflow.com/comment/43181781
type: Question
has answer: http://stackoverflow.com/a/27375597
has answer: http://stackoverflow.com/a/27364877
has title: How do I add active class to parent of li that i selected?
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43181282

http://stackoverflow.com/comment/43367731
has text: Is your problem with what the client is sending to the server or with what the server is returning to the client?
comment on: http://stackoverflow.com/q/27465490
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43093901
type: Comment
type: QuestionComment
has text: Couldn't you just use a target method? I may be wrong though
score: 0
comment on: http://stackoverflow.com/q/27316889

http://stackoverflow.com/comment/43178762
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27363095
has text: it's still not making the parent class to active

http://stackoverflow.com/comment/43118168
comment on: http://stackoverflow.com/q/27324709
score: 0
type: Comment
type: QuestionComment
has text: @JonathanSampson - Actually, you have me an idea. Since I know the elements that need to be plugged in the HTML string, I can check their `tagName`s and add similar elements in their places. I can distinguish them later by a special CSS class.

http://stackoverflow.com/a/27559716
answers question: http://stackoverflow.com/q/27457663
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has body: The js code required for the purpose is not complex. trying Adding these in scripts, $(document).ready(function () { $("td", this).on("click", function () { var tds = $(this).parents("tr").find("td"); $.each(tds, function (i, v) { $($(".data-form input")[i]).val($(v).text()); }); }); }); Moreover your form happens to be in table tag.Bring it out of the table tag.Only thing that remains in your table tag is your table.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27457663

http://stackoverflow.com/comment/43180049
comment on: http://stackoverflow.com/a/27335136
type: Comment
score: 0
type: AnswerComment
has text: You show me the currect way that is form id should be diffrent, thanks

http://stackoverflow.com/comment/43262725
has text: Hi i am in a big picture program. we get to choose a few electives, that we take online classes in. i took one from codecademy in javascript. at the end of the term we are required to design and complete a project, on a topic of our choice.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27391590
score: 0

html-head
tag name: html-head
type: Tag
tags question: http://stackoverflow.com/q/27385058

http://stackoverflow.com/q/27439321
type: Question
has answer: http://stackoverflow.com/a/27439714
answer count: 1
has comment: http://stackoverflow.com/comment/43318408
tagged with: underscore.js
score: 0
has comment: http://stackoverflow.com/comment/43319020
tagged with: function
accepted answer: http://stackoverflow.com/a/27439714
tagged with: javascript
has title: call function in underscore template
tagged with: jquery
has body: I want use one function in my template underscore. my function created in my .javascript file like this: and this is my templete underscore : when run my code I got error ... in my template underscore this function en2per() not found!!! Now I want call this function in my template.
type: AnsweredQuestion

http://stackoverflow.com/q/27455884
tagged with: javascript
score: 1
has title: FIle copyTo not working in cordova
tagged with: android
favorite count: 0
tagged with: cordova-plugins
tagged with: cordova
answer count: 0
type: UnansweredQuestion
tagged with: file
upvote count: 1
has body: In my cordova(v 3.3) application i used copyTo for copy files from one directory to another directory in sdcard. Some time it is working fine some time it is not working. Here is the source i used to copy files from one dierctory to another. window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function gotFS(fileSystem) { var root = fileSystem.root.fullPath; console.log(skiTemplateFileName); alert(root); var fails = function(err) { alert(err.code);} window.resolveLocalFileSystemURI(root+"/"+TEMPLATE_DIRECTORY+""+TemplateFileName, function(file) { window.resolveLocalFileSystemURI(root+"/"+PDF_DIRECTORY, function(destination) { file.copyTo(destination,randomFileName); alert("File Download Successfully"); },fails) },fails); }, function fail(e){ }); when copy files first time only shows the file download success. For next time it shows only root alert Note : This issue occurs in samsung tab 4(v4.4.2) devices working well in nexus 7. Please guide to solve this issue.
type: Question
downvote count: 0

http://stackoverflow.com/comment/43375178
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27469175
has text: This is something that was not referred to at all in the question. If this was the answer, then the question wasn’t what was actually asked.
score: 0

http://stackoverflow.com/comment/43159628
type: Comment
has text: thank you..but this code is overriding text in a file..I want to write in between as you displayed as output in your answer.
comment on: http://stackoverflow.com/a/27352691
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43108418
type: QuestionComment
comment on: http://stackoverflow.com/q/27324635
has text: This is not valid JSON, use this to help you: [Json Validator](http://jsonlint.com/)
score: 0
type: Comment

http://stackoverflow.com/q/27365082
linked to: http://stackoverflow.com/q/20824558
linked to: http://stackoverflow.com/q/3561043
accepted answer: http://stackoverflow.com/a/27365299
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/43182053
has comment: http://stackoverflow.com/comment/43182026
has comment: http://stackoverflow.com/comment/43182030
tagged with: function
has body: Apparently return can be invoked as a function? function say() { return ( console.log("Am"), console.log("I"), console.log("a"), console.log("function?") ); } say(); Does this mean that return is a function?
answer count: 1
has answer: http://stackoverflow.com/a/27365299
has comment: http://stackoverflow.com/comment/43182028
has comment: http://stackoverflow.com/comment/43182218
favorite count: 0
duplicate of: http://stackoverflow.com/q/6949162
downvote count: 5
score: -3
linked to: http://stackoverflow.com/q/6949162
duplicate of: http://stackoverflow.com/q/3561043
type: AnsweredQuestion
has title: Is return a function in JavaScript?
tagged with: return
type: Question
has comment: http://stackoverflow.com/comment/43182136

http://stackoverflow.com/comment/43157735
type: AnswerComment
comment on: http://stackoverflow.com/a/27344041
has text: @SaB That sounds like a separate issue. You should create a new question, make sure to include relevant code.
score: 0
type: Comment

http://stackoverflow.com/q/27367534
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27367629
type: Question
score: 0
answer count: 2
tagged with: php
accepted answer: http://stackoverflow.com/a/27367629
possible better answer: http://stackoverflow.com/a/27367594
has title: jQuery droppable element id is undefined
has answer: http://stackoverflow.com/a/27367594
tagged with: javascript
tagged with: jquery
has body: I'm trying to get the li element id from a droppable function, but it just returns undefined, any idea why this might be the case? each li element is as follows: &lt;li class="ui-state-default" data= "&lt;?php $row['ID']?&gt;"&gt; &lt;?php echo $row['name']?&gt; &lt;/li&gt; an upon dropping I have this: $(document).ready(function(){ $( "#draggable" ).draggable(); $( "#droppable" ).droppable({ drop: function(event, ui) { var ID = $(this).data("ID"); var ajaxurl = 'delete.php'; $.post(ajaxurl,{ID:ID}); alert("You have deleted the row successfully" + ID); $(ui.draggable).remove();} }); }); in the alert, the ID is being printed out as simply "undefined". Any idea how this should be written?
tagged with: ajax

http://stackoverflow.com/comment/43294572
has text: You can use something like [`through`](https://www.npmjs.com/package/through) to do this. It takes a read and write function and lets you transform the stream without resorting to storing large arrays in memory.
score: 1
comment on: http://stackoverflow.com/q/27426081
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27357033
has answer: http://stackoverflow.com/a/43581665
has body: I have a fix positioned element at the bottom of the screen which works perfectly except for the Android browser where the bottom control bar overlays my element. It doesn't even trigger the window resize event to try and work with that. iOS Safari also has the bottom control bar but it pushes my element correctly and it doesn't overlay it. I'm open to any suggestion.
favorite count: 0
type: UnansweredQuestion
has title: Android browser bottom control bar overlays content
tagged with: css
upvote count: 6
score: 6
tagged with: mobile-browser
tagged with: android-browser
type: Question
tagged with: mobile
tagged with: javascript
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43313876
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27433090
has text: @beardedlinuxgeek but it's deprecated...
score: 0

http://stackoverflow.com/a/27322132
score: 0
has body: Remove @ViewBag from the front of your variables.
answers question: http://stackoverflow.com/q/27321942
type: Answer

http://stackoverflow.com/comment/137499516
type: Comment
score: 0
has text: Good point, you can also optionally call a function. like `global?.gc?.()`
type: AnswerComment
comment on: http://stackoverflow.com/a/30654451

http://stackoverflow.com/q/27340742
score: 1
type: Question
has answer: http://stackoverflow.com/a/27351457
accepted answer: http://stackoverflow.com/a/27351457
tagged with: javascript
tagged with: ruby-on-rails-4
upvote count: 1
answer count: 1
tagged with: websocket
favorite count: 0
has title: Page shows internal server error after page refresh (using websocket-rails)
type: AnsweredQuestion
downvote count: 0
has body: When I refresh the page where a websocket is open I get a 'Internal server error' on the refreshed page I couldn't find any solutions to this problem..I am using rails 4.1.8, websocket-rails gem ,thin server. this is my rails log... Unexpected error while processing request: deadlock; recursive locking /usr/local/share/gems/gems/rack-1.5.2/lib/rack/lock.rb:16:in `lock' /usr/local/share/gems/gems/rack-1.5.2/lib/rack/lock.rb:16:in `call' /usr/local/share/gems/gems/actionpack-4.1.8/lib/action_dispatch/middleware/static.rb:84:in `call' /usr/local/share/gems/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call' /usr/local/share/gems/gems/railties-4.1.8/lib/rails/engine.rb:514:in `call' /usr/local/share/gems/gems/railties-4.1.8/lib/rails/application.rb:144:in `call' /usr/local/share/gems/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process' /home/john/.gem/ruby/gems/faye-websocket-0.8.0/lib/faye/adapters/thin.rb:40:in `process' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data' /home/john/.gem/ruby/gems/faye-websocket-0.8.0/lib/faye/adapters/thin.rb:44:in `receive_data' /home/john/.gem/ruby/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine' /home/john/.gem/ruby/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start' /home/john/.gem/ruby/gems/thin-1.6.3/lib/thin/server.rb:162:in `start' /usr/local/share/gems/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run' /usr/local/share/gems/gems/rack-1.5.2/lib/rack/server.rb:264:in `start' /usr/local/share/gems/gems/railties-4.1.8/lib/rails/commands/server.rb:69:in `start' /usr/local/share/gems/gems/…

signalr
tags question: http://stackoverflow.com/q/27406755
tags question: http://stackoverflow.com/q/27410316
tag name: signalr
tags question: http://stackoverflow.com/q/27446371
type: Tag
tags question: http://stackoverflow.com/q/27442310

http://stackoverflow.com/q/27376792
score: 0
upvote count: 1
tagged with: http-status-code-404
answer count: 1
downvote count: 1
tagged with: stockquotes
has title: How to download stock price data only when it is not erroneous (404)?
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
type: Question
has body: The script downloads historic stock prices from finance.yahoo.com. An array of tickers is used to loops through the script, creats li´nks based on the ticker array and downloads the data associated to each ticker. However, some of the ticker symbols are not up to date anymore and as a result yahoo delivers a 404 page instead of a csv containing price information. The errorpage is then instead stored in a csv and saved to my computer. To not download these files I am looking for the string 'Sorry, the page you requested was not found.', which is contained within each of yahoos error sites as an indicator for a 404 page. Behaviour of the code (output, see below code): The code runs through all tickers and downloads all stock price .csv's. This works fine for all ticker, but some ticker symbols are not used anymore by yahoo. In the case of a ticker symbol that is not used anymore the program downloads a .csv containing yahoos 404 page. All files (also the good ones containing actual data) are downloaded in the directory c:\Users\W7ADM\stock-price-leecher\data2. Problem: I would like for the code to not download the 404 page into a csv file, but just do nothing in this case and move on to the next ticker symbol in the loop. I am trying to achive this with the if-condition that looks for the String "Sorry, the page you requested was not found." that is diplayed on yahoos 404-pages. In the end I hoope to download all csv's for tickers that actually exists and save them to my hdd. var url_begin = 'http://real-chart.finance.yahoo.com/table.csv?s='; var url_end = '&amp;a=00&amp;b=1&amp;c=1950&amp;d=11&amp;e=31&amp;f=2050&amp;g=d&amp;ignore=.csv'; var tickers = []; var link_created = ''; var casper = require('casper').create({ pageSettings: { webSecurityEnabled: false } }); casper.start('http://www.google.de', function() { tickers = ['ADS.DE', '0AM.DE']; //ADS.DE is retrievable, 0AM.DE is not //loop through all ticker symbols for (var i in tickers){ //create a link with the c…
tagged with: casperjs
has answer: http://stackoverflow.com/a/27383246

http://stackoverflow.com/a/27456979
answers question: http://stackoverflow.com/q/27456939
score: 0
has body: your input checkbox must have id="checkbox" ..... function validateForm() { if(document.getElementById("checkbox").checked) return true; else return false; }
type: Answer

http://stackoverflow.com/a/27329356
has body: try something like this: var arr = ["1", "kumar", "mumbai", "aur",'500','2','kushal','ahm','del','1000'], count= arr.length,counter=0, myArr = []; for(var i = 0; i &lt; count; i += 5){ myArr[counter]=[]; var temp = arr.slice(i, i + 5).toString(); myArr[counter].push(temp); counter++; } console.log(myArr); output: 0 ["1,kumar,mumbai,aur,500"] 1 ["2,kushal,ahm,del,1000"]
has comment: http://stackoverflow.com/comment/43119346
score: 0
has comment: http://stackoverflow.com/comment/43119839
answers question: http://stackoverflow.com/q/27329077
has comment: http://stackoverflow.com/comment/43119561
type: Answer
has comment: http://stackoverflow.com/comment/43119894

http://stackoverflow.com/a/28760468
answers question: http://stackoverflow.com/q/27414233
downvote count: 0
upvote count: 2
type: Answer
has body: It looks like you forgot to add wsHost config option. I got the same issue as you, and this worked for me. Following slanger documentation, you should do it like this: Pusher.host = 'slanger.example.com' Pusher.port = 4567 var pusher = new Pusher('#{Pusher.key}', { wsHost: "0.0.0.0", wsPort: "8080", wssPort: "8080", enabledTransports: ['ws', 'flash'] });
score: 2

http://stackoverflow.com/a/27447114
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43333143
has body: If you're getting json as string, then use var json = JSON.parse(jsonStr). Then you can do it with Array.filter var result = json.line.filter(function(obj){ return obj.source.id == "startId" }); Then you could get the values like this var ids = result.map(function(o){ return o.target.id });
type: Answer
has comment: http://stackoverflow.com/comment/43334722
accepted answer of: http://stackoverflow.com/q/27447062
answers question: http://stackoverflow.com/q/27447062
upvote count: 1
score: 1

http://stackoverflow.com/q/27420637
type: Question
answer count: 2
score: 5
has body: I have the following setup for displaying my order by date: I have the following template that shows each order for a given week: (I stripped some html for brevity) Template: {{#each ordersByDate in ordersByDateOfWeek}} &lt;div class="orders-by-date"&gt; &lt;div&gt; &lt;span&gt;{{order-date-formatted ordersByDate.date}}&lt;/span&gt; &lt;/div&gt; {{#each order in ordersByDate.orders}} {{order.number}} {{order.market.name}} {{/each}} &lt;/div&gt; {{/each} The computed property: ordersByDateOfWeek: function () { var result = []; // return value var object = null var date = null; // add every order to an array with a date an order objects this.forEach(function (order) { // get the date of the order date = order.get('created'); // create a new object that holds the orders for a given date object = result.findProperty('date', date); // create the object if it does not exist if (!object) { object = { date: date, orders: [], // some more }; // add the object with the date to the result result.push(object); } // add the orders to the current object object.orders.push(order); // more calculations done here below }); }.property('model', 'sortProperties', 'sortAscending'), What it does is, that it creates an array of objects like this: [ { "date":"2014-12-08", "orders":[// order objects here], // some more properties }, { "date":"2014-11-08", "orders":[], }, { "date":"2014-10-08", "orders":[], }, ] I am trying for hours now, and cannot get my head around it to get it to work. My intuition says that it has to do with promises? But in the "orders: []" array are real Ember objects, so it should have to work I think. I hope that someone can point me in the right direction. Many thanks guys! Edit: to be 100% clear: my order model consists solely of orders. That custom object do I create myself. Thats why the binding of data gets broken I think.
possible better answer: http://stackoverflow.com/a/27562332
has answer: http://stackoverflow.com/a/27563138
downvote count: 0
accepted answer: http://stackoverflow.com/a/27563138
tagged with: javascript
has comment: http://stackoverflow.com/comment/43551145
has comment: http://stackoverflow.com/comment/43650549
has comment: http://stackoverflow.com/comment/43964090
has comment: http://stackoverflow.com/comment/43311572
tagged with: ember.js
favorite count: 0
has comment: http://stackoverflow.com/comment/43549757
has comment: http://stackoverflow.com/comment/43560486
has answer: http://stackoverflow.com/a/27562332
type: AnsweredQuestion
upvote count: 5
has title: Ember.js Computed property does not update hasMany item after sorting
has comment: http://stackoverflow.com/comment/43476073

http://stackoverflow.com/a/27435919
has comment: http://stackoverflow.com/comment/43313818
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43313924
answers question: http://stackoverflow.com/q/27380018
has body: This is almost certainly to do with system set 'hot keys'.Apparently according to the docs this missing keyup event is expected behaviour too. When i do cmdspace i dont even get a keydown event for the space as the spotlight window appears. On your mention of the ctrl key: because i have 'spaces' set up when i ctrlleft or ctrlright i get no left or right keydown events fired, however ctrlup or ctrldown at least fire their keydown events. I think it would be difficult to assume the use of a system that does not have the "default" hot keys setup.
upvote count: 2
has comment: http://stackoverflow.com/comment/43313475
has comment: http://stackoverflow.com/comment/43313890
type: Answer
has comment: http://stackoverflow.com/comment/43313429

http://stackoverflow.com/a/27359615
upvote count: 5
type: Answer
answers question: http://stackoverflow.com/q/27359591
downvote count: 0
has body: Should add else on all statements: function chkDetail(detail){ if(detail == 'one') { jQuery('#valMsg').text('one'); } else if(detail == 'two') { jQuery('#valMsg').text('two'); } else if(detail == 'three') { jQuery('#valMsg').text('three'); } else { jQuery('#valMsg').text('NO'); } }
score: 5

http://stackoverflow.com/q/27335320
favorite count: 0
type: UnansweredQuestion
score: 2
type: Question
has answer: http://stackoverflow.com/a/27335321
tagged with: ios
tagged with: javascript
upvote count: 2
has title: Detect the end of overscroll
downvote count: 0
answer count: 1
has body: When an element has a webkit-overflow-scrolling set to "touch" (default for the document.documentElement on the iOS devices), then user can overscroll the content. When user releases the touchevent, it takes time until element is scrolled to 0. How to detect the end of the overscroll?

http://stackoverflow.com/comment/43158331
type: QuestionComment
has text: Well what you want to do ? Replace the first by a text input with autocompletion or replace the data in the first because from your title and what you write im not sure we can understand what you really want.
comment on: http://stackoverflow.com/q/27351927
score: 0
type: Comment

sortedmap
tags question: http://stackoverflow.com/q/27355583
tag name: sortedmap
type: Tag

http://stackoverflow.com/q/27416388
tagged with: datepicker
linked to: http://stackoverflow.com/q/17660947
score: 2
has answer: http://stackoverflow.com/a/27418350
upvote count: 2
type: UnansweredQuestion
type: Question
has body: I am having a hard time in creating this code. What I used was $scope.convertToLanguage = function ($language) { var fileref = document.createElement("script"); fileref.setAttribute("type", "text/javascript"); fileref.setAttribute("src", "whatever the filename is"); if (typeof fileref != "undefined") { document.getElementsByTagName("head")[0].appendChild(fileref) } } I tried to make the source dynamic by loading either of these locales &lt;script src = "angular-locale_de-de.js"&gt; &lt;/script&gt; angular-locale_es-es.js angular-locale_it-it.js angular-locale_fr-fr.js The script loads. However, the language does not change. As I read from previous questions we use the Locales(s) to convert the language of the picker. I want to change the language in my "**ng-click**" event. Please help.
has title: Dynamically change the Language of Angular Bootstrap Datepicker
answer count: 2
has answer: http://stackoverflow.com/a/27562086
downvote count: 0
tagged with: angularjs-bootstrap
tagged with: javascript
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/27464695
score: 1
has body: I don't use Pixi but you tagged Flash so.. If your system supports -minus values you could try this as a starting point //R, G, B, A 0.0, 0.0, 0.0, 0, //Red -0.5, -0.5, -0.5, 1, //Green 0.0, 0.0, 0.0, 0, //Blue 0.0, 0.0, 0.0, 1 //Alpha (= always 1 for visibilty In a colour matrix you control //Green but you can add/mult/subtract hints of another channels using the R.G.B.A values at the top (which are multiplied not plused together anyway for the final colour. Here you are saying Green must be 1 (full opacity) and then -0.5 * -0.5 * 0.5. Experiment with a colour photograph of a limited palette to get the hang of colourmatrix and how it affects pixel colours.
answers question: http://stackoverflow.com/q/27449431
upvote count: 1
type: Answer
downvote count: 0

plunker
tags question: http://stackoverflow.com/q/27473437
tag name: plunker
type: Tag

http://stackoverflow.com/comment/43252293
has text: not sure why but only the 2nd regex in array is working after merge
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27402916
type: Comment

http://stackoverflow.com/a/46806465
type: Answer
has comment: http://stackoverflow.com/comment/82614220
has body: Hope this helps you: (It hides first and last labels in y axis) var myChart2 = new Chart(document.getElementById("canvas2"), { type: 'bar', data: data, options: { responsive: true, title: { display: true, text: "Chart.js - Modified Chart Hiding Min/Max" }, tooltips: { mode: 'index', intersect: false }, legend: { display: false, }, scales: { yAxes: [{ afterTickToLabelConversion: function(scaleInstance) { // set the first and last tick to null so it does not display // note, ticks[0] is the last tick and ticks[length - 1] is the first scaleInstance.ticks[0] = null; scaleInstance.ticks[scaleInstance.ticks.length - 1] = null; // need to do the same thing for this similiar array which is used internally scaleInstance.ticksAsNumbers[0] = null; scaleInstance.ticksAsNumbers[scaleInstance.ticksAsNumbers.length - 1] = null; }, ticks: { min: 10, max: 90, }, }], } }}); complete code on : https://codepen.io/jordanwillis/pen/jBeWWN
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/80728892
downvote count: 0
answers question: http://stackoverflow.com/q/27437883

http://stackoverflow.com/comment/43246022
comment on: http://stackoverflow.com/q/27400188
has text: Are you sure `_src[i]` is a properly formatted string? Try `for (var i = 0; i < aL; i++) { _dt.push(parseInt(_src[i].toString())); }`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27453480
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/43345298
has comment: http://stackoverflow.com/comment/43345274
accepted answer of: http://stackoverflow.com/q/27453441
answers question: http://stackoverflow.com/q/27453441
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43345260
has body: You can use the developer tools in Firefox (available in essentially all browsers at this point). In Firefox, the shortcut to open them is CTRL+SHIFT+K. Then go to the Console tab, and you can type JavaScript.
type: Answer

http://stackoverflow.com/comment/43089481
has text: Agreed. /filling the min limit/
comment on: http://stackoverflow.com/a/27314454
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27352540
type: Question
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: jquery UI slider rotate
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
type: UnansweredQuestion
downvote count: 0
tagged with: jquery-ui
score: 1
has body: I am using jquery-ui's slider, as input[type=range] looks dissimilar in all browsers and there is no way to make it look exactly the same across browsers (my target audience is using all latest browsers). Now I have multiple jQuery-ui sliders in a page. I want to rotate them using CSS3, to create a custom complex control (which requires uniform look-and-feel of range/slider control). Here is what I have so far: HTML: &lt;div class="slider"&gt;&lt;/div&gt; &lt;div class="slider"&gt;&lt;/div&gt; &lt;div class="slider"&gt;&lt;/div&gt; JavaScript: $('.slider').slider({ min: 1, max: 10, step: 1 }); CSS: .slider:last-of-type { transform: rotate(150deg); /* you can try with 180deg to see a clear difference */ } It rotates well, but its behavior is inversed: When we click on the one end of the scroller, it moves the knob to the oppose end. I tried rotating the input[type=range] as well, and it doesn't exhibit this problem. Is there a quick way to fix this issue in jQuery-UI slider? (if not) Is there any other library, which offers the similar range control with uniform look-and-feel across (latest) browsers?

http://stackoverflow.com/comment/43222097
comment on: http://stackoverflow.com/a/27386106
score: 0
type: AnswerComment
type: Comment
has text: I attempted to use single quotes and did not get an error. But when I hover over the number being printed, nothing happens. When I click, the js is not fired.

http://stackoverflow.com/comment/43332249
comment on: http://stackoverflow.com/q/27434387
score: 0
type: Comment
type: QuestionComment
has text: that should work . can you make me a fiddle on this so i can check that up . try keeping `<a href` outside div and try . cheers

http://stackoverflow.com/q/27462607
score: -1
tagged with: ajax
has answer: http://stackoverflow.com/a/27464074
has body: I want to use ajax to add data in the database but nothing happens i don't know whats wrong is it in the ajax!or in the php This is part of my code: this the html form: comment Send and this is a part of the php page for adding to the database extract($_POST) if(isset($context)) { mysql_query("INSERT INTO menu_commnet VALUES('$I_name','$U_N',NULL,NOW(),'$context')"); }
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27474443
tagged with: php
answer count: 4
has comment: http://stackoverflow.com/comment/43361502
has answer: http://stackoverflow.com/a/27462952
has answer: http://stackoverflow.com/a/27462788
downvote count: 1
type: Question
upvote count: 0
has title: My ajax code don't send the data to the database
tagged with: database
tagged with: javascript

http://stackoverflow.com/comment/43146892
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27345739
has text: @John: "this" what? Anyway you made me remember that also NaNs and infinities are not accepted in JSON (also no idea why). If something you parsed with `JSON.parse` is of type "number" you can be sure it's not a NaN.

http://stackoverflow.com/comment/86634020
type: QuestionComment
type: Comment
has text: Actually I did, if you use jQuery file upload script (github), you will not face this problem. The above code I never really got to work for all phones and tablets so best be just leave it and use jQ script.
comment on: http://stackoverflow.com/q/27376005
score: 0

http://stackoverflow.com/a/27335658
type: Answer
answers question: http://stackoverflow.com/q/27335488
has comment: http://stackoverflow.com/comment/43128165
has body: You will need to use javascript in order to change the image. But if you change dynamically the image "src" attribute – or the background-image if not an img – you will see a little blink during transition. For a clean effect you can use the sprite technique.
score: 0

http://stackoverflow.com/q/27380567
has title: AngularJS set checkbox checked, and ionRangeSliders value
answer count: 0
has comment: http://stackoverflow.com/comment/43210675
type: Question
has body: I'm trying to set default values for some inputs, it works fine for all other input, but I'm having problems with the check boxes and the slider. (setting them to checked when needed) This is my controller: App.controller('EmailAlertController', function($rootScope, $scope, $stateParams, $http, $timeout) { var ID = $stateParams.ID; $http.get('ajax/email_alerts/view_email_alert.php?ID='+ID).then(function (results) { $scope.EmailAlert = results.data }); }); This is view_email_alert.php: $EmailAlerts = array(); if (isset($_GET['ID']) &amp;&amp; intval($_GET['ID']) &gt; 0) { $ID = $_GET['ID']; $EmailAlerts = EmailAlerts::getById($ID); } echo json_encode($EmailAlerts); With this result: {"ID":"9539","AppRef":"7418","PriceMin":"439900","PriceMax":"789800","Type":"House","SubType":"Detached House","Rooms":"4","Area":"City","SubArea":"Town","Terms":"Fixed Price","SearchGroupName":"name","DTRecv":"2014-12-08 23:02:15.440","DTCreated":"12-08-2014 06:36","Name":"Name Example","Email":"email@email.com","Protection":"Protected"} And my HTML: &lt;input type="checkbox" name="Terms" id="Terms" ng-model="EmailAlert.Terms" value="{{EmailAlert.Terms}}" ng-checked="EmailAlert.Terms=='Fixed Price'" ng-true-value="Fixed Price" ng-false-value=""&gt; {{EmailAlert.Terms}} var min = $('#PriceRange').val().split(";")[0]; var max = $('#PriceRange').val().split(";")[1]; $("#PriceRange").ionRangeSlider({ min: 0, max: 1000000, from: min, to: max, type: 'double', step: 100, prefix: "&amp;pound;", prettify: false, hasGrid: true });
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/43210369
score: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: checkbox

http://stackoverflow.com/comment/43270749
has text: All I know is that you have numeric indices mapped to values. It would seem that whatever `name` represents could have an Array of values instead of individual properties for each value. So you'd do `name.values[currentLoc]`.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27413063

http://stackoverflow.com/q/27356847
accepted answer: http://stackoverflow.com/a/27357049
has title: Why does a part of HTML code disappear (AngularJS)?
tagged with: javascript
has body: I'm learning AngularJS. I've written following code: &lt;ul class="list-group"&gt; &lt;li class="list-group-item" ng-repeat="product in store.products"&gt; &lt;h3 ng-include="'product-title.html'"/&gt; &lt;section ng-controller="PanelController as panel"&gt; &lt;ul class="nav nav-pills"&gt; When I open the browser I see that the &lt;section ng-controller="PanelController as panel"&gt; part is not present in the resulting HTML code. You can find the entire source here. How can I fix this problem (make the section part appear in the browser) ?
has comment: http://stackoverflow.com/comment/43166293
score: 0
has answer: http://stackoverflow.com/a/27357049
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43166337
has comment: http://stackoverflow.com/comment/43166240
has comment: http://stackoverflow.com/comment/43166265
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/27460215
tagged with: model
type: UnansweredQuestion
tagged with: node.js
tagged with: orm
has title: sails.js: Newly created record doesn't populate on page until refresh
type: Question
tagged with: sails.js
tagged with: javascript
has body: I have a small app that I'm prototyping (I'm very new at sails) that has a task in a list. Simple stuff. However, when I create a task and forward to the list after create, the task doesn't appear on my list. If I do a page refresh it does. Here's the code snippets: In Task->Create List.findOne(req.session.List.id) .exec(function foundTasks (err, list) { Task.find({where: { list: list.id }, limit: 1, sort: 'priority desc'}) .exec(function getTaskPriority (err, task) { if (err) { console.log(err); req.session.flash = { err: err } } list.tasks.add({name: req.param('name'), list: req.session.List.id}); list.save(function(err) {}); }); res.redirect('/list/show/'+req.session.List.id); }); }); In List->Show show: function(req, res, next) { List.findOne(req.param('id')) .populate('tasks') .exec(function foundTasks (err, r) { req.session.List = r; if (err) return next(err); res.view({ name: r.name, tasks: r ? r.tasks : [] }); }); }, This doesn't happen when I create a normal item, only create an item through the .add() functionality. It happens in other places in my code as well (I have multiple contextual adds). With this code, if I create task "Do this 1", I am redirected to my task list and "Do this 1" is not there. If I hit refresh, it does show. If I add "Do this 2", then I'm redirected to the task list and only "Do this 1" appears. Until I refresh, then "Do this 2" appears. I thought perhaps there was an async issue (the page is loading faster than the record is being created and read in the db?) but I've added debug steps to factor that out. Anyone have any ideas?
score: 0
has answer: http://stackoverflow.com/a/27477451
answer count: 1

http://stackoverflow.com/q/27423530
favorite count: 0
has title: Three.js on Chrome Android : Error creating WebGL context
has comment: http://stackoverflow.com/comment/45518943
score: 3
tagged with: android
has body: I made a simple cube with Three.js for testing purpose. The thing is : when it runs on Chrome desktop, everything's fine, but on Chrome (37) on Android (4.1.2), the remote inspector shows : Error creating WebGL context. This error refers to this code : new THREE.WebGLRenderer(); I tried others demo (as http://lab.aerotwist.com/webgl/undulating-monkey/) I get the same error. Is Three.js or simply WebGl not supported by Chrome on Android ? UPDATE I did another test on my android tablet (Android 4.1.2, Chrome 33), and it's working fine on it. Android Chrome 37 issue ? Or maybe my smartphone can't handle WebGL (hardware too weak) ?
has comment: http://stackoverflow.com/comment/45476309
answer count: 0
type: UnansweredQuestion
upvote count: 3
tagged with: google-chrome
tagged with: webgl
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/27456730
answer count: 3
has comment: http://stackoverflow.com/comment/43350778
has answer: http://stackoverflow.com/a/27456747
favorite count: 0
downvote count: 2
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27456768
accepted answer: http://stackoverflow.com/a/27456747
score: -1
has comment: http://stackoverflow.com/comment/43350805
has answer: http://stackoverflow.com/a/27456749
has answer: http://stackoverflow.com/a/27456768
has comment: http://stackoverflow.com/comment/43351429
has body: Below is my javascript code. I am trying to get my function timedisplay() triggered each second. But it is not hapenning so.. function timedisplay() { alert ("Welcome"); var pelement = document.getElementById("myclock"); var timeobj = new Date(); alert (timeobj); pelement.innerHTML = timeobj.toLocaleTimeString(); alert (pelement.toLocaleTimeString()); settimeout (timedisplay,1000); } Timer Clock Testing.. Click me What is the issue ?
type: Question
has title: Unable to invoke recursively the function using settimeout in javascript
tagged with: javascript

http://stackoverflow.com/a/27384462
answers question: http://stackoverflow.com/q/27384013
has body: That is to be expected. When resizing the canvas its content is cleared. From the standard: When the user agent is to set bitmap dimensions to width and height, it must run the following steps: ... 3. Resize the scratch bitmap to the new width and height and clear it to fully transparent black. 4. If the rendering context has an output bitmap, and the scratch bitmap is a different bitmap than the output bitmap, then resize the output bitmap to the new width and height and clear it to fully transparent black. To get around this you must listen to the resize event of the window object and redraw all the content when invoked: window.addEventListener("resize", function() { // call redraw method here... }, false); Hope this helps.
has comment: http://stackoverflow.com/comment/43220533
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43219248
upvote count: 1

http://stackoverflow.com/a/27352179
type: Answer
has body: To detect the activity of the user you can utilize the onmousemove Event in javascript It executes when the mouse pointer is over a particular div in the page in the browser. If you want it to record the user activity on the complete page body content, you can use it in this fashion &lt;body onmousemove = "recordactivity(event)"&gt; Else If you want it to record end to end of your page, you can attach it in your html tag itself &lt;html onmousemove = "recordactivity(event)"&gt; You can get the coordinates of the page using the clientX and clientY and track the user mouse pointer location.
score: 1
answers question: http://stackoverflow.com/q/27351628
upvote count: 1
has comment: http://stackoverflow.com/comment/43158279
downvote count: 0

http://stackoverflow.com/q/27460739
has comment: http://stackoverflow.com/comment/43358371
has comment: http://stackoverflow.com/comment/43358407
favorite count: 0
has title: how to distribute JS components/widgets as SAAS
tagged with: saas
has body: I'm interested in creating and potentially selling javascripts that ideally can be implemented on any website, I do however have a few questions. So far, I've have made applications in Node and Rails, where the application is just served through HTTP requests, but I don't quite understand how I can write some software, that can be injected into a site (think component/widget), while still keeping the source code hidden. Ideally I would just give customers 1 or 2 lines of code to include in the header of their file, some credentials to authenticate against, and then have my scripts working on their site. How can this be done? Example: https://www.purechat.com/ Any help is much appreciated
answer count: 0
tagged with: widget
type: UnansweredQuestion
upvote count: 1
tagged with: components
has comment: http://stackoverflow.com/comment/43358399
has comment: http://stackoverflow.com/comment/43358355
score: 1
tagged with: javascript
type: Question
downvote count: 0
tagged with: web

http://stackoverflow.com/q/27366652
has answer: http://stackoverflow.com/a/27366959
tagged with: ajax
answer count: 3
has comment: http://stackoverflow.com/comment/43185629
has comment: http://stackoverflow.com/comment/43185779
favorite count: 0
has comment: http://stackoverflow.com/comment/43185378
has answer: http://stackoverflow.com/a/27376535
has comment: http://stackoverflow.com/comment/43185576
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27377271
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/43188667
has comment: http://stackoverflow.com/comment/43185461
score: 1
has comment: http://stackoverflow.com/comment/43185647
has comment: http://stackoverflow.com/comment/43185599
type: Question
has body: I'm trying to check the db to make sure a user name doesn't already exist during a registration process. I have it getting the count from the db. PHP Code: if($result=mysql_query("SELECT count(*) from users where username='$requsername'")) { while($row=mysql_fetch_array($result)) { $usercount=$row[0]; echo $usercount; } } else { $goof=mysql_error(); $error = "Error: $goof"; echo $error; } jQuery code: $('#newusername').blur(function() { var requsername=$('#newusername').val(), dataString='requsername=' + requsername; $.ajax({ url:'scripts/checkusername.php', data: dataString, type:'POST', success: function(data) { var response=data; if(response==="0") { $('#usernamestat').html('Username Available'); $('#addusrbtn').removeAttr('disabled'); alert(response); } } } } But it is ignoring the value of data. I did an alert and it is alerting the number from the db but it isn't running the code to enable my button and say username available. I do not know what I"m doing wrong! I want it to either pass or fail - if it passes (no users found with that username requested) it enables the submit button and lets them continue; but if it does not pass and has a value of greater than 0, it displays an error message that the username is already taken. It is not working at all or recognizing the numbers at all!
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: I'm trying to write a conditional based on what comes back from an AJAX success call

http://stackoverflow.com/comment/43363903
comment on: http://stackoverflow.com/q/27412572
score: 0
has text: Hi, I tested your links and they work fine via Flash programming tools (IDE) for both AAC and FLV. Now I assumed from the Flash tag that you were a coder who could handle ActionScript but it just hit me that really you want help for setting up JPlayer. No need to learn a new language just for one stream but you can try **[Muses Radio Player](https://www.muses.org/)**.. The page to **[setup a test is here](https://www.muses.org/setup)** can be slightly slow to load the test stream but it will work (tested).
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27380073
score: 1
has comment: http://stackoverflow.com/comment/43209673
type: Question
has comment: http://stackoverflow.com/comment/43209545
downvote count: 0
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/2167310
has comment: http://stackoverflow.com/comment/43209620
has body: I have disabled cookies in IE and would like to check with the help of jquery whether cookies are enabled in browser or not. I have written some functionality to check but it is not working in IE browser. After disabling the cookie in IE. I am trying to set cookie in IE broswer. It is still setting even though I disabled the cookie in the settings. Thanks in advance Code: $.cookie = function (name, value, options) { if (typeof value != 'undefined') { // name and value given, set cookie options = options ||{}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires &amp;&amp; (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); } var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { // only name given, get cookie var cookieValue = null; if (document.cookie &amp;&amp; document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i &lt; cookies.length; i++) { var cookie = $.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; }} } return cookieValue; } }; $.cookie("locations", 1); if ($.cookie('locations') == null) { //cookie does not exist, just set cookie to empty alert('cookie empty'); }
has comment: http://stackoverflow.com/comment/43209815
favorite count: 0
has comment: http://stackoverflow.com/comment/43210182
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2167310
has title: Check cookie is enabled in browser or not?
upvote count: 1
answer count: 0

http://stackoverflow.com/q/27324050
has answer: http://stackoverflow.com/a/27340935
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/3846735
has comment: http://stackoverflow.com/comment/43107376
has title: replacing aroow with a custom image and make it open dropdown
accepted answer: http://stackoverflow.com/a/27340935
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43107330
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27324320
linked to: http://stackoverflow.com/q/11185906
has answer: http://stackoverflow.com/a/27324320
tagged with: javascript
has body: I have a drop down in my page. I disabled the default arrow that comes with the select and over layed it with the my custom arrow ( icon font). The issue I am facing now is when I click on my custom arrow, the drop down doesn't open up. Is there a way to get it working. HTML mark up: O[tion 1 O[tion 2 Other CSS code: select{ -webkit-appearance: none; -moz-appearance: none; } .applicationDropDown{ background:#e6e6e6; color:#989898; @include rem-px(font-size,(16px)); @include rem-px(height,(50px)); max-height:200px; overflow-y:scroll; outline : none; transition: none; } span.drop-down-arrow{ background: #a4cf53; display: block; float: right; @include rem-px(height,(50px)); @include rem-px(width,(40px)); position:relative; @include rem-px(right,(1px)); @include rem-px(top,(50px)); &:after{ clear: both; content: "\e669"; color:#fff; font-family:icons; @include rem-px(font-size,(13px)); display: block; float: right; height: 0; position: relative; @include rem-px(right,(7px)); @include rem-px(top,(21px)); } }
score: 0

http://stackoverflow.com/q/27429709
score: 3
has body: I have imported a table from MySQL into RethinkDB, and it worked well. Now I am trying to figure out how to update my previous MySQL timestamp fields into Time objects in RethinkDB, with no success. Using the query explorer: r.table('users').withFields('last_login_at').update({ last_login_at: new Date(r.row('last_login_at')) }); -- Result -- JavaScript error: RangeError: Invalid time value
has answer: http://stackoverflow.com/a/27431999
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: RethinkDB - Convert Imported MySQL Timestamp String to Time Object
accepted answer: http://stackoverflow.com/a/27431999
type: AnsweredQuestion
tagged with: rethinkdb
upvote count: 3
type: Question

http://stackoverflow.com/a/27327805
type: Answer
answers question: http://stackoverflow.com/q/27327745
upvote count: 1
has comment: http://stackoverflow.com/comment/43116423
has body: You can check the length of the names array like this: Do something Just add ng-if to the same element that has ng-repeat, and then it will be conditional. Update: You can listen to the logic in a controller using $watch: $scope.$watch('names', function() { if (names.length === 1) { // Do something } }
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43116498

http://stackoverflow.com/comment/43177617
type: Comment
has text: True, I was too "lazy" :) but yes the idea is to use the server and not rely on file
comment on: http://stackoverflow.com/q/27362779
score: 0
type: QuestionComment

http://stackoverflow.com/a/27379378
type: Answer
has comment: http://stackoverflow.com/comment/43208382
downvote count: 0
score: 1
has body: The problem lies in the format that you pass the required date to the Date() object. For some reason browsers surprisingly do not support the date format “yyyy-mm-dd” and therefore fail. The following formats are definitely supported across all browsers and would advise sticking to one of these to avoid errors: var d = new Date(2011, 01, 07); // yyyy, mm-1, dd var d = new Date(2011, 01, 07, 11, 05, 00); // yyyy, mm-1, dd, hh, mm, ss var d = new Date("02/07/2011"); // "mm/dd/yyyy" var d = new Date("02/07/2011 11:05:00"); // "mm/dd/yyyy hh:mm:ss" var d = new Date(1297076700000); // milliseconds var d = new Date("Mon Feb 07 2011 11:05:00 GMT"); // ""Day Mon dd yyyy hh:mm:ss GMT/UTC alert(d.getFullYear()+""+(d.getMonth()+1)+""+((d.getDate()&lt;10)?"0"+d.getDate():d.getDate())); Reference : http://biostall.com/javascript-new-date-returning-nan-in-ie-or-invalid-date-in-safari
has comment: http://stackoverflow.com/comment/43208075
upvote count: 1
answers question: http://stackoverflow.com/q/27379243
has comment: http://stackoverflow.com/comment/43208031

http://stackoverflow.com/comment/43131332
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27337354
has text: True. But I presumed that he might want to return more than just one function.

http://stackoverflow.com/comment/43138948
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/27341498
has text: @roywasse I'm not trying to go back on that iframe. I'm trying to eliminate it's effect on the browser history.

http://stackoverflow.com/comment/43247670
type: Comment
type: QuestionComment
has text: How about binding if it's inset or outset with http://api.jquery.com/jquery.data/ to the li element and then just check if it's in used and the element has the same in/outset value as the slider has currently?
score: 0
comment on: http://stackoverflow.com/q/27401241

http://stackoverflow.com/comment/43256616
comment on: http://stackoverflow.com/q/27405974
type: QuestionComment
type: Comment
has text: Like I said, I didn't found nothing and I'm starting with this jquery/ajax thing
score: 0

http://stackoverflow.com/comment/43358890
comment on: http://stackoverflow.com/q/27461292
has text: have you tried iterating over them? Or doing something like `data.ids[0]` to get the first index
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/q/27427292
has comment: http://stackoverflow.com/comment/43323014
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43296173
has title: Minifying Javascript On Website Stops Images Loading
tagged with: wordpress
has body: I am desperately trying to minify + combine all my javascript files using a wordpress plugin. I have tried a few and the same problem happens on all of them when activated my front page slider (http://www.joellepoulos.com) and none of my portfolio images show up. I have tried deactivating every javascript that is being minified and the problem remains. It seems to happen when the plugins are activated even if the plugin isn't minifying any files. I cannot figure this out - my site is so slow right now due to loads of javascript files running and minifying them helps so much but this problem is killing me!
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27427485
score: 0

http://stackoverflow.com/q/27459205
linked to: http://stackoverflow.com/q/6425062
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: set multiple dates on jquery datepicker programmatically
favorite count: 0
tagged with: jquery-plugins
tagged with: datepicker
score: 5
has answer: http://stackoverflow.com/a/27460419
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27460419
has body: I want to set multiple dates programmatically on an inline jQuery datepicker. I have an array of dates and I want to loop through them and on each iteration, a date should be selected in datepicker. The result should be multiple dates selected on the inline jQuery datepicker. This is what I'm trying, but I haven't had much success with it. for(var j=0; j&lt;dateArr.length; j++){ $("#inlineDp").datepicker.('setDate',dateArr.pop()); }
upvote count: 5
type: Question

http://stackoverflow.com/q/27468684
has body: FINAL UPDATE: Kalman Hazins pointed me in the right direction, the computed property wasn't being called because of the fact that it wasn't rendered onscreen, so it wasn't "necessary" to re-compute it. I'll include here the final code for the controller: App.QuestionController = Ember.ObjectController.extend({ isEditing : false, resetIsEditing : function() { this.set('isEditing', false); }.observes('model.id'), canEditQuestion : function() { return this.get('author.id') === App.currentUser; }.property('author.id') } UPDATE: a "nice enough" solution has been provided by Raymond Liu below , it doesn't really answer the question "why this is happening", but it's the best I've got so far. I'm learning Ember.js, follwing this book and making some changes. In my controller I have a property bound to the model, but when I change such model the property is not updated. This is the controller: App.QuestionController = Ember.ObjectController.extend({ isEditing : false, canEditQuestion : function() { this.set('isEditing', false); return this.get('author.id') === App.currentUser; }.property('model') }); This is the template: Note that if I move the {{else}} branch content before {{#if isEditing}} it works as expected (but not how I want to). Maybe the fact that question is a nested route matters: App.Router.map(function() { this.resource('questions', function() { this.resource('question', { path : '/:question_id' }); }); }); What I want is that even if I'm already editing a question, if I change model the isEditing property should go back to false and the question form is not shown. Apparently I can solve it if I always render the question, but that's not what I want. What am I missing? EDIT: I'm adding the code for the question and the user model: App.Question = DS.Model.extend({ title : DS.attr('string'), question : DS.attr('string'), date : DS.attr('date'), author : DS.belongsTo('user', { async : true }), answers : DS.hasMany('answer', { async : true }) }); App.User = DS.Mod…
has comment: http://stackoverflow.com/comment/43539435
type: Question
has answer: http://stackoverflow.com/a/27477544
tagged with: javascript
has title: Ember.js not updating model
upvote count: 2
accepted answer: http://stackoverflow.com/a/27555165
has answer: http://stackoverflow.com/a/27487013
possible better answer: http://stackoverflow.com/a/27487916
favorite count: 0
has answer: http://stackoverflow.com/a/27487916
has answer: http://stackoverflow.com/a/27555165
tagged with: ember.js
has comment: http://stackoverflow.com/comment/43407697
tagged with: ember-model
answer count: 4
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43538079
downvote count: 0
has comment: http://stackoverflow.com/comment/43414335
has comment: http://stackoverflow.com/comment/43538577

kinect
type: Tag
tags question: http://stackoverflow.com/q/27369178
tag name: kinect

http://stackoverflow.com/a/27326436
answers question: http://stackoverflow.com/q/27325508
has comment: http://stackoverflow.com/comment/43131345
type: Answer
has comment: http://stackoverflow.com/comment/43122030
has comment: http://stackoverflow.com/comment/43122167
has comment: http://stackoverflow.com/comment/43122301
has body: Instead of document.files[0], try document.querySelectorAll('input[type="file"]')[0]. function demo(){ var inpts=document.querySelectorAll('input[type="file"]'); alert(inpts[0].className); } Demo The above example echo's the classname of file-input 0 (to simply show we have a reference to it). From here on you want to grab (for example) first file (from the first found input-element): var f = inpts[0].files[0]; PS: there is a lot of good related info in my answer linked here.
has comment: http://stackoverflow.com/comment/43117019
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/27325508
has comment: http://stackoverflow.com/comment/43129600

http://stackoverflow.com/q/27334033
score: -1
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How do I change the position and add a wrapper of a hidden element with jQuery?
has comment: http://stackoverflow.com/comment/43202351
has answer: http://stackoverflow.com/a/27334391
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43125336
tagged with: css
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43169905
downvote count: 1
has body: I have a div that I have hidden with jQuery. What I want to do is this: I want to show the hidden jQuery element on the far right position instead of the left position where it is hidden in the first place. Besides, I want to give it a new wrapper when I show it on the right. I am using multiple classes and this one is used for hiding it: $("div.post.apple").hide(); I want to show this one on the right, wrapped in a new div. I couldn't find an answer to this. Is this even possible in jQuery and if so, how do I do this?
type: Question

http://stackoverflow.com/comment/43310881
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27434834
type: AnswerComment
has text: I see your point. But I wanted to make it so that some answers will add points to some characters and take points from others. Also, I'm trying to make it so that you don't end up getting the same amount of points for two characters at the end.

http://stackoverflow.com/a/27348227
has comment: http://stackoverflow.com/comment/43151998
has comment: http://stackoverflow.com/comment/43151620
type: Answer
has body: You could do it this way, which would greatly "simplify" your script. Here's a codepen html Home About contact Awards css .container { display: inline-block; width: 100px; height: 100px; background: #bada55; transition: height 0.2s; text-align: center; } .container > a { color: white; display: inline-block; line-height: 100px; text-decoration: none; } .container.hide { display: hidden; height: 0px; } .container:nth-of-type(2) { background: #85da55; } .container:nth-of-type(3) { background: #55dac5; } .container:nth-of-type(4) { background: #9055da; } jquery $(function() { // cache containers var $containers = $('.container'); // hide all but home $containers.not('#home').addClass('hide'); $(document).on('keypress', function(e) { var hotkey = e.which, $keyContainer = $('[data-hotkey='+e.which+']'); // if not in hotkeys, return if (!$keyContainer.length) return; $containers.addClass('hide'); $keyContainer.removeClass('hide'); }); });
has comment: http://stackoverflow.com/comment/43152308
has comment: http://stackoverflow.com/comment/43151945
score: 0
answers question: http://stackoverflow.com/q/27347198

http://stackoverflow.com/q/27338163
has answer: http://stackoverflow.com/a/27341974
answer count: 1
downvote count: 0
tagged with: asp.net
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: python
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/27341974
upvote count: 2
has comment: http://stackoverflow.com/comment/43137292
has comment: http://stackoverflow.com/comment/43136251
tagged with: scrapy
type: Question
has body: I'm trying to login to a web site using scrapy and it is unable to find the correct submit button as there is a search button and the login button. I'm aware that in these cases I need to use clickdata but I am unable to get scrapy to locate the button that needs to be clicked. The website I'm trying to scrap is formatted poorly so I'm unable to simply use a name or ID to locate the button. The only way I can identify the button in the code is via the class, which i'm not even sure if it is unique. For whatever reason even with the class I scrapy is unable to locate the button. If it helps the website is in ASP and I think the button runs a javascript. Button HTML &lt;tr&gt;&lt;td class="x-btn-ml"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;td class="x-btn-mc"&gt;&lt;em class="" unselectable="on"&gt;&lt;button tabindex="0" class="x-btn-text" type="button" style="position: relative; width: 64px; height: 15px;"&gt;Login&lt;/button&gt;&lt;/em&gt;&lt;/td&gt;&lt;td class="x-btn-mr"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt; Scrapy login code return FormRequest.from_response(response, formdata = {loginInputName: login, passwordInputName: password}, clickdata = {'class': 'x-btn-text'}, callback = self.check_login_response(response))
tagged with: javascript
has title: Scrapy: Unable to find form button
has comment: http://stackoverflow.com/comment/43139608

http://stackoverflow.com/q/27320126
type: Question
answer count: 1
tagged with: javascript
has body: I am in the process of creating a calculator in javascript, and am trying to make a backspace. My initial thought was to use the .slice function, and it works, to a point. It works in the way that it takes a number off, but I am having trouble getting it to actually take off the number from the first value, if that makes any sense. It doesn't work on the first time, for example, if I type in 12, then use the backspace, then make the number 13 and do 13 + 6; it will come up with NaN. However if I do that same process again, it works as long as i use my clear button and not refresh the page. I have tried everything I can think of, bu't can't get it to work. Here is the code, sorry its a lot, but I figured it be better to have it all there. I am open to any suggestions, but prefer not to use jQuery, as I haven't yet learned a single thing about jQuery Code: //Variables var xValue = 0; var xValue2 = 0; //Button Values var plusButton = 0; var subButton = 0; var timesButton = 0; var divideButton = 0; var squaredButton = 0; var powerButton = 0; //Answers var sum = 0; var difference = 0; var product = 0; var quotent = 0; var square = 0; var power = 0; //Functions function add () { if (plusButton &gt;= 1) { xValue2 = xValue; xValue = ""; } subButton = 0; timesButton = 0; divideButton = 0; squaredButton = 0; powerButton = 0; //alert(xValue); } function addFunction () { sum = +xValue + +xValue2; answer.innerHTML = sum; } function subtract () { if (subButton &gt;= 1) { xValue2 = xValue; xValue = ""; } plusButton = 0; timesButton = 0; divideButton = 0; squaredButton = 0; powerButton = 0; } function subtractFunction () { difference = +xValue2 - +xValue1; answer.innerHTML = difference; } function multiply () { if(timesButton &gt;= 1) { temp = xValue2; xValue2 = xValue; xValue = ""; } subButton = 0; plusButton = 0; divideButton = 0; squaredButton = 0; powerButton = 0; } function multiplyFunction () { product = +xValue * +xValue2; answer.innerHTML = product; } function divide () { i…
score: 0
has answer: http://stackoverflow.com/a/27320263
type: UnansweredQuestion
has title: Javascript calculator backspace not working on first time

http://stackoverflow.com/q/27435165
has comment: http://stackoverflow.com/comment/46277005
tagged with: android
tagged with: cordova
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/43340842
type: Question
has comment: http://stackoverflow.com/comment/43316310
has comment: http://stackoverflow.com/comment/46589777
has comment: http://stackoverflow.com/comment/46522598
has title: Cordova 4.x/phonegap webintent
has body: I tried on a variety of plugins webintent, but i can't do that. I must send image from e.g. gallery, to cordova app. My code window.plugins.webintent.getExtra(WebIntent.EXTRA_STREAM, function(url) { // url is the value of EXTRA_TEXT console.log(url); }, function() { console.log('?'); // There was no extra supplied. } ); I testing on chrome. And according to the plugin webintent, there are two options. function with url send null, or error function send ? Probably problem is the plugins to max version cordova 3.x How do I get to send the photos from gallery to phonegap/cordova 4.x app?
tagged with: javascript

http://stackoverflow.com/q/27318995
type: UnansweredQuestion
has title: BSF Sampler. How to process local variable as a parameter for built-in Jmeter function
has comment: http://stackoverflow.com/comment/43097670
tagged with: beanshell
answer count: 0
tagged with: jmeter
has comment: http://stackoverflow.com/comment/43110291
has body: I have BSF Sampler and the following code inside: param = "valuestring"; result = "${__CustomFunc(param)}"; There is some variable 'var' inside __CustomFunc, getting the value from parameter 'param'. I want to have var=="valuestring", but currently have var=="param". I have tried several variants: result = "${__CustomFunc("+param+")}": var=="+param+" result = "${__CustomFunc"+"("+param+")}": result is just equal to "${__CustomFunc(valuestring)}" as a string and __CustomFunc is not processed result = "${__CustomFunc(${__eval(param)})}": var=="param" note: result = "${__CustomFunc(valuestring)}" work just well (var="valuestring") Any suggestions? Can I somehow process the string "${__CustomFunc(valuestring)}" to evaluate __CustomFunc?
type: Question
has comment: http://stackoverflow.com/comment/43129381
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43148665

http://stackoverflow.com/a/27343115
type: Answer
answers question: http://stackoverflow.com/q/27317465
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27317465
type: AcceptedAnswer
downvote count: 0
has body: Update Solved! The set_viewXml camlQuery.set_viewXml(" <FieldRef Name='Author' /> <UserID Type='Integer'/> "); had to be extend with

http://stackoverflow.com/q/27384844
tagged with: switch-statement
has answer: http://stackoverflow.com/a/27384976
downvote count: 0
possible better answer: http://stackoverflow.com/a/27384996
tagged with: javascript
has body: I'm a complete beginner to JavaScript and have been looking into this for quite some time now, I feel I've tried a lot of different ways of writing this code and it just doesn't seem to work as intended, nothing happens at all. I want to convert this if statement: if (browserName == "MSIE") { } else if (browserName == "IE11+") { } else if (browserName == "Chrome") { } else if (browserName == "Firefox") { } else if (browserName == "Safari") { } else alert("your browser is not compatible, please use one of these web browsers: Google Chrome, Mozilla Firefox, Internet Explorer or Apple Safari.") into a switch statement, this is what I currently have: switch (browserName) { case '1': == "MSIE"(); break; case '2': == "Safari"(); break; case '3': == "Chrome"(); break; case '4': == "IE11+"(); break; case '5': == "Firefox"(); break; default: alert("test1"); } I just want it to skip to the else alert if it does not detect the browser's name. Any help will be greatly appreciated.
has answer: http://stackoverflow.com/a/27384996
favorite count: 0
has comment: http://stackoverflow.com/comment/43218361
has answer: http://stackoverflow.com/a/27384993
has answer: http://stackoverflow.com/a/27385057
answer count: 4
score: 2
type: AnsweredQuestion
upvote count: 2
has title: Javascript beginner if.else to switch conversion
type: Question
has comment: http://stackoverflow.com/comment/43218207
has comment: http://stackoverflow.com/comment/43218302
tagged with: if-statement
has comment: http://stackoverflow.com/comment/43218377
accepted answer: http://stackoverflow.com/a/27385057

http://stackoverflow.com/a/27367387
type: AcceptedAnswer
type: Answer
has body: The easiest way is to simply require it via a relative path name: var obj = require('./codes.json'); Requires are always relative to the module itself, not the current working directory. Node.js understand that this is a JSON file and parses it accordingly. In general, you can get a reference to the directory the module is in via the __dirname variable. So the following works as well: var path = require('path'); var obj = JSON.parse(fs.readFileSync(path.join(__dirname, 'codes.json'), 'utf8'));
accepted answer of: http://stackoverflow.com/q/27367368
answers question: http://stackoverflow.com/q/27367368
score: 0

http://stackoverflow.com/comment/43354546
score: 0
type: AnswerComment
type: Comment
has text: @Basj: I can't immediately think of why it would be a problem to use an `https` JavaScript link on an `http` page, so go for it if you like. Note: `type` defaults to `text/javascript`, so there's no reason to put `type` on the `script `tag.
comment on: http://stackoverflow.com/a/27457555

http://stackoverflow.com/comment/43188271
comment on: http://stackoverflow.com/q/27367448
score: 5
has text: If bringing up the console changes the size of, or clips the image drawn to screen, you've decreased the amount of work that needs to be done each frame.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43286334
type: QuestionComment
comment on: http://stackoverflow.com/q/27418623
has text: `position: absolute` is needed to keep the first column at a fixed position. If you remove it the column will scroll as all the other columns.
score: 0
type: Comment

http://stackoverflow.com/q/27324748
tagged with: javascript
has body: I'm looking for a way to lookup the value of a variable passed into an underscore template, using a string that contains the variable name. For example, suppose my template contains the following: &lt;% _.each(detailFields, function(fieldName) { %&gt; &lt;% print(getValueByName(fieldName)); %&gt; &lt;% } %&gt; getValueByName() is the function I'm looking for. According to underscore documentation, the values passed to _.template() are put into local scope using a 'with' statement. If I understand correctly, that means window[fieldName] or this[fieldName] won't work. eval(fieldName) is an option, but I'd rather avoid using eval().
score: 0
tagged with: marionette
has answer: http://stackoverflow.com/a/27326129
answer count: 1
tagged with: templates
tagged with: backbone.js
type: UnansweredQuestion
has title: underscore template: lookup a variable by name
tagged with: underscore.js
type: Question

flux
tag name: flux
tags question: http://stackoverflow.com/q/27440053
tags question: http://stackoverflow.com/q/27336882
type: Tag

http://stackoverflow.com/comment/43251556
type: Comment
has text: You're making it seem that's somehow a problem? Could you explain better what exactly it is you're trying to do?
type: QuestionComment
comment on: http://stackoverflow.com/q/27402598
score: 0

http://stackoverflow.com/q/27429180
has comment: http://stackoverflow.com/comment/43300225
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/27429418
has comment: http://stackoverflow.com/comment/43299865
has comment: http://stackoverflow.com/comment/43300772
type: Question
has comment: http://stackoverflow.com/comment/43299843
tagged with: javascript
has comment: http://stackoverflow.com/comment/43299821
has comment: http://stackoverflow.com/comment/43299806
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Removing whitespace in inline-block with javascript
has body: I'm trying to remove the white space between inline blocks with this Javascript code. $.fn.removeSpace = function(){ this.contents().filter(function() { return this.nodeType === 3; }).remove(); }; $('.Container').removeSpace(); Test Test 2 Test 3 If I set $('.Container') to $('.lolers') the whitespace is striped correctly. If it's set as .what it wouldn't strip it either. Edit: Sorry for not including the question. How can I make the javascript code go through everything and strip out whitespaces?

http://stackoverflow.com/q/27435891
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43313682
has body: Sorry if some of the code seems primitive. I'm currently a freshman in highschool taking computer programming for the first time. We have a project going on, and I'm trying to sort the alphabetically, and by price. It's all in document.write() because I'm making multiple pages. If anyone can help me, that'd be great. I've searched all over the internet, but have had no luck.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27436525
linked to: http://stackoverflow.com/q/802854
downvote count: 1
has comment: http://stackoverflow.com/comment/43313293
has comment: http://stackoverflow.com/comment/43314058
score: -1
has title: How can I sort div tags in a document.write?

http://stackoverflow.com/comment/86875824
has text: @matanster You mean the passing of `onClick` as a prop? Well, I am not sure. The actual binding, the DOM and stuff, happens after you return from `render`. Whether React rebinds the event every time, I have no idea. Why would that be a concern?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/39878181
type: Comment

http://stackoverflow.com/q/27347004
has comment: http://stackoverflow.com/comment/43148835
has body: I am bit confused of this integer comparison using jQuery I have 2 input values. input type="number" class="highestBid" value= input type="number" min="0" class=" bid" name="bid" id="bid" so basically the inputed bid from user in the 2nd input field must be always higher than the current highest bid. I used following jQuery code to compare between these 2 codes : $(function(){ $('.bid').focusout(function(){ if($('.bid').val() &lt;= $('.highestBid').val()){ $('.bidPlaced').prop('disabled', true); } else{ $('.bidPlaced').prop('disabled', false); $('.buyItNow').prop('disabled', false) } }); }); The code works fine, but just now there is a bug I figured out if the current highest bid is : $123 and the user input : $21 the function will not work but if the user key in $122, the code will work I found out that the jQuery code just compare the first value which in this case is $(1)23 to $(2)1. can anybody tell me what is wrong with the jQuery code? Thanks!
has comment: http://stackoverflow.com/comment/43148904
has title: jQuery.val() integer datatype comparison
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43149000
downvote count: 0
has answer: http://stackoverflow.com/a/27347123
score: 7
favorite count: 0
type: Question
upvote count: 7
answer count: 1

http://stackoverflow.com/comment/43212980
has text: Not sure what `meal` is, but this will likely lead to XSS problems
type: AnswerComment
comment on: http://stackoverflow.com/a/27382069
score: 0
type: Comment

http://stackoverflow.com/comment/43146941
type: QuestionComment
has text: If I rephrase my question to ask what JS libraries exist at all that allow native comic style drawing, will you re-open the question? Please note that I would _not_ ask for "best practice" or "recommendations" but for mere existence of any JS lib - and there should be very few if any at all.
comment on: http://stackoverflow.com/q/27321215
score: 1
type: Comment

http://stackoverflow.com/comment/43284329
has text: Im using 1.11.1 and i know the on() function. on() not work like delegate(). I perferred to use delegate() but i connot do it my way :/
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27420781

http://stackoverflow.com/a/27339333
has body: Maybe you've answered your own question by now, but I just got back to it, See if this is what you need. Check this out: JS FIDDLE html image: {{image.title}} Show Image js function ImageCtrl($scope) { $scope.activeImageIndex; $scope.showImage = function(index) { $scope.activeImageIndex = index; }; $scope.isShowing = function(index){ return $scope.activeImageIndex === index; }; }; Should be pretty easy... Just hope I understood correctly. lol.
score: 0
answers question: http://stackoverflow.com/q/27335338
type: Answer

http://stackoverflow.com/comment/43347957
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27455022
has text: try setting `window.location`.
score: 0

http://stackoverflow.com/comment/43383274
has text: Mh now if i re-click the opened link i hide for a moment but it return fast, there is not a way to close the div permanently?
comment on: http://stackoverflow.com/a/27474248
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27474546
tagged with: javascript
tagged with: scope
duplicate of: http://stackoverflow.com/q/26297654
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/14220321
accepted answer: http://stackoverflow.com/a/27474592
has body: I'm using Firebase to access to same data, but i can't use the data out of the function used to access it. How i can make a console log of the data just accessed instead of the initial value? var whatNeed = 'hello'; gameData = new Firebase('https://thegame.firebaseio.com/gameData'); gameData.on("value", function(snapshot) { var data = snapshot.val(); whatNeed = data.property; }); console.log(whatNeed);
has title: variable no accessible after a Firebase call
linked to: http://stackoverflow.com/q/23667086
has comment: http://stackoverflow.com/comment/43384763
has comment: http://stackoverflow.com/comment/43383459
linked to: http://stackoverflow.com/q/25677977
tagged with: firebase
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/25697907
type: Question
has answer: http://stackoverflow.com/a/27474592
linked to: http://stackoverflow.com/q/26297654
tagged with: database

http://stackoverflow.com/a/27446142
type: Answer
has body: Just add a change to the backgroundColor. I'm using orange here, use the one you want. &lt;a href="javascript:;" id=" hideaway3" onclick="document.getElementById('hideaway1').style.display='none';document.getElementById('hideaway2').style.display='none'; document.getElementById('hideaway3').style.display='block';document.getElementById('hideaway1').style.backgroundColor='#f60';toggleTable3();return false"&gt; You HAVE to use unique IDs, you are using the same with an space in front, what makes it very confusing and buggy
score: 0
answers question: http://stackoverflow.com/q/27445613

http://stackoverflow.com/a/27363510
upvote count: 3
type: Answer
has body: Bind the data and set up events: d3.selectAll('.x .tick') .data(data) .on('mouseover', tip.show) .on('mouseout', tip.hide); Example here.
downvote count: 0
score: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27360506
answers question: http://stackoverflow.com/q/27360506

http://stackoverflow.com/q/27326367
tagged with: javascript
has comment: http://stackoverflow.com/comment/43111962
tagged with: template-engine
score: 1
favorite count: 0
has body: I've just started using handlebars.js in attempt to move away from rendering dynamic data the ugly way using string concat and injection. I am trying to separate the template script from the main HTML file and render the template file via a function call. Here is what I've got: script.js ---------- $(function() { var myData = { requests: [ {id: "1", firstname: "Roger", lastname: "Jones", age: 24}, {id: "2", firstname: "Phillip", lastname: "Green", age: 44} ]}; $.ajax({ url: 'templates/requests.html', dataType: 'html', cache: false, success: function(data, status, response) { var template = Handlebars.compile(response.responseText); var context = myData; $('#InjectTemplate_Requests').html(template(context)); } }); }); index.html ------------- Handlebars requests.html (template file inside the 'templates' directory) -------------- Name Status Type {{#requests}} {{firstname}} {{lastname}} {{age}} {{/requests}} File Structure -------------- index.html | script.js | | |---templates | | |---requests.html I seem to be getting this error on the console: Failed to load resource: The requested URL was not found on this server. However, when I add the template to Index.html (and remove ajax call from the script file), the template renders just fine. Can anybody shed some light as to why this is happening and how I can fix this? Thanks in advance.
has comment: http://stackoverflow.com/comment/43111882
tagged with: handlebars.js
upvote count: 1
has comment: http://stackoverflow.com/comment/43112042
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43111831
has answer: http://stackoverflow.com/a/27326702
possible better answer: http://stackoverflow.com/a/27326433
has title: Rendering local templates using Handlebars.js
type: Question
has answer: http://stackoverflow.com/a/27326433
has comment: http://stackoverflow.com/comment/43111872
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/27326702

http://stackoverflow.com/comment/43120373
type: Comment
comment on: http://stackoverflow.com/a/27331283
score: 1
type: AnswerComment
has text: The `POST` is fine - it's clearly PHP not returning any data. the function here is the 3rd parameter to `POST` which is the callback function and is passed the returned data by jQuery

http://stackoverflow.com/q/27430060
has comment: http://stackoverflow.com/comment/43303072
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27430091
has body: In my jQuery function I have: var is_employee = $('input[name=is_employee_1]:checked').val(); It's supposed to get the value from the html block below: &lt;div id="employee_question_1" class="unavailable"&gt; Is this attendee an employee of an ADA Dentist? &lt;input type="radio" name="is_employee_1" value="yes" id="is_employee_yes_1" class="cb_course is_employee_1" /&gt;&lt;label for="is_employee_yes_1"&gt;Yes&lt;/label&gt; &amp;nbsp;&amp;nbsp; &lt;input type="radio" name="is_employee_1" value="no" id="is_employee_no_1" class="cb_course is_employee_1" /&gt;&lt;label for="is_employee_no_1"&gt;No&lt;/label&gt; &lt;/div&gt; the class="unavailable" is utilized by $(".unavailable").addClass('hidden'); This is to hide certain fields that aren't available to all registration types. The CSS for the hidden class is: .hidden { display:none; } The field is later unhidden by JavaScript, but when I try to fetch the value, it returns "no" regardless of what is actually checked. I also tried to fetch the value using: var checkedValue = null; var inputElements = document.getElementsByClassName('is_employee_1'); for(var i=0; inputElements[i]; ++i){ if(inputElements[i].checked){ checkedValue = inputElements[i].value; break; } } which always returns no.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Javascript not returning the correct value for a radio button that is initially hidden
has comment: http://stackoverflow.com/comment/43301869

http://stackoverflow.com/q/27468703
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/43378888
has comment: http://stackoverflow.com/comment/83640304
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/43396480
upvote count: 1
has comment: http://stackoverflow.com/comment/43375530
has comment: http://stackoverflow.com/comment/83805098
tagged with: strace
type: Question
has comment: http://stackoverflow.com/comment/43383139
tagged with: javascript
tagged with: ubuntu
has title: Node js process suddenly jump to 100% CPU usage
has comment: http://stackoverflow.com/comment/43375206
has comment: http://stackoverflow.com/comment/43374930
downvote count: 0
tagged with: amazon-ec2
has comment: http://stackoverflow.com/comment/43375366
favorite count: 0
has body: We are facing a problem with our Node js (v0.10.26) application with CLUSTER module on ubuntu amazon EC2 (c3.large) instance that nearly everyday we get a 100% cpu spike (on the workers) suddenly and it never goes down until we restart our application the problem is that these spikes happens randomly and at weird times (at 3AM) when the traffic is minimal, when i looked at the logs i found that the logs stopped recording any requests probably because the node js app stopped working, what i did based on what i read so far is to do a strace on the process which was at 100% and check the output so i did and here is the output of my stack trace gettimeofday({1418314214, 491214}, NULL) = 0 gettimeofday({1418314214, 491327}, NULL) = 0 futex(0x7faad80008c8, FUTEX_WAKE_PRIVATE, 1) = 1 gettimeofday({1418314214, 619975}, NULL) = 0 gettimeofday({1418314214, 620055}, NULL) = 0 futex(0x7faad80008c8, FUTEX_WAKE_PRIVATE, 1) = 1 mmap(0xfcc3b000000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfcc3b000000 mprotect(0xfcc3b005000, 4096, PROT_NONE) = 0 mmap(0xfcc3b006000, 1019904, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfcc3b006000 mprotect(0xfcc3b0ff000, 4096, PROT_NONE) = 0 mmap(0xfcc3b100000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfcc3b100000 mprotect(0xfcc3b105000, 4096, PROT_NONE) = 0 mmap(0xfcc3b106000, 1019904, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfcc3b106000 mprotect(0xfcc3b1ff000, 4096, PROT_NONE) = 0 gettimeofday({1418314214, 731602}, NULL) = 0 gettimeofday({1418314214, 731682}, NULL) = 0 futex(0x7faad80008c8, FUTEX_WAKE_PRIVATE, 1) = 1 mmap(0xfcc3b200000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfcc3b200000 mprotect(0xfcc3b205000, 4096, PROT_NONE) = 0 mmap(0xfcc3b206000, 1019904, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfcc3b206000 mprotect(0xfcc3b2ff…

http://stackoverflow.com/comment/43371423
comment on: http://stackoverflow.com/q/27467875
has text: Your code refers to a specific element, with `$('#test1')`. It shows no attempt at doing what you describe.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43114936
type: Comment
comment on: http://stackoverflow.com/a/27324434
has text: `{"unit_id":"14","unit_title":"Res2","unit_max_occupancy":"12","unit_no":"0","unit_no_adults":"0","unit_no_children":"0","unit_no_extrabed":0,"unit_mealtype":"Bed and Breakfast","unit_fullboard_adult":"9000.00","unit_fullboard_child":"7000.00","unit_halfboard_adult":"7000.00","unit_halfboard_child":"5000.00","room_total":"90000.00","all_room_price":"0.00","extra_bed_price":"","meal_price":0,"saving_amount":0,"discounted_bedroom_price":0}] `
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43252710
has text: The use of inline anonymous functions like that are common. You could pull the function out, give it a name, and then pass in the same function by name instead of the function literal. You might want to check out the [MDN JavaScript Guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide) to become more familiar with the language and its differences from Java/C++.
comment on: http://stackoverflow.com/a/27393309
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43343194
type: AnswerComment
has text: I've actually been playing around with recursion and specifically reversing strings for funsies and had something similar to yours. In my example, I suppose if it were to be in the functional paradigm I would need `i` to be an accumulator (I believe that's the nomenclature)?
type: Comment
comment on: http://stackoverflow.com/a/27451995
score: 0

http://stackoverflow.com/comment/43132671
has text: and the answer of Aditya is the best solution for you .
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27334810

http://stackoverflow.com/a/27402943
has comment: http://stackoverflow.com/comment/43250753
answers question: http://stackoverflow.com/q/27402840
type: Answer
has comment: http://stackoverflow.com/comment/85303787
upvote count: 23
has body: You can add padding to your td with CSS: td { padding-right: 30px; } Hello Goodbye Hola Adios or give them a fixed width: td { min-width: 200px; } Hello Goodbye Hola Adios
has comment: http://stackoverflow.com/comment/43250582
score: 23
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27402840
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43251382

http://stackoverflow.com/comment/43144973
comment on: http://stackoverflow.com/a/27336742
score: 0
type: AnswerComment
has text: @artch Thanks for the clarification. I'm using FireFox as well and never noticed stacktrace reports... Perhaps it's just my memory...
type: Comment

http://stackoverflow.com/q/27451592
has body: I have the following code for autoresizing a textarea: HTML: &lt;textarea class="autoresize" id="txt" rows="2"&gt;&lt;/textarea&gt; JS: $('#txt').keydown(function(e) { var $this = $(this), rows = parseInt($this.attr('rows')); // on enter, add a row if (e.which === 13) $this.attr('rows', rows + 1); // on backspace, remove a row -- THIS IS THE PROBLEM if (e.which === 8 &amp;&amp; rows !== 2) $this.attr('rows', rows - 1); }); It works well, but when I hit backspace to erase a letter from a word, it also removes rows, and that's my problem. I want it to shrink back when the user "deletes" empty rows but I don't know how to achieve it. If you want, you can check it out in this fiddle.
upvote count: 3
has title: Autoresize textarea remove rows on backspace
has answer: http://stackoverflow.com/a/27451758
type: Question
score: 3
has answer: http://stackoverflow.com/a/27451742
answer count: 2
tagged with: textarea
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/27451742
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27451758
type: AnsweredQuestion

http://stackoverflow.com/q/27408644
type: Question
tagged with: soundcloud
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/9613111
tagged with: oauth
has body: I've followed the simple example of connecting to the SC API that's on their dev site. I've managed to get everything working on my local server but now that I've pushed it to my website it doesn't seem to be working. The "connect to app" window pops up. I click connect. It shows my 'redirect_url' page which has: &lt;body onload="window.opener.setTimeout(window.opener.SC.connectCallback, 1)"&gt; But it seems like it is never fired. I found one SO question about this from 2 years ago here: Javascript SDK connect() function not working in chrome And the top answer says that there is a problem with trying to do this if you have the SC Chrome app and to try listening for a 'Storage Event' as a workaround. My problem is that I don't have the SC app installed on chrome and never have. Also, it seems strange that this works perfectly on my local server. Can anyone think of how moving the code to my web hosting could have killed this? Do some hosting companies block window.opener.setTimeout() for some reason or anything? Thank in advance for the help.
upvote count: 3
type: UnansweredQuestion
tagged with: google-chrome
has answer: http://stackoverflow.com/a/33196998
score: 3
has title: Soundcloud Javascript API - Connect window.opener.setTimeout() not working

http://stackoverflow.com/a/61797411
score: 1
has body: I was facing the same issue ngx-toastr and resolved by adding the below code in my module file. ToastrModule.forRoot({ maxOpened: 1, preventDuplicates: true, autoDismiss: true }) Also, if lazy loading is implemented, then you need to add the same lines of code to your parent module file also as I've added in my app.module.ts
answers question: http://stackoverflow.com/q/27365538
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/a/27373848
has comment: http://stackoverflow.com/comment/43238216
type: Answer
has comment: http://stackoverflow.com/comment/43199033
has comment: http://stackoverflow.com/comment/43199369
has body: Try: https://github.com/carhartl/jquery-cookie $.cookie('mycookie','1234',{ expires: 10, path: '/' });
score: 0
has comment: http://stackoverflow.com/comment/43198188
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27373808
has comment: http://stackoverflow.com/comment/43198475
has comment: http://stackoverflow.com/comment/43198721
has comment: http://stackoverflow.com/comment/43198253
has comment: http://stackoverflow.com/comment/43198706
accepted answer of: http://stackoverflow.com/q/27373808

http://stackoverflow.com/q/27455101
tagged with: if-statement
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43349504
has answer: http://stackoverflow.com/a/27456152
tagged with: mysqli
has comment: http://stackoverflow.com/comment/43348612
has comment: http://stackoverflow.com/comment/43348578
tagged with: php
has title: Checking if Username exists not working
has body: I believe that the issue has to do with if(data == 1) At the moment, the alert box keeps saying available and when i change it to ===, and the alert box kept saying unavailable. I'm not exactly sure where the issue is. This is my register.html &lt;form name="registerform" id="registerform" action="register.php" method="post"&gt; &lt;div class="form_settings"&gt; &lt;p&gt; &lt;label for="firstname"&gt;First Name:&lt;/label&gt; &lt;input name="firstname" id="firstname" maxlength="32" type="text" placeholder="Optional" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="username" id="usernameText"&gt;Username:&lt;/label&gt; &lt;input data-parsley-pattern="^[A-Za-z0-9_]{3,15}$" data-parsley-length="[3, 15]" name="username" id="username" maxlength="32" type="text" data-parsley-error-message="Username needs to be between 3 and 15 characters. Case sensitive. No special characters allowed." required/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="password1"&gt;Password:&lt;/label&gt; &lt;input name="password1" id="password1" data-parsley-pattern="^[A-Za-z0-9_-]{5,25}$" data-parsley-length="[5, 25]" type="password" data-parsley-equalto="#password2" data-parsley-error-message="Passwords must match. Needs to be between 5 and 25 characters. Case sensitive. No special characters allowed." required/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="password2"&gt;Confirm Your Password:&lt;/label&gt; &lt;input name="password2" id="password2" data-parsley-length="[5, 25]" data-parsley-error-message="Passwords must match. Needs to be between 5 and 25 characters. Case sensitive. No special characters allowed." data-parsley-pattern="^[A-Za-z0-9_-]{5,25}$" type="password" data-parsley-equalto="#password1" required/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="email"&gt;E-Mail:&lt;/label&gt; &lt;input data-parsley-trigger="change" name="email" id="email" maxlength="1024" type="email" required/&gt; &lt;/p&gt; &lt;p style="padding-top: 15px"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt; &lt;input type="submit" class="submit" na…
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27456505
has comment: http://stackoverflow.com/comment/43349784
has answer: http://stackoverflow.com/a/27456505
has comment: http://stackoverflow.com/comment/43348622
has comment: http://stackoverflow.com/comment/43348588
has comment: http://stackoverflow.com/comment/43348338
has comment: http://stackoverflow.com/comment/43348102
tagged with: mysql
accepted answer: http://stackoverflow.com/a/27456152
type: Question

http://stackoverflow.com/a/27409394
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27408576
answers question: http://stackoverflow.com/q/27408576
has body: To answer the above question, you have to know Checkbox element has these two distinct attributes i. checked == true/false ii. value := 'any string vals' one not related to the other. In your CHECKED attribute, you set it to true only if that line has changes. Checkbox object would make itself invisible (disabled) from Server.Request otherwise. In your VALUE attribute, you can stash away all your to-be-posted values for that line(similar to jQuery.Data(input)) disregarding the checked attribute == true/false! Browser on-submit, you execute function do_checkChanges() {// checking each row for (var ii = 0; ii &lt; document.getElementsByName("N_CheckChanged").length; ii++) { document.getElementsByName("N_CheckChanged")[ii].checked = 0; //detect changes if ((document.getElementsByName("R_DateResume")[ii].value != document.getElementsByName("h_DateResume")[ii].value) || (document.getElementsByName("R_CheckInhibited")[ii].value != document.getElementsByName("h_CheckInhibited")[ii].value) ) { document.getElementsByName("N_CheckChanged")[ii].checked = 1;//mark the change document.getElementsByName("N_CheckChanged")[ii].value = document.getElementsByName("h_RowID")[ii].value + "|" + document.getElementsByName("R_CheckInhibited")[ii].checked + "|" + document.getElementsByName("R_DateResume")[ii].value ; } } whoPostBack.value = 'view2'; } After you have stored your updates inside the checkboxes, your server-side code should be like a breeezzee! On the server side, all you need to do is string[] formCheckChanged = Request.Form.GetValues("N_CheckChanged"); if (formCheckChanged != null) { foreach (string checkChanged in formCheckChanged) { sValues = checkChanged.Split('|'); correspondedRow = sValues[0]; data1 = sValues[1]; data2 = sValues[2]; theSqlCmd.CommandText = " update tb_LOG set InhibitedNow='" + data1 + "', InhibitEnd = '" + data2 + "', InhibitedBy = '" + MyConnections.userID + "' where RowID =" + correspondedRow; try { theSqlCmd.ExecuteNonQuery(); } catch (Exception eX) …
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27456349
has answer: http://stackoverflow.com/a/27483646
type: Question
tagged with: google-apps-script
upvote count: 0
tagged with: arrays
linked to: http://stackoverflow.com/q/16897067
has title: Submitting a response to google form using google apps script
tagged with: javascript
score: -1
duplicate of: http://stackoverflow.com/q/16897067
has comment: http://stackoverflow.com/comment/43350600
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/16089041
type: UnansweredQuestion
downvote count: 1
has body: I am attempting to generate a script that opens up a google form and fills it out. I have been able to read through the documentation and do the following: select a form using it's ID, get a list of questions in an "item" array, get the type of question and it's ID, get the item by id, return it by various types and do all sorts of "selecting" of the elements in the form. I have not been able to 1. set a response to a specific item in the form, or 2. submit that form with a response. The formReponse object continues to be empty no matter what I do. formResponse, despite being a class, without the for loop comes up as undefined unless I have that code there. function myFunction() { var form = FormApp.openById('1h_8Gz5GKwLqUdw249rpMWu6-AlrDJgUig-rdMCC7TWU'); //form.addTextItem(); var items = form.getItems(); Logger.log(items); // Access the text item as a generic item. var item1 = items[0]; Logger.log(item1); var item1type = item1.getType(); Logger.log(item1type); var item1id = item1.getId(); var getitem1 = item1.asTextItem(); var getitem1t = form.getItemById(item1id); var response = "tewtw"; getitem1t.createResponse(response); var formResponses = form.getResponses(); for (var i = 0; i &lt; formResponses.length; i++) { var formResponse = formResponses[i]; var itemResponses = formResponse.getItemResponses(); for (var j = 0; j &lt; itemResponses.length; j++) { var itemResponse = itemResponses[j]; Logger.log('Response #%s to the question "%s" was "%s"', (i + 1).toString(), itemResponse.getItem().getTitle(), itemResponse.getResponse()); } formResponse.submit(); } Thanks!

http://stackoverflow.com/q/27375857
has comment: http://stackoverflow.com/comment/43206974
score: 0
tagged with: jsni
has body: How can I set focus from JSNI method for a field in GWT application that I know its ID? For example suppose I have this method: public native void focusOn(String id) /*-{ $wnd.$("#" + id).focus(); }-*/; This is not working. Are there a solution for this problem?
has comment: http://stackoverflow.com/comment/43234169
answer count: 0
type: UnansweredQuestion
has title: call jquery focus from JSNI method inside GWT
tagged with: gwt
has comment: http://stackoverflow.com/comment/43205683
tagged with: java
type: Question
has comment: http://stackoverflow.com/comment/43264567
tagged with: javascript

http://stackoverflow.com/comment/43175720
has text: @user247077 There are actually more chances that it would be faster because the browser would make parallel requests
comment on: http://stackoverflow.com/a/27361523
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27367157
type: UnansweredQuestion
tagged with: facebook
has comment: http://stackoverflow.com/comment/43186469
type: Question
tagged with: c#
has body: I've been searching the internet to get some information about how i can be able to detect and show what a url is about. Facebook has a good example of what i actually want to achieve: If you create a update on facebook and paste in a URL, facebook will detect some information about it and show a box with some text and often the right picture. for instance, take: http://www.ebay.com/itm/Mens-Monk-Strap-Loafers-Suede-Lined-Metal-Buckle-Slip-Casual-Dress-Shoes-New-/311170422772 . then it shows the image of the shoe and headline. Ive found other services which does this with image services and youtube, but what i need is about getting information of products most of the time, so often urls from shops. So the user pastes in a url, and i can detect what that link is about. any ideer how this can be done ? Is it backend code, like c# or javascript ? Hopefully some of you can point me in the right direction. Thanks in advance!
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27367292
has title: show contents of link

http://stackoverflow.com/comment/43133626
has text: I'm just asking conceptually. But, of course, I'm going to be encrypting the data.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27338465
type: QuestionComment

http://stackoverflow.com/comment/43321663
comment on: http://stackoverflow.com/q/27421528
type: Comment
score: 0
has text: pdfmake is exposing different apis depending on the environment (which is not good imho). I've [opened an issue](https://github.com/bpampuch/pdfmake/issues/150) for that.
type: QuestionComment

http://stackoverflow.com/a/41973925
type: Answer
has body: Ui select doesnt work when search item closed or if the binding element is empty. The fastest way to do that adding css display:block placeholder item. .select2-chosen{ display: block !important; } Or you can edit ui-select.js.
answers question: http://stackoverflow.com/q/27382766
score: 0

http://stackoverflow.com/comment/43258205
has text: I've been running into cross stack version issues with bootstrap and angular. I cringe when thinking about adding more, but looking at the docs, it does look like it has what I need. Thanks! I'll look into this.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27406486
score: 0

http://stackoverflow.com/a/27358574
type: Answer
answers question: http://stackoverflow.com/q/27358528
has comment: http://stackoverflow.com/comment/43169672
has comment: http://stackoverflow.com/comment/43169636
has body: JavaScript resets every time the page is loaded. Once the page is reloaded, your for loop is history. Here's an alternative using HTML5 Local Storage: $(document).ready(function() { if(localStorage.getItem('reload') != false) localStorage.setItem('reload', false); location.reload(); } });
score: 3
downvote count: 1
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43169796
accepted answer of: http://stackoverflow.com/q/27358528

http://stackoverflow.com/comment/43229230
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27387613
has text: Only add that the method (or property) may not be `flush` in the first `prototype` level. As I see the prototype object `F`, or perhaps is solved by inheritance. In this case, javascript searching prototypes to the lowest level until it finds a match. If it is not found, returns `undefined`.
score: 0

http://stackoverflow.com/comment/43296740
comment on: http://stackoverflow.com/q/27427495
has text: Using document.ready() may be the issue - I'm not sure if that fires when you add new content after the main document is already ready. You should be able to simply include the script without wrapping it in document.ready() at that point.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43365012
has text: And more, if you just set it, and retrieve, w/o any side effects - you don't need setters/getters at all..
comment on: http://stackoverflow.com/q/27464148
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/27381596
upvote count: 2
downvote count: 2
tagged with: animation
type: AnsweredQuestion
has body: How to animate a div into determinated coordenades X and Y and choose the velocity with JavaScript? Animation <img src="image" X Y V Thanks.
type: Question
accepted answer: http://stackoverflow.com/a/27382219
answer count: 2
has title: Animation with JavaScript
possible better answer: http://stackoverflow.com/a/27382172
tagged with: javascript
has answer: http://stackoverflow.com/a/27382172
score: 0
favorite count: 0
has answer: http://stackoverflow.com/a/27382219

http://stackoverflow.com/a/27322418
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27321841
downvote count: 0
type: Answer
has body: Have you considered making an AJAX call to the backend, making use of Laravel's form validators, as the user tabs to the next input field? That way the form is validated prior to submit.

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/27332119
tags question: http://stackoverflow.com/q/27376416
type: Tag

http://stackoverflow.com/comment/43252173
score: 0
type: AnswerComment
has text: Thanks this worked. I know that most of the functionality is already present in ExtJS. I would only use jQuery for some problems that easier to solve using jQuery than ExtJS. Basically I just want to have more flexibility if I ever need it. ExtJS will be the main library I use.
type: Comment
comment on: http://stackoverflow.com/a/27389123

http://stackoverflow.com/comment/43194801
comment on: http://stackoverflow.com/q/27371558
has text: what you are expecting ? a date in mm/dd/yyyy ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27449543
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/41675134
favorite count: 0
has answer: http://stackoverflow.com/a/79152189
has answer: http://stackoverflow.com/a/27450575
type: Question
possible better answer: http://stackoverflow.com/a/27450575
score: 4
accepted answer: http://stackoverflow.com/a/52570090
tagged with: responsive-design
has body: I have a navigation of lets say 12 items, and when resolution gets smaller items drop in a new line. I need to make that when an item doesn't fit on a navigation anymore it should put a "MORE" dropdown button on the right side of nav. and put that item that doesn't fit in a dropdown. If you don't understand me there is image below. But the problem is that navigation items aren't always the same width because navigation items are generated from REST api. I tryed to make jQuery script for calculating items width and adding them to navigation. Here is the script I created, I made it in a hurry so it's really bad. I need to help on how to properly calculate items witdh and navigation width and calculating when to add items to navigation or remove items from navigation. Here is image if you don't get it: http://img.hr/aagV /* * Here we check how many items can we put on the navigation bar * If item doesn't fit we clone it on the more dropdown button */ function removeMany() { var i = $items.length - 1; if (itemsWidth > navWidth) { while (itemsWidth > navWidth) { $($items[i]).removeClass('first-level-item').addClass('second-level-item'); dropdownItems.push($items[i]); $($items[i]).removeClass('showed'); $items.pop(); i--; getItemsWidth(); } $nav.append($navMore); dropdownItems.reverse().forEach(function (element, index, array) { $('ul.second-level').append(element); }); getItems(); } } //If window is resized to bigger resolution we need to put back items on the navbar function addMany() { var i = dropdownItems.length - 1; if (dropdownItems.length != 0) { do { $('ul.first-level').append(dropdownItems.reverse()[i]); $items.push(dropdownItems[i]); dropdownItems.pop(); i--; getItemsWidth(); } while (itemsWidth < navWidth); $navMore.remove(); $items.each(function (i) { $(this).addClass('first-level-item showed').removeClass('second-level-item'); }); if (!(dropdownItems != 0)) { return; } else { $nav.append($navMore); } } } body { margin: 0; padding: 0; border: 0; } ul, li { ma…
answer count: 5
upvote count: 4
has title: adding more button for list in responsive navigation
has comment: http://stackoverflow.com/comment/43337863
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/52570090
has answer: http://stackoverflow.com/a/27451386
downvote count: 0

http://stackoverflow.com/q/27336736
has comment: http://stackoverflow.com/comment/43130311
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am trying to multiply the value from the dropdown list by a certain value say $10 and the value ALL multiply it by $7 and for the value to appear in the text box. I am totally new at scripting and would appreciate any help. Amount: 5 6 7 8 9 10 ALL Total:
has comment: http://stackoverflow.com/comment/43130245
type: UnansweredQuestion
has title: multiply dropdown list value with a constant
has answer: http://stackoverflow.com/a/27336928

http://stackoverflow.com/q/27355718
has title: How to filter data according to strict match in Angular js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27355962
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: ng-grid
possible better answer: http://stackoverflow.com/a/27356959
accepted answer: http://stackoverflow.com/a/27355962
has answer: http://stackoverflow.com/a/27356959
has body: i want to filter data on the fly when data is provided to ng-grid in angular. what i am trying to achieve is that when i filtering 'Nephi' then all the data which contain 'Nephi' with its. I am providing a plunker link to better understand: Like if i search 'Nephi' then it should only give me 1 result or exact result(expected result) 1. Nephi but right now it is giving me: 1. Nephi 2. Nephiss 3. Nephisss
has comment: http://stackoverflow.com/comment/43164202
favorite count: 0
score: 2
tagged with: angularjs
upvote count: 2

http://stackoverflow.com/q/27349921
has comment: http://stackoverflow.com/comment/43154563
has title: Json parse error on JSONLint
favorite count: 0
has comment: http://stackoverflow.com/comment/43154536
linked to: http://stackoverflow.com/q/27261042
tagged with: parsing
has body: I have this JSON output: { "title": "test1", "status": "private", "markers": "\"[{\"k\":48.28319289548349,\"B\":1.494140625},{\"k\":44.024421519659334,\"B\":20.302734375},{\"k\":47.517200697839414,\"B\":40.517578125},{\"k\":53.9560855309879,\"B\":23.73046875},{\"k\":49.66762782262194,\"B\":3.251953125}]\"" } { "title": "test2", "status": "public", "markers": "\"[{\"k\":48.574789910928864,\"B\":10.546875},{\"k\":43.19716728250127,\"B\":12.48046875}]\"" } On JSONLint I get this error: Parse error on line 5: ...":3.251953125}]\""}{ "title": "test ----------------------^ Expecting 'EOF', '}', ',', ']' Here is the PHP code witch fetch the JSON objects: if ($bdd = mysqli_connect('localhost', '', '', _BDD_NAME_)) { $sql = 'SELECT * FROM `trip`'; $result = mysqli_query($bdd, $sql); if ($result) { while ($row = $result-&gt;fetch_assoc()) { echo json_encode(array('title' =&gt; stripslashes($row['title']), 'status' =&gt; stripslashes($row['status']), 'markers' =&gt; stripslashes($row['markers']))); } } else { echo json_encode(array('status' =&gt; 'failure')); } } if ($bdd) { mysqli_close($bdd); } Can someone help me to identify where is the error in this JSON object?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43154389
downvote count: 2
has comment: http://stackoverflow.com/comment/43154559
type: Question
has comment: http://stackoverflow.com/comment/43154435
tagged with: object
has comment: http://stackoverflow.com/comment/43154430
tagged with: http://stackoverflow.com/tag/json
score: -1
upvote count: 1
has comment: http://stackoverflow.com/comment/43154518
answer count: 1
has answer: http://stackoverflow.com/a/27349967
accepted answer: http://stackoverflow.com/a/27349967
tagged with: javascript

http://stackoverflow.com/comment/43289084
type: AnswerComment
comment on: http://stackoverflow.com/a/27422778
has text: thanks..how can i call another ajax calling inside the controller
type: Comment
score: 0

http://stackoverflow.com/comment/43117597
comment on: http://stackoverflow.com/q/27329544
score: 0
type: QuestionComment
type: Comment
has text: Ho oh... I think that's the issue.. let me quickly bower install

http://stackoverflow.com/q/27456367
has comment: http://stackoverflow.com/comment/43350241
downvote count: 0
tagged with: vb.net
type: AnsweredQuestion
tagged with: c#
has answer: http://stackoverflow.com/a/27456524
accepted answer: http://stackoverflow.com/a/27456524
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43350269
upvote count: 1
has title: How to set textBox.Text=radCombo.Text in javascript
answer count: 1
has body: I am having a &lt;telerik:RadComboBox&gt; and a &lt;asp:TextBox&gt; in my form. i want to display textBox.Text=radCombo.Text in client side on Textchange event of the comboBox. i am using the code for this as: &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt; &lt;/asp:ScriptManager&gt; &lt;telerik:RadComboBox ID="cboSample" EnableLoadOnDemand="true" runat="server" Skin="WebBlue" Text ="sample" OnClientKeyPressing ="func()"&gt; &lt;/telerik:RadComboBox&gt; &lt;asp:TextBox runat="server" ID="txtSample"&gt;&lt;/asp:TextBox&gt; &lt;/div&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; function func() { var cbo = document.getElementById("cboSample"); document.getElementById("txtSample").Text = cbo.getAttribute("Text"); } &lt;/script&gt; &lt;/body&gt; what i am doing wrong? how can i achieve the goal
tagged with: javascript
tagged with: asp.net
favorite count: 0
tagged with: telerik

http://stackoverflow.com/comment/43364911
comment on: http://stackoverflow.com/q/27464148
score: 0
has text: @vp_arth could you clarify? I don't usually use getter/setter in this way (one of the reasons I didn't answer).
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/100407773
type: Comment
has text: Great. It works well for me. I got a typo module.export = router; I did it without (s) at the end of export. Holy heck, one hour of my life.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28379965

http://stackoverflow.com/comment/43382446
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27473759
has text: @Verhaeren: Interesting. Different behavior between the two.
score: 0

http://stackoverflow.com/q/27351976
tagged with: mojolicious
type: Question
upvote count: 2
tagged with: perl
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27367166
accepted answer: http://stackoverflow.com/a/27367166
downvote count: 0
has title: Why isn't my data been added to the stash in mojolicious?
has body: I'm having an issue with Mojolicious and the stash and I think I'm probably just not understanding the way it works? I have a page with 2 combo boxes and when the first entry changes I wish to update the options in the second. So I add an event handler like below, which then calls my controller sub routine 'devicecommandset' and then puts the result of a DBIx query into an array of hashes which I add to my stash. I am then just render some benign text. My subroutine gets called and there is the expected contents in '@commandsets'. However I cannot see it in the stash on the browsers console ( I'm running in debug mode ). Do I need to actually modify the DOM for the stash to be populated? Basically I'm just trying to get data back from my request to fill the combobox options. In my template $(document).ready(function() { $('select:not([name*="command"])').live('change', function (e) { $.get('devicecommandset', { device: $(this).attr("value") }, function (data) { alert("Made it this far"); }); }); }); In my Controller sub devicecommandset { my $self = shift; my $device = $self-&gt;param('device') || ''; my @commandsets = $self-&gt;db-&gt;resultset('CommandSet')-&gt;search_commandsets_by_devicename($device); $self-&gt;stash(commandsets =&gt; \@commandsets ); print Dumper(@commandsets); $self-&gt;render(text =&gt; 'success' ); }
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/27364605
type: AcceptedAnswer
has body: Found it: &lt;div class="model-content"&gt; Should be: &lt;div class="modal-content"&gt; // Notice the a That should fix it. Cheers!
type: Answer
upvote count: 15
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27364420
answers question: http://stackoverflow.com/q/27364420
score: 15

http://stackoverflow.com/comment/43314537
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27436881
has text: http://plnkr.co/edit/xHoi2Jgb3uLbIGWInI6Z

http://stackoverflow.com/comment/43160182
type: AnswerComment
comment on: http://stackoverflow.com/a/27353208
type: Comment
has text: Okay. The reason why i load the JS code at the end of the page is because from what i know, it will load faster. But since i'm just a beginner, thanks for your advices :)
score: 0

http://stackoverflow.com/a/27368464
score: 0
answers question: http://stackoverflow.com/q/27368081
has body: As an alternative to @abl and @Purag's good answers, you can also manually loop through the text, looking for non-space characters: var bioContent = $(".bio").html(); var hasContent = false; var characterToIgnore = ' '; for (var i=0;i&lt;bioContent.length;i++){ if (bioContent[i] != characterToIgnore){ hasContent = true; break; } } JSFiddle
type: Answer

http://stackoverflow.com/a/27444723
accepted answer of: http://stackoverflow.com/q/27444581
score: 2
has body: You need Date.parse var dateStr = "11/28/2014 11:00 am", date = new Date(), date.setTime(Date.parse(dateStr)); var formDate = new Date(date); console.log(formDate);
answers question: http://stackoverflow.com/q/27444581
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/27359095
accepted answer of: http://stackoverflow.com/q/27358694
has comment: http://stackoverflow.com/comment/43171199
has comment: http://stackoverflow.com/comment/43173232
has comment: http://stackoverflow.com/comment/43172741
has comment: http://stackoverflow.com/comment/43171090
has comment: http://stackoverflow.com/comment/43170458
type: AcceptedAnswer
has body: Use this: Home About Contact Awards Links and alter this: showViaLink($("aside .navigation a")); In your old code you cant reach the lik, because you always push the button and so you never triggered $(this).click(function() you just have to add some css and style your own buttons. This generator may be helpfull. EDIT: If you want to use die Buttons maybe this works: Home About Contact Awards Links jQuery: showViaLink($("aside .navigation")); // shows proper DIV depending on link 'href' function showViaLink(array) { array.each(function(i) { $(this).click(function() { var target = $(this).attr("id"); $(".container").css("display","none"); $(target).slideDown("slow"); }); }); }
score: 0
answers question: http://stackoverflow.com/q/27358694
has comment: http://stackoverflow.com/comment/43172869
type: Answer

http://stackoverflow.com/q/27388435
accepted answer: http://stackoverflow.com/a/27418585
has comment: http://stackoverflow.com/comment/43227628
type: AnsweredQuestion
tagged with: karma-runner
score: 1
upvote count: 1
type: Question
tagged with: testing
has comment: http://stackoverflow.com/comment/43225243
tagged with: javascript
has title: Angular Testing - promise not returning data
has body: I can't see why vm.chartData in my HomeCtrl never gets populated with the data i've mocked to it in the beforeEach(). the console.log(scope.vm.chartData) returns undefined even while the other scope vars like graphLoading are defined and changed properly. describe('HomeCtrl', function () { var controller, scope, myService, q, $timeout; beforeEach(module('dashboardApp')); beforeEach(inject(function ($controller, $rootScope, $q, _$timeout_) { controller = $controller; scope = $rootScope.$new(); $timeout = _$timeout_; myService = jasmine.createSpyObj('Chart', ['get']); q = $q; })); describe('when returning promises', function () { beforeEach(function () { myService.get.and.returnValue(q.when( { result: 'Stuff' })); controller('HomeCtrl as vm', { $scope: scope, Chart: myService }); scope.$apply(); }); it('test dirty graph init', function () { expect(scope.vm.graphLoading).toBe(true); scope.vm.dirtyTestGraph(); scope.$digest(); $timeout.flush(); expect(scope.vm.graphLoading).toBe(false); console.log(scope.vm.chartData); }); }); }); relevent code from homectrl vm.dirtyTestGraph = function() { vm.graphTitle = 'Deposit Amount'; $timeout(function(){ Chart.get( { interval:'3h', type:'_type:deposit', from:1416960000000, to:Date.now() } ) .then(function(chart){ vm.graphLoading = false; vm.chartData = chart.data; }); }, 2000); }; and here is the return value of Chart.get in the Chart factory return $q.all([chartData]) .then(function(data){ var graphData = data[0].data.facets[0].entries; var newData = []; graphData.forEach(function(element){ var newElem = { time: element.time, deposits: element.total.toFixed(2) }; newData.push(newElem); }); return new Chart(newData); });
has comment: http://stackoverflow.com/comment/43225746
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/27418585
tagged with: jasmine
has comment: http://stackoverflow.com/comment/43238803
favorite count: 0
has comment: http://stackoverflow.com/comment/43267075
tagged with: angularjs

http://stackoverflow.com/comment/85303787
comment on: http://stackoverflow.com/a/27402943
has text: Of course it would be bad practice to add styling to all TDs like this. It is better to add classes instead and style those.
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/43167853
comment on: http://stackoverflow.com/a/27314717
type: Comment
has text: @RossBeer I have updated the answer and added a fiddle to demonstrate the dynamic change of the name attribute. As I comment in the answer, I would prefer the name/ array variant in your case for example mac[], seats[].
type: AnswerComment
score: 0

http://stackoverflow.com/a/27415224
downvote count: 0
has comment: http://stackoverflow.com/comment/43308304
has comment: http://stackoverflow.com/comment/43295408
has body: The DOM (Document Object Model) which represents the contents of a Chrome App window is initiated from an HTML file, but from that point on you can't change it by referencing any other file, which is what you're expecting navigation to do. (&lt;a&gt; elements that navigate to an external browser via a "target=_blank" attribute are perfectly OK.) However, you are free to change the DOM from your JavaScript at runtime. If you like, set an event handler on the &lt;a&gt; element and change the DOM as you wish. If you want to change the DOM via HTML (not from a file), you might find the JavaScript method insertAdjacentHTML useful. Actually, you can get the HTML from a file, but you have to read that file yourself with the Chrome App file I/O API. Advice in another answer to use a framework is, in my opinion, overkill. If you think of a Windows app, a Mac app, or any other kind of GUI-based app, you would never assume that you could just change the UI over to something completely different by referencing an HTML file. Think of a Chrome App as being similar to those technologies in that sense, and you'll be on the right track.
score: 3
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/27405918
has comment: http://stackoverflow.com/comment/43303816

http://stackoverflow.com/q/27340024
tagged with: php
has comment: http://stackoverflow.com/comment/43145963
has comment: http://stackoverflow.com/comment/43136406
score: -1
has body: I'm new to JS and PHP and currently have a key I need to use in JavaScript; but I don't want the user to be able to view the code and see it. I tried putting the key in PHP and echoing it for the JS variable that holds the key, but that will just print it out anyways. How can I use the key in JavaScript without allowing users to view the source? EDIT: I'm using an API key to get data and use that data in functions.
type: Question
has answer: http://stackoverflow.com/a/27340589
has comment: http://stackoverflow.com/comment/43136710
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43136465
has title: Secure key with PHP?
has comment: http://stackoverflow.com/comment/43136503
upvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27374616
has comment: http://stackoverflow.com/comment/43211091
has title: How to update a record using updateAttributes with sequelize.js and node.js
has comment: http://stackoverflow.com/comment/43200875
downvote count: 0
has comment: http://stackoverflow.com/comment/43200020
has comment: http://stackoverflow.com/comment/43200130
has comment: http://stackoverflow.com/comment/43200174
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/43199853
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43199836
has comment: http://stackoverflow.com/comment/43200032
tagged with: sequelize.js
has comment: http://stackoverflow.com/comment/43199576
has comment: http://stackoverflow.com/comment/43200193
has comment: http://stackoverflow.com/comment/43199989
tagged with: node.js
answer count: 0
type: UnansweredQuestion
has body: I have a database table called adresses where I want to update any field by submitting a form. so, lets say I want to update the field name: I have the HTML input field: &lt;input type="text" name="name" /&gt; Then I have this method in Node.js: var changeName = function(cb){ db.addresses.find({where : {id: '21' }}) .success(function(name){ db.addresses.updateAttributes({name: req.body.name}) .success(function(){ cb(null) }) .error(cb); }) .error(cb); } When I submit the form, nothing happens and I dont get an error. What am I doing wrong here? Any help is highly appreciated
upvote count: 1
type: Question

http://stackoverflow.com/q/27351422
type: Question
has title: Need to enable a button when click a button in another page in php/javascript
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43156888
answer count: 1
tagged with: jquery
has body: my Question is the 1st user logged in one page and has one button.2nd user logged in his page .he has one disable button.when 1st user click the button the 2nd user disable button will be enabled in php/javascript.is this possible? Thanks in advance.
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/27351462
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43156885

http://stackoverflow.com/comment/43349360
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27453805
has text: OK, those answers in the other question provide just answers how to parse whole JavaScript. I could now spend some time designing a grammar or making sure that only objects are read in the AST tree and then convert them manually to normal objects. But my question is: is there something which is already made for parsing only JavaScript objects.
score: 0

http://stackoverflow.com/a/27420704
has comment: http://stackoverflow.com/comment/43284162
answers question: http://stackoverflow.com/q/27419607
type: AcceptedAnswer
score: 0
has body: Since ng-options is a priority 0 directive your directive's link function cannot be guaranteed to fire after it: Angular 1.3.7 Compile Docs. priority When there are multiple directives defined on a single DOM element, sometimes it is necessary to specify the order in which the directives are applied. The priority is used to sort the directives before their compile functions get called. Priority is defined as a number. Directives with greater numerical priority are compiled first. Pre-link functions are also run in priority order, but post-link functions are run in reverse order. The order of directives with the same priority is undefined. The default priority is 0. To achieve the desired behavior you will want to pass your objects into a directive that creates the select element in its template. This is a very good example: https://stackoverflow.com/a/14586825/1861459. This should move your link method invocation to the correct part of the directive lifecycle (after the compile is completed for the directives in your template). You would also change restrict: 'AE', to restrict: 'E', and change your HTML to something like &lt;selectric addresses="{{ search.result.addresses }}" ...&gt;&lt;/selectric&gt;
type: Answer
has comment: http://stackoverflow.com/comment/43284273
accepted answer of: http://stackoverflow.com/q/27419607

http://stackoverflow.com/comment/43209066
comment on: http://stackoverflow.com/a/27379368
score: 0
type: AnswerComment
has text: also not work , i will post my code , please check it , tell me why it is not working
type: Comment

http://stackoverflow.com/a/27475252
score: 0
has body: I think this is what you're looking for. Basically, set a flag when you've clicked on the box. If the mouse is dragged AND the flag is true, then rotate. int boxX, boxY; // position of box int boxRadius; // width of box / 2 float boxAngle = 0.01; // keep track of angle of rotation boolean inBox = false; // are we clicking in the box? // have we clicked in the box? void mousePressed() { if (mouseX &gt; boxX-boxRadius &amp;&amp; mouseX &lt; boxX+boxRadius &amp;&amp; mouseY &gt; boxY-boxRadius &amp;&amp; mouseY &lt; boxY+boxRadius) { inBox = true; } // stop behavior when we release the mouse void mouseReleased() { inBox = false; } // rotate! void mouseDragged() { if (inBox) { pushMatrix(); translate(boxX, boxY); rotate(radians(boxAngle)); fill(255,150,0); rect(0,0, boxRadius*2, boxRadius*2); popMatrix(); // update the angle each frame boxAngle += 0.1; } }
type: Answer
answers question: http://stackoverflow.com/q/27383435

http://stackoverflow.com/comment/43414547
comment on: http://stackoverflow.com/q/27464274
has text: I figured it out. I was having a scope issue with the farmList. Thanks for the help fellas!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27407516
upvote count: 1
downvote count: 0
score: 1
type: Answer
has body: TL/DR - skip to 3 as it's probably most relevant, but I've included the rest for completeness. I assume you're putting the console.log... line in the "click .delete-current-chapter" callback? The currentChapter variable is going to be local to that function, so you won't get anything by entering that in the console. Apologies if that's obvious, but it's not clear that you're not doing this from the question. Even in the callback, currentChapter is going to be a cursor, not a document or array of documents. Use findOne to return a single doc (or null), or find(query).fetch() to return an array (which in this case should probably be just one doc). Where and when are you trying to subscribe to singleChapter? If it's in the callback, you have to bear in mind that this isn't a reactive function. This means that you'll subscribe (once you know the _id to which to subscribe), but immediately return currentChapter before the collection is actually ready (and thus doesn't have anything in it). In this case, the callback won't rerun once the collection is ready as event handlers aren't reactive. The easiest way to resolve this would be to use the onReady callback when you subscribe, and set currentChapter in there. The alternative would be a self-stopping Tracker.autorun in the event handler, but this seems like overkill. As a final point, you need to be a bit careful about subscriptions with this sort of setup, as you can easily accumulate dozens and dozens of them per client, with none of the automatic subscription stopping that Iron Router provides. Given this use case, it's probably preferable to stop the subscription as soon as your callback has run and the item in question has been deleted.
answers question: http://stackoverflow.com/q/27406899

http://stackoverflow.com/a/27465547
has body: What version of Knockout are you using? I can't re-create this behavior. Here is a snippet I ran on JSbin with KO 3.0 and running it does not cause the result read function to evaluate until you call getResult() var vm = function() { var holder = ko.observable(); var makeAjax = function() { holder('new value'); }; var result = ko.computed({ read: function() { console.log('excuting read') makeAjax(); return holder(); }, write: function(newValue) { console.log('setting holder to ' + newValue) //not relevant holder(newValue) }, deferEvaluation: true }); result.subscribe(function(val) { console.log(val); }); this.getResult = function() { return result; } this.setResult = function(val) { result(val); } } var VM = new vm(); ko.applyBindings(VM); VM.setResult("test");
answers question: http://stackoverflow.com/q/27465299
has comment: http://stackoverflow.com/comment/43382049
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43388216
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27465299

http://stackoverflow.com/q/27409977
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43267032
tagged with: javascript
has title: unexpected d3.stack() output
has body: I'm using d3's stack layout for the first time to produce a stream graph. This code: var w = 600, h = 350; var x = d3.scale.linear().range([0, w]) y = d3.scale.linear().range([h, 0]) //... d3.csv("filePath", function(error, input)){ var data = parseData(input); setDomains(data); //sets x and y domain values. These are return expected values var svg = d3.select("body").append("svg") .attr("width", w) .attr("height", h) //.attr("height", h*3) is used to produce second result .append("g") //.attr("transform", "translate(0, 250)"); is used to produce second result var stack = d3.layout.stack().offset("silhouette"), layers = stack(data); var area = d3.svg.area() .interpolate("basis") .x(function (d, i) {return x(d.x);}) .y0(function (d) {return y(d.y0);}) .y1(function (d) {return y(d.y0 + d.y);}); svg.selectAll(".layer") .data(layers) .enter().append("path") .attr("class", "layer") .attr("d", function (d) {return area(d);}) .style("fill", function (d, i) {return color(d[0].type);}); is giving me this output: By increasing the height of the svg and translating the parent g down by 240px (see comments in code), I get my expected result: The scale of those images is a bit off - in reality, I'm getting the same graphic, but it's placed ~250 pixels higher than expected. I'm trying to understand why might that be? I can post setDomains() if needed, but my x() and y() functions are returning expected outputs for given inputs in debugging - i.e. a call to y(maxDataVal) returns 0, as expected. I'm thinking this is related to something I'm not understanding about stack(), which hopefully is evident in the above.
downvote count: 0
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43266127
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/43266650

http://stackoverflow.com/comment/43115471
comment on: http://stackoverflow.com/q/27328233
type: Comment
type: QuestionComment
has text: Now, if you're trying to schedule *recurring* events, so that meeting in May is still happening every week or whatever when we get to December, then yes, you have to store the local time and time offset instead of just storing UTC.
score: 1

http://stackoverflow.com/q/27465219
has answer: http://stackoverflow.com/a/27465258
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27465258
score: 0
answer count: 1
tagged with: jquery
has body: I have a really simple accordion that I am building and I want to set ti to open ALL of the containers on page load. Getting it to open a single item (or no item) is no problem but how can I get it to open all of the items on page load. HTML My Title" my super cool content My Second Title" more super cool content jQuery jQuery(document).ready(function($){ var headers = ["H1" , "SPAN"]; $('.accordion h1.accTitle').eq(0).addClass('active'); $('.accordion div.accContent').eq(0).show(); $(".accordion").click(function(e) { var target = e.target, name = target.nodeName.toUpperCase(); if($.inArray(name,headers) > -1) { var subItem = $(target).next(); //slideUp all elements (except target) at current depth or greater var depth = $(subItem).parents().length; var allAtDepth = $(".accordion div.accContent").filter(function() { if($(this).parents().length >= depth && this !== subItem.get(0)) { return true; } }); $(allAtDepth).slideUp("fast"); //slideToggle target content and adjust bottom border if necessary subItem.slideToggle("fast",function() { $(".accordion .accTitle :visible:last").css("border-radius","0 0 10px 10px"); }); // $(target).css({"border-bottom-right-radius":"0", "border-bottom-left-radius":"0"}); } }); $('.accordion h1.accTitle').last().addClass('accTitleLast'); $('.accordion .accTitle').click(function(){ $(this).toggleClass('active').siblings('.accordion .accTitle').removeClass('active'); }); }); Here is a link to what I have on jsFiddle: http://jsfiddle.net/bbyrdhouse/a6cscLjn/3/ Thanks
has title: Set Accordion to Open All Accordions
type: AnsweredQuestion

http://stackoverflow.com/comment/43160335
has text: Well i followed that from bootstrap page. I mean both the libraries are for bootstrap. U can take a look at this link http://getbootstrap.com/examples/jumbotron/ and look at their index.php on the very end of the pages :|
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27353208
type: Comment

http://stackoverflow.com/a/27355595
score: 0
type: Answer
has body: There are two ways of doing this: load the scripts in the order you want to access them, or don't start executing your scripts until the page the has loaded (recommended, as this ensures that everything is definitely loaded!). Either way you can reference your variables as if they were in the same file - you do not need to re-declare them with 'var'.
answers question: http://stackoverflow.com/q/27355397

http://stackoverflow.com/q/27344005
has title: html draw submit form in the same form using switch() JS
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I am new in programming and I need to make a DB insert using jsp. My probem is that I have my page with choose option (see img), and when I press "Display form to insert" button I want to have in the same page the rows (enter name and enter adresse) for this table from my DB. the used code is: Choose Table Name : univer client company departament employee person promotion service subsidiary
accepted answer: http://stackoverflow.com/a/27345870
type: AnsweredQuestion
tagged with: java
tagged with: servlets
type: Question
tagged with: jsp
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27345870

http://stackoverflow.com/a/27349199
downvote count: 0
has comment: http://stackoverflow.com/comment/106678051
type: Answer
upvote count: 3
score: 3
has body: You should exit out of the loop as soon as you know that it's not a prime, otherwise the result will be overwritten in the next itaration. There is actually no point in having the else clause (as it just sets the same value over and over), just set that value before the loop: prime = "this is a prime number"; for (var l = 2; l &lt;= Math.sqrt(total); l++) { if (total % l == 0) { prime = "this is not a prime number"; break; } } Side note: You don't need to check the values 2 and 3 separately before the loop, those will be catched by the first two iterations in the loop.
accepted answer of: http://stackoverflow.com/q/27349165
answers question: http://stackoverflow.com/q/27349165
type: AcceptedAnswer

http://stackoverflow.com/comment/43244331
comment on: http://stackoverflow.com/a/27398342
type: AnswerComment
has text: We didn't deal with that scenario at the moment. I guess once you know when to force logout, it should be easy to disable browser back button.
type: Comment
score: 1

http://stackoverflow.com/comment/43242423
comment on: http://stackoverflow.com/a/27398181
has text: @KalhanoToressPamuditha then on logout i will have to remove all this data from localStorage? is it safe ?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45564997
score: 4
has text: The sanitizer has a hard-coded list of allowed attributes, which means there is no built in feature to add your own, and data-attributes will by default be removed. You cak check the source https://github.com/angular/angular.js/blob/master/src/ngSanitize/sanitize.js
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27348558

http://stackoverflow.com/a/27344651
score: 5
accepted answer of: http://stackoverflow.com/q/27344626
upvote count: 5
has comment: http://stackoverflow.com/comment/43144595
answers question: http://stackoverflow.com/q/27344626
type: AcceptedAnswer
downvote count: 0
has body: There is no technological way to enforce copyright. DRM doesn't work on complex systems where the hardware vendors collaborate to try to enforce it, let alone on open standards. Use copyright law instead.
type: Answer
has comment: http://stackoverflow.com/comment/43144609

http://stackoverflow.com/q/27417160
favorite count: 0
has title: Clearing uikit html editor
upvote count: 2
type: UnansweredQuestion
tagged with: getuikit
score: 2
has body: i am trying to clear the content of my uikit html editor after saving data of when closing/cancelling my modal. i tried clearing it with these codes: $("#description").val(''); $('#description').attr('data-uk-htmleditor'); $.UIkit.htmleditor('#description', { /* options */ }); but it's still not working. does anyone here can help me? EDIT: here's my other codes for pulling the data from the database: function editTask(id){ key = id; s_type = 'u'; console.log(s_type); enableForm('#task'); $('#btn-save-task').hide(); $('#btn-save-edited-task,#btn-cancel-task').show(); $.ajax({ type: "GET", url: baseUrl+"/opportunities/getInfo/task/"+id, async : true, data : { getType : "getTask" }, dataType: 'json', error : function(req,error){ notify(req.statusText,'warning'); }, success: function(data){ $("#taskDescription").val(data.description); $('#taskDescription').attr('data-uk-htmleditor'); $.UIkit.htmleditor('#taskDescription', { /* options */ }); } }); }
type: Question
has comment: http://stackoverflow.com/comment/43279868
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27417339
has comment: http://stackoverflow.com/comment/43279763
has comment: http://stackoverflow.com/comment/43279245
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43262783
comment on: http://stackoverflow.com/a/27409215
type: AnswerComment
has text: What benefit does this have?
score: 0
type: Comment

http://stackoverflow.com/a/27461717
has comment: http://stackoverflow.com/comment/43361866
has comment: http://stackoverflow.com/comment/43359922
has body: what about &lt;body onload="myFunction()"&gt; and &lt;script id="wpcp_css_disable_selection" type="text/javascript"&gt; function myFunction(){ var e = document.getElementsByTagName('body')[0]; e.setAttribute('unselectable','on'); }; &lt;/script&gt; which makes sure, DOM is set up and then function will be called. i suspect DOM is not ready yet when your function is called. just a guess. may also be wrong
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27461660
has comment: http://stackoverflow.com/comment/43359780

http://stackoverflow.com/q/27382951
has body: I've been going through the rot.js tutorial located here and I'm making sense of the majority of the examples. However, I'm confused by one line of code and I was hoping someone could explain what's going on. This is in the Game._generateBoxes function toward the bottom of the page: var key = freeCells.splice(index, 1)[0]; I understand that it's removing one element from location index from the freeCells array and assigning it to key. I don't understand what the [0] is doing at the end. I tried removing it and it appeared to function normally. What is this accomplishing?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27382988
type: Question
has title: Splice confusion
has comment: http://stackoverflow.com/comment/43214512
tagged with: javascript
has answer: http://stackoverflow.com/a/27382988
score: 0
answer count: 1

http://stackoverflow.com/q/27356619
type: AnsweredQuestion
has body: Hi I need to combine 2 error checking procedures. I dont use jquery I only want these values appear 0123456789, My HTML, i need to know the pattern for other instances of my website &lt;input type="text" pattern="?" maxlength="10" id="f2f11c3" value="0"&gt;&lt;/input&gt; My JS document.getElementById("f2f11c3").addEventListener("keyup", function(){addcommas("f2f11c3")}, false); . function addcommas(id) { //i dont know what to place here //every 3 numbers must have a comma //ie. input is 123.c39,1mc //it must also remove if a comma is placed manually //result must be 123,391 } Hope someone could help. Thanks!
favorite count: 0
has comment: http://stackoverflow.com/comment/43166307
has answer: http://stackoverflow.com/a/27357036
has comment: http://stackoverflow.com/comment/43165935
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Javascript Numbers and Comma with input pattern
score: -2
tagged with: regex
accepted answer: http://stackoverflow.com/a/27358921
answer count: 3
downvote count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/43169386
possible better answer: http://stackoverflow.com/a/27357962
tagged with: mobile
has answer: http://stackoverflow.com/a/27357962
has comment: http://stackoverflow.com/comment/43169547
tagged with: javascript
has comment: http://stackoverflow.com/comment/43165818
has answer: http://stackoverflow.com/a/27358921

http://stackoverflow.com/comment/43389679
comment on: http://stackoverflow.com/a/27475237
type: AnswerComment
score: 0
type: Comment
has text: @Bergi: The fresh-created anonymous function has access to the entire scope in which the op's code is being executed. By only passing an `eval` reference to the `$.get` method, you execute it in the scope of the jQuery library, which may be isolated from the Graphie library. It's just a hunch, but this could well be the problem.

http://stackoverflow.com/comment/43228537
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27389821
score: 2
has text: You are probably trying to get the value too early before even angular has a chance to process it. `innerHtml` should be `innerHTML` and try wrapping it in timeout. `setTimeout(function(){ console.log(document.getElementById('someDiv').innerHtml); });` http://jsbin.com/lodazaxose/4/edit

http://stackoverflow.com/comment/43149962
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27346402
has text: Which code? I did it with first scenario but I want to know how to do it with second one.

http://stackoverflow.com/comment/43204910
score: 0
type: Comment
type: QuestionComment
has text: It may be worth if you put the code that converts the bytes in an actual image
comment on: http://stackoverflow.com/q/27377671

http://stackoverflow.com/comment/43224465
comment on: http://stackoverflow.com/a/27386224
type: AnswerComment
score: 0
type: Comment
has text: I think I understand. To restate: while it can be done in the parser, it may be simpler to fold a stream of tokens to tokens with meta-information that lets the parser identify places where semicolons can be; instead of complicating the grammar by explicitly matching "ignorable" tokens as in `statement := expression (ignorables semi | negative_lookahead(ignorables (line_terminator | multiline-comment) ignorables (infix_operator | postfix_op | ...))`

http://stackoverflow.com/q/27328597
has comment: http://stackoverflow.com/comment/43117085
has answer: http://stackoverflow.com/a/27332382
favorite count: 0
possible better answer: http://stackoverflow.com/a/27332382
has comment: http://stackoverflow.com/comment/43117046
has answer: http://stackoverflow.com/a/27328629
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27363855
has body: What can I do to simulate or use the onblur functionality for a TR. Here's my jsfiddle http://jsfiddle.net/davomarti/4L859p5t/2/ val1_1 val1_2 val1_3 val2_1 val2_2 val2_3 function showEditRow( rowId ) { var editElemId = "#edit_" + rowId; var viewElemId = "#view_" + rowId; $(viewElemId).hide(); $(editElemId).show(); } function showViewRow(rowElem) { var editElemId = "#edit_" + rowId; var viewElemId = "#view_" + rowId; $(viewElemId).show(); $(editElemId).hide(); } I have coded onblur for the TR and I know that doesn't work for a TR. I want to click on a row and get the edit boxes to replace the text, then when I click out of the row, I want the edit boxes to be replaced by the text TR.
score: 1
has title: onblur functionality for TR
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43115913
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/27363855

http://stackoverflow.com/comment/43244411
has text: @RoToRa , OP said "However, if I have a page that shows for example 100 rows from database, then its loading is not fast (at comparison to short pages)." No webserver will render a page before it's done with the server-side processing. That's all he asked for.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27398648

http://stackoverflow.com/a/27394309
answers question: http://stackoverflow.com/q/27394148
score: 0
type: Answer
has body: I just wrote a piece of code for your problem. Try it. The logic is all the same loop in all inputs ^ then search the name in array &amp; disable it. yesListStrings = ['14','12']; $('#click_me').on('click', function() { $('input[type="text"]').each(function() { if(jQuery.inArray(this.name,yesListStrings) != -1) { $('input[name="'+this.name+'"]').attr('Disabled',true); } }); }); http://jsfiddle.net/z59kmm96/
has comment: http://stackoverflow.com/comment/43278404
has comment: http://stackoverflow.com/comment/43236790

http://stackoverflow.com/a/27333926
score: 0
has body: The previous answer is right. What you can do is reconstruct your selections to be an object like { arrObjs : [ your array will be here], models: [...], manufacturers:[...] }
type: Answer
answers question: http://stackoverflow.com/q/27333398

http://stackoverflow.com/a/27381008
type: Answer
has comment: http://stackoverflow.com/comment/43211244
has body: You have two major syntax errors: 1- You have two function with the same name! populate. 2- The call of the function's parameters in the second list is wrong populate('slct2' 'slct1','slct3')" there should be a , between slct2 and slct1. Checkout this DEMO: http://jsbin.com/xameye/1/
score: 0
answers question: http://stackoverflow.com/q/27380546

http://stackoverflow.com/comment/43331261
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27411562
has text: @Pointy yes you have to test it in a seperate local file, not on JSFiddle. The problem is unsolved but my workaround - until a better solution is found here - is to put all internal JavaScripts also into a external file since the external files will be loaded in the correct order.
score: 0

http://stackoverflow.com/comment/43099889
type: Comment
comment on: http://stackoverflow.com/a/27320228
score: 1
type: AnswerComment
has text: Sure, but as a practical matter, I would hardly recommend confusing someone who doesn't know how to write an if statement to compare something to undefined with arcana such as `void 0` and its relationship to the practically non-existent probability of `undefined` having been redefined, something I have actually never seen once in more than a decade of JS programming.

http://stackoverflow.com/q/27350551
tagged with: timer
has comment: http://stackoverflow.com/comment/43155803
has title: Pause, Increase & Decrease Interval
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has body: I am currently writing a code to create a slideshow. My pause button works one time around but once it starts playing again and then doesn't pause again. &amp; same thing once i press the increase button. decrease button doesn't work. I have tried anything. Can someone point me in the right direction or let me know what is wrong. http://jsfiddle.net/#&amp;togetherjs=7F7KQf0TtS var pic= new Array(); var pcount= 0; var pindex = 0; var ptimer; var cap= new Array(); var ccount= 0; var cindex = 0; var ctimer; var resetButton = document.getElementbyId('resetButton'); resetButton.onclick= reloadPage; function getallpics(){ var size = prompt("How many pictures are you uploading?"); for (var i = 0; i&lt;size; i++) { pic[i] = prompt("Enter picture filename:"); pindex++; cap[i] = prompt("Enter caption:"); cindex++; } } function getpics() { pcount++; if (pcount &gt; pindex) { pcount = 1; } document.getElementById("pictures").innerHTML= "&lt;img src=" +pic[pcount-1]+ "&gt;"; } function getcaps(){ ccount++; if(ccount &gt; cindex){ ccount=1; } document.getElementById("captions").innerHTML = cap[ccount-1]; } function displaypics() { ptimer = setInterval("getpics()", 3000); ctimer = setInterval("getcaps()", 3000); } function pause(){ clearTimeout(ptimer); clearTimeout(ctimer); } function increase() { ptimer = setInterval("getpics()", 1000); ctimer = setInterval("getcaps()", 1000); } function decrease() { ptimer = setInterval("getpics()", 6000); ctimer = setInterval("getcaps()", 6000); } function reloadPage(){ window.location.reload(); }
has comment: http://stackoverflow.com/comment/43155670
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43155792
score: 0
tagged with: intervals

http://stackoverflow.com/q/27418353
has answer: http://stackoverflow.com/a/27418979
score: 2
upvote count: 3
tagged with: whitespace
downvote count: 1
has comment: http://stackoverflow.com/comment/43279912
type: Question
tagged with: java
tagged with: javascript
has body: I am writing lots of whitespaces as you can see the code below. out.println("new Array('1453 12999 ALPER KOPUZ')"); unfortunately when code compiles and run the code in the screen I am able to see it as "1453 1299 ALPER KOPUZ". It means it auto removes whitespaces and put only one whitespace after one word.It works fine at older versions of Internet Explorer but it does show line such like "1453 1299 ALPER KOPUZ" at Internet explorer which I need to fix and our application runs on this server. I tried css "white-space: pre;" but it is still same. This problem makes me crazy and ate my 3 hours. I would be glad if you have any idea to fix it. Cheers Alper Kopuz
has title: jsp page auto removes whitespaces
has comment: http://stackoverflow.com/comment/43283284
answer count: 1
tagged with: jsp
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43419567
type: AnswerComment
score: 0
type: Comment
has text: You will not find a viable sync solution for node js. It is async by nature. You should design your code accordingly or you'll face performance and compatability problems. Your mock a bow however supports async behaviour via the done callback. Are you sure async is not supported on the other parts of your code? I would advice you to read about nodes event loop and how it is diferent from multithreaded applications.
comment on: http://stackoverflow.com/a/27429156

http://stackoverflow.com/comment/43590615
type: AnswerComment
has text: I created another post in an effort to get this thing working using a timing trigger and a column that has Sent if emails have been sent for it. It wont send anything though, I bet you would know why...check it out if you want and Happy Holidays! [other post] (https://stackoverflow.com/questions/27583046/gas-to-scan-a-sheet-look-for-values-and-send-e-mail-wont-do-anything-thought)
type: Comment
comment on: http://stackoverflow.com/a/27488216
score: 0

http://stackoverflow.com/comment/43158951
comment on: http://stackoverflow.com/q/27328324
type: Comment
type: QuestionComment
score: 0
has text: I think you can do that even in the IE, Firefox and maybe others. But I wanted to do that more cleanly - in the code.

http://stackoverflow.com/q/27420531
type: Question
linked to: http://stackoverflow.com/q/8359085
tagged with: javascript
tagged with: jquery
score: 0
tagged with: delegates
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27420781
has title: Jquery - Delegate multiple element and multiple event
has body: Im just ask my question fast.(because my english is not so good) Can i use delegate like this or other similar way? $( 'body ').delegate({ 'input[type=text]': { 'change': function( e ) { //codes.. }, 'blur': function( e ) { //codes.. } }, '.ipsum': { 'click': function( e ) { //codes.. } } });

http://stackoverflow.com/a/27422235
accepted answer of: http://stackoverflow.com/q/27420777
answers question: http://stackoverflow.com/q/27420777
score: 0
has body: Try this, $("head").append(' ');
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27445559
tagged with: iframe
tagged with: stripslashes
has comment: http://stackoverflow.com/comment/43330235
has title: stripslashes() removes my src after iframe submission
type: Question
has comment: http://stackoverflow.com/comment/43330202
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43330337
has answer: http://stackoverflow.com/a/27446632
has body: I have this form: Entry Body: This is the iVideo() function: function iVideo(){ var vidSrc = prompt('Enter video embed code:',''); var iframe = document.getElementById('richTextField').contentDocument; iframe.writeln(" "+vidSrc); } The submit_form() function: function submit_form(){ var theForm = document.getElementById("myform"); theForm.elements["myTextArea"].value = window.frames['richTextField'].document.body.innerHTML; theForm.submit(); } And this is my_parse_file.php: <?php echo ' You posted: '.$_POST['title'].' '.stripslashes($_POST['myTextArea']); ?> I go to let's say Vimeo, take the embed code of a video (which is an iframe too) and paste it into the prompt input box which pops up when I press the "Embed video" button. The video appears in my iframe on my index.php page (where I have the "richTextField" iframe) as a result of my iVideo() function, I can play it (no problem till now). Then I press the submit button and the content of my iframe appears in "my_parse_file.php", BUT without my embeded iframe from Vimeo. I looked at the source code of "my_parse_file.php" and I saw that the iframe code of the video is still there, it has all the attributes but the src attribute is empty (src=""). And that's because of the stripslashes() function which should remove the backslashes (from what I know) resulted after form submission, but it seems like this removes the link from my src attribute for some reason. I tried to remove the stripslashes() function like this: echo ' You posted: '.$_POST['title'].' '.$_POST['myTextArea']; But then the src attribute looks like this: src="\"//player.vimeo.com/video/15077261\"" And this one isn't good too. What can I do to get a "clean" src? Original src: //player.vimeo.com/video/15077261 Desired output:
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43330117
tagged with: php

http://stackoverflow.com/a/27454286
type: Answer
answers question: http://stackoverflow.com/q/27454211
has body: You could use this: function elemPropVal(elem, prop){ var r = getComputedStyle(elem) || elem.currentStyle; return r[prop]; } console.log(elemPropVal(document.getElementById('someId'), 'backgroundColor'));
has comment: http://stackoverflow.com/comment/43347497
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/43352316
downvote count: 2
has comment: http://stackoverflow.com/comment/43386090

http://stackoverflow.com/comment/43213003
comment on: http://stackoverflow.com/a/27369056
has text: Yeah I'm all for decoupling too, will have to give it a go and see how noisy it looks within the app as a whole. Thanks for your suggestion :)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43307884
score: 0
type: Comment
has text: FYI, the "infinite scroll" you're speaking about is named "pageless". This might help as a google keyword if you need help with this in the future.
type: QuestionComment
comment on: http://stackoverflow.com/q/27385289

http://stackoverflow.com/comment/43345745
score: 0
type: QuestionComment
type: Comment
has text: I have to use document.write, as the iframe's content is dynamically generated using Javascript to determine content based on date and time.
comment on: http://stackoverflow.com/q/27442008

http://stackoverflow.com/q/27344775
type: AnsweredQuestion
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27486862
has answer: http://stackoverflow.com/a/27486862
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/27669400
score: 0
accepted answer: http://stackoverflow.com/a/27669400
tagged with: angularjs
has body: When start a new meanjs project (mongoose, angular etc.) using the generator and add a CRUD-module i get methods like this: $scope.findOne = function() { $scope.income = Incomes.get({ incomeId: $stateParams.incomeId }); In my income server model is shown below, it has some different attributes and some different object types on these attributes, for example, number, date and string. When i get data in my $scope.income after the promise "$scope.findOne" has succeded all my data are strings. Do i need to cast each and every one of them to their proper type? In my front end i want to present the different types in the input elements of my "update" view. For example: Date of transaction This does not work since the object $scope.income.date consists of a string. Changing the input type to string makes it show up. But I want to use a date picker here. Should I write something like: $scope.findOne = function() { Incomes.get({ incomeId: $stateParams.incomeId }).then(function(data){ var dateVar=new Date(data.date); var amountVar =Number(data.amount) $scope.income ={date: dateVar, name: data.name, amount:amountVar}() ); What is best practise here? Model I am using: 'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Income Schema */ var IncomeSchema = new Schema({ name: { type: String, default: '', required: 'Please fill Income name', trim: true }, amount: { type: String, default: '', required: 'Please fill Income amount', trim: true }, date: { type: Date, default: '', required: 'Please fill Income date', trim: true }, monthly: { type: Boolean, default: '', required: 'Please fill whether income is recurring monthly', trim: true }, yearly: { type: Boolean, default: '', required: 'Please fill whether income is recurring yearly', trim: true }, account: { type: Schema.ObjectId, ref: 'Account', required: 'Please select account' }, created: { type: Date, default: Date.now }, user: { type: Schema.ObjectId, ref: 'User' } })…
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/43191435
tagged with: node.js
has title: extend mean module findOne() to handle other attributes that strings

http://stackoverflow.com/a/27407915
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
has body: Test if the event target is .fa-gear $(document).click(function(event) { if($(event.target).is('.fa-gear')) { $('.options').show(); } else { $('.options').hide(); } });
type: Answer
accepted answer of: http://stackoverflow.com/q/27407870
answers question: http://stackoverflow.com/q/27407870

http://stackoverflow.com/comment/43342019
has text: I love the simplicity of your solution. Can you tell me how should I modify your code if elements don't have fixed width?
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27450575

http://stackoverflow.com/a/27320221
has body: You can do a strict comparison to the undefined value. if (x === undefined) { x = 0; } Naturally you'll want to be sure that x has been properly declared as usual. If you have any sensitivities about the undefined value being plagued by really bad code (overwritten with a new value), then you can use the void operator to obtain a guaranteed undefined.You can do a strict comparison to the undefined value. if (x === void 0) { x = 0; } The operand to void doesn't matter. No matter what you give it, it'll return undefined. These are all equivalent: if (x === void undefined) { x = 0; } if (x === void "foobar") { x = 0; } if (x === void x) { x = 0; } Ultimately if someone squashed undefined locally (it can't be squashed globally anymore), it's better to fix that bad code. If you ever want to check for both null and undefined at the same time, and only those value, you can use == instead of ===. if (x == null) { x = 0; } Now x will be set to 0 if it was either null or undefined, but not any other value. You can use undefined in the test too. It's exactly the same. if (x == undefined) { x = 0; } From your question, it seems a little bit like you're specifically looking for number elements, even NaN. If you want to limit it to primitive numbers including NaN, then use typeof for the test. if (typeof x !== "number") { x = 0; } However, you'll lose numeric strings and other values that can successfully be converted to a number, so it depends on what you ultimately need.
has comment: http://stackoverflow.com/comment/43100518
upvote count: 11
type: AcceptedAnswer
type: Answer
score: 11
accepted answer of: http://stackoverflow.com/q/27320166
answers question: http://stackoverflow.com/q/27320166
downvote count: 0
has comment: http://stackoverflow.com/comment/43100632

http://stackoverflow.com/comment/43188170
comment on: http://stackoverflow.com/a/27367819
type: Comment
has text: Silly me! It works!!!! I lovvvve it. If you ever need some SEO advices or linkbuilding feel free to let me know.
type: AnswerComment
score: 0

http://stackoverflow.com/a/27348587
has body: Looking at your JSFiddle, the problem is the way dropMarkers and dropMarkers2 is called. In your HTML, you have: Category #1 Category #2 Optionelements don't have an onclick method. What you need to do is attach a function to the select element's onchange method: Category #1 Category #2 This way, whenever an option is selected, dropMarkers is called, passing in the select element as its only argument (referred to by this). dropMarkers itself will have to be refactored to accept the new argument and process it. The additional advantage of this solution (besides merely working :)) is that you can get rid of the duplication in all your code. You won't need the dropMarkers2 function. You simply check what the value of the select element is in your function. (Note that we changed the option elements to have value attributes above.) function dropMarkers(target) { var option = target.value; // the `value` attribute of the `select` element passed in if (option == 1) { // drop the markers in set 1 } else if (option == 2) { // drop the markers in set 2 // ... } It will take refactoring your code, but it can come out on the other end much cleaner. There are a lot of things that could go into that, but for now, the takeaway point is that you call a function by attaching to the select element, and that the select element has an attribute called value, which is equal to the value attribute of whatever option element is selected. By passing in the select element to the function, you can then refer to the value of the element inside the function. If you understand that, you will be able to fix your problem.
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/27348146
type: Answer
upvote count: 0

file
type: Tag
tags question: http://stackoverflow.com/q/27403257
tags question: http://stackoverflow.com/q/27325508
tag name: file
tags question: http://stackoverflow.com/q/27352389
tags question: http://stackoverflow.com/q/27440032
tags question: http://stackoverflow.com/q/27455884
tags question: http://stackoverflow.com/q/27343656

http://stackoverflow.com/comment/43271941
score: 0
comment on: http://stackoverflow.com/q/27413602
type: QuestionComment
has text: `dateToTimestamp()` is not returning appropriate data. It seems that you're moving the "year" to the end of the string, which is not a [format recognized by Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse), causing an "Invalid Date" and returning "NaN". You should be able to pass the date you provided (1999-01-01) directly into `Date()` without first manipulating the string.
type: Comment

http://stackoverflow.com/q/27392907
has body: What is the idiomatic way to provide dependency injection for the following piece of javascript/nodejs ? I want to be able to replace util, cfg and call_hard with my own mocks in order to facilitate unit testing : /* file: platform.js */ var config = require('./config'), ConfigParser = require('./ConfigParser'), fs = require('fs'), util = require('./util'); function add(dir){ var xml = util.getConfigFile(dir); var cfg = new ConfigParser(xml); return call_hard(xml, cfg); } function call_hard(xml, cfg){ ... } module.exports.add = add; /* end of file: platform.js */ 1- What is the best way to write unit tests for this code ? I want to be able to replace util, cfg and call_hard with my mocks. I've been added the following code to my platform.js file. It allows me to provide my mocks (it doesn't feel idiomatic to me) : /* file: platform.js */ ... module.exports.set_util = function(new_util) { util = new_util; }; module.exports.set_cfg= function(new_cfg) { cfg = new_cfg; }; module.exports.set_call_hard= function(new_call_hard) { call_hard= new_call_hard; }; /* end of file: platform.js */ 2- Or should I just write integration tests and not bother ? 3- Any other suggestions on how to write better code / unit tests in JavaScript ? 4- Should I use any other libraries or tools or perspective ? Any suggestion is welcome.
tagged with: unit-testing
type: Question
tagged with: javascript
has title: Javascript Dependency Injection : How to mock dependencies of private variables/functions?
has comment: http://stackoverflow.com/comment/43243750
tagged with: mocking
downvote count: 0
tagged with: jasmine
favorite count: 0
type: UnansweredQuestion
tagged with: node.js
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/43236676
upvote count: 1

http://stackoverflow.com/q/27373237
tagged with: ruby
type: UnansweredQuestion
upvote count: 1
has title: TypeError: gapi.client.plus is undefined
score: 1
type: Question
answer count: 1
downvote count: 0
tagged with: google-plus
tagged with: javascript
favorite count: 0
tagged with: ruby-on-rails-3
has answer: http://stackoverflow.com/a/27553925
has body: I want to post message to google plus when a user logged in my Ruby on Rails application with his google plus credentials. I have tried the following code. &lt;script src="/../assets/plusone.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function writeAddActivity(url){ var payload = { "type":"http:\/\/schema.org\/AddAction", "startDate": "2012-10-31T23:59:59.999Z" }; if (url != undefined){ payload.object = { 'url' : "https://plus.google.com/js/client:plusone.js" }; }else{ payload.object = { "id" : "replacewithuniqueidforaddtarget", "image" : "http:\/\/www.google.com\/s2\/static\/images\/GoogleyEyes.png", "type" : "http:\/\/schema.org\/CreativeWork", "description" : "The description for the action", "name":"An example of AddAction", "src" : "https://plus.google.com/js/client:plusone.js" }; } gapi.client.plus.moments.insert( { 'userId' : 'me', 'collection' : 'vault', 'resource' : payload }).execute(function(result){ console.log(result); }); } But it's giving "TypeError: gapi.client.plus is undefined" . Could you explain what is the error and how to resolve it? Thanks in advance.

http://stackoverflow.com/q/27394365
has comment: http://stackoverflow.com/comment/43430584
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/27396033
has title: Wordpress database not inserting values posted via Ajax
type: UnansweredQuestion
tagged with: wordpress
has comment: http://stackoverflow.com/comment/43236932
tagged with: php
has body: I am trying to retrieve a user's email and store it in the database using Ajax. I can see the form Values in the console after the ajax request,but it doesn't store the data in the database. Everything else works fine,except that nothing is stored in the Database.Any help with be much appreciated. You can test this using any default Wordpress TwentyFourteen installation. I am providing the following files. .subsc.js is the subscription script, the functions to send info is in the functions.php file and my subscription widget has been included. Copy and past class subscribeFm extends WP_Widget { /** * Register widget with Wordpress */ function __construct() { parent::__construct( 'subscribe_widget', // Base ID __( 'Newsletter Subscription', 'text_domain' ), // Name array( 'description' => __( 'Displays Subscription form', 'text_domain'), ) // args ); } /* Front end Display of widget */ public function widget($args, $instance) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title']; ?> Signup <?php } // echo __('Subscribe to our mailing list', 'text_domain'); echo $args['after_widget']; } public function form( $instance ) { $title =! empty( $instance['title'] ) ? $instance['title'] : __('New title', 'text_domain' ); ?> <label for="<?php echo $this->get_field_id( 'title' ); ?>"> <?php _e( 'Title'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" > <?php } /** * Sanitize widget form values as they are saved * */ public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; return $instance; } } ?> Add this lines to function twentyfourteen_scripts() in functions.php /* Email Subscription queue */ wp_enqueue_s…
type: Question

http://stackoverflow.com/comment/43197070
has text: console.log(a) is undefined
comment on: http://stackoverflow.com/q/27373138
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27390147
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27389906
has body: Although you're not sharing much of that in your question, looks like all your other toggles have toggle2 as their class (&lt;div class="toggle2"&gt;&lt;/div&gt;). Add another one to the one you're trying to swipe (&lt;div class="toggle2 toggle-swipe"&gt;&lt;/div&gt;), and use that for your swipe script: $('.toggle-swipe').click(function() { /* code which switches between toggled on and toggled off */ }).disableSelection().swipe({ // ... });

http://stackoverflow.com/q/27326864
tagged with: audio
has title: Javascript getUserMedia exclusively microphone input without internal audio
has comment: http://stackoverflow.com/comment/43126238
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43112849
tagged with: web-audio-api
has comment: http://stackoverflow.com/comment/43134733
answer count: 0
type: UnansweredQuestion
has body: My goal is to play sound through speakers and analyze the audio coming in from the speakers. However, when I run getUserMedia for the audio input, I'm getting the microphone input AND the audio that is being sent out to the speakers. I've tested this in as many ways as I can think. I'm hoping that theres some option that I'm missing that makes this possible. There's code all over the place for getting microphone input such as this one which leads to this demo. When I play this video or any music from in my computer, it shows up in the audio input stream even if I have headphones on. Thus, the problem is that I cannot get exclusively microphone input... Any ideas how to make this happen?

http://stackoverflow.com/a/27364295
upvote count: 1
has comment: http://stackoverflow.com/comment/43181747
has comment: http://stackoverflow.com/comment/43181151
has body: Simply use an if statement for .hasClass: $("div").click(function(){ if($(this).hasClass("span1")){ alert("SPAN 1 CLICKED"); return true; } }); FIDDLE UPDATE: I read your question too quick, here is a new fiddle which targets your a's instead of the div NEW FIDDLE should be this instead: if($(this).closest("div").hasClass("span1")){
answers question: http://stackoverflow.com/q/27364250
has comment: http://stackoverflow.com/comment/43181069
downvote count: 0
has comment: http://stackoverflow.com/comment/43181160
score: 1
type: Answer

http://stackoverflow.com/q/27458755
has body: I am trying to trigger on drag event using jQuery. Please find the fiddle here http://jsfiddle.net/sgsvenkatesh/hepbob75/5/ I used this to trigger on drag event but it is not working. $(document).bind("mousedown", function () { ... }); This is acting like a on click event rather than a on drag event. The same code is working absolutely fine when I use mousemove instead of mousedown like $(document).bind("mousemove", function () { ... }); Is there a way to work on drag event? Or is there any other function which trigger on drag event? Please let me know if any further information is necessary.
has title: jQuery mousedown() function is not working to trigger on drag event
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27458806
linked to: http://stackoverflow.com/q/4127118
downvote count: 0
answer count: 1
tagged with: mousedown
accepted answer: http://stackoverflow.com/a/27458806
favorite count: 0
upvote count: 2
tagged with: drag
tagged with: bind
score: 2
type: AnsweredQuestion

overlay
tags question: http://stackoverflow.com/q/27392564
tags question: http://stackoverflow.com/q/27348861
tags question: http://stackoverflow.com/q/27465417
type: Tag
tag name: overlay

http://stackoverflow.com/comment/43117602
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27329599
has text: yeah it's fine. it's working perfectly in php. but problem is i need to get that data array like this `$temp = array([1,25000],[2,31700],[5,52900],[8,45000]);` in javascript
type: AnswerComment

http://stackoverflow.com/comment/43142363
comment on: http://stackoverflow.com/q/27342428
score: 0
has text: I imagine this is a very common use case, and I thought there must be someone else who already has this requirement, or figured out a workaround..
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43151978
type: QuestionComment
score: 0
has text: When I ran code snippet I got blank page for both...
comment on: http://stackoverflow.com/q/27348655
type: Comment

http://stackoverflow.com/q/27314704
tagged with: javascript
tagged with: google-maps-api-3
tagged with: google-maps
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43095268
favorite count: 0
has title: Cant get markers from XML
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43091467
tagged with: http://stackoverflow.com/tag/xml
has body: I cant get my map to show the markers which I am trying to get out of a XML file. I have tried a number of different tutorials and solutions with no avail, the code below was my last attempt at it before posting here. Here is what I have: Here is my code: (Index.html) Google Map of the WoW World Azeroth Outland Deepholm Draenor markers.js: // // Google Maps functions // // Google Maps vars var myLatlng; // Add the coordinates var mapOptions = {} var geocoder; var map; var defaultZoom = 10; var image; var xmlUrl; var infoWindow; var markers; var contactUrl; function downloadUrl(url,callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest; request.onreadystatechange = function() { if (request.readyState == 4) { //request.onreadystatechange = doNothing; callback(request, request.status); } }; request.open('GET', url, true); request.send(null); } function loadMarkers() { map.markers = map.markers || [] downloadUrl(xmlUrl, function(data) { var xml = data.responseXML; markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("name"); var marker_image = markers[i].getAttribute('markerimage'); var id = markers[i].getAttribute("id"); var address = markers[i].getAttribute("address1")+" "+markers[i].getAttribute("address2")+" "+markers[i].getAttribute("address3")+" "+markers[i].getAttribute("postcode"); var image = { url: marker_image, size: new google.maps.Size(71, 132), origin: new google.maps.Point(0, 0), scaledSize: new google.maps.Size(71, 132) }; var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var html = " " + name + " " + address+' '; var marker = new google.maps.Marker({ map: map, position: point, icon: image, title: name }); map.markers.push(marker); bindInfoWindow(marker, map, infoWindow, html); } }); } function bindInfoWindow(marker, map, infoWindow, html) { …
has comment: http://stackoverflow.com/comment/43090360
downvote count: 2
has answer: http://stackoverflow.com/a/27315588
has comment: http://stackoverflow.com/comment/43092182
has comment: http://stackoverflow.com/comment/43092644
type: Question
score: -2

http://stackoverflow.com/comment/43145917
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27344672
type: Comment
has text: @zooney The solution will still work for your edited array, as long as they should be sorted according to `Id` property. The objects can have any number of other properties having different values...

http://stackoverflow.com/comment/43310702
type: AnswerComment
type: Comment
has text: And Wayne shows yet another concept which is the client-side Viewmodel. This is something that Angular is opening up and the community appears to be running to client side View Models, Controllers and even Routing.
comment on: http://stackoverflow.com/a/27434815
score: 0

http://stackoverflow.com/a/27370228
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27370124
upvote count: 3
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/27370124
has body: I have seen a number of structures using exports, module.exports and even prototype, and it has left me wondering which method is considered best practice and why? Things which had a .prototype were constructor functions, and the module exported them as a class to be instantiated. Exporting normal objects (as literals usually) or even extending the by-default-empty exports object is used when you want to export a "singleton" object with static properties, a "namespace" so to say. module.exports = new Helper() This is almost always wrong. The Helper is totally unnecessary, and typically even objectionable. You should go with your Option 2. If you really did export only a single function you might consider module.exports = function urlise(orgString){…}, but to export several functions accessible on the module your Option 2 is exactly the pattern to use.

http://stackoverflow.com/comment/43312173
type: AnswerComment
comment on: http://stackoverflow.com/a/27435141
type: Comment
has text: Very comprehensive answer, thank you. I have used the context option, which works perfectly
score: 0

http://stackoverflow.com/q/27332452
has body: I have a php form showing via a iframe in parent window, the php form scrollTop on its own ok, but once in a iframe in the parent window page, it just jumps directly to error. Is there a way to add to the code below to make it scrolltop in the iframe in the parent window? $(function () { $("#frmFormMail").validate({ invalidHandler : function() { $('html, body').animate({ scrollTop: $("#frmFormMail").offset().top // scroll top to your form on error }, 'slow' ); }, // Specify the validation rules rules: { field_0: { // Title required: true, minlength: 3 }, field_1: { // Full Name required: true, email: true, minlength: 5 }, field_2: { // Address required: true, minlength: 20 }, field_3: { // Age required: true, minlength: 2 }, field_4: { // Marital Status required: true, minlength: 3 }, field_5: { // Children required: true, minlength: 1 }, field_6: { // Nationality required: true, minlength: 3 }, field_7: { // Health required: true, minlength: 10 }, field_8: { // Glasses required: true, minlength: 3 }, field_9: { // Car Licence required: true, minlength: 10 }, field_10: { // Nationality required: true, minlength: 3 }, field_11: { // Website of interest 1 required: false, minlength: 5 }, field_12: { // Website of interest 2 required: false, minlength: 5 }, field_13: { // Applying for Position required: true, minlength: 3 }, field_14: { // Resume required: true, //Put the allowed file types accept here if required - add remove more extention type as required. accept: "jpg|jpe|jpeg|png|mp3|wav|aac|rtf|odt|doc|docx|pdf|txt" }, field_15: { // Cv required: true, //Put the allowed file types accept here if required - add remove more extention type as required. accept: "jpg|jpe|jpeg|png|mp3|wav|aac|rtf|odt|doc|docx|pdf|txt" }, field_16: { // Present Job required: true, minlength: 10 }, field_17: { // When can You Start required: true, minlength: 3 }, field_18: { // Relocate Dropdown required: true // required: false not a required field, required: true required field }, fiel…
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43145098
has comment: http://stackoverflow.com/comment/43123530
has comment: http://stackoverflow.com/comment/43123088
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43122796
score: 0
has title: Can jQuery invalidHandler ScrollTop Via Iframe in Parent Window
tagged with: iframe
has comment: http://stackoverflow.com/comment/43123154
has answer: http://stackoverflow.com/a/27347394
type: Question
has comment: http://stackoverflow.com/comment/43123571
tagged with: javascript

http://stackoverflow.com/a/27465458
score: 0
answers question: http://stackoverflow.com/q/27465416
type: Answer
has body: Try this. You are returning IQuerable. [HttpGet] public JsonResult GetTestimonialsList() { var model = _spdb.TestimonialDetails.Where(t =&gt; t.Status == Enums.TestimonialsStatus.approved).Select(t =&gt; new { t.Comment, t.Name, t.Date}).ToList(); return Json(model, JsonRequestBehavior.AllowGet); }

http://stackoverflow.com/a/27392816
answers question: http://stackoverflow.com/q/27392756
type: Answer
score: 0
has body: Your second method is kind of good enough. Maintain a global object myObjs for searching, whose keys are name and the values are object itself. For each of the objects like: var obj = { name : "beta", email:"xxx@msn.com" } myObjs[obj[name]] = obj; // If the name is not unique, add an id. Then bind the key to the HTML element: admin When the element is clicked, find the key, query myObjs and find the obj. Something like (assume you are using jQuery): $('ul').on('click', 'li', function() { var $this = $(this); var name = $this.data('key'); var obj = myObjs[name]; console.log(obj); // Here is your corresponding object. }); Cons: extra memory Pros: fast.

http://stackoverflow.com/q/27457711
score: 1
has title: Loading a libary from node-modules into nodeJS
accepted answer: http://stackoverflow.com/a/27457741
type: Question
tagged with: javascript
has body: I am running on win 7 and have installed nodeJS as a path variable. I have installed a nodeJs module(pusher): When running my script I get: require('pusher-client') var API_KEY = 'cb65d0a7a72cd94adf1f' var pusher = new Pusher(API_KEY); var channel = pusher.subscribe("ticker.160"); channel.bind("message", function(data) { console.log(data); var topbuy = data.trade.topbuy; console.log("Price: ", topbuy.price, "Quantity:", topbuy.quantity, "Timestamp:", data.trade.timestamp); }); Error Message: $ node pusher.js c:\xampp\htdocs\projects\psher\node_modules\pusher.js:9 var pusher = new Pusher(API_KEY); ^ ReferenceError: Pusher is not defined at Object.&lt;anonymous&gt; (c:\xampp\htdocs\projects\psher\node_mo dules\pusher.js:9:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3 I thought with require("insert node_module") the libary is loaded by nodeJS and can be used? Any recommendations what I am doing wrong? I appreciate your answer!
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27457741

http://stackoverflow.com/comment/43182130
comment on: http://stackoverflow.com/q/27365054
score: 0
type: QuestionComment
type: Comment
has text: @Evilzebra what do you mean, "looks like homework"? It's obviously homework, even says so in the post.

http://stackoverflow.com/a/27356607
has comment: http://stackoverflow.com/comment/43171261
upvote count: 5
score: 4
answers question: http://stackoverflow.com/q/27356273
type: Answer
has body: In addition to Teemu's answer of using translate: container.style.transform = 'translate(' + container.x + 'px, ' + container.y + 'px)'; Which you should also use other vendor prefixes, You can simply fix this by using this on the body: height: 100%; width: 100%; position: relative; overflow: hidden; and this on html: height: 100%; this will, however, disable scrolling. So what I'd do is, add a mousedown event to the body and apply those styles using a css class whenever mousedown is triggered, and removing that class on mouseup.
downvote count: 1

http://stackoverflow.com/a/27408249
answers question: http://stackoverflow.com/q/27408047
score: 0
has body: Target it with something like below CSS .the-class { enter code here } jQuery $("td:has(table)").addClass("the-class"); Note: I prefer addClass method because .css adds an inline css to your html.
type: Answer

http://stackoverflow.com/comment/43368048
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27465996
has text: If you open this JSON file direcly (locally and remotely) with your browser, do you see any difference?

http://stackoverflow.com/comment/43256265
score: 0
has text: When you say "display a message" do you mean that you want the new window to show a message instead of the 404, or that you don't want there to be a new window at all if there's a 404?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27405684

http://stackoverflow.com/a/27398757
has comment: http://stackoverflow.com/comment/43273177
accepted answer of: http://stackoverflow.com/q/27391448
answers question: http://stackoverflow.com/q/27391448
type: Answer
score: 2
downvote count: 0
upvote count: 2
has body: Its something strange that kendo map don't provide "MarkerClick" event when the map is defined in html. Also trying to bind "MarkerClick" event after initialization of the map don't work. I used the following code: var map = $("#map").data("kendoMap"); map.bind("markerClick", function (e) { alert("assx"); }); But the same code works for other enevts like "zoomStart" etc. Surprisingly if the map is defined in javascript it is possible to raise the "MarkerClick" event. i.e. $("#map").kendoMap({ center: [30.268107, -97.744821], zoom: 3, markerClick: clicked, //other declarations.. }); function clicked(e){ alert("assx"); //$("#venueName").text("Venue 1") also works. } This is what I could able to find. Hope it helps!
type: AcceptedAnswer

http://stackoverflow.com/q/27317519
has comment: http://stackoverflow.com/comment/43104751
answer count: 2
accepted answer: http://stackoverflow.com/a/56163823
downvote count: 0
score: 21
possible better answer: http://stackoverflow.com/a/29981913
favorite count: 0
linked to: http://stackoverflow.com/q/19754381
has answer: http://stackoverflow.com/a/29981913
tagged with: angularjs
has body: I am currently look for a solution to put ONE bold word in a string being translated by the angular-translate filter. Sample code below: (I'm sure the solution is simple... I just can't seem to figure this one out!) my language JSON file looks like so: "AUTHENTICATE-ENTER-CODE": "blah blah blah" In my html file I have this (which translates correctly according to key:value): {{'AUTHENTICATE-ENTER-CODE' | translate}} RESULT: "blah blah blah" The result I am look for is "blah blah blah" I could split this into multiple translation keys but the particular translation consists of multiple bold words in a few sentences... and I was told to attempt to keep the translations keys to a minimum since we have a couple hundred in this project. I have tried putting the bold HTML tags surrounding the font I want to be bold (knowing it wouldn't work anyways) and no... it does not work! I also browsed through the angular-translate API and couldn't find exactly what I was looking for either. Any input would be great!
has title: Adding /bold text in translated string using angular-translate
type: AnsweredQuestion
tagged with: translation
upvote count: 21
tagged with: angular-translate
type: Question
has comment: http://stackoverflow.com/comment/67421953
tagged with: javascript
has comment: http://stackoverflow.com/comment/67421752
has answer: http://stackoverflow.com/a/56163823

http://stackoverflow.com/comment/43309912
comment on: http://stackoverflow.com/q/27434357
score: 2
has text: So in other words, prototype lookup and variable lookup are entirely separate in JavaScript. If you reference a value directly by a variable rather than as a property on an object, JavaScript doesn't have any object on whose prototype chain to do a lookup.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27427415
answers question: http://stackoverflow.com/q/27427358
score: 0
has comment: http://stackoverflow.com/comment/43296913
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43296425
has comment: http://stackoverflow.com/comment/43298712
accepted answer of: http://stackoverflow.com/q/27427358
has comment: http://stackoverflow.com/comment/43297132
type: Answer
has comment: http://stackoverflow.com/comment/43296803
has body: On your server, use res.json({data:'text'}); instead of res.render(...) to send json. That should do the trick. Update: If you want to build a single page application with multiple ajax requests you should use different routes for those. One will send the page and the other the data. However, if your application is small and simple, you could continue doing what you did, but get the data via javascript variable instead of an ajax request. For that in your template you'll have to do something like that (assuming it's jade): script(type='text/javascript') var local_data =!{JSON.stringify(data)}; The page will be rendered with the following HTML: &lt;script type="text/javascript"&gt; var local_data = {"data":"text"}; &lt;/script&gt; You than in your script can do the following: //Your javascript function displayPage(data){ //display logic here console.log(data); } displayPage(local_data);
has comment: http://stackoverflow.com/comment/43298433
has comment: http://stackoverflow.com/comment/43298352

http://stackoverflow.com/q/27372323
tagged with: pug
has answer: http://stackoverflow.com/a/27374119
answer count: 1
has title: How do you pass looping values to a Bootstrap modal?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: twitter-bootstrap
type: Question
accepted answer: http://stackoverflow.com/a/27374119
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43226119
tagged with: javascript
has body: Preface: I've looked at answers about passing variables into a Bootstrap modal. They do not seem to address my problem. I'm iterating over a JSON object which has an image URL and an array of comments about that image like so-- [{ URL:"www.imageurl.com/image1.jpg", COMMENTS:[ {comment: "Hello", by: "Jane"}, {comment: "World", by: "John"} ] },{ URL:"www.imageurl.com/image2.jpg", COMMENTS:[ {comment: "Ruby", by: "Ann"}, {comment: "Is Better", by: "Luke"} ] }] This is a Node.js app so I'm writing in Jade, but for the sake of clarity, I'll refer to HTML. So I'm iterating through the JSON object (for image in images) and for each image, I'm creating an &lt;img&gt; tag wrapped with an &lt;a&gt; tag that opens the modal. Inside the modal, I would like to display the appropriate comments and author for the clicked image. So, if "image in images" is referring to image1.jpg, the modal should display Hello - by Jane, World - by John. My problem is that I'm in a loop and I need to pass into the modal the correct image object. How do I do this?
score: 0

datetime
tags question: http://stackoverflow.com/q/27421821
tags question: http://stackoverflow.com/q/27376286
tags question: http://stackoverflow.com/q/27433086
tags question: http://stackoverflow.com/q/27328497
tags question: http://stackoverflow.com/q/27426037
tag name: datetime
tags question: http://stackoverflow.com/q/27323791
tags question: http://stackoverflow.com/q/27326937
tags question: http://stackoverflow.com/q/27424094
type: Tag
tags question: http://stackoverflow.com/q/27334672
tags question: http://stackoverflow.com/q/27382900
tags question: http://stackoverflow.com/q/27456315
tags question: http://stackoverflow.com/q/27436396
tags question: http://stackoverflow.com/q/27400766
tags question: http://stackoverflow.com/q/27395196

http://stackoverflow.com/comment/43310348
type: Comment
type: QuestionComment
has text: do you mean get the contents of a file inside DOM element?
comment on: http://stackoverflow.com/q/27434686
score: 0

http://stackoverflow.com/q/27449851
downvote count: 0
has comment: http://stackoverflow.com/comment/43346232
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43346841
has body: Hello I'm trying to get slick.min.js to work in IE8, but I'm getting an error: Error: 'jquery is undefined' (Line 18 character 27) I'm using slick.min.js 1.3.15. Same result as slick.min.js 1.3.11. And have these in my head section Aon Hewitt Cloud Solutions
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/43340377
has title: slick.js and IE8
tagged with: internet-explorer
tagged with: internet-explorer-8
score: 1
type: Question

http://stackoverflow.com/comment/43094374
score: 0
type: Comment
type: AnswerComment
has text: @PaulRoub if you know how browser work you will not say in this way. Because every element has default css preset for each element. The suggested answer is the best but there are alternatives every time. So you can use css in order to do this. Of course there is not doubt that it will make overhead for rendering page.
comment on: http://stackoverflow.com/a/27317247

http://stackoverflow.com/q/27396698
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/63503626
possible better answer: http://stackoverflow.com/a/54447054
has answer: http://stackoverflow.com/a/54447054
type: Question
has answer: http://stackoverflow.com/a/27396779
has body: I want to know if there is a way to do this without make a full copy of the array and then splice the copy. var arr = [{id:1, name:'name'},{id:2, name:'name'},{id:3, name:'name'}]; I need to temp remove element by his index and use the array without this element, but i dont want to change the original array. You can give me way even with lodash.
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: Js remove element from array without change the original
score: 22
upvote count: 22
accepted answer: http://stackoverflow.com/a/27396779
favorite count: 0
has answer: http://stackoverflow.com/a/59587665
has comment: http://stackoverflow.com/comment/43239589

http://stackoverflow.com/comment/43404088
comment on: http://stackoverflow.com/a/27441810
type: AnswerComment
has text: You can't pass a file's path as a parameter to a function, I'm guessing your trying to do `Browser("Home").Page("Home").RunScript("cloneArray(makeArray())")` Now that the `makeArray` function is defined you can call it.
score: 0
type: Comment

http://stackoverflow.com/comment/43289724
comment on: http://stackoverflow.com/q/27423606
score: 0
type: QuestionComment
type: Comment
has text: the 2 examples are the full code for opening a file in IE, the Chromes way is what is in the URL bar when I drag and drop a video to play. its only a short bit of code itself however chrome is making the extremely difficult

http://stackoverflow.com/a/30734199
score: 0
type: Answer
has body: Could this jQuery plugin be any help? https://github.com/tormjens/jquery-dom-router You can change the default element using $.DOMRouter.defaults.element = '#element'; before initalizing the plugin.
answers question: http://stackoverflow.com/q/27316509

http://stackoverflow.com/a/27426316
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43332574
has comment: http://stackoverflow.com/comment/43395503
downvote count: 0
answers question: http://stackoverflow.com/q/27422408
type: Answer
has comment: http://stackoverflow.com/comment/43314743
has body: When you do Category1 = data;, you are setting the variable label Category1 to the value of the data. What you want to do is change the object referenced by that label. Better would be to make Category1 an Ember object, and set its properties by the data. Something like this: model1: function () { var Category1 = Ember.Object.create(); $.ajax({ url: 'http://localhost:63951/Home/GetAllCountry', type: 'GET', datatype: 'application/json', async: false, success: function (data) { alert(data) Category1.setProperties(data); } }); return Category1; }.property(), If your data is coming in as an array, but you just want the first element (like you showed above), you would instead do Category1.setProperties(data[0]);

http://stackoverflow.com/q/27450139
has comment: http://stackoverflow.com/comment/43339528
upvote count: 1
has comment: http://stackoverflow.com/comment/43339615
has comment: http://stackoverflow.com/comment/43339467
has comment: http://stackoverflow.com/comment/43339527
has body: Having issues with this. So in short I want var hprH = 555px when screens are >= 910px, then hprH = 300px when screens are between 910px - 400px and 150px when &lt; 400px. I tried this with CSS media queries, but couldn't get it to work. So now I am trying to do this solely in js. This is the global variable var hprH = $('#hpr').height(); I would like to change this as stated above. Here is the code that uses the variable, which works until I need the hprH height to be less than 555px. $(function() { hpr_init(); $('#hpr .thumb').click(function(){ clearInterval(timer); showHPR($(this)); }); timer = setInterval(function(){showHPR(nextThumb);}, interval); $(window).resize(function(){ hprH = $('#hpr').height(); $('.selected').height(hprH); }); }); function showHPR(obj){ $(obj).fadeOut(300,function(){ $(obj).parent().animate({ height:hprH, zIndex:0, bottom:0 },duration); $(obj).parent().find('img').animate({ top:0 },500,function(){ $(this).css({bottom:'auto'}); }); $(obj).parent().find('.content').fadeIn(); lastThumb(obj); }); }
favorite count: 0
has title: Changing variable based on window size - jQuery/JS
answer count: 0
has comment: http://stackoverflow.com/comment/43339458
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/58919005
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43338925
type: Question
has comment: http://stackoverflow.com/comment/43339438
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/27443151
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27443300
answer count: 5
linked to: http://stackoverflow.com/q/70579
possible better answer: http://stackoverflow.com/a/27443232
has answer: http://stackoverflow.com/a/27443300
has title: How to get inner html based on attribute Id
has comment: http://stackoverflow.com/comment/43325488
type: Question
type: AnsweredQuestion
has body: I have the attibute Id. In console when I type in the following jquery command: $('#LocationRadioButtons a') I get the following output [Test​​, Test1​​, test2​​] Which is an array If I type in the following jquery command: $('#LocationRadioButtons a').first(); It will return the first element in that array: Test​​ How do I return an element based on it's Id, and return its innerHTML. For example id = 5 innerHTML is test1, Cheers
has answer: http://stackoverflow.com/a/27443226
has answer: http://stackoverflow.com/a/27443430
tagged with: javascript
has answer: http://stackoverflow.com/a/27443232
score: 0
has comment: http://stackoverflow.com/comment/43325551
has answer: http://stackoverflow.com/a/27443444

http://stackoverflow.com/q/27377190
has comment: http://stackoverflow.com/comment/43204029
type: UnansweredQuestion
has body: I am working on a force layout graph and i wish to press shift and click to pan. This is so i have the ability to select multiple nodes by highlighting them with one click. How would i go about disabling the ordinary click and hold to pan so i can use that to select and then use shift + click to pan around my network ?
answer count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/43209321
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43209283
has title: How to disable normal panning and use shift + click to pan ? d3/js

http://stackoverflow.com/q/27363071
has body: I have a working toggle button that slides a div up and down. The problem I have is when I try changing the toggle button status: A demo of my code is here: http://jsfiddle.net/zwu0sn83/3/ Button code, with inner span for the icon: Filter Products I'm using the following to change text but the span html is actul text rather than html. I need to change text and update the span class: $(this).text(function(i, text){ return text === "Filter Products" ? "Close Filters" : "Filter Products"; });
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27363201
type: Question
has title: Jquery button toggle change text and span class
answer count: 2
possible better answer: http://stackoverflow.com/a/27363257
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27363257
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27363201
has comment: http://stackoverflow.com/comment/43178253

http://stackoverflow.com/comment/43320082
type: Comment
comment on: http://stackoverflow.com/a/27440068
has text: I am upvoting this answer because it solves problem in every respect
score: 0
type: AnswerComment

http://stackoverflow.com/q/27340763
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27340937
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27340937
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27344033
accepted answer: http://stackoverflow.com/a/27344033
type: Question
has body: I have created textboxes in javascript using for loop with this code: for (i = 0; i &lt; 3; i++) { var div1 = document.createElement('div'); div1.setAttribute('id', "di" + i); document.getElementById('t').appendChild(div1) var tx = document.createElement('input'); tx.setAttribute('id', i); var di = document.getElementById("di" + i); di.appendChild(tx); var br = document.createElement('br'); di.appendChild(br); tx.onblur = (function (i) { return function (evt) { num = Number(evt.currentTarget.value); var currentId = evt.currentTarget.id; var d = document.getElementById('di' + i); for (x = 0; x &lt; num; x++) { var b = document.createElement('b'); b.innerHTML = "num" + (x + 1); var tx1 = document.createElement('input'); tx1.setAttribute('id', 'tx' + x); d.appendChild(br); d.appendChild(b); d.appendChild(tx1); d.appendChild(br); } } })(i); di.appendChild(br); } I create a button onclick function i want to retrieve the values of each num in this format: (num1+num2+num3) for each textbox of the three textboxes each one in different line.. var sub = document.getElementById('sub'); sub.onclick = function () { for (i = 0; i &lt; 3; i++) { cv1 = document.getElementById("tx" + i).value; cc += cv1 + "+"; } document.write("(" + cc + ")" + "&lt;br&gt;"); };
has title: How to retrieve values from created textboxes using for loop in javascript?

http://stackoverflow.com/comment/43174891
type: Comment
has text: the part of echo is not necessary delete it completly from php. echo ' '; echo " "; echo "<link rel='stylesheet' href=....
comment on: http://stackoverflow.com/a/27361281
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43098117
has text: I'm trying to show you the code that I used. Give me a second.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27318644
type: AnswerComment

http://stackoverflow.com/q/27391576
type: AnsweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43231290
has body: as the title suggests. what im trying to do is get my button to show or hide the above text ( on my Tutorial Quiz page), by clicking the button. So what happens is the text shows. but when i click the button it will not hide. Here is my html code for "Tutorial Quiz" Page &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Tutorial Quiz&lt;/title&gt; &lt;link rel="stylesheet" href="css/normalize.css"&gt; &lt;link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400italic,700,700italic,800' rel='stylesheet' type='text/css'&gt; &lt;link rel="stylesheet" href="css/main.css"&gt; &lt;script src="quizconfig.js"&gt; &lt;/script&gt; &lt;script&gt; var actualchoices=new Array() document.cookie="ready=yes" &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;header&gt; &lt;a href="Tutorial Quiz.html" id="logo"&gt; &lt;h1&gt;Webprograming Quiz&lt;/h1&gt; &lt;h2&gt;by Chris Moore&lt;/h2&gt; &lt;/a&gt; &lt;nav&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="Tutorial.html"&gt;Tutorial&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="Tutorial Quiz.html"class="selected"&gt;Quiz&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="Feedback.html"&gt;Feedback&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/header&gt; &lt;div id="wrapper"&gt; &lt;p align="center"&gt; &lt;form method="POST" name="myquiz"&gt; &lt;font face="Arial"&gt;&lt;big&gt;&lt;big&gt;General Knowledge Quiz&lt;/big&gt;&lt;/big&gt;&lt;/font&gt;&lt;/p&gt; &lt;div class="qheader"&gt;1) What is the colour of Irn-Bru&lt;/div&gt; &lt;div class="qselections"&gt; &lt;input type="radio" value="a" name="question1"&gt;a) Orange.&lt;br&gt; &lt;input type="radio" value="b" name="question1"&gt;b) Red.&lt;br&gt; &lt;input type="radio" value="c" name="question1"&gt;c) Green.&lt;br&gt; &lt;input type="radio" value="d" name="question1"&gt;d) Purple.&lt;br&gt; &lt;/div&gt; &lt;div id="target"&gt; This is the hint you want to hide&lt;/div&gt; &lt;…
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43231452
has answer: http://stackoverflow.com/a/27391612
accepted answer: http://stackoverflow.com/a/27391612
has title: Created a button using a Tutorial on Intellij what is wrong with the code?

http://stackoverflow.com/q/27429123
has comment: http://stackoverflow.com/comment/43304337
score: 8
has title: HTML5 Audio, Web Audio API, CORS and Firefox
has comment: http://stackoverflow.com/comment/43303959
has comment: http://stackoverflow.com/comment/43304557
has comment: http://stackoverflow.com/comment/43304490
has comment: http://stackoverflow.com/comment/43303279
has body: I have been trying to get this to run correctly so days now with no luck. I have created a custom audio player, that accesses an MP3 on a S3 Amazon server. The audio player has custom controls enabled by Javascript, and a Audio Visualizer made possible by the Web Audio API. Now the problem I am running into is this: Work fine on Chrome. Safari out right says it can't run the Web Audio API, but the audio will still play. In Firefox, the entire thing shuts down. Click play... nothing. I thought it was a CORS issue, so we set the proper headers on the server and still nothing. BUT... if I deactivate the Web Audio API visualizer, then I can get the player to play just fine. http://jsfiddle.net/murphy1976/yqqf7uL1/1/ Here is my jFiddle. I have separated the Audio Player controls Script from the Visualizer Script with comments so you can see how it will work in Firefox, and how it will NOT work in Firefox. I read somewhere that this issue that I'm running into MAY be a bug with Firefox. I just want to make sure so that I can stop beating my skull over this. Could I put a call to CORS here?: &lt;source crossorigin="anonymous" src="audioFiles/35022797.mp3" id="srcMP3" type="audio/mp3"&gt;
has comment: http://stackoverflow.com/comment/43304196
tagged with: audio
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29975914
has comment: http://stackoverflow.com/comment/43302942
linked to: http://stackoverflow.com/q/30603872
linked to: http://stackoverflow.com/q/3076414
type: Question
has answer: http://stackoverflow.com/a/27431853
accepted answer: http://stackoverflow.com/a/27431853
answer count: 2
linked to: http://stackoverflow.com/q/31308679
tagged with: firefox
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/64478585
favorite count: 0
upvote count: 8
tagged with: cross-domain
possible better answer: http://stackoverflow.com/a/29975914
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43390498
type: QuestionComment
has text: The structure of the selection doesn't matter. All I want to know is what colors Chrome is currently using to style selected text in an ` `. On Windows, it's currently white text on #3297fd background, and on Mac it's black text on #accef7. But that can obviously change, e.g., the user has set the OS to use a high contrast theme. So is there a way for an extension to look up those color values at runtime?
comment on: http://stackoverflow.com/q/27454211
score: 0
type: Comment

http://stackoverflow.com/q/27321512
has body: I'm trying to add a clicked 60 seconds animated pie button timer to each list item. Each list view is generated by javascript. I have tried different things but I can never make it work to generate each row with the pie timer inside, with each one to have different time depending on the click. For better understanding of what I'm trying to accomplish here is the timer animation with the list row creation: FIDDLE LINK Some code for the list view creation: var listCreated = false; function appendToList() { //Create the listview if not created if (!listCreated) { $("#content").append(" "); listCreated = true; $("#content").trigger("create"); } $("#list").append(" Item "); $("#list").listview("refresh"); } I'm new to jQuery mobile so the help will be much appreciated :)
type: AnsweredQuestion
type: Question
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27322541
accepted answer: http://stackoverflow.com/a/27322541
has title: Generating animation on dynamic listview
has comment: http://stackoverflow.com/comment/43103624

http://stackoverflow.com/comment/43236932
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27394365
has text: provide your html and js link so we can check issue
score: 0

http://stackoverflow.com/q/27333140
has comment: http://stackoverflow.com/comment/43123670
has comment: http://stackoverflow.com/comment/43123860
upvote count: 2
tagged with: same-origin-policy
answer count: 1
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43123895
has comment: http://stackoverflow.com/comment/43123758
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43123676
has title: I'm getting "Cross-Origin Request Blocked" with the same domain
has body: Well my JavaScript calls the url that is the part of the website, so I have no idea why this is "cross-origin". My AJAX call: $.ajax({ url: SITE_URL+'ajax_check.php?p='+P_ID, //let's say SITE_URL is http://example.com/dev success:function(result){ alert(result); } }); And this is the error I get in firebug: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com/dev/ajax_check.php?p=23. This can be fixed by moving the resource to the same domain or enabling CORS."
type: Question
has comment: http://stackoverflow.com/comment/43123844
has answer: http://stackoverflow.com/a/27335040
accepted answer: http://stackoverflow.com/a/27335040
tagged with: javascript

http://stackoverflow.com/comment/92484689
comment on: http://stackoverflow.com/a/27386370
type: AnswerComment
has text: This is a brilliantly obscure bit of knowledge that had me stumped. It allows destructuring across scope (well, sort of - you still need to declare your variables, of course). But it solves a constraint of using Promise chains while needing to use multiple variables resolved from one step of a Promise chain in another, without creating too much mess. Thanks.
type: Comment
score: 1

http://stackoverflow.com/q/27352874
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27353154
has comment: http://stackoverflow.com/comment/43159562
tagged with: javascript
favorite count: 0
tagged with: scope
answer count: 5
accepted answer: http://stackoverflow.com/a/27353154
possible better answer: http://stackoverflow.com/a/27352921
has title: Please explain the behavior of this code in javascript
has answer: http://stackoverflow.com/a/27352921
has body: I have wrote a code in javascript like function onClic(){ var i = 0; if ( i==2 ){ var m = function(){ return 1; } } else { var m = function(){ return 2; } } alert(m()); } the alert shows 2; can you please explain me the behavior in this statement i.e. Why am I able to access m outside the If statement when I declared it inside If statement scope. Also why is this working as ECMAScipt 5 specifies that we donot put the function declaration inside IF-ElSE block.
score: -1
has answer: http://stackoverflow.com/a/27352967
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27352962
type: Question
has answer: http://stackoverflow.com/a/27352935

http://stackoverflow.com/q/27397687
type: Question
has title: Use a string as a function call scope
possible better answer: http://stackoverflow.com/a/27397785
has body: function foobar() { console.log(this); } foobar.call("Hello"); This code displays : { '0': 'H', '1': 'e', '2': 'l', '3': 'l', '4': 'o' } I was expecting "Hello" to be displayed. Why? and how to remedy this?
has answer: http://stackoverflow.com/a/27397785
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27397759
has comment: http://stackoverflow.com/comment/43241413
type: AnsweredQuestion
tagged with: function
tagged with: javascript
tagged with: string
accepted answer: http://stackoverflow.com/a/27397759
favorite count: 0
tagged with: scope

http://stackoverflow.com/a/27387072
has comment: http://stackoverflow.com/comment/43240822
has body: Its because your local drive is considered as "other-domains" try uploading it to a web server it solved my issue
score: 0
answers question: http://stackoverflow.com/q/27386968
type: Answer

http://stackoverflow.com/q/27355234
has title: How to drag an image and drop it at desired location?
tagged with: drag-and-drop
upvote count: 2
type: UnansweredQuestion
tagged with: css
score: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27355466
tagged with: jquery
has comment: http://stackoverflow.com/comment/43164010
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43164087
has body: I am trying to make an interface in which user can select and drag an image and drop it over at a desired position over another image. I started with the following code. I am able to drag and drop, but the image gets dropped at top left corner automatically. I want to drop image at a desired position (for eg. in middle somewhere or bottom right etc...). How can I do that ? Code I started with: Drag image into the rectangle:

http://stackoverflow.com/q/27406216
accepted answer: http://stackoverflow.com/a/27406404
has comment: http://stackoverflow.com/comment/43257195
type: Question
tagged with: autocomplete
has body: Fiddle Example I have an autocomplete code in my main js file. Here's an example: var availableTags = [ "ActionScript", "AppleScript", "Asp" ]; $("#tags").autocomplete({ source: availableTags, select: function(event, ui) { return false; } }); And I have a separate js file that will only be served up on a specific page. In that file, I want to overwrite the select option in the $("#tags") instance, here's an example in that seperate js file: $.widget( "ui.autocomplete", $.ui.autocomplete, { select: function (event, ui) { $(this).val(ui.item.label); // to automatically populate the input box with the selected option } }); Is it possible to overwrite the select option like that in jQuery?
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43257255
has answer: http://stackoverflow.com/a/27406404
score: 0
has title: Can I overwrite select options in jQueryUI autocomplete
type: AnsweredQuestion
tagged with: jquery-ui

http://stackoverflow.com/comment/43260725
has text: Your code doesn't mention anything about initializing a range picker, only datepicker. where are you initializing the range picker?
comment on: http://stackoverflow.com/q/27408013
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/comment/55541587
type: Comment
comment on: http://stackoverflow.com/q/27424094
type: QuestionComment
has text: @supercool thnxx got the same error and resolved it
score: 0

http://stackoverflow.com/a/27470642
accepted answer of: http://stackoverflow.com/q/27413049
type: Answer
upvote count: 3
score: 3
has body: Your question does not have an answer as asked. And it seems you had a sense of that when you said Or am I not thinking "immutable" enough at all? First you say you are using an immutable data structure. Meaning it can't be changed. Then you say: If I stored a Paris node reference at currentlyFocusedNode, it would be out of sync as soon as any other part of the app modifies the node With immutable data structures things don't get modified. What you have is an old version of the data and a new version of the data. Neither will ever change. So the question should really be something like: How do I identify when 2 nodes represent the same data? Answer is use an ID. Another good question might be: Given a reference to an old node, tree, and newData, how can I update the tree and keep track of the node? This depends largely on how the rest of the code works and what parts you have access to. E.g. you could have something like this: function updateNodeInTree(nodeId, newData, inTree){ oldNode = findNode(nodeId, inTree); newNode = merge(oldNode, newData); newTree = merge(inTree, {path: {to: newNode}}); return [newTree, newNode]; } But if you don't have access to where the tree is updated, you may have to settle for: newTree = updateTree(oldTree, someData); newNode = findNode(nodeId, newTree);
answers question: http://stackoverflow.com/q/27413049
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27422796
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/5984463
score: 0
answer count: 3
tagged with: css
type: UnansweredQuestion
has title: Load code when I open a popup
tagged with: styles
has answer: http://stackoverflow.com/a/27423246
tagged with: popup
has answer: http://stackoverflow.com/a/27423026
type: Question
has body: I need to load some code JS when I load a popup window. I've tried with: mypopup.ready(function... But nothing. Here's my code. function popup(){ mypopup = window.open('http://33bits.es/foro/masiconos.php', 'popup', 'width=400','height=300','status=no', 'scrollbars=yes', 'toolbars=no', 'menubar=no', 'location=no'); } $('#mas').click(function(evt) { popup(); }); mypopup.ready(function() { //Más Iconos $('img').click(function (evt) { var clase = $(this).attr('class'); insertar_popup(clase); }); $('.cerrar').click(function(evt) { window.close(); }); //Mas Iconos CSS $('.cerrar').css("font-family", "Arial"); $('.cerrar').css("cursor", "pointer"); $('.cerrar').css("margin", "50%"); $('.pop').css("background", "url(http://www.33bits.es/foro/Themes/epic_2_0/images/id/abgg.png)"); $('.iconos_pop &gt; img').css("margin", "5px"); $('.iconos_pop &gt; img').css("cursor", "pointer"); $('.iconos_pop').css("border-radius", "10px"); $('.iconos_pop').css("padding", "10px"); $('.iconos_pop').css("background", "white"); $('.iconos_pop').css("margin", "5% auto"); $('.iconos_pop').css("width", "95%"); }); I want to load the popup and then, load this part of my code, it will give style to the popup. But it doesn't load and my popup doesn't have style, it seems empty and shabby.
has answer: http://stackoverflow.com/a/27422911

http://stackoverflow.com/comment/43341837
type: Comment
has text: Oh thats intrasted the function run but just once, ajter not refresh the iframe.
type: AnswerComment
comment on: http://stackoverflow.com/a/27451538
score: 0

http://stackoverflow.com/comment/43233777
type: Comment
score: 1
has text: This seemed to speed up the way to 50k results but the results are still the same, I wonder if there is some closure/garbage collection issues going on.
comment on: http://stackoverflow.com/q/27392679
type: QuestionComment

http://stackoverflow.com/comment/43185603
has text: Does it load `/portfolio/index.html` or `/index.html`?
comment on: http://stackoverflow.com/q/27365727
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43355409
has text: What does `{{foobar.foo}}` emit?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27456675
score: 0

http://stackoverflow.com/comment/43178226
comment on: http://stackoverflow.com/q/27363095
score: 0
type: Comment
type: QuestionComment
has text: yeah but i think Im doing it wrong. since Im a newbie in js. where do I add it?

http://stackoverflow.com/q/27467461
tagged with: php
has comment: http://stackoverflow.com/comment/43370833
accepted answer: http://stackoverflow.com/a/27467712
tagged with: ssi
answer count: 1
downvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43370780
has comment: http://stackoverflow.com/comment/43370527
has title: Is it possible to insert SSI into javascript in a PHP file?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43370618
has body: As I don't know javascript at all, I'm wondering if it's possible to insert some SSI into javascript in a PHP file. I've got a bit of script going to preload some images, and I'd like to set it up so that some images always get preloaded across my entire site (via the SSI) of which I may add to over time, while allowing me to add individual images as needed page by page. It works fine in my HTML files, but not it my PHP files. Here's what I've got in my HTML files which works just fine: &lt;script&gt; function preload(arrayOfImages) { $(arrayOfImages).each(function () { $('&lt;img/&gt;')[0].src = this; }); } preload([ &lt;!--#include virtual="/grabbag/preload-images.html" --&gt; '/images/image-1.png', '/images/image-2.png' ]); &lt;/script&gt; But this doesn't work in my PHP files, the SSI getting replaced with nothing but empty text: &lt;script&gt; function preload(arrayOfImages) { $(arrayOfImages).each(function () { $('&lt;img/&gt;')[0].src = this; }); } preload([ &lt;?php include("/grabbag/preload-images.php"); ?&gt; '/images/image-1.png', '/images/image-2.png' ]); &lt;/script&gt; Is this possible? Thanks in advance.
score: 1
favorite count: 0
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27467712

http://stackoverflow.com/comment/43300752
score: 0
comment on: http://stackoverflow.com/q/27419048
type: QuestionComment
type: Comment
has text: Yes, that would work fine as well. Just don't use some random prefix like `N` or `C` that no one understands :-)

http://stackoverflow.com/comment/43246465
score: 0
comment on: http://stackoverflow.com/q/27400200
type: Comment
type: QuestionComment
has text: http://underscorejs.org/#uniq may help

http://stackoverflow.com/comment/43152783
score: 0
type: Comment
type: QuestionComment
has text: I can't understand your needs.
comment on: http://stackoverflow.com/q/27349038

http://stackoverflow.com/comment/43360282
type: AnswerComment
comment on: http://stackoverflow.com/a/27461755
has text: @King_Fisher As I already pointed out, the problem is in jQuery unobtrusive Ajax, not modernizr. I would suggest getting the latest version of jQuery Unobtrusive Ajax and jQuery Unobtrusive Validation from NuGet. The latest versions of those have already been properly updated to use `.on()`.
score: 0
type: Comment

http://stackoverflow.com/a/27316593
downvote count: 0
has body: There is no event raised when a class changes. The alternative is to manually raise an event when you programatically change the class: $(document).ready(function() { $(id_element).addClass("active").trigger('classChange'); $(id_element).on('classChange', function() { // do stuff }); });
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27316509
score: 1
has comment: http://stackoverflow.com/comment/43093005
has comment: http://stackoverflow.com/comment/43092945
has comment: http://stackoverflow.com/comment/43092972

http://stackoverflow.com/comment/43241655
type: AnswerComment
comment on: http://stackoverflow.com/a/27396914
score: 0
type: Comment
has text: what i mean by mix is for example. you see my alphabet[0], it is declared in my java code (above the loadUrl), my for loop is declared in my javascript code. The red code is javascript while the other code is java code. i want to use my alphabet[0] but instead of taking [0] i want to take the forloops 'i' variable. Something like this alphabet[i].

http://stackoverflow.com/comment/43332576
score: 0
type: AnswerComment
type: Comment
has text: as a side note, you should always place the proprietary IE syntax crap at the **bottom** of the CSS statement rather than the top. Older versions of webkit would blow up if you didn't.
comment on: http://stackoverflow.com/a/27446731

http://stackoverflow.com/comment/43229590
type: Comment
comment on: http://stackoverflow.com/a/27389525
has text: `echo strftime("%B %e, %Y");`
type: AnswerComment
score: 0

http://stackoverflow.com/q/27338748
answer count: 4
type: AnsweredQuestion
has body: On my Solar System model, when you click 'Toggle Orbits' it display the orbit for the all familiar planet earth, but you notice that the ring is not centred in the middle of the planet, only outside of it, how would I make it so it would be in the middle? function myFunction() { for (var i = 0; i < 500; i++) { var x = Math.random() * screen.width; var y = Math.random() * screen.height; var star = document.createElement('div'); star.className = 'star'; star.style.left = x + 'px'; star.style.top = y + 'px'; document.body.appendChild(star); } } html { background-color: #000; overflow-x: hidden; overflow-y: hidden; } .star { position: absolute; width: 1px; height: 1px; background: white; z-index: -1; } .sun { position: absolute; height: 100px; width: 100px; top: 50%; left: 50%; margin-left: -50px; margin-top: -50px; border-radius: 50%; /*box-shadow: rgb(204, 153, 0) 0px 0px 50px 0px;*/ } #button-change { position: absolute; top: 2px; left: 2px; } .earth { position: absolute; height: 25px; width: 25px; border-radius: 50%; box-shadow: green 0 0 25px; } .earth-orbit { position: absolute; height: 200px; width: 200px; top: 50%; left: 50%; margin-left: -100px; margin-top: -100px; -webkit-animation: spin-right 15s linear infinite; } .earth-lines { border-width: 1px; border-style: solid; border-color: white; border-radius: 50%; position: absolute; } .moon { height: 10px; width: 10px; } .moon-orbit { top: 50%; left: 50%; height: 50px; width: 50px; margin-left: -12.5px; margin-bottom: -37px; border: 1px solid rgba(255, 0, 0, 0.1); border-radius: 50%; -webkit-animation: spin-right 4s linear infinite; } @-webkit-keyframes spin-right { 100% { -webkit-transform: rotate(360deg); } } Vanishing Act Toggle Orbits
possible better answer: http://stackoverflow.com/a/27338826
upvote count: 10
has answer: http://stackoverflow.com/a/27338849
type: Question
has answer: http://stackoverflow.com/a/27338956
score: 10
tagged with: javascript
has answer: http://stackoverflow.com/a/27338996
downvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27338956
has title: Solar System Orbit html center
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27338826
tagged with: css

http://stackoverflow.com/comment/43309594
type: QuestionComment
comment on: http://stackoverflow.com/q/27431759
score: 0
has text: I wouldn't recommend putting any javascript directly inside the head like that. Instead, you should have no problem including the file like any other client-side JavaScript file. If you can post the relevant code, it should be pretty easy to show you how to include like this.
type: Comment

http://stackoverflow.com/a/27390190
answers question: http://stackoverflow.com/q/27389523
type: Answer
score: 0
has body: You are using relative paths in your css - change them so they start ~/ The ~ character represents the root of your application.
has comment: http://stackoverflow.com/comment/43233028

http://stackoverflow.com/a/27367671
has comment: http://stackoverflow.com/comment/43210767
score: 4
has comment: http://stackoverflow.com/comment/43187425
has comment: http://stackoverflow.com/comment/43188075
answers question: http://stackoverflow.com/q/27367604
upvote count: 4
type: Answer
has body: You only grab the DOMElement with the ID Pizza, not its value. Try adding .value to get the element's value. Like so: pizza_total= document.getElementById("pizza").value * pizza;
has comment: http://stackoverflow.com/comment/43187540
downvote count: 0
has comment: http://stackoverflow.com/comment/43187375

http://stackoverflow.com/a/27451502
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27450179
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27450179
has body: There are a few problems in your markup: Use id when appropriate. You are using class everywhere instead. This is a problem because your statements like $('.apply-promo-form').val() will pick up first jQuery object if there are more than one element with the same class. Use class when you need to style and group elements together. Use id when you have to uniquely qualify and element. Use templates as far as possible. You are prepending the couponCode and then .cloneing it, but not using the cloned object anywhere. Regardless, this is not required. pushIt = $('.promo-info-div') and then later $('.promo-applied-area').prepend(pushIt)? Prepending the same set of elements? Here is a very crude example of what you could start with: $('.button').click(function () { var couponCode, templateHtml, $template, $span; template = $('#template').html(); // get the html out of template $template = $(template); // convert that to a jQuery object $span = $(""); // create a span to hold the coupon code couponCode = $('#apply-promo-form').val(); // get value of input into couponCode $span.text(couponCode); // Add the couponCode text to the span $template.prepend($span); // Prepend the span to the templated object // prepend the templated object to the area and show it $template.prependTo("#promo-applied-area").slideDown(); // clear the form $('#apply-promo-form').val(''); }); // Event delegation required here, // because these are newly created elements $('#promo-applied-area').on("click", ".close", function () { $(this).parent().fadeOut(function() { $(this).remove(); // Remove from DOM, no use for lingering objects }) }); #promo-applied-area { height: 100px; padding: 5px; background: lightblue; } .promo-info-div { display: none; background: lightgreen; } .close { cursor:pointer; padding: 0 10px; } Click
has comment: http://stackoverflow.com/comment/43342927
type: Answer

http://stackoverflow.com/comment/43149516
comment on: http://stackoverflow.com/a/27346592
has text: No ... simply use the variable; i.e. `Teacher.Eng` or `Teacher.Math`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27467494
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27472175
has comment: http://stackoverflow.com/comment/43370919
answer count: 1
downvote count: 0
favorite count: 0
has body: Are there any errors is this code? I am using a new version of Chrome to test on. I've written a similar program that displays a wireframe cube, with no issues. It ran well. I'm thinking I may have written or structured my code incorrectly. var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(50,window.innerWidth/window.innerHeight, 1, 10000); var renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); // create the particle variables var particleCount = 1000; var particles = new THREE.Geometry(); var pMaterial = new THREE.ParticleBasicMaterial({ color: 'red', size: 20 }); // create the individual particles for (var p = 0; p &lt; particleCount; p++) { var pX = Math.random()*500 - 250; var pY = Math.random()*500 - 250; var pZ = Math.random()*500 - 250; var particle = new THREE.Vertex( new THREE.Vector3(pX, pY, pZ) ); particles.vertices.push(particle); } // create the particle system var particleSystem = new THREE.ParticleSystem( particles, pMaterial); // add the particle system to the scene scene.add(particleSystem); function render() { particleSystem.rotation.y += 0.01; renderer.render(scene, camera); requestAnimationFrame(render); } render(); I'm not seeing any results, so to speak - just a black canvas element on the page.
tagged with: three.js
has comment: http://stackoverflow.com/comment/43370906
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27472175
upvote count: 1
type: Question
has title: Why is this simple THREE.js javascript particle system not working?

http://stackoverflow.com/q/27440004
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43320909
tagged with: http://stackoverflow.com/tag/html
has title: Save content of textarea to file and load from PHP server page
tagged with: css
has answer: http://stackoverflow.com/a/27441207
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43319721
upvote count: 1
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27441207
has comment: http://stackoverflow.com/comment/43320634
has comment: http://stackoverflow.com/comment/43319722
has comment: http://stackoverflow.com/comment/43320564
downvote count: 0
answer count: 1
has body: how to save content of textarea of html page into a file and load it in PHP server page using ajax (no JQuery)?? Html page will be like this :
has comment: http://stackoverflow.com/comment/43321695

http://stackoverflow.com/a/27359249
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27359173
has body: You cannot remove the url bar from a window using script inside a website. This would be a security issue.
downvote count: 0
type: Answer

http://stackoverflow.com/a/27337164
has comment: http://stackoverflow.com/comment/43132339
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27336904
answers question: http://stackoverflow.com/q/27336904
has body: First of all, you shouldn't use the same id for all of the divs. So instead of iDiv.id = 'div' you might want to do this: iDiv.attr('id', 'div[' + i + ']'); I'm not sure about your requirements, but you might also want to check the number of divs before creating new ones: $('#numberDiv').keyup(function() { var s = $(this).val(); var currentDivsCount = $('body > div').length; var nbrDiv = parseInt(s, 10) - currentDivsCount; if (isNaN(nbrDiv)) return; var iDiv; for (var i = 0; i < Math.abs(nbrDiv); i++) { if (nbrDiv > 0) { iDiv = $(' I\'m a div '); iDiv.attr('id', 'div[' + (currentDivsCount + i) + ']'); iDiv.appendTo('body'); } else { $('body > div:last').remove(); } } });
has comment: http://stackoverflow.com/comment/43132402
score: 0

immutable.js
tags question: http://stackoverflow.com/q/27446960
type: Tag
tag name: immutable.js

http://stackoverflow.com/q/27361443
upvote count: 1
has comment: http://stackoverflow.com/comment/43175100
has body: I'm trying to get a simple test page with a working Bar Graph using Morris. Here's my code. Morris Test When I open this page I get the error TypeError: Morris.bar is not a function. I've doubled checked that the path for Morris.min.js and Raphael.min.js are correct and I can't think of another reason that the function wouldn't be working.
has answer: http://stackoverflow.com/a/27361595
has comment: http://stackoverflow.com/comment/43175050
has title: Morris.bar function is not recognized
type: Question
downvote count: 0
tagged with: morris.js
tagged with: javascript
answer count: 1
score: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43127508
score: 4
has text: look if (('#gold') > 99) { line carefully.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27335330

http://stackoverflow.com/q/27379935
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/43243190
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/43243256
has title: New created elements are not delegated listeners in Backbone
has comment: http://stackoverflow.com/comment/43219716
has answer: http://stackoverflow.com/a/27398738
type: AnsweredQuestion
has body: When creating a new user via Ajax, a new user element (which is created manually) is not delegated events. If I try to move on of my elements from one list to another an call this.delegateEvents() the click listeners are applied. However, no matter what I try I cannot get the click listeners to apply to this newly created element. The event does not even need to be attached to the model, just a simple show/hide event is all I need it to do. events: { 'click a.toggle': 'toggleContent', }, addNewUserElement: function (userId) { var $formName = this.$('form').attr('name'); var $listElement = this.createNewListElement(userId, $formName); this.trigger('user-created-event', $listElement); // this.onUserCreate }, createNewListElement: function (userId, $formName){ var html = this.$('form input#' + $formName + '_lastName').val().toUpperCase() // more html creation return html; } onUserCreate: function ($el) { var targetList = '#active-users' alert("User created"); this.insertIntoList(targetList, $el); }, insertIntoList: function(targetList, $elementToMove){ this.undelegateEvents(); var added = false; var $targetList = // grab a set of &lt;li&gt;'s $targetList.append($elementToMove); this.delegateEvents(); return false; },
has comment: http://stackoverflow.com/comment/43243209
tagged with: javascript
type: Question
accepted answer: http://stackoverflow.com/a/27398738
score: 0

http://stackoverflow.com/comment/67618162
score: 1
type: AnswerComment
has text: @Lux.Capacitor @Zen It's an almost 2 year old answer and I totally agree with current practices. However when answer was posted the OP was using `React.createClass()` which really didn't have any constructor.
type: Comment
comment on: http://stackoverflow.com/a/27397318

http://stackoverflow.com/comment/43327596
type: AnswerComment
score: 0
type: Comment
has text: @M42 OP's pattern does not match any non-alpha numeric characters and is also needlessly complex. https://www.debuggex.com/r/dlsjoQrphPvuV0u8
comment on: http://stackoverflow.com/a/27443123

http://stackoverflow.com/comment/43161902
has text: Thank you I have do like this and it works great ! I have noticed I can't send object method too, and I don't know why ! I have to re-attribute function to my object when I emit it to an other socket :/. I think it's not possible too ? Thank you :)
comment on: http://stackoverflow.com/a/27334935
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43261081
type: Comment
comment on: http://stackoverflow.com/a/27405411
score: 0
type: AnswerComment
has text: So, I got confused with the hoisting thing, and this link discuses the concept in more mundane manner : http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html

http://stackoverflow.com/q/27462851
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap
tagged with: ruby-on-rails
type: Question
possible better answer: http://stackoverflow.com/a/32325492
tagged with: javascript
has answer: http://stackoverflow.com/a/32325492
has title: Bootstrap modals - update the background shadow mask when updating the size / content of the modal window
has body: I have a bootstrap modal window that contains a form. In this modal is also a link that uses the jQuery function .slideToggle(). Pressing this link expands a div that is otherwise hidden. The size of the modal popover is therefore dynamic. When pressing this link I get the following effect: The dark grey color is the default Bootstrap modal background shadow, the white box with some words is my modal popover, and the light grey background is my original background color. So what I want to do is to update the size of my Bootstrap modal background shadow so it fills the whole view, also when the size of the modal changes. Is there a simple way to do this? I use Rails and my HTML (HAML) and JS is very simple in this case: = link_to "#", "Click me to toggle", id: "toggle" # JS $("#toggle").click -&gt; $(".my-div").slideToggle()
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27463138
accepted answer: http://stackoverflow.com/a/27463138
tagged with: jquery

http://stackoverflow.com/comment/43294969
type: QuestionComment
comment on: http://stackoverflow.com/q/27426539
has text: @PSL If I write something like `item.name for item in items`, the `select` becomes empty
score: 0
type: Comment

http://stackoverflow.com/comment/43254690
score: 0
has text: The site isn't uploaded yet. This is my code on jsfiddle http://jsfiddle.net/jm2o73f2/9/ Hope this helps.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27404932

http://stackoverflow.com/a/27410151
has body: You need setTimeout(), not setInterval(). Also, you need location.href, not just window.location. This script says, "When .prize_select is clicked, redirect to "cnn.com" after 2000 ms. $(document).ready(function() { $(".prize_select").click(function() { window.setTimeout(function() { location.href = 'http://www.cnn.com'; }, 2000); }); }); Click me!
has comment: http://stackoverflow.com/comment/43265525
score: 3
has comment: http://stackoverflow.com/comment/43264734
has comment: http://stackoverflow.com/comment/43265837
has comment: http://stackoverflow.com/comment/43265117
has comment: http://stackoverflow.com/comment/43265187
has comment: http://stackoverflow.com/comment/43264843
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27410050
has comment: http://stackoverflow.com/comment/43264910
accepted answer of: http://stackoverflow.com/q/27410050
has comment: http://stackoverflow.com/comment/43265353
type: Answer
has comment: http://stackoverflow.com/comment/43265632
has comment: http://stackoverflow.com/comment/43265381
has comment: http://stackoverflow.com/comment/43264947
upvote count: 3
has comment: http://stackoverflow.com/comment/43265619
has comment: http://stackoverflow.com/comment/43585753
has comment: http://stackoverflow.com/comment/43265016

http://stackoverflow.com/q/27376472
has answer: http://stackoverflow.com/a/27376574
has answer: http://stackoverflow.com/a/27376690
downvote count: 0
tagged with: jquery
favorite count: 0
has body: here's my problem. I have a month-view type calendar in a table. In this calendar there can be certain periods which are (they have the class 'blocked'). The first date of such a period has the class 'blocked' as well as 'start', while the last date has the classes 'blocked' and 'end'. Now, when I hover over one of these TDs I want that td, and all the other ones in ONLY THAT SPECIFIC period (can be over multiple rows), to get the class 'blocked-highlight'. Here is a JSFiddle which generally shows what I have: http://jsfiddle.net/aoxmpouw/ Here is the Code from the Fiddle: RELEVANT PART OF HTML: ... 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ... JS: $( document ).ready(function() { $("td.blocked").hover( function() { $( this ).addClass('blocked-highlight') }, function() { $( this ).removeClass('blocked-highlight') } ); }); CSS: .blocked { color: white; background-color: red; } .start { border-left: 5px solid black; } .end { border-right: 5px solid black; } .blocked-highlight { background-color: blue; } JQuery is perfectly fine, as well as pure CSS solutions, if there are any. Thanks in advance, Cheers -N
possible better answer: http://stackoverflow.com/a/27376689
has answer: http://stackoverflow.com/a/27376689
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27376730
upvote count: 2
has title: How do I change the class of several tds when hovering over one of them?
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27376730

http://stackoverflow.com/q/27414614
type: Question
possible better answer: http://stackoverflow.com/a/27414724
answer count: 2
has answer: http://stackoverflow.com/a/27414687
accepted answer: http://stackoverflow.com/a/27414687
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43273200
has answer: http://stackoverflow.com/a/27414724
has comment: http://stackoverflow.com/comment/43273225
type: AnsweredQuestion
has body: I used this base64 and uriencode on a number base64 num gives me MTQxODI2NTg2OTQ1Mg== But actually i also needs to uri encode it after base64 encode when i tried to encodeURIComponent(base64num) it throwed me an error as follows: Exception thrown from JavaScript : Error: Malformed UTF-8 data How to achieve this
has title: Base64 encode on number in javascript

http://stackoverflow.com/q/27381272
score: 1
has comment: http://stackoverflow.com/comment/44676630
favorite count: 0
type: Question
tagged with: twitter-bootstrap
has title: Align a bootstrap-growl alert bottom left
has body: According to the bootstrap-growl options documentation we can use placement options to stick the growl notifications elsewhere. I'm trying to put my growl notifications bottom left, but it's not working. Here's what I'm trying to do: $(document).ready(function () { $.growl({ message: 'Test.' }, { placement: { from: "bottom", align: "left" }, delay: 1000000 }); }); The options are being parsed it seems: the delay option is honored. So are others if I add them. However, the placement remains at its default top/right position. I'm using bootstrap-growl version 1.0.6. Version 2 seems to be in the making but not released yet. Perhaps part of my problem is that the bootstrap-growl website's documentation is aimed at V2? What am I missing here? Probably something obvious...
accepted answer: http://stackoverflow.com/a/27382055
has comment: http://stackoverflow.com/comment/44676706
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/44673846
tagged with: javascript
has answer: http://stackoverflow.com/a/27382055
tagged with: bootstrap-notify
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/44675089
downvote count: 0

http://stackoverflow.com/comment/43358781
type: QuestionComment
has text: Why is the text there in the first place? Surely you want to stop the text getting there rather then removing it.
comment on: http://stackoverflow.com/q/27461226
score: 0
type: Comment

http://stackoverflow.com/comment/43193916
comment on: http://stackoverflow.com/q/27371243
type: Comment
type: QuestionComment
has text: You really need to use quotes for all your form stuff. Some browsers let that go by; many don't. You mention JS stuff, but haven't shown it. Plus, this won't work ` `.
score: 1

http://stackoverflow.com/comment/43256643
has text: Actually `$.each` provides the index for you, so you can just write: `$(".plans-description").each(function(i) { $("ul li:nth-child(" + (i + 1) + ")").prepend($(this).clone(true)); });`
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27405565
score: 3

http://stackoverflow.com/comment/43276200
has text: Well its all the same, I just like it that way! I am using a custom routeResolver.js service to load the controllers based on the route and that's why using app.register.controller(...)
score: 0
comment on: http://stackoverflow.com/q/27415959
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/71856255
type: AnswerComment
has text: I'll tidy that up later when I get a chance
type: Comment
comment on: http://stackoverflow.com/a/27390711
score: 0

http://stackoverflow.com/a/27367118
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27366961
has body: You could very well use a double negative. var test = 0; console.log(!!test); var test = ""; console.log(!!test); var test = "0"; console.log(!!test); var test = null; console.log(!!test); Although "0" is not an empty string so it evaluates to true, the rest return false. Also, I agree with the comment that dfsq made in that you shouldn't rely on this. You should know and understand what types your variables are holding.

http://stackoverflow.com/comment/43204515
type: Comment
has text: I have added the login function to the question, could you please have a look if you get a chance? thanks
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27376546

http://stackoverflow.com/comment/43379779
type: Comment
has text: yes I called func() through html . Here's the code Set min 00:00 Start Stop
type: QuestionComment
comment on: http://stackoverflow.com/q/27472476
score: 0

http://stackoverflow.com/comment/43302293
score: 0
type: Comment
type: QuestionComment
has text: Add a querystring with a timestamp to the url.
comment on: http://stackoverflow.com/q/27430557

http://stackoverflow.com/comment/43252466
type: Comment
has text: Yes, and that is exactly why CDNs are used to load js files.
type: AnswerComment
comment on: http://stackoverflow.com/a/27403836
score: 0

http://stackoverflow.com/comment/43147934
comment on: http://stackoverflow.com/a/27341389
type: AnswerComment
score: 0
type: Comment
has text: Wow, very impressive. Would you recommend the one approach above the other?

intellisense
tags question: http://stackoverflow.com/q/27439479
type: Tag
tag name: intellisense

http://stackoverflow.com/q/27355397
has answer: http://stackoverflow.com/a/29138093
has answer: http://stackoverflow.com/a/27355428
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27355430
has comment: http://stackoverflow.com/comment/43163590
has comment: http://stackoverflow.com/comment/43163686
tagged with: javascript
tagged with: variables
has title: How to get variable value from another js file
has answer: http://stackoverflow.com/a/27355429
has comment: http://stackoverflow.com/comment/43163626
has comment: http://stackoverflow.com/comment/43163895
tagged with: global
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/43164056
downvote count: 0
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43164112
has comment: http://stackoverflow.com/comment/43163665
has body: I've JavaScript file named Second.js which contains variable named page. Second.js: var page = 1; How can I retrieve that value, i.e page, from another JavaScript named one.js?
has answer: http://stackoverflow.com/a/27355595

http://stackoverflow.com/a/27326687
has comment: http://stackoverflow.com/comment/43134465
has body: It seems that your surface has a too small height to draw a 10px border. You should also add a line style to the border e.g. solid. You could try the following to see a border: var surface = new Surface({ content: ' Famous in JSFiddle ', size: [window.innerWidth / 2, 100], border: [10], properties: { background: 'red', border: '10px solid', borderColor: 'blue' } }); Famous.loaded(function () { var Engine = Famous.Core.Engine; var Modifier = Famous.Core.Modifier; var RenderNode = Famous.Core.RenderNode; var Surface = Famous.Core.Surface; var Transform = Famous.Core.Transform; var mainContext = Engine.createContext(); var surface = new Surface({ content: ' Famous in JSFiddle ', size: [window.innerWidth / 2, 100], border: [10], properties: { background: 'red', border: '10px solid', borderColor: 'blue' } }); var sizeModifier = new Modifier({ size: [window.innerWidth, window.innerHeight] }); var alignModifier = new Modifier({ align: [0.5, 0.5], origin: [0.5, 0.5] }); mainContext.add(sizeModifier).add(alignModifier).add(surface); /* var surface = new Surface({ content: ' Famous in JSFiddle ' }); var modifier = new Modifier({ transform: Transform.translate(50, 50) }); */ //var node = new RenderNode(modifier); //node.add(surface); var appContext = mainContext; //Engine.createContext(); //appContext.add(node); Engine.pipe(Application); });
type: Answer
answers question: http://stackoverflow.com/q/27326411
has comment: http://stackoverflow.com/comment/43137238
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27326411
score: 0

http://stackoverflow.com/comment/43175674
type: AnswerComment
score: 0
type: Comment
has text: Thanks. I'll have one combined JS file for everything. Don't want to separate out jQuery beacuse DNS lookup + HTTP connection to google servers would take extra time too. 1) Latency: I win 2) Parallelism: I win 3) I've read a study which showed that it's actually a misconception, due to protocol, version and CDN differences, hits are very low ~17%. So overhead is not worth it
comment on: http://stackoverflow.com/a/27361523

http://stackoverflow.com/q/27388168
linked to: http://stackoverflow.com/q/4753957
favorite count: 0
type: UnansweredQuestion
tagged with: sockets
has comment: http://stackoverflow.com/comment/43230959
tagged with: node.js
has comment: http://stackoverflow.com/comment/43229462
answer count: 0
score: 1
tagged with: authentication
upvote count: 1
type: Question
has title: Socket.io authentication token vs. cookie
has comment: http://stackoverflow.com/comment/43229228
has comment: http://stackoverflow.com/comment/43229487
downvote count: 0
tagged with: javascript
has body: I'm using Socket.IO in Node.js, and need a system to authenticate users connecting through websockets. The both key questions are, how to: 1) get the information to the server about who is connecting via Socket.IO 2) authenticate who they say they are Basically, my question is exactly similar to this question, but as nearly 4 years have past since the question was answered, I wanted to make sure if this is still best - practice. Another answer on the question posted at the beginning of this year is about using tokens, so what would be the way to go for a new application?
has comment: http://stackoverflow.com/comment/43229512

http://stackoverflow.com/a/27326479
answers question: http://stackoverflow.com/q/27322723
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43121261
has body: You can use promises as proxies that represent values: username = getUserName() company = username.then(getRelatedCompany) // assuming good promise lib, otherwise shim .spread of nest once connexion = Promise.all([username, company]).spread(registerConnexion) In bluebird, this is even simpler and becomes: username = getUserName() company = username.then(getRelatedCompany) connexion = Promise.join(username, company, registerConnexion); Since .join was designed for this use case in mind.
has comment: http://stackoverflow.com/comment/43120738
has comment: http://stackoverflow.com/comment/43120707
accepted answer of: http://stackoverflow.com/q/27322723

http://stackoverflow.com/comment/43230989
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27391608
score: 0
has text: Also adding the above rule successfully gets the file.

http://stackoverflow.com/q/27415536
tagged with: http://stackoverflow.com/tag/html
has title: html5 fullscreen video onClick event
has comment: http://stackoverflow.com/comment/43275043
type: UnansweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/52535987
has comment: http://stackoverflow.com/comment/43275024
tagged with: javascript
has comment: http://stackoverflow.com/comment/43275088
upvote count: 2
linked to: http://stackoverflow.com/q/1055214
answer count: 3
has body: Is there a way to make a image fire a fullscreen html5 video? Basically I have something like this: So I was thinking of hiding the #myVideo and adding a click event to #videoButton to take the video into full browser screen. Is this possible??
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27415695
has answer: http://stackoverflow.com/a/27415571

http://stackoverflow.com/comment/81265095
type: AnswerComment
has text: @PardeepJain the above link is the working example, I haven't tried myself anyways.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27341614

http://stackoverflow.com/q/27403515
has comment: http://stackoverflow.com/comment/43251719
has comment: http://stackoverflow.com/comment/43254888
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27410555
favorite count: 0
has title: Export object from three.js to anything
has comment: http://stackoverflow.com/comment/43252112
has answer: http://stackoverflow.com/a/62645383
upvote count: 3
tagged with: three.js
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/27410555
has comment: http://stackoverflow.com/comment/43257204
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/62645383
has body: Is there any way to export object from three.js? Any one will do : Collada,Blender,3ds Max,Maya There is import plugin for blender (in master branch) but it's not working (can't even import exported cube), I tried to look in dev branch for updated version, but there is no importer, only exporter Consider this workflow : User generates some objects/models in browser(three.js) and than I want to import these objects into 3d modeling software for further editing/post modeling

http://stackoverflow.com/q/27387966
tagged with: angularjs-scope
has body: I am a Java programmer. I am working now in a mobile app with JavaScript, especifically with Angular.js. I am totally new to this technology, so I am trying to figure out how to hold values in a controller scope when switching from one view to another that share the same controller. For example: this is my UserController .controller('UserCtrl',['$scope','UserService',function($scope, UserService) { UserService.getAll().success(function(data){ $scope.items=data.results; }); UserService.get("h7D2wy5lIs").then(function(data){ $scope.item = data.data; }); $scope.onItemDelete = function (item) { UserService.delete(item.objectId); $scope.items.splice($scope.items.indexOf(item),1); }; }]) This controller is shared between two different views. When I navigate, the controller reloads every time, and I need to get the default user item from a REST service only once, and then store it in the controller's scope to work with it. If I modify the item properties in a form, when I go back, it gets the values from the REST API, instead of keeping the state with the new values I provided. Is there a way to initialize a Controller just once and keep its state through the navigation? Thanks in advance.
has comment: http://stackoverflow.com/comment/43227768
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43226551
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43225870
favorite count: 0
type: Question
has title: What is the correct way to handle $scope state and values when changing views in Angular.js
score: 1
tagged with: angularjs
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/27390163

http://stackoverflow.com/comment/125536698
has text: How about the peculiar case : Api is the same server for dev/QA environment but different for uat/production[CORS] environment.
comment on: http://stackoverflow.com/a/27407440
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43361069
score: 0
has text: Do you want to show the timer, or just disable the action. If it is the second, check setInterval function in javascript.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27462396

http://stackoverflow.com/comment/43123927
type: Comment
type: QuestionComment
has text: I'm not a fan of the down voting (esp w/o a comment) - the question is simple but still seems to meet the criteria for a SO question.
score: 0
comment on: http://stackoverflow.com/q/27333234

http://stackoverflow.com/comment/68802251
comment on: http://stackoverflow.com/a/28610249
type: AnswerComment
type: Comment
score: 1
has text: `it` blocks in tests should be independent from each other as the order they run is not guaranteed. Hence this approach might works sometimes, sometimes not.

http://stackoverflow.com/q/27420687
answer count: 3
has comment: http://stackoverflow.com/comment/43284366
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27420793
has answer: http://stackoverflow.com/a/27420923
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43284077
has comment: http://stackoverflow.com/comment/43284045
tagged with: css
has comment: http://stackoverflow.com/comment/43284094
type: UnansweredQuestion
has body: I tried to replace block of html codes replace with another block of html. but i could not do it. this is the html block with this code block i tried this with this code but it not working $(document).ready(function() { $('.test-img').click(function () { var lookbook2 = ' ' + ' '; $('#book1').append(lookbook2); }); Can anyone help me?
downvote count: 1
has comment: http://stackoverflow.com/comment/43284267
type: Question
has title: how to replace html block of codes with another block of codes with inline css in jquery?
score: -1
has answer: http://stackoverflow.com/a/27420813

http://stackoverflow.com/comment/43234829
has text: I've never heard of ImpactJS, but what you remember is the [`Function.prototype.bind` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) - that is native and does not need any extensions on `Object`.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27393364

http://stackoverflow.com/a/27468232
has body: The ".en" and ".de" refer to the class names, and the ":lang(en)" and ":lang(sl)" refer to the lang attributes. .en:lang(en), .de:lang(sl) { display:block; } means "enable block display for any items with class 'en' and lang='en', and any items with class 'de' and lang='sl'"
answers question: http://stackoverflow.com/q/27468110
score: 0
has comment: http://stackoverflow.com/comment/43371843
type: Answer
has comment: http://stackoverflow.com/comment/43372922

http://stackoverflow.com/comment/43367679
type: AnswerComment
comment on: http://stackoverflow.com/a/27465818
type: Comment
has text: the keyword `event` is must be added as is or I can change the word to anything?
score: 0

http://stackoverflow.com/a/27334212
score: 0
has comment: http://stackoverflow.com/comment/43125614
type: Answer
has body: Try var arr = [ 87 , 101 , 98 , 32 , 68 , 101 , 118 , 101 , 108 , 111 , 112 , 109 , 101 , 110 , 116 ]; var output = String.fromCharCode.apply(String, arr); $("#txtInput") .on("keydown.str", function(e) { alert(e.target.value) }) .prop("value", output) .trigger("keydown.str"); var arr = [ 87 , 101 , 98 , 32 , 68 , 101 , 118 , 101 , 108 , 111 , 112 , 109 , 101 , 110 , 116 ]; var output = String.fromCharCode.apply(String, arr); $("#txtInput") .on("keydown.str", function(e) { alert(e.target.value) }) .prop("value", output) .trigger("keydown.str"); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input id="txtInput" type="text" /&gt;
answers question: http://stackoverflow.com/q/27333808
has comment: http://stackoverflow.com/comment/43125742

http://stackoverflow.com/comment/43347560
has text: Oh, sorry for spoiling the fun ;)
comment on: http://stackoverflow.com/a/27454300
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43103410
comment on: http://stackoverflow.com/q/27321859
type: Comment
type: QuestionComment
score: 0
has text: OK, I think this is what you want: http://jsfiddle.net/nLgqhqwc/10/ See the fiddle and tell us if it works as wanted.

http://stackoverflow.com/comment/43165600
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27354853
type: AnswerComment
has text: yep. You are right. I read it again, that is what you said :) Somehow on my previous readings I mistook the code example on Tuples as a continuation on how you would then use the union in a function. My bad, as they said in the '90s.

http://stackoverflow.com/comment/43364398
type: Comment
comment on: http://stackoverflow.com/a/27463945
has text: what is the type of elementStart that you are passing into your function?
type: AnswerComment
score: 0

http://stackoverflow.com/q/27363134
score: 0
has body: I'm trying to call a function when a radio button is clicked but it's not working. I have this fiddle doing basically just what I want it to do, but it's not working in my code. In the view.. @* bunch of html *@ @* bunch of html *@ @Html.RadioButtonFor(model => model.MedicalSeverity, "none", new { @id = "MedicalSeverity_None", @name = "radioGroup", @class="radioGroup", @checked = "checked" }) None @Html.RadioButtonFor(model => model.MedicalSeverity, "minor", new { @id = "MedicalSeverity_Minor", @name = "radioGroup", @class = "radioGroup"}) Minor @Html.RadioButtonFor(model => model.MedicalSeverity, "major", new { @id = "MedicalSeverity_Major", @name = "radioGroup", @class = "radioGroup"}) Major Click me Which renders into... None etc etc So here, if the button is clicked, the function fires the alert. If a radio button is clicked, nothing happens. In summary, what works in the fiddle doesn't seem to be working here. Thoughts? I also tried to use .change() to get the radio button event (this would also be an acceptable solution), but that didn't work either. Something to do with Razor maybe?
answer count: 2
has comment: http://stackoverflow.com/comment/43211036
has title: Function on radio button click not firing
tagged with: jquery
has comment: http://stackoverflow.com/comment/43178394
has comment: http://stackoverflow.com/comment/43178280
has comment: http://stackoverflow.com/comment/43178735
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43178301
linked to: http://stackoverflow.com/q/17186239
type: AnsweredQuestion
tagged with: icheck
has comment: http://stackoverflow.com/comment/43178413
has answer: http://stackoverflow.com/a/27381231
has comment: http://stackoverflow.com/comment/43178391
type: Question
has answer: http://stackoverflow.com/a/27426803
accepted answer: http://stackoverflow.com/a/27426803
possible better answer: http://stackoverflow.com/a/27381231
tagged with: javascript

http://stackoverflow.com/q/27430740
has comment: http://stackoverflow.com/comment/43306521
has comment: http://stackoverflow.com/comment/43306603
tagged with: wampserver
has title: change number representation to indian
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43306628
tagged with: php
has comment: http://stackoverflow.com/comment/43302997
type: Question
has body: i need change number representation to 'Arabic-Indic digits' in my web application to display the 123456789 to "٠١٢٣٤٥٦٧٨٩" . the following code do what i need but over Jquery selected dom element like span .BUT i need to change all number on the whole response from the server // Eastern Arabic (officially "Arabic-Indic digits") "0123456789".replace(/\d/g, function(v) { return String.fromCharCode(v.charCodeAt(0) + 0x0630); }); // "٠١٢٣٤٥٦٧٨٩" more info about my Application. i use WampServer as webserver which mean i hope to get a solution using php,jquery,js,css , Apache server settings.
has comment: http://stackoverflow.com/comment/43302764
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27430960
tagged with: jquery
score: 0

http://stackoverflow.com/comment/43337405
comment on: http://stackoverflow.com/a/27449269
type: Comment
score: 0
type: AnswerComment
has text: That is true, I missed the `Object` in front of it, thought it could have been a problem with the JSON serializer. Some JSON serializers do have the option to not quote strings, or maybe that's just when deserializing...

http://stackoverflow.com/a/27422888
type: Answer
accepted answer of: http://stackoverflow.com/q/27422655
upvote count: 1
answers question: http://stackoverflow.com/q/27422655
has body: try like this: &lt;script&gt; jQuery(document).ready(function() { $('.priceswrapper').each(function(){ var data = 'reg'; var types = $(this).attr('tour_type').split(',');// you should get string fron here. console.log(types); if ($.inArray(data, types) !== -1) { $(this).show(); }else { $(this).hide(); } }); }); &lt;/script&gt; &lt;label class="priceswrapper" tour_type="reg, div"&gt;Price &lt;input name="adult_cost" type="text"/&gt; &lt;/lable&gt; &lt;label class="priceswrapper" tour_type="reg, div"&gt;Price &lt;input name="kids_cost" type="text"/&gt; &lt;/lable&gt; &lt;label class="priceswrapper" tour_type="div"&gt;Price &lt;input name="intro_dive" type="text"/&gt; &lt;/lable&gt; &lt;label class="priceswrapper" tour_type="div"&gt;Price &lt;input name="pro_dive" type="text"/&gt; &lt;/lable&gt; &lt;label class="priceswrapper" tour_type="qud"&gt;Price &lt;input name="quad_price" type="text"/&gt; &lt;/lable&gt;
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/comment/62581027
comment on: http://stackoverflow.com/a/27467380
score: 1
type: AnswerComment
has text: @Moran "*"the fact that '$destroy' event is fired prove that Angular's flow is working as expected, the directive and it scope should be deleted"* - if there is a leak, even though `'$destroy'` is fired, the GC won't be able to collect the directive and it's scope, that is what a leak is.
type: Comment

http://stackoverflow.com/a/27338696
has body: I put together a jsFiddle using divs in place of images to demonstrate (pure js): http://jsfiddle.net/oogley_boogley/az9gd8wf/ the script: var divs = document.getElementsByClassName('square'); var arrLength = divs.length; var randomNumberLimit; var interval_speed = 1000; setInterval(function(){ randomNumberLimit = Math.floor((Math.random() * arrLength) + 1); for(i=0;i&lt;arrLength;i++){ var matchingDiv = divs[i]; if(matchingDiv.id == randomNumberLimit){ matchingDiv.setAttribute("class","showing square blue"); } if(matchingDiv.id != randomNumberLimit){ matchingDiv.setAttribute("class","hiding square blue"); } } }, interval_speed);
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27338085
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27338085

http://stackoverflow.com/q/27395087
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43236756
type: Question
tagged with: javascript
has title: Calculating sum from a table in an iframe
tagged with: jquery
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/27395237
accepted answer: http://stackoverflow.com/a/27395237
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1
has body: I have a main page and a sub page (frame) one. The frame contains a table that contains numbers in a column. I want to sum up these numbers and get the result from the main page. Now my problem is just I don't know how to access the s in the frame table. The file ServicesList_guest_form.php contains ... ... ... Thank you for help
favorite count: 0

http://stackoverflow.com/q/27331917
type: Question
tagged with: javascript
score: 0
has title: JQuery mobile how to prevent the li item to swipe right?
tagged with: jquery-mobile
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27333732
type: AnsweredQuestion
has body: I am using this peace of code https://github.com/ksloan/jquery-mobile-swipe-list that I have modified and its working fine. However the code has two buttons, right and left. In my project, I only have one in the right side so swipe left to uncover it its ok, but I cannot find how can I eliminate the swipe right since I dont have any button in the left side and it crashes every time it swipe that direction. Any advice? Code: $(function() { function prevent_default(e) { e.preventDefault(); } function disable_scroll() { $(document).on('touchmove','#myPostsList .ui-content', prevent_default); } function enable_scroll() { $(document).unbind('touchmove',' #myPostsList .ui-content', prevent_default); } var x; $(document) .on('touchstart', '.swipe-delete li &gt; a', function(e) { console.log(e.originalEvent.pageX); ///// GET ID OF SELECTED POST AND STORE IN A DIV FOR AJAX ///// document.getElementById("myPostIDStorage").value = $(this).attr('data-key'); $('.swipe-delete li &gt; a.open').css('left', '0px').removeClass('open') ;// close em all $(e.currentTarget).addClass('open'); x = e.originalEvent.targetTouches[0].pageX // anchor point }) .on('touchmove', '.swipe-delete li &gt; a', function(e) { var change = e.originalEvent.targetTouches[0].pageX - x; change = Math.min(Math.max(-100, change), 100); // restrict to -100px left, 0px right e.currentTarget.style.left = change + 'px'; if (change &lt; -10) disable_scroll() // disable scroll once we hit 10px horizontal slide }) .on('touchend', '.swipe-delete li &gt; a', function(e) { var left = parseInt(e.currentTarget.style.left); var new_left; if (left &lt; -35) { new_left = '-100px'; } /*else if (left &gt; 35) { new_left = '100px' } */ else { new_left = '0px'; } //e.currentTarget.style.left = new_left $(e.currentTarget).animate({left: new_left}, 200) enable_scroll(); }); });
has answer: http://stackoverflow.com/a/27333732

http://stackoverflow.com/q/27347856
has title: Nodejs VM. Set memory limit
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27349631
possible better answer: http://stackoverflow.com/a/51360510
has answer: http://stackoverflow.com/a/51360510
tagged with: virtual-machine
type: Question
has body: I'm working now with nodejs virtual machine: http://nodejs.org/api/vm.html I'm interesting, is it possible to set memory limit to script and maybe limit to CPU?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27349631
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/87703885

http://stackoverflow.com/a/27388294
score: 1
has comment: http://stackoverflow.com/comment/43225141
has comment: http://stackoverflow.com/comment/43224702
has comment: http://stackoverflow.com/comment/43225217
has comment: http://stackoverflow.com/comment/43225729
upvote count: 1
has comment: http://stackoverflow.com/comment/43225995
has body: Something like: ^\d+(\.\d{1,2})?$ Note we dropped the sign part [-+]? because you stated only positive numbers. Explanation: ^ start of string \d+ match zero or more digits (\.\d{0,2})? match the pattern in the brackets 0 or 1 time \. match a literal . \d{1,2) match 1 or 2 digits $ end of string So this allows some digits optionally followed by a . and 1 or 2 more digits. Adjust as needed. var rx = /^\d+(\.\d{1,2})?$/; alert(rx.test("1.22") + "\n" // true + rx.test("10") + "\n" // true + rx.test("2223.4") + "\n" // true + rx.test("foo") + "\n" // false + rx.test("1..22") + "\n" // false + rx.test(" 1")); // false
has comment: http://stackoverflow.com/comment/43225006
type: Answer
answers question: http://stackoverflow.com/q/27388094
has comment: http://stackoverflow.com/comment/43224495
downvote count: 0

http://stackoverflow.com/a/27354951
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43162869
has comment: http://stackoverflow.com/comment/43163464
type: Answer
has comment: http://stackoverflow.com/comment/43163479
has body: I'm going out from the assumption that your example code is inside a loop, thus all you need to do is to ensure that when you hit a certain id (the one you want to keep open), that it gets the status of open at all times. Assuming, say, the id of the section you want to keep open is 3, this is what you could do: if ($id == 3) $state = 'open'; Insert this statement on top of the code block you added to your question. As I don't know what else is influencing the variable $state, make sure it's not being changed anywhere else, so that your statement above always remains true ensuring the section to always remain open.
answers question: http://stackoverflow.com/q/27354750
has comment: http://stackoverflow.com/comment/43163439
has comment: http://stackoverflow.com/comment/43163217
accepted answer of: http://stackoverflow.com/q/27354750
score: 0
has comment: http://stackoverflow.com/comment/43163357
has comment: http://stackoverflow.com/comment/43163017

http://stackoverflow.com/a/27393309
has comment: http://stackoverflow.com/comment/43252710
type: Answer
has comment: http://stackoverflow.com/comment/43238541
has body: I'm not sure what you mean by "the second one is the callback function which shouldn't accept any parameters according to is signature". The callback signature (function(tasks)) certainly does expect an argument (tasks). cb is the callback function that was passed in. In this case it is literally the anonymous function: function(tasks) { for(var i in tasks) { console.log(tasks[i]); } } tasks is the name of two different variables (but they point to the same object because arrays are passed by reference) in different scopes. One is defined in loadOrInitializeTaskArray() as you noted, the other is a parameter for the callback passed to loadOrInitializeTaskArray(). Also, on an unrelated note, typically callbacks follow the "error-first" format. This allows for handling of errors upstream. Modifying the code to follow this convention would result in: function loadOrInitializeTaskArray(file, cb) { fs.exists(file, function(exists) { var tasks = []; if (exists) { fs.readFile(file, 'utf8', function(err, data) { if (err) return cb(err); var data = data.toString(); // JSON.parse() throws errors/exceptions on parse errors try { var tasks = JSON.parse(data || '[]'); } catch (ex) { return cb(ex); } cb(null, tasks); }); } else { cb(null, []); } }); } function listTasks(file) { loadOrInitializeTaskArray(file, function(err, tasks) { if (err) throw err; for (var i in tasks) { console.log(tasks[i]); } }); }
answers question: http://stackoverflow.com/q/27393206
score: 0

http://stackoverflow.com/q/27327408
answer count: 1
accepted answer: http://stackoverflow.com/a/27327580
has title: Coffeescript instance method encapsulation in an Object
has answer: http://stackoverflow.com/a/27327580
type: AnsweredQuestion
tagged with: coffeescript
type: Question
has body: Say I have a Coffeescript class: class Foo MyMethodsBar: () =&gt; "bar" MyMethodsBaz: () =&gt; "baz" Is there any way to encapsulate methods like this (not working): class Foo MyMethods: bar: () =&gt; "bar" baz: () =&gt; "baz" So I can call: f = new Foo() f.MyMethods.bar() The problem is that this (or @) is not the instance when I do this like a regular method. I'm trying to do this for cleaner mixins/concerns. Thanks, Erik
tagged with: javascript
score: 0

http://stackoverflow.com/q/27436680
score: -2
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I obfuscated my javascript code using this one http://www.javascriptobfuscator.com/Default.aspx but it seems I can' find way to back it to original code.. is there any way?
downvote count: 3
has comment: http://stackoverflow.com/comment/43315250
has comment: http://stackoverflow.com/comment/43314008
has comment: http://stackoverflow.com/comment/43314015
has title: How to UnObfuscate, Obfuscated Javascript?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27437005
accepted answer: http://stackoverflow.com/a/27437005

http://stackoverflow.com/a/27437076
has comment: http://stackoverflow.com/comment/43315018
has comment: http://stackoverflow.com/comment/43315286
has comment: http://stackoverflow.com/comment/43315044
score: 0
has comment: http://stackoverflow.com/comment/43315262
has body: how about this $(document).ready(function() { $('#receipt_image').bind('change', function() { var fileInput = $("#receipt_image")[0]; var ImgSizeInBytes = fileInput.files[0].size; if ($('.alert-danger').length) { $('.alert-danger').remove(); if(ImgSizeInBytes &gt; 10485760) { var htmlStr = "&lt;div class='alert alert-danger alert-dismissible' role='alert'&gt;&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;&lt;/button&gt;The file you are trying to upload exceeds 10MB upload limit.&lt;/div&gt;"; $(htmlStr).insertBefore('div.modal-body #rebate_request_form'); } }); }); UPDATE $(document).ready(function() { $('#receipt_image').bind('change', function() { var htmlStrobj = $("&lt;div class='alert alert-danger alert-dismissible' id='errordiv' role='alert'&gt;&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;&lt;/button&gt;&lt;/div&gt;"); var fileInput = $("#receipt_image")[0]; var ImgSizeInBytes = fileInput.files[0].size; if ($('#errordiv').length) { $('#errordiv').remove(); if(ImgSizeInBytes &gt; 10485760) { var htmlStr = "The file you are trying to upload exceeds 10MB upload limit.&lt;/br &gt;"; htmlStrobj.append(htmlStr); } // You can add more validation rules here htmlStrobj.insertBefore('div.modal-body #rebate_request_form'); }); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43314942
type: Answer
has comment: http://stackoverflow.com/comment/43314891
answers question: http://stackoverflow.com/q/27436712
has comment: http://stackoverflow.com/comment/43315346
accepted answer of: http://stackoverflow.com/q/27436712

variables
tag name: variables
tags question: http://stackoverflow.com/q/27322325
tags question: http://stackoverflow.com/q/27431911
tags question: http://stackoverflow.com/q/27321580
tags question: http://stackoverflow.com/q/27414295
tags question: http://stackoverflow.com/q/27336719
tags question: http://stackoverflow.com/q/27464500
type: Tag
tags question: http://stackoverflow.com/q/27409552
tags question: http://stackoverflow.com/q/27454238
tags question: http://stackoverflow.com/q/27355397
tags question: http://stackoverflow.com/q/27422352
tags question: http://stackoverflow.com/q/27409812
tags question: http://stackoverflow.com/q/27450196
tags question: http://stackoverflow.com/q/27440746
tags question: http://stackoverflow.com/q/27389674
tags question: http://stackoverflow.com/q/27351803
tags question: http://stackoverflow.com/q/27431870
tags question: http://stackoverflow.com/q/27344710
tags question: http://stackoverflow.com/q/27371127
tags question: http://stackoverflow.com/q/27322564
tags question: http://stackoverflow.com/q/27381591
tags question: http://stackoverflow.com/q/27353541
tags question: http://stackoverflow.com/q/27351816
tags question: http://stackoverflow.com/q/27379000

http://stackoverflow.com/comment/43326344
has text: @JamesHunt but the best way to sync it would be to do it with ajax, not a full page reload if you just wanna sync the time.
comment on: http://stackoverflow.com/a/27441279
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43214836
has text: Not really I already tried that option, but I'm trying to append a highlight on the outer div (parent one, with classname 'highlights') so that entire bracket gets bordered with good rendered shadow effect, not just the inner child one.
comment on: http://stackoverflow.com/q/27382945
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27422549
has answer: http://stackoverflow.com/a/27428413
answer count: 1
has body: I'm writing script, that splits too long edges of faces (make 2 faces instead 1 big) Result exports to .obj file Geometry reduces ok, but after rendering the result, reduced faces have wrong light reflection and WebGl event doesn't show some faces. https://yadi.sk/i/yU33fJ51dJaVP For new (children) faces I save the normal and all properties from parent big face. Here is the code: var loader = new global.THREE.OBJMTLLoader(); var geometry = loader.load("source.obj").children[0].geometry; var uvs = []; var limiter = function () { var baseLength = 80; var createdVertex = {}; var faces=[]; var faceVertexUvs = []; var l = geometry.faces.length; geometry.faces.forEach(function(cFace, i){ var fromToProgress = function (from, to, third, splitedEdge) { var vFrom = geometry.vertices[from], vTo = geometry.vertices[to], vThird = geometry.vertices[third], newVertexIndex; if (vFrom.distanceTo(vTo) &gt; baseLength) { var exists = createdVertex[from + "_" + to] || createdVertex[to + "_" + from]; if (exists) { newVertexIndex = exists; } else { var newVertex = getTheCenter(vFrom, vTo); geometry.vertices.push(newVertex); newVertexIndex = geometry.vertices.length - 1; createdVertex[from + "_" + to] = newVertexIndex; } makeFace(from, newVertexIndex, third, splitedEdge, 0); makeFace(newVertexIndex, to, third, splitedEdge, 1); return true; } return false; }; var makeFace = function (a, b, c, splitedEdge, side) { var templ = cFace.clone(); templ.a = a; templ.b = b; templ.c = c; templ.vertexNormals = [ templ.normal, templ.normal, templ.normal]; faces.push(templ); splitUvs(templ, splitedEdge, side); }; var copyUvs = function () { faceVertexUvs[faces.length - 1] = geometry.faceVertexUvs[0][i]; }; var splitUvs = function (face, splitedEdge, side) { var a,b,c,d; var bigTri = geometry.faceVertexUvs[0][i]; if (splitedEdge === 'ab') { if (side === 0) { a = bigTri[0]; b = getTheCenter(bigTri[0], bigTri[1]); c = bigTri[2]; } else { a = getTheCenter(bigTri[0], bigTri[1]); b = bigTri[1]; c = bigTri[2]…
score: 1
favorite count: 0
tagged with: geometry
tagged with: three.js
accepted answer: http://stackoverflow.com/a/27428413
upvote count: 1
has comment: http://stackoverflow.com/comment/43295413
tagged with: normals
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43296654
type: Question
has title: three.js - Split Faces with Long Edges into Two Faces
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/27325685
has comment: http://stackoverflow.com/comment/43177241
type: AnsweredQuestion
has title: Stacked / Nested / Overlapping pie chart and donut chart with javascript
has answer: http://stackoverflow.com/a/27466690
type: Question
tagged with: charts
accepted answer: http://stackoverflow.com/a/27466690
linked to: http://stackoverflow.com/q/6736346
has comment: http://stackoverflow.com/comment/43196574
tagged with: flot
tagged with: javascript
downvote count: 0
answer count: 1
score: 1
favorite count: 0
upvote count: 1
has body: I am not sure if anyone has come across this scenario or has even made a solution but basically I am able to create simple Pie and Donut charts using Flot Charts. What I am looking for though is a scenario where there is a pie chart in the center and it is surrounded by a Donut Chart. Very similar to this question but that question is now 3 years old and was never really answered. I tried creating two charts using the same DIV but then one just overwrites the other. I thought of creating two different charts on two different DIVs and having them overlap but that just doesnt seem like a clean approach that will also accommodate responsive behavior. Any thoughts / suggestions are welcome. Thanks in advance

http://stackoverflow.com/a/27437927
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27437746
accepted answer of: http://stackoverflow.com/q/27437746
upvote count: 1
type: AcceptedAnswer
has body: You don't need to use durations for this and also no need to convert to "DD/MM/YYYY" format. Just use diff method with "days" as the second parameter: var test1 = new Date("01/12/2015"); var test2 = new Date("12/12/2014"); var result_diff = moment(test1).diff(moment(test2), "days"); // 31
type: Answer

http://stackoverflow.com/q/27446108
accepted answer: http://stackoverflow.com/a/27446139
possible better answer: http://stackoverflow.com/a/27446340
score: 1
has body: The javascript code is not working. Would you please tell me why its not working? I want two div in equal size whatever the content height is. I took two div inside of a container and put some dummy text inside of two div. stlylesheet is also attached herewith. The browser is throwing this error. "Uncaught ReferenceError: $ is not defined" . $(document).ready(function() { var leftHeight = $('#left-block').height(); var rightHeight = $('#right-block').height(); if (leftHeight > rightHeight) { rightHeight = leftHeight; } else { leftHeight = rightHeight; } $('#left-block').css('height','rightHeight'); $('#right-block').css('height','rightHeight'); }); * { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; } .container:before, .container:after { content: ""; display: table; } .left-block, .right-block { float: left; padding: 20px; width: 50%; } .left-block { background: #e4e4e4; } .right-block { background: whitesmoke; } demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo text demo tex…
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43331198
type: AnsweredQuestion
has title: javascript error is shown in the browser
has answer: http://stackoverflow.com/a/27446340
has answer: http://stackoverflow.com/a/27446139
upvote count: 1
has comment: http://stackoverflow.com/comment/43331214
has comment: http://stackoverflow.com/comment/43331149
type: Question

http://stackoverflow.com/comment/43291658
type: QuestionComment
comment on: http://stackoverflow.com/q/27423950
score: 0
has text: @NimChimpsky Thank you for link. See the second sentence of the question.
type: Comment

http://stackoverflow.com/a/27334893
has comment: http://stackoverflow.com/comment/43139719
score: 2
accepted answer of: http://stackoverflow.com/q/27334856
upvote count: 2
has body: Try calling the drawImage function inside the image's load function to ensure that the image is actually loaded before trying to draw it. var canvas = document.getElementById("canvas"), context = canvas.getContext("2d"); var internal_image = new Image(); internal_image.src = "ball.png"; internal_image.width = 18; internal_image.height = 19; internal_image.addEventListener("load", function() { context.drawImage(internal_image, 10, 10); }, false);
has comment: http://stackoverflow.com/comment/43127103
answers question: http://stackoverflow.com/q/27334856
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43189748
type: Comment
has text: I think something else is wrong with my code because after i changed to array_push, I still didn't get any results.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27368135

http://stackoverflow.com/comment/43312311
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27418201
has text: Is the popup showing? Do you go through the giving access steps?

http://stackoverflow.com/q/27404232
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43260546
tagged with: node.js
answer count: 0
has body: I'm trying to download a number of images and do some logic on them. problem is that I can't rap the entire function inside of waterfall beacuse it is part of an external modoule. the principle is: function asyncGetImage(link, onResp){ request({url: link, encoding: null}, function (err, res, body) { if (!err &amp;&amp; res.statusCode === 200) { var base64prefix = 'data:' + res.headers['content-type'] + ';base64,'; var image = body.toString('base64'); onSuccess(image, base64prefix); } else { console.log("errororororor"); onResp(null,null); } }); } function getBase64Images (urlArray){ async.waterfall([ function(callback){ var responses = {}; var respCount = 0; urlArray.forEach(function (item){ asyncGetImage(item.url,function (image,base64prefix){ responses[item.key] = {image:base64prefix+image,ratio: item.ratio}; respCount+=1; if (urlArray.length === respCount) { callback(null,responses); } }); }); } ], function(err,response){ if(err){ console.log("ereprwertwertwerter"); } console.log(response); return response; } ); } function applyLogic(urlList){ // do some code here return getBase64Images(imageUrls); }
has comment: http://stackoverflow.com/comment/43274976
type: Question
tagged with: javascript
has title: Using waterfall inside a function node.js
score: 0
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/44457721

http://stackoverflow.com/comment/43149408
type: AnswerComment
has text: @user3524214: `iDiv.children().first().prop("disabled", true)`. Or with less jQuery: `iDiv[0].children[0].disabled = true`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27347221

http://stackoverflow.com/comment/43243377
type: Comment
has text: I originally had count printing to check it had loaded and it still did the same thing. And still no luck ensure it's loaded completely. :(
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27398772

http://stackoverflow.com/a/27369289
upvote count: 1
has body: The idea of that loop is to "pass" on those entries that match the if condition (perhaps leaving as-is), and to take some action (//some other code) when an entry is encountered that doesn't meet that condition.
answers question: http://stackoverflow.com/q/27369236
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/q/27454975
accepted answer: http://stackoverflow.com/a/27463107
downvote count: 0
score: 1
tagged with: sendgrid
type: Question
tagged with: javascript
tagged with: parse-cloud-code
upvote count: 1
answer count: 1
tagged with: email
has body: CONTEXT: I am using Parse.com as the backend for my web application. I want to send myself an email when a new user has signed up (i.e., a new record is saved to the 'User' table). I am using the SendGrid Module for Parse. PROBLEM: The email does not send. I neither receive a success nor error response. Log files print "Step 2" but not "Step 3" (see below). Also, I am not sure if "mySendGridFunction" refers to anything and needs to be changed. CODE: Parse.Cloud.afterSave(Parse.User, function(request) { // Indicate Function Start console.log("**********************************"); console.log("** New User Email Notification ***"); console.log("**********************************"); // For New Users Only if(!(request.object.existed())){ // New User Identified console.log("New user identified"); // Initialize SendGrid Module var sendgrid = require("sendgrid"); sendgrid.initialize("myUsername", "myPassword"); console.log("Step 2"); // Send Email Parse.Cloud.define("mySendGridFunction", function(request, response) { console.log("Step 3"); sendgrid.sendEmail({ to: "me@mydomain.com", from: "sendgrid@parse.com", //from: "sendgrid@cloudcode.com", subject: "Notification: New User", text: "A new user has just signed up." }, { success: function(httpResponse) { console.log("User Notification email being sent"); console.log("HTTP Response: " + httpResponse); response.success("User Notification email successfully sent"); }, error: function(httpResponse) { console.log("There was an error sending the User Notification email"); console.error("HTTP Response: " + httpResponse); response.error("There was an error sending the User Notification email"); } }); }); } });
favorite count: 0
has title: Email Notification with Parse.com Cloud Code and SendGrid
tagged with: parse-platform
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27463107

http://stackoverflow.com/q/27325315
has answer: http://stackoverflow.com/a/27386534
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/43110809
type: Question
has comment: http://stackoverflow.com/comment/43110927
tagged with: google-maps
tagged with: javascript
has title: In an Ionic app, Google Maps only loads when page is refreshed, but not when coming from another page,
possible better answer: http://stackoverflow.com/a/42427909
has answer: http://stackoverflow.com/a/42427909
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/27386534
has answer: http://stackoverflow.com/a/42536220
tagged with: angularjs
has body: I am trying to show a Google Maps street view in an Ionic app but am having troublegetting it work. When I go from another page to this page, it doesn't load. But I refresh this current page, then the street view works. Any idea on how to fix this? controllers.js .controller('StreetviewCtrl', function($scope, $ionicLoading, $state, $stateParams){ console.log('Street view page loaded'); Parse.initialize("xyz", "xyz"); //Load the Goog map $scope.initialise = function() { console.log('initialize function'); var myLatlng = new google.maps.LatLng(40.758774, -73.98504); var mapOptions = { center: myLatlng, zoom: 1, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("street"), mapOptions); var panoramaOptions = { position: myLatlng, addressControl: false, pov: { heading: 34, pitch: 10 } }; var panorama = new google.maps.StreetViewPanorama(document.getElementById('street'), panoramaOptions); $scope.map=panorama; }; google.maps.event.addDomListener(document.getElementById("street"), 'load', $scope.initialise()); //Go to the guessing page $scope.makeGuess = function(item,event){ console.log('guess button tapped'); // $state.go('tab.account'); }; }) template (streetview.html) Make a Guess
type: AnsweredQuestion

http://stackoverflow.com/a/27355810
has comment: http://stackoverflow.com/comment/43165543
answers question: http://stackoverflow.com/q/27355205
has comment: http://stackoverflow.com/comment/43173493
type: Answer
has body: First of all, be sure you are consequent with your input fields. E.g. the first input field of question 2 have the name I1 while the next have the name Iquestion[1]. Make sure they have all the same structure, you would get somethink like this: I am a high achiever. 1 2 3 4 5 6 7 8 9 10 question2 1 2 3 4 5 6 7 8 9 10 question3 1 2 3 4 5 6 7 8 9 10 question4 1 2 3 4 5 6 7 8 9 10 I am strong willed. 1 2 3 4 5 6 7 8 9 10 Also note that i added an id to the form. We need to use this for catching the submit event. For the event-handling you can use AJAX. Here you can check how many different radio inputs there are and how many are submitted. With this knowlegde it's possible to compare these values and based on the result you can go through with submission or show an alert (or any other kind of message you want). To catch the submit event and determine the follow-up action you can use something like this: Note that this is client-side and isn't save, because client-side scripts can be manipulated. You should use this only for usable purpose and also create a check in your PHP script if all answers are filled.
has comment: http://stackoverflow.com/comment/43173518
has comment: http://stackoverflow.com/comment/43205423
score: 0
has comment: http://stackoverflow.com/comment/43165635

http://stackoverflow.com/comment/43143095
comment on: http://stackoverflow.com/q/27343789
has text: possible duplicate of [Truncate (not round off) decimal numbers in javascript](http://stackoverflow.com/questions/4912788/truncate-not-round-off-decimal-numbers-in-javascript)
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/43186575
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27360326
has text: @SeanKendle I automatically reach for the close button when there is 0 effort displayed. This is a perfect example of that. If the OP tried "everything" they should at least show some of that attempt. My opinion as well.
score: 0

http://stackoverflow.com/a/32596546
answers question: http://stackoverflow.com/q/27411386
upvote count: 2
type: Answer
score: 2
has body: I recently came up with an interesting pattern for creating tables from database output dynamically, while holding references to the relevant created elements and the values used to create them. This method came in handy for me because I created input elements for each table cell, then utilized the structure created to check the original values against their actual values and generate an sql update query based on the changed fields. I realize that it may be overkill for this specific situation, but it does aid in readability and maintainability so I'm posting it here in case it could possibly help someone else in the future. var responseText = {"Summary":[{"ID":"1234","Name":"John","Status":"Green",}, {"ID":"5678","Name":"Mike","Status":"Green",}, {"ID":"9012","Name":"Tom","Status":"Red",}, {"ID":"3456","Name":"Chris","Status":"Red",}, {"ID":"2445","Name":"Pat","Status":"Green",}, {"ID":"6543","Name":"James","Status":"Red",}]}; var list = new List(responseText.Summary); document.body.appendChild(list.node); function List(data) { if(!(this instanceof List)) return false; var list = this.node = document.createElement('div'); list.setAttribute('class','list'); var items = this.items = {}; for(var i in data) { items[i] = new ListItem(data[i]) list.appendChild(items[i].node); } } function ListItem(data) { if(!(this instanceof ListItem)) return false; var item = this.node = document.createElement('div'); item.setAttribute('class','item'); var lines = this.lines = {}; for(var i in data) { lines[i] = new ListItemLine(i, data[i]) item.appendChild(lines[i].node); } } function ListItemLine(name, value) { if(!(this instanceof ListItemLine)) return false; var line = this.node = document.createElement('div'); this.name = name; this.value = value; line.setAttribute('class','line ' + name); if(name !== 'ID') line.setAttribute('contenteditable', true); line.appendChild(document.createTextNode(value)); } .item { display: inline-block; padding: 5px; text-align: center; } Then I used s…
downvote count: 0

http://stackoverflow.com/comment/43196547
comment on: http://stackoverflow.com/q/27372774
score: 0
type: Comment
type: QuestionComment
has text: Does your function do the calculation right? Is the problem initializing?

http://stackoverflow.com/comment/43186573
type: Comment
type: QuestionComment
has text: You're looking for Progressive Images. Here is something to get you started: http://peteschuster.com/2013/01/saving-jpegs-for-the-web-setting-photoshop-up-for-progressive-jpegs/
comment on: http://stackoverflow.com/q/27367235
score: 1

http://stackoverflow.com/a/27374842
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/27368951
has body: No, the store will still exist after destroying the Grid No, you will not need to override the destroy method of the grid You can force the store to destroy itself by setting it's autoDestroy flag to true API-Link autoDestroy : Boolean When a Store is used by only one DataView, and should only exist for the lifetime of that view, then configure the autoDestroy flag as true. This causes the destruction of the view to trigger the destruction of its Store. Defaults to: false See this working demo for the effect of autoDestroy on a store that is used by a grid (close the grids in the demo) Additional info: Always use a storeId Use the StoreManager to lookup the existence of a store
accepted answer of: http://stackoverflow.com/q/27368951
score: 5
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/43225112
type: AnswerComment
has text: lol, I misread your answer. It worked. Thank you for your help. I was forgetting to put in `function(){...}` before calling `doSetTimeout`
type: Comment
comment on: http://stackoverflow.com/a/27388257
score: 0

http://stackoverflow.com/a/27423908
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/27422095
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27422095
downvote count: 0
has body: Alright, it turns out it was a problem related to the way I was actually creating the regular expression. I was creating (and applying) the regular expression like this: var rExclude = '(?:[ \t]*)?(?:\/\/|\/\*)[ \t]*#exclude[ \t]*([^\n*]*)[ \t]*(?:\*\/)?(?:[ \t]*[\r\n]+)?((?:.|\n|\r)*?)(?:[ \t]*)?(?:\/\/|\/\*)[ \t]*#endexclude[ \t]*(?:\*\/)?(?:[ \t]*[\r\n]+)?'; contents = contents.replace(new RegExp(rExclude, 'gi'), function () { return ""; }); This gives me the error that is described in the starting post. However, because the regular expression is in a string, JavaScript decides it wants to handle the regular expression differently. You can fix it in two ways: Solution 1 This solution alters the way stuff is being escaped in your string. var rExclude = '(?:[ \t]*)?(?://|/\\*)[ \t]*#exclude[ \t]*(?:\\*/)?(?:.|\n|\r)*?(?://|/\\*)[ \t]*#endexclude[ \t]*(?:\\*/)?'; contents = contents.replace(new RegExp(rExclude, 'gi'), function () { return ""; }); Solution 2 This solution alters the way the actual regular expression is being created: contents = contents.replace(/(?:[ \t]*)?(?:\/\/|\/\*)[ \t]*#exclude[ \t]*(?:\*\/)?(?:.|\n|\r)*?(?:\/\/|\/\*)[ \t]*#endexclude[ \t]*(?:\*\/)?/gi, function () { return ""; }); It's just another weird ass JavaScript quirk, unfortunately.

http://stackoverflow.com/comment/43224481
has text: This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27358308

http://stackoverflow.com/q/27349790
score: 1
type: Question
has body: I have the code below where I'd like to the numbers count back to 0% once hover the object out. Also I can't figure our how to make the value disappear again as it was on load. Could you please help me solve this. Thanks in advance. HTML &lt;div class="container"&gt; &lt;div class="fill" data-width="80%"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="container"&gt; &lt;div class="fill" data-width="50%"&gt;&lt;/div&gt; &lt;/div&gt; CSS .container { position: relative; width: 300px; height: 30px; background-color: blue; margin: 10px auto; } .fill { height: 100%; width: 0; background-color: red; line-height: 30px; text-align: left; z-index: 1; text-align: right; } JQuery $(function() { $('.container').hover( function(){ var width=$(this).find(".fill").data('width'); $(this).find(".fill").animate({ width: width }, { duration:800, step: function(now, fx) { $(this).html(Math.round(now) + '%'); } }); }, function(){ $(this).find(".fill").animate({ "width": "0px" }, 800); }); }); jsFiddle http://jsfiddle.net/zp8pe069/
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/27350002
accepted answer: http://stackoverflow.com/a/27350002
type: AnsweredQuestion
downvote count: 0
has title: Count back percentage using JQuery

http://stackoverflow.com/a/27464894
has body: As I understand from the information that you posted, the issue appears to be caused by the following lines: at Object. (/Users/dev/wishlist/server/api/wishList/person.model.js:11:27) module.exports = mongoose.model('Person', PersonSchema); at Object. (/Users/dev/wishlist/server/api/wishList/wishList.controller.js:4:14) var Person = require('./person.model'); This error most commonly comes from a mismatching between Mongoose models. Somewhere along the road, you have defined this model under a different name, but the same Schema. In order to see if this is the thing that causes your error, add this code in person.model.js right after you require mongoose: 'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema; mongoose.models = {}; mongoose.modelSchemas = {}; This will clear out your mongoose data and empty out all existing models and schemas. I found the aforementioned information at the following LINK. I have also found some additional discussions that address this issue HERE and HERE.
answers question: http://stackoverflow.com/q/27464631
has comment: http://stackoverflow.com/comment/43366947
type: Answer
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/81541247
type: AnswerComment
score: 10
comment on: http://stackoverflow.com/a/46568081
type: Comment
has text: Thank you. Definitely the best answer here for those using visual studio code. For ref, User Settings via (Mac:) "Code" > Preferences > Settings.

http://stackoverflow.com/q/27448049
upvote count: 0
has comment: http://stackoverflow.com/comment/43334999
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/43335188
has title: .classname element needs mousemove event even when the cursor is not on top of them. How to get event to elements?
possible better answer: http://stackoverflow.com/a/27448153
has answer: http://stackoverflow.com/a/27448205
has answer: http://stackoverflow.com/a/27448153
favorite count: 0
has comment: http://stackoverflow.com/comment/43335113
accepted answer: http://stackoverflow.com/a/27448205
has comment: http://stackoverflow.com/comment/43335031
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43335055
has body: Is there a way to get the mousemove event when the cursor is not on top of the element itself? This is what I currently have: $(document).on('mousemove', '.className', OnMouseMove); function OnMouseMove(e) { var clientCoords = "( " + e.clientX + ", " + e.clientY + " )"; var pageCoords = "( " + e.pageX + ", " + e.pageY + " )"; var offsetCoords = "( " + e.offsetX + ", " + e.offsetY + " )"; console.log('clientCoords: '+clientCoords+', pageCoords: '+pageCoords+', offsetCoords: '+offsetCoords); } I have a lot of elements using the .className that I will be adding animations to but I need the mouse coordinates even when the cursor is not on top of the elements. How can I do this?
has comment: http://stackoverflow.com/comment/43335227
downvote count: 1
has comment: http://stackoverflow.com/comment/43334916
has comment: http://stackoverflow.com/comment/43336045
type: Question
answer count: 2

http://stackoverflow.com/q/27359748
tagged with: indexeddb
type: Question
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/27361022
has title: How to add initial data in indexeddb only once
downvote count: 0
has body: I am creating an indexeddb, and have several stores in it. Have some data that has to be initially added when stores are created. I have function where I create database and stores: function db_init(){ var request = indexedDB.open("db", "1.0"); request.onupgradeneeded = function(){ var db = request.result; //store 1 db.createObjectStore("store1", {keypath: "id", autoIncrement: true}); //add initial datas; //store2 db.createObjectStore("store2", {keypath: "id", autoIncrement: true}); //... //store 3 // init necessary databases db_populate(); } request.onsuccess = function (){ db = request.result; populate:db(); } } And inside db_populate function have 4 other functions where I am populating datastores: function db_populate() { init_store1(); init_store2(); //... console.log("db populated with data"); } Each init_score populates stores with transactions like below: var tx = db.transaction("store1", "readwrite"); var store = tx.objectStore("store1"); Now, I have a problem. Every time I open or refresh the page, the initial data are duplicated. There are added over again. When I add db_populate at the end of onupgradeneeded function, I get an error: Uncaught TypeError: Cannot read property 'transaction' of undefined on line: var tx = db.transaction ("store1", "readwrite"); What I am trying to achieve is to create data stores with its initial data once and that is it. Any idea what I am doing wrong? Thanks in advance.
favorite count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has answer: http://stackoverflow.com/a/57534229

http://stackoverflow.com/q/27466809
has body: I feel like I have completely missed something here but I am trying to use ejs partials in a single page angular app. I keep getting a Uncaught ReferenceError: angular is not defined in my partial. I think this may have something to do with using ejs partials instead of using ng-include, however I have not had any luck in playing with that. Any help would be amazing. app.js (function(){ var app = angular.module('dashboard', []); app.controller('ItemController', function(){ this.item = items; }); //need to loop through items in DB for now using these test objects var items = [ { name : 'name1',//query to db for name goes here stock : '4',//query to db img : '/images/bb-logo.png'//query to db }, { name : 'name2',//query to db for name goes here stock : '6',//query to db img : '/images/bb-logo.png'//query to db } ]; })(); index.ejs <%= title %> <% include partials/topbar %> <% include partials/etsy-container %> <% include partials/amazon-container %> /amazong-container Amazon <% include /item %> /item.ejs {{item.name}} Stock level: {{item.stock}}
tagged with: angularjs
tagged with: node.js
type: AnsweredQuestion
upvote count: 0
has title: Node/Express project using EJS partials and angular: Uncaught ReferenceError: angular is not defined
type: Question
tagged with: mean-stack
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27466839
accepted answer: http://stackoverflow.com/a/27466839
favorite count: 0

http://stackoverflow.com/comment/43179220
type: Comment
type: QuestionComment
has text: can we write this in a javscript file instead of inline.
comment on: http://stackoverflow.com/q/27358564
score: 0

http://stackoverflow.com/q/27453622
favorite count: 0
has comment: http://stackoverflow.com/comment/43348575
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27453991
tagged with: regex
has comment: http://stackoverflow.com/comment/43348910
has comment: http://stackoverflow.com/comment/43345729
has comment: http://stackoverflow.com/comment/43371263
upvote count: 2
type: Question
has title: Is this possible? Using only an one liner JavaScript regexp
has comment: http://stackoverflow.com/comment/43346058
tagged with: javascript
has body: How can I convert this into an one-liner JavaScript regex? html.replace(/src="(.*?)"/gi, function($1) { return $1.replace(/(abc.*?)\/abc/gi, "abc"); }); The above code block should be self-explanatory of what I'm trying to accomplish, but I'll elaborate. What I'm trying to accomplish is replace all matches of this regex /src="(.*?)"/ which contains the substring: abc[random_characters]/abc to just abc. And so for example src="abc[random_characters]/abc[random_characters]" => src="abc[random_characters]" Edit: One-liner without the anonymous function call or callback. Edit: Solution html.replace(/src="abc(?:.*?)\/(abc[^"]+)"/gi, "src=\"$1\"");
score: 2
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43287547
comment on: http://stackoverflow.com/a/27421751
type: Comment
has text: no this part occurs when the ajax call is over and here you will receive the data to use.any ways your problem is solved or not.please read about ajax in jquery site for more info.
score: 0
type: AnswerComment

http://stackoverflow.com/a/27413975
answers question: http://stackoverflow.com/q/27413788
type: Answer
score: 0
has body: Welcome to Stack Overflow! Here's a fiddle: http://jsfiddle.net/uo15brz1/2/ Basically, you need a way to point to the relevant content &lt;div&gt; based on the link that's clicked. It would be tricky to do that in a robust way with your current markup, so I've edited it. The examples in the jquery documentation are pretty good. Spend some time studying them, they are a great way to start out.

http://stackoverflow.com/comment/43100790
has text: Oh, so you're wanting the first hover to have animation, but none of the other hovers, right? When exiting the box, should "bottomdata" stay at the top, covering "topdata", or should it slide back down as it is now?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27320673

http://stackoverflow.com/comment/43368099
score: 0
type: QuestionComment
has text: Nope, it looks exactly the same. I went directly to the file location on the FTP server using the address bar
type: Comment
comment on: http://stackoverflow.com/q/27465996

http://stackoverflow.com/a/27326935
downvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27325524
type: Answer
has body: ANSWER UPDATED ON 2018-10-30 TypeScript now has type intersections. So you can now simply do: interface ClientRequest { userId: number sessionKey: string } interface Coords { lat: number long: number } function log(data: ClientRequest &amp; Coords) { console.log( data.userId, data.sessionKey, data.lat, data.long ); } ORIGINAL ANSWER The specific answer to your question is: no, there is not a single inline annotation to signify combined or extended types. The best practice for the problem you are trying to solve would be to create third type that would extend the other two. interface IClientRequestAndCoords extends IClientRequest, ICoords {} function(data: IClientRequestAndCoords)
answers question: http://stackoverflow.com/q/27325524
upvote count: 224
score: 223

http://stackoverflow.com/a/27394214
type: Answer
answers question: http://stackoverflow.com/q/27393838
score: 0
has body: I will use the display: because the visibility is only hidden. You can look at JSFiddle:http://jsfiddle.net/anyuc7/sjyuo685/1/ var sub1=document.getElementById("Sub1"), sub2=document.getElementById("Sub2"), Main_body = document.getElementById("Main_body"); sub2.style.display = 'none'; Main_body.onchange = function (){ if(this.value == 1){ sub2.style.display = 'none'; sub1.style.display = 'inline-block'; }else{ sub1.style.display = 'none'; sub2.style.display = 'inline-block'; } };
accepted answer of: http://stackoverflow.com/q/27393838
type: AcceptedAnswer

http://stackoverflow.com/q/27405684
score: 0
has title: Open file in ASP.NET
tagged with: javascript
tagged with: asp.net
has comment: http://stackoverflow.com/comment/43256380
has comment: http://stackoverflow.com/comment/43256893
answer count: 0
has comment: http://stackoverflow.com/comment/43256265
type: UnansweredQuestion
tagged with: webmethod
type: Question
tagged with: c#
has body: I want to open file (image or pdf document). I use this function to do this: [HttpGet] public void Download(string filePath) { try { var context = HttpContext; if (System.IO.File.Exists(filePath)) { FileInfo file = new FileInfo(filePath); context.Response.Clear(); context.Response.AddHeader("Content-Disposition", "attachment; filename=\"" + file.Name + "\""); context.Response.ContentType = "application/octet-stream"; context.Response.WriteFile(filePath); context.Response.Flush(); context.Response.End(); } else context.Response.StatusCode = 404; } catch (Exception e) { } } and it works fine. This function is called from javascript when user click right button. User sees window that allows to open or download file. But now I want to display a message (instead of redirecting user to 404 page) when file wasn't found. I thought about changing function to WebMethod: [WebMethod] public void Download(string filePath) { JsonResult result = new JsonResult(); try { var context = HttpContext; if (System.IO.File.Exists(filePath)) { result.Data = new { Id = 0 }; FileInfo file = new FileInfo(filePath); context.Response.Clear(); context.Response.AddHeader("Content-Disposition", "attachment; filename=\"" + file.Name + "\""); context.Response.ContentType = "application/octet-stream"; context.Response.WriteFile(filePath); context.Response.Flush(); context.Response.End(); } else result.Data = new { Id = -1 }; } catch (Exception e) { } return result; } and call it from javascript using ajax. But in this case user can't see window which allows to open/download file. What can I do about it?

http://stackoverflow.com/q/27390479
tagged with: php
has comment: http://stackoverflow.com/comment/43229273
has comment: http://stackoverflow.com/comment/43229159
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43229129
has comment: http://stackoverflow.com/comment/43229054
has comment: http://stackoverflow.com/comment/43229017
has comment: http://stackoverflow.com/comment/43228911
type: Question
has comment: http://stackoverflow.com/comment/43229140
has comment: http://stackoverflow.com/comment/43229056
has comment: http://stackoverflow.com/comment/43229098
has body: Problem: Trouble receiving what is being sent to my PHP document. Javascript: $('#form_id').submit(function(event){ event.preventDefault(); event.stopPropagation(); var message; var myRegExp = validation stuff var urlToValidate = document.getElementById("url").value; if (!myRegExp.test(urlToValidate)){ }else{ var code = (urlToValidate).slice(-22) var request = new XMLHttpRequest(); request.addEventListener('readystatechange', function(event){ if (this.readyState == 4){ if (this.status ==200){ console.log (this.status); }else{ console.log('Server replied with HTTP status ' + this.status); } } }); request.open('POST', 'php/submit.php', true); request.setRequestHeader('Content-Type', 'text/plain'); request.send("code=" + code); } }); Then I'm using this code on my php/submit.php: if (!empty($_POST['code'])) { $code = $_POST['code']; echo $code; }; I feel like I'm not using the right tag names for PHP because I'm new to all of this. I'll note that I'm using form id but getting the value from an input. Ramblings I'm trying to send a user input that has been validated and sliced to mySQL database. I achieved the string I wanted with javascript and passed it to a variable. I'm trying to send it to a separate php file in another folder with a request.send(the_javaS_variable). Now in the console I can see the variable holds the correct text value and I see it sending with state 4 and 200. But it never shows up on the submit.php page.
tagged with: javascript
has title: Trouble receiving Javascript variable when sent to PHP
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/43229021
has answer: http://stackoverflow.com/a/27390690
answer count: 1
accepted answer: http://stackoverflow.com/a/27390690
has comment: http://stackoverflow.com/comment/43229326

http://stackoverflow.com/q/27419045
upvote count: 1
tagged with: css
score: 1
type: Question
has body: I've been working with jakezatecky/d3-funnel to create a simple funnel graph. I need to be able to rotate the the labels inside the sections. I tried add .style('trasform', 'rotate(180reg)') to the group.append("text") I've created a jsBin sample: http://jsbin.com/xafomoyume/1/edit?html,js,output I need to flip some of the labels and other labels should be rotated 90 degrees to the right. If I try to just rotate each font rotates and the text is distorted Thanks in advance
tagged with: rotation
has title: d3-funnel rotate funnel labels
tagged with: javascript
downvote count: 0
favorite count: 0
answer count: 0
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/comment/43176003
type: Comment
comment on: http://stackoverflow.com/a/27359592
has text: It gives you options. You can just use `var user = User.get({userId:123});` and rely on angular to resolve it, or you can use the callback when resolved to do extra processing. Or both. The example from the docs is meant to show both.
type: AnswerComment
score: 1

http://stackoverflow.com/comment/43439692
type: Comment
comment on: http://stackoverflow.com/q/27423130
type: QuestionComment
has text: @hbk35 I tried that but I don't know how to parse that data to ajax, as that example you've posted is for d3. Like i said im a bit of a noob, I started with that documentation first and half went over my head so I came here. If you could try and fix my fiddle we can try and sort this out. Would be much appreciated, THANKS - http://jsfiddle.net/192xmbwb/6/
score: 0

http://stackoverflow.com/q/27375995
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27381786
accepted answer: http://stackoverflow.com/a/27381786
score: 1
type: Question
tagged with: kendo-grid
answer count: 2
has answer: http://stackoverflow.com/a/27380189
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
has body: I have the below command button column in my Kendo grid.. How to disable the "Edit" button in the rows with empty "ItemValue". $("#list485").kendoGrid({ dataSource: dataSource, columns: [ { command: [{ name: "edit" }], title: "&amp;nbsp;", width: "100px"}, { field: "ItemValue", title: "Item Description" } ], editable: "popup" });
favorite count: 0
has title: Kendo Grid - Dont allow certain records for editing
possible better answer: http://stackoverflow.com/a/27380189

http://stackoverflow.com/comment/43300892
has text: `< script src="http://foo.bar">` is valid HTML. The whitespace after the `<` doesn't matter.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27428457

http://stackoverflow.com/q/27355703
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27355739
has comment: http://stackoverflow.com/comment/43164230
has body: I have following json [{\"Country\":\"Europe\",\"City\":[\"Berlin\",\"Istanbul\",\"London\",\"Manchester\",\"Milan\",\"Paris\"]},null] I want to read the country and its cities. I have tried it like this var eu = jQuery.parseJSON($("#EU").val()); for( i=0; i&lt;eu.length();i++) { alert( eu[0][0]); } But I am getting undefined error in alert. How can I accomplish the above task?
answer count: 4
has answer: http://stackoverflow.com/a/27356024
has comment: http://stackoverflow.com/comment/43164306
has comment: http://stackoverflow.com/comment/43164246
has title: reading json using jquery
type: AnsweredQuestion
upvote count: 1
type: Question
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27356456
has answer: http://stackoverflow.com/a/27355742
possible better answer: http://stackoverflow.com/a/27356024
accepted answer: http://stackoverflow.com/a/27355739
downvote count: 0

http://stackoverflow.com/comment/43092247
has text: This seems to be a Firefox only issue - clicking below the last option will count as click on the last option. I dont think you can change this. In Chrome its working just fine.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27315615

http://stackoverflow.com/a/27382545
answers question: http://stackoverflow.com/q/27380531
has body: thanks to paul i was able to work around the next issue kind of. currently this working function findAll(callback){ return function send(req, res){ db.findAll(function(err, docs){ if(callback){ req.docs = docs return callback(req, res, next()); } res.render('table', {docs:docs}); }); } } function handleData(req, res, next){ res.send(req.docs); } will work with router.get('/', findAll()); or router.get('/', findAll(handleData));
type: Answer
upvote count: 3
score: 3
downvote count: 0

http://stackoverflow.com/comment/43334480
type: AnswerComment
score: 0
type: Comment
has text: @AlexChar you can use @ and the user's name to have your comment notify them.
comment on: http://stackoverflow.com/a/27445274

http://stackoverflow.com/comment/43285457
comment on: http://stackoverflow.com/q/27421437
score: 0
type: Comment
type: QuestionComment
has text: @AlokBhat http://jsfiddle.net/Sa_2019/n7r57pv7/

http://stackoverflow.com/comment/108373443
type: Comment
has text: thanks man, I had some different problems but anyway your code helped me a lot.
comment on: http://stackoverflow.com/a/27396929
score: 0
type: AnswerComment

http://stackoverflow.com/a/27461304
answers question: http://stackoverflow.com/q/27461292
score: 2
has comment: http://stackoverflow.com/comment/43358990
downvote count: 0
type: Answer
has body: By the time you see it as data, it's not JSON anymore. It's just an object. To access the ids array, use data.ids: console.log(data.ids.length); // 2 Or loop through them: data.ids.forEach(function(id) { console.log("id = " + id); }); (More about looping through arrays in this answer, which also explains about polyfilling forEach on really old browsers.)
upvote count: 2
has comment: http://stackoverflow.com/comment/43359029

http://stackoverflow.com/q/27460899
has title: Stop match at first occurence of character, or continue
tagged with: regex
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27460919
has answer: http://stackoverflow.com/a/27460919
has body: I have input like this: "Some string (parens)" "Some string" I want to get everything before the first parens, or just everything if there are none I've tried this: (.+)(?=\() But that only works when there are parens, obviously. Then I tried this: (.+)(?=\()? But that just selects everything. Does anyone have a solution?
type: Question
has answer: http://stackoverflow.com/a/27460918
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27460918
score: 0
answer count: 2

http://stackoverflow.com/comment/43181906
score: 0
has text: Does the code work if you run the snippet above? If so, then there may be something else in your code somewhere that is throwing an error that would cause the remainder of your code to not execute.
comment on: http://stackoverflow.com/a/27364771
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28968626
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27371840
has body: Try this: $chooser.on("listChanged",function(event,selection,list){ //event &lt;- The jQuery event invoking the callback. //selection &lt;- The field (or set of fields) which has moved. //list &lt;- The field list to which the selection has moved. alert("listChanged"); } Documentation link: https://github.com/mateagar/fieldChooser I hope this help.

http://stackoverflow.com/comment/43207342
has text: This directive use isolated scope (see scope property in definition object).
type: AnswerComment
comment on: http://stackoverflow.com/a/27357486
score: 0
type: Comment

http://stackoverflow.com/q/27386132
upvote count: 1
type: Question
tagged with: java
has body: I'm working with the US Census API (examples), in which there are optional parameters, which are space-separated. I needed a general-purpose URL templating mechanism, and Google led me to RFC 6570 and its implementations. But as I understand it, RFC 6570 can't template a query substring like: ...&amp;in=state:02+county:170&amp;... where "county" may be undefined and should be omitted if so, along with the preceding "+"-encoded space, to leave just ...&amp;in=state:02&amp;... Can RFC 6570 encode this? If not, is there an alternative templating syntax for general-purpose URI templating in common use I should consider that's implemented in Javascript and maybe Java? Is use of a "+" to delimit query sub-elements, as done here, common, or extremely quirky? (I'm asking about frequency-of-use, not whether it's wise!) Is RFC 6570 too restrictive for an application where one is not in control of the URI query syntaxes used? UPDATE I see two problems: one is the "+" separator, and the other is the use of ":" in e.g. "state:02", which I don't see how to do either.
downvote count: 0
tagged with: uritemplate
tagged with: url
tagged with: javascript
score: 1
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Can RFC 6570 URI Templates encode space separators for optional parameters?

http://stackoverflow.com/comment/43114409
comment on: http://stackoverflow.com/a/27326174
score: 0
type: Comment
has text: I like where you are going, but I am not quite sure where it could be being loaded twice from. I updated the question with my `bootstrap_and_overrides.css.scss` file.
type: AnswerComment

http://stackoverflow.com/q/27412680
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43269826
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27412792
has comment: http://stackoverflow.com/comment/43270094
has comment: http://stackoverflow.com/comment/43269837
has comment: http://stackoverflow.com/comment/43269861
has comment: http://stackoverflow.com/comment/43269831
tagged with: onkeyup
has title: Why missing one character from my regex?
has comment: http://stackoverflow.com/comment/43269799
type: Question
has answer: http://stackoverflow.com/a/27412792
tagged with: javascript
has body: I have a very good regex function which call in here: &lt;input onkeyup="vimeo();"&gt; But the problem is, when the user paste a link in to the input, he get this link: //player.imeo.com/video/VIDEOID You see? Missing "v" from vimeo and I can't pass on this problem. If I delete the "/" character before of "v" I get repeated value, for example: //player.player.player.player.player.player.player.player.vimeo.com/video/VIDEOID My replace script looks like this: var vimeo = function(){ var str2; $('#url').keyup(function(){ str2 = $(this).val(); $(this).val(str2.replace(/(?:http:\/\/)?(?:www\.)?(?:vimeo\.com)\/(.+)/g, '\/\/player/\.\vimeo\.\com\/video/$1')); }); }; How can I fix missing "v" without repeat any value? Update: Demo link is here: http://neocsatblog.mblx.hu/addvideos/

http://stackoverflow.com/a/27647828
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27416274
has body: Everything seems fine to me, but here my guess about your code : ==> MAKE SURE THE COUNTRY ID IS NEVER EQUAL TO NULL 1 - in your Model, change this, if($query-&gt;result()){ foreach ($query-&gt;result() as $city) { $cities[$city-&gt;NUMVILLEDEPART] = $city-&gt;NOMVILLEDEPART; return $cities; } else{ return FALSE; } to this : if($result = $query-&gt;result_array()) $cities = array_column($result, 'NOMVILLEDEPART', 'NUMVILLEDEPART'); return $cities; 2 - in your Controller, change this : function get_ville_depart($country){ foreach($this-&gt;ville_model-&gt;get_ville_depart($country) as $ville){ log_message('debug',json_encode($ville)); } header('Content-Type: application/json; charset=utf-8'); echo json_encode($this-&gt;ville_model-&gt;get_ville_depart($country)); } to this : function get_ville_depart($country){ $countries = $this-&gt;ville_model-&gt;get_ville_depart($country); return $this-&gt;output-&gt;set_content_type('application/json') -&gt;set_output(json_encode($countries)); } 3 - In your View, Change this : var country_id = $('#paysdepart').val(); to this : var country_id = $(this).val(); Note : you can access directly to this page "http://{mywebsite}/get_ville_depart/{country_id}" with {country_id} equal to the country ID you have a problem with, and check if everything's OK before using the Ajax Query.

http://stackoverflow.com/comment/43307923
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27415402
has text: Thank you, I determined that it was a typo and it is fixed now.
score: 0

http://stackoverflow.com/a/27427293
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27425117
score: 5
type: Answer
has body: If the package is maintained, you always have the latest version of the library for free. If you use two different packages that both make use of the same library, they don't need to include their own copy of the library. Instead they use a package providing the library, and Meteor makes sure only one instance of the library is loaded, and that both packages have access to it.
upvote count: 5
accepted answer of: http://stackoverflow.com/q/27425117

http://stackoverflow.com/comment/43342629
comment on: http://stackoverflow.com/a/27452060
score: 0
type: AnswerComment
has text: Why did you include `\W`?
type: Comment

http://stackoverflow.com/a/27438029
score: 0
type: AcceptedAnswer
has body: Change to
accepted answer of: http://stackoverflow.com/q/27437066
has comment: http://stackoverflow.com/comment/43316349
type: Answer
has comment: http://stackoverflow.com/comment/43316251
answers question: http://stackoverflow.com/q/27437066

http://stackoverflow.com/a/27344330
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43144147
type: Answer
has body: In your js, try to add this: var formData = $('#billingForm,#videoForm').serializeArray(); $.post('Olliff_receipt.php', formData, function(data) { $('div#Wrapper').empty().append(data); $('div#Wrapper').removeAttr('contenteditable'); //new line }); With this change, your href will be clickable
answers question: http://stackoverflow.com/q/27344171
score: 0
accepted answer of: http://stackoverflow.com/q/27344171
has comment: http://stackoverflow.com/comment/43144013

http://stackoverflow.com/comment/43270554
comment on: http://stackoverflow.com/q/27413115
has text: @chazsolo No, obj is just an index of an array that I used in my MySQL query like that: $rows[] = array('obj' => $r);echo json_encode($rows); It can be 'Bob' ...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43293845
type: Comment
comment on: http://stackoverflow.com/q/27426005
score: 1
has text: ? What you want to achive? What is that `edit_'+id+'`?
type: QuestionComment

http://stackoverflow.com/comment/43167376
comment on: http://stackoverflow.com/q/27357120
type: Comment
has text: http://www.regexr.com/3a1jm your code seems to work ?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43332756
type: AnswerComment
has text: ah okay, I've edited it in the answer, I'd do it with javascript, but that's a little opinion based... @CharlesAnthonyBrowne
type: Comment
comment on: http://stackoverflow.com/a/27446229
score: 0

http://stackoverflow.com/comment/43133631
score: 0
type: Comment
type: QuestionComment
has text: What step would reveal the data?
comment on: http://stackoverflow.com/q/27338465

http://stackoverflow.com/q/27424001
tagged with: css
type: Question
score: 0
possible better answer: http://stackoverflow.com/a/27424098
has answer: http://stackoverflow.com/a/27424098
linked to: http://stackoverflow.com/q/20433129
has comment: http://stackoverflow.com/comment/43290108
has body: in my html code, i have the following: ....... ...... How do i actually make my section take up the whole screen when the page loads, whereas the footer actually goes down to a scrollbar. Note that this has to be dynamic since different computers have different screen sizes, i know of the height 100% trick, but in my case there are multiple elements, and is it possible to make a specific one take up the whole screen whereas the other one can be accessed via scroll? Thanks! I actually tried removing a js script, and it worked, so i suspect its some css defined inside the js script, but i cant seem to find which is the conflicting css, i tried to add !important to my current css, but it does not overide the one in the js script. Here is the JS script: /* skel-layers.js v1.0.4 | (c) n33 | getskel.com | MIT licensed */ (function(e) { typeof define == "function" && define.amd ? define(["jquery", "skel"], e) : e(jQuery, skel) })(function(e, t) { ... ... } var t; return typeof e == gt ? H : (e.fn[p] = function() { var t, n; if (this[z] > 1) { for (t = 0; t < this[z]; t++) e(this[t])[p](); return e(this) } return n = e(this), n[S](it, n.data(A)).data(A, ""), n }, e.fn[Ct] = function() { var t = e(this), n = t.parent(), r = 12; n[M]().each(function() { var t = e(this), n = t[Lt]("class"); n && n.match(/(\s+|^)([0-9]+)u(\s+|$)/) && (r -= parseInt(RegExp.$2)) }), r > 0 && (t[ct](), t[S](E, (t.data(Jt) + r) / 12 * 100 + "%")) }, e.fn[Ot] = function() { return e(this).parents()[z] > 0 }, e.fn[ct] = function() { var t = e(this); t[Lt]("class").match(/(\s+|^)([0-9]+)u(\s+|$)/) && t.data(Jt, parseInt(RegExp.$2)) }, e.fn[c] = function(r) { var i, s, o; if (this[z] > 1) { for (i = 0; i < this[z]; i++) e(this[i])[c](r); return e(this) } return s = e(this), isNaN(o = parseInt(s.data(ot))) && (o = 0), s.data(A, s[S](it))[S](it, t[n].baseZIndex + o + (r ? r : 1)), s }, e.fn[u] = function() { var t = e(this); return e(this)[At]("form").each(function() { this.reset() }), t }, e.fn[qt] = fu…
has answer: http://stackoverflow.com/a/27424447
answer count: 2
has comment: http://stackoverflow.com/comment/43290240
has comment: http://stackoverflow.com/comment/43290294
has comment: http://stackoverflow.com/comment/43290063
has title: Make a Section take up full screen
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27424447
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27336934
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27327266
has comment: http://stackoverflow.com/comment/57891518
type: Answer
score: 5
answers question: http://stackoverflow.com/q/27327266
type: AcceptedAnswer
upvote count: 5
has body: I am afraid there is no way from Javascript to know the HTTP status code of the negotiation. There are defined closing codes, and 1006 only means that the connection is closed abruptly, but the protocol even allows to close the connection without providing a reason. That, together with the readyState API, are the only tools you have to diagnosed the reason of the problem.

http://stackoverflow.com/q/27324883
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43109074
has body: I'm able to pull my JSON results into my table with no problem, but when it comes to filtering the results based on my PHP $_GET variables I can't seem to return a result set. My table is simple: Meter Address City Date Status Location that that2 that3 that4 that5 that6 My jQuery function looks like this. I am simply trying to append my table with the results from the $_GET variables I set using PHP: Json_return = []; jQuery(function(){ jQuery.getJSON('./json/acm2.txt',{},function(data){ Json_return = data; jQuery('#displaythatdata').eq(0).html(''); jQuery(Json_return).each(function(indx,Val){ var returnedData = $.grep(Json_return, function(element, index){ return element.PLAT = <?php echo $getthedivision ?>; return element.DIVISION = <?php echo $getthedivision ?>; jQuery('#displaythatdata').eq(0).append(' '+returnedData.METER+' '+returnedData.LOCADDRESS+' '+returnedData.CITY+' '+returnedData.INSPECTION_DATETIME+' '+returnedData.INSPECTION_STATUS+' '+returnedData.LOC+' '); }); }); }); My PHP is standard: $getthedivision = $_GET['getregion']; $gettheplat = $_GET['getplat']; My JSON looks like: [{"ID":1,"UUID":"5D2F830-8757-F80FA715A78E","SPID":86810,"METER":"900A","LOCADDRESS":"123 MEADOW RD","CITY":"SANTA ANA","DIVISION":"SAN DIEGO","PLAT":"1145-C08","ADDRESS_NUM":123,"ADDRESS_EVODD":1,"ADDRESS_STREET":"MEADOW RD","GRD_BELOW_SU":null,"GRD_ABOVE_SU":null,"MANIFOLD_METER":null"}, Any ideas on why I can return a result set based on my PHP $_GET variables? I am able to print them out so I know they are being set. I saw that .grep() was the way to filter using jQuery JSON. Is this the case for objects too?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43109014
tagged with: grep
has comment: http://stackoverflow.com/comment/43109262
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: php
has title: Filtering Results with JQuery.grep in PHP from Json Txt File
answer count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/a/27342268
accepted answer of: http://stackoverflow.com/q/27342011
type: Answer
has body: It is possible to reshape objects that get emmited to inservable in function that comes third parameter in .fromEvent return Observable.fromEvent(Events, eventName, function() { var args = [].slice.call(arguments[0]); return { name: eventName, args: args }; }); So it will be arguments of .subscribe: var eventName = event.name; var args = event.args;
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27342011

http://stackoverflow.com/q/27319841
score: 0
has title: How do I set the height of every td element to it's width?
has answer: http://stackoverflow.com/a/27319971
type: UnansweredQuestion
tagged with: css
has answer: http://stackoverflow.com/a/27319914
type: Question
answer count: 2
has body: I have a table with the width 100%. It has seven columns that divide up the width equally. All I want to do is to have the height of a td element be equal to it's dynamic width. Any ideas? jquery is fine table { width: 100%;}
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/20456694

http://stackoverflow.com/a/46297796
answers question: http://stackoverflow.com/q/27433928
type: Answer
upvote count: 2
has body: The app decides how to open links so you cant force it to use an external browser through your code. It can be changed in the app settings but that won't help you. You can try to detect the Facebook browser through the user-agent and then throw a popup or something like that asking the user to click the 3 dots at the top right and then "open with chrome" or whatever the iPhone equivalent is.
score: 2
downvote count: 0

http://stackoverflow.com/a/27370747
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27370638
upvote count: 3
score: 3
has body: Adding to @HoboSapiens answer (sorry, I can't comment due to score), you may also want to use the ::selection selector to ensure users can't drag across the area to uncover the text. http://jsfiddle.net/Delorian/mm8tp1xb/ .clozed::selection { color: transparent; } Note that users will always be able to see the text in the source, so if you want something more effective, you will need to use JavaScript on the client or server-side script to replace the text. However you will lose the benefit of having the underline at an accurate width.

http://stackoverflow.com/a/27400353
has comment: http://stackoverflow.com/comment/43248999
answers question: http://stackoverflow.com/q/27399984
accepted answer of: http://stackoverflow.com/q/27399984
has comment: http://stackoverflow.com/comment/43547627
has body: Have you tried this approach? app.directive('myDirective', function(){ return{ retrict: 'EA', replace: false, scope:{ fstData: '@', sndData: '@' }, link: function(scope ,element , attrs) { var markup = ' '+scope.sndData+' ' ; element.append(markup); } } });
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/43307658
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27410945
has text: UPDATE: Changed the line #4 to a simple alert message and it worked. So I think that this narrowed the problem down to the jQuery UI library.

http://stackoverflow.com/comment/43174241
comment on: http://stackoverflow.com/q/27360774
has text: @pointy Just ignore the "Username" parameter for the time. Just assume that it is function username()
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27407160
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27406765
has body: setTimeout does not block JavaScript execution. That's why it continue execution of the for loop, scheduling each function to execute at almost the same time There is no native sleep function AFAIK, and you wouldn't want that, as it would block any other JS executing on the page until everything finishes. You can schedule the timeouts to run at different times. var cap = 5; for(var i = 0; i &lt; cap; i++){ setTimeout((function(){ var remainingTime = cap - i; return function(){ startTimeElement.innerHTML = "Starting in " + remainingTime + "."; } })(), 1000 * (i + 1)); } Also, because of closures, you need to store the remaining time in a different function, otherwise it would capture the final value of i. See fiddle.

http://stackoverflow.com/comment/43267534
comment on: http://stackoverflow.com/a/27394296
has text: He needs to create a copy to store in the $scope.cars array.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27333745
has comment: http://stackoverflow.com/comment/43131426
has comment: http://stackoverflow.com/comment/43131392
has comment: http://stackoverflow.com/comment/43125064
upvote count: 1
has comment: http://stackoverflow.com/comment/43125005
has comment: http://stackoverflow.com/comment/43144328
has answer: http://stackoverflow.com/a/27333802
has comment: http://stackoverflow.com/comment/43124790
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/27333804
tagged with: javascript
has title: How to target Firefox and IE with CSS?
type: UnansweredQuestion
has body: There's a slight difference on the layout of my website from webkit browsers to Firefox and Internet Explorer. I need to target Firefox and IE to apply some CSS only in those two browser. I've tried for Firefox: @-moz-document url-prefix() { // CSS here } And I've tried for IE these two solutions: &lt;!--[if IE]&gt;&lt;!--&gt; // Load specific CSS file here &lt;!--&lt;![endif]--&gt; @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { // CSS here } But nothing works. Do I need to do it with Javascript? If so, why can't I target it with CSS or HTML like everyone seems to do?
tagged with: firefox
downvote count: 0
has comment: http://stackoverflow.com/comment/43124818
has comment: http://stackoverflow.com/comment/43132888
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/43131405
has comment: http://stackoverflow.com/comment/43125138
answer count: 2
tagged with: css
has comment: http://stackoverflow.com/comment/43144221

http://stackoverflow.com/comment/43319299
has text: Cool. Thanks Any answer for my query? Anyone please?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27439117
type: Comment

http://stackoverflow.com/q/27343133
upvote count: 1
favorite count: 0
has body: var dropSpeed = 3750; var spawnSpeed = 2000; var i = 0; function makeSymbol(sym) { setInterval(function(){ if(dropSpeed &gt; 1500){dropSpeed = dropSpeed - 350;}if(spawnSpeed &gt; 50){spawnSpeed = spawnSpeed - 231;} var aSymbol = sym.createChildSymbol("aSymbol" ,"stage"); i = i + 1; symbols[i] = aSymbol.getSymbolElement(); symbols[i].animate({top: "950px"},dropSpeed); //uses the changed dropspeed },spawnSpeed); //does not use the change spawnSpeed but keeps using the 2000 } The spawnSpeed doesn't change but the dropSpeed does. how can i let the spawnspeed change? I hope it's not a stupid question but i'm stuck here for ages. you guys are my only hope. :)
has answer: http://stackoverflow.com/a/27343191
accepted answer: http://stackoverflow.com/a/27343191
has title: setting a variable intervalspeed
has answer: http://stackoverflow.com/a/27343297
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27343297
downvote count: 0
score: 1
type: Question
tagged with: adobe-edge
has comment: http://stackoverflow.com/comment/43141784
tagged with: javascript
has comment: http://stackoverflow.com/comment/43141865
answer count: 2

http://stackoverflow.com/comment/43362795
type: Comment
has text: Id didn't downvote ur thread!!! I never do that. It wasn't me. I actually want to help you.
comment on: http://stackoverflow.com/a/27463308
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43304405
comment on: http://stackoverflow.com/a/27431432
score: 1
type: AnswerComment
type: Comment
has text: `string` is no reserved word, `String` however is;) (Technically it is not, because you CAN use this word as variable name, this however will break some funcitonality)

http://stackoverflow.com/comment/43149749
has text: Is it just failing in IE?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27347436

http://stackoverflow.com/a/27383543
has body: .on events are only picked up for elements that exist at the time of the declaration. From the jQuery docs - http://api.jquery.com/on/ Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on(). To ensure the elements are present and can be selected, perform event binding inside a document ready handler for elements that are in the HTML markup on the page. If new HTML is being injected into the page, select the elements and attach event handlers after the new HTML is placed into the page. Or, use delegated events to attach an event handler, as described next. Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. So to use delegated events you want to attach the on event to the parent element e.g. if you are attaching the new comments to an element #container $("#container").on('click','input[type=submit]',function(event){ // send AJAX to Django views.py }); Example - http://jsfiddle.net/eg0yx920/
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27383280
answers question: http://stackoverflow.com/q/27383280

http://stackoverflow.com/q/27378103
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43206537
has comment: http://stackoverflow.com/comment/43205957
upvote count: 1
has answer: http://stackoverflow.com/a/31768278
has body: I'm doing a responsive site then a I'm using: window.addEventListener("resize", function(){ if(window.innerWidth &lt; 768){ //execute some code } else{ //execute some code } }); When my navigator is at full width and click at the "Restore Down" button the window is resized to a width less then 768 the code inside of addEventListener("resize") doesn't work. These images below shows the condition of this "resize". My code works only when I resize the window using the pointer of the mouse. Any solution for this situation?
accepted answer: http://stackoverflow.com/a/31768278
type: Question
score: 1
has comment: http://stackoverflow.com/comment/43207067
possible better answer: http://stackoverflow.com/a/27378196
answer count: 2
has comment: http://stackoverflow.com/comment/43205689
has comment: http://stackoverflow.com/comment/43207247
has title: onresize does not work
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: onresize
has answer: http://stackoverflow.com/a/27378196
has comment: http://stackoverflow.com/comment/43206057

http://stackoverflow.com/a/27396331
downvote count: 0
answers question: http://stackoverflow.com/q/27396281
type: Answer
has comment: http://stackoverflow.com/comment/43239263
score: 1
upvote count: 1
has body: All you need to do is to add an quatifier + to regex "h....e l___l^^0".replace(/[^a-zA-Z0-9]+/g, "-") NOTE instead of [^\w] give [^a-zA-Z0-9]+ because \w contains _ hence it wont be replaced if you give [^\w]

http://stackoverflow.com/comment/43351591
comment on: http://stackoverflow.com/q/27457208
score: 0
type: QuestionComment
has text: My Code didn't come up OMG! help me please dont leave
type: Comment

http://stackoverflow.com/q/27389801
tagged with: javascript
has title: ThreeJS Molecules - Double Bonds
has comment: http://stackoverflow.com/comment/43253408
answer count: 1
favorite count: 0
upvote count: 5
type: UnansweredQuestion
tagged with: three.js
has answer: http://stackoverflow.com/a/32934631
tagged with: css
downvote count: 0
type: Question
score: 5
has body: Working with threejs, I am trying to use the following example: http://threejs.org/examples/#css3d_molecules The problem is that in that example, the bonds from the grey to the red balls are supposed to be double bonds. I have found a few links that suggest how this is done, but it doesn't seem supported by threejs. Here is what I was talking about: https://www.umass.edu/microbio/rasmol/faq_em.htm#doublebonds There you can see the fumerate molecule (it is a text file) and how they structured it. Any tips on how to add a double bond either visually, or by changing the class of the line so I can change the size or color?

http://stackoverflow.com/a/27474610
has body: Ruby/Rails are server side languages and have no effect on the client. You would need to use client side languages or send a notification to the client telling it to update, using something like SocketIO
has comment: http://stackoverflow.com/comment/43410630
answers question: http://stackoverflow.com/q/27474569
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27474569

http://stackoverflow.com/comment/43319749
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27424416
has text: My example is simplified, the processes in place are more complex and the application is big (I need strict typing for this functionality and not for others). And I can't decide to change technology, I should find a solution in this situation.
score: 0

http://stackoverflow.com/a/27343669
has comment: http://stackoverflow.com/comment/43143158
has comment: http://stackoverflow.com/comment/43143782
accepted answer of: http://stackoverflow.com/q/27343604
has comment: http://stackoverflow.com/comment/43143197
answers question: http://stackoverflow.com/q/27343604
has comment: http://stackoverflow.com/comment/43143752
upvote count: 2
type: AcceptedAnswer
has body: The problem is in this line: search.onreadystatechange.handleSearchSuggest(); search.onreadystatechange needs a callback function assigned to it. Change it to the following: search.onreadystatechange = handleSearchSuggest; Note that this does not invoke the handleSearchSuggest function here as onreadystatechange needs a callback function not the result of the function.
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43143126

select
tags question: http://stackoverflow.com/q/27382766
tags question: http://stackoverflow.com/q/27406202
tags question: http://stackoverflow.com/q/27321481
tags question: http://stackoverflow.com/q/27473355
tags question: http://stackoverflow.com/q/27441135
tags question: http://stackoverflow.com/q/27393838
tags question: http://stackoverflow.com/q/27319574
type: Tag
tags question: http://stackoverflow.com/q/27382767
tags question: http://stackoverflow.com/q/27386840
tags question: http://stackoverflow.com/q/27435167
tags question: http://stackoverflow.com/q/27373954
tags question: http://stackoverflow.com/q/27403315
tags question: http://stackoverflow.com/q/27411334
tag name: select

http://stackoverflow.com/comment/43222635
has text: `$(document).on("mouseover", "a[href*='window']", function () {/**/});`
comment on: http://stackoverflow.com/q/27387181
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27454716
type: Question
type: AnsweredQuestion
tagged with: image
has body: I want to link an image from CSS to Javascript but my code does not work. CSS : .backImage { background-image: url("img/level1.jpg"); background-repeat: repeat-y; } Javascript Code : var x1 = 450; var y1 = 40; var speed1 = 5; var angle1 = 90; var mod1 = 1; var tmp= $("&lt;div&gt;").addClass('backImage'); var src = tmp.css('background-image').match(/[^"][^"]+/g)[1]; console.log(src); var back = new Image(); back.src = src; function drawBackground() { x1 += (speed1 * mod1) * Math.cos(Math.PI / 180 * angle1); y1 += (speed1 * mod1) * Math.sin(Math.PI / 180 * angle1); context.save(); context.translate(x1, y1); context.rotate(Math.PI / 180 * angle1); context.drawImage(back, -(back.width / 2), -(back.height / 2)); context.restore(); }
has answer: http://stackoverflow.com/a/27454774
has comment: http://stackoverflow.com/comment/43347411
has title: Linking images from CSS to Javascript
has comment: http://stackoverflow.com/comment/43347489
answer count: 1
tagged with: javascript
score: 0
tagged with: css
has comment: http://stackoverflow.com/comment/43347435
accepted answer: http://stackoverflow.com/a/27454774

http://stackoverflow.com/comment/43383550
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27474265
has text: @Aweary with console.log I get the following: _function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option var selector = options && options.selector if (!data && option == 'destroy') return if (selector) { if (!data) $this.data('bs.popover', (data = {})) if (!data[selector]) data[selector] = new Popover(this, options) }_ **[...]**
score: 0

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/27452210
tags question: http://stackoverflow.com/q/27423130
tags question: http://stackoverflow.com/q/27381934
tags question: http://stackoverflow.com/q/27348554
tags question: http://stackoverflow.com/q/27408449
tags question: http://stackoverflow.com/q/27424036
tags question: http://stackoverflow.com/q/27434686
tags question: http://stackoverflow.com/q/27400188

http://stackoverflow.com/q/27356608
score: 0
has body: We are building hybrid applications with worklight framework 6.1.0.2 20141016-1539. In the wlCommonInit method of main.js, we setup table schema with code like this: db = openDatabase('mydb', '1.0', 'Test DB', 10 * 1024 * 1024); db.transaction(function (tx) { .... tx.executeSql("CREATE TABLE IF NOT EXISTS CAR_OFFLINE_DATA (COMPANY_CODE TEXT, SLIP_NO TEXT, DELIVERY_AREA_CODE TEXT, DELIVERY_DATE TEXT, DELIVERY_ATTRIBUTE TEXT, DELIVERY_TYPE_CODE TEXT, CAR_CODE TEXT, CREATETIME DATE DEFAULT CURRENT_TIMESTAMP,UPDATETIME DATE)"); .... },dao.db_error); In order to meet our new requirement in the next patch, our data model have to change. So we create new table to replace CAR_OFFLINE_DATA table which used for the same purpose. Then we will patch application with worklight direct update. This is what we have done in the next patch. We drop the table in previous version, and create a table with similar name except that it has additional columns: db = openDatabase('mydb', '1.0', 'Test DB', 10 * 1024 * 1024); db.transaction(function (tx) { tx.executeSql("DROP TABLE IF EXISTS CAR_OFFLINE_DATA");//SQL 1 rebuild this table .... tx.executeSql("CREATE TABLE IF NOT EXISTS CAR_OFFLINE_DATA_V2 (SEQID integer primary key autoincrement ,COMPANY_CODE TEXT, SLIP_NO TEXT, DELIVERY_AREA_CODE TEXT, DELIVERY_DATE TEXT, DELIVERY_ATTRIBUTE TEXT, DELIVERY_TYPE_CODE TEXT, CAR_CODE TEXT, CREATETIME DATE DEFAULT CURRENT_TIMESTAMP,UPDATETIME DATE)"); //SQL 2 .... },dao.db_error); }, After we direct update application , strange things happened. Debug tools of desktop safari and chrome shows that table CAR_OFFLINE_DATA didn't drop by web sql and CAR_OFFLINE_DATA_V2 does not exists either. Any sql execution related to CAR_OFFLINE_DATA_V2 such us below all failed with warnings that they can't prepare statement with table which is not exist. But if we attach success callback function for each sql execution, then these function definitely will be invoke every time when we start application. db.transaction(…
has comment: http://stackoverflow.com/comment/43325100
has comment: http://stackoverflow.com/comment/43224013
has answer: http://stackoverflow.com/a/27526142
tagged with: web-sql
answer count: 1
has comment: http://stackoverflow.com/comment/43168785
has comment: http://stackoverflow.com/comment/43325123
tagged with: ibm-mobilefirst
has comment: http://stackoverflow.com/comment/43175680
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43166620
has comment: http://stackoverflow.com/comment/43175052
type: Question
has comment: http://stackoverflow.com/comment/43175119
tagged with: javascript
has title: Websql can not drop and create table after worklight direct update

http://stackoverflow.com/comment/43305504
comment on: http://stackoverflow.com/q/27422884
type: Comment
score: 0
has text: That would break the AngularJS routing wouldn't it?
type: QuestionComment

http://stackoverflow.com/a/27363034
downvote count: 0
score: 1
has body: Maybe it is better to create a separate validation method. so you will have something like this function moveStepOnetoStepTwo() { if (!validateInput()) { console.log("wrong input"); alert("bad input"); return } //continue to move to step 2 //Go thru the master list $.each(item_checkout_master_list, function() { if (this.itemID == attr_userid) { this.final_bid = attr_final_bid; } }); console.log(item_checkout_master_list); //if pass move to tab 2 $('#tab1_box').hide(); $('#tab3_box').hide(); $('#tab2_box').show(); $('#myTab li:eq(1) a').tab('show'); } function validateInput() { var validateOk = true; $('.inputfields').each(function() { var attr_userid = $(this).data('userid'); //get item ID from custom data attr val var attr_final_bid = $(this).val(); //Let's do some error checks with input attr_final_bid = attr_final_bid.trim(); if (empty(attr_final_bid) == true) { $(this).css({ "border-color": "red", "border-width": "2px", "border-style": "solid" }); validateOk = false; } }); return validateOk; }
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27362765
answers question: http://stackoverflow.com/q/27362765

http://stackoverflow.com/a/27333721
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/54803782
has body: In IE you can hide the scrollbar with the following line. .element { -ms-overflow-style: none; }
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/43133407
answers question: http://stackoverflow.com/q/27332879

http://stackoverflow.com/a/27373897
score: 1
answers question: http://stackoverflow.com/q/27373625
has body: if i wanted to make a text area and print the value of the dropdown option? Then you can do this: $(document).ready(function () { var $val = $('select[id="#jform_params_foreignmanuf"] :selected').text(); $("#jform_params_manucounter").val($val); }); As your select element contains a special character of # so either you can escape it with \\ or you can make an attribute selector like above. would ouput "127" instead of "1" that i want to print right? For this you just need to use .text() instead of .val(). Checkout the demo.
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/27386703
linked to: http://stackoverflow.com/q/10898786
score: -2
has body: I am working inheritance in JavaScript, here, have created two objects. on the below code, when try to alert as alert(newOnj.whatAreYou());, now, it is working fine. But, when i try to alert alert(newOnj.whatAreYounow());, now, am getting error as 'newOnj.whatAreYounow is not a function'. Actually, have inherited parent class to child class as subGadget.prototype = new Gadget();. what is the thing that i haven't understood here? please function Gadget() { this.name = "Alex"; this.color = "red"; this.whatAreYou = function(){ return 'I am a ' + this.color + ' ' + this.name; } } function subGadget() { this.whatAreYounow = function(){ return 'Now, I am a ' + this.color + ' ' + this.name; } } subGadget.prototype = new Gadget(); var newOnj = new Gadget(); alert(newOnj.whatAreYounow());
tagged with: javascript
tagged with: inheritance
upvote count: 0
has answer: http://stackoverflow.com/a/27386775
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 2
type: Question
has title: javascript: object inheritance is not able understand

http://stackoverflow.com/q/27334753
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27335089
type: Question
has title: Remove circle and path on click d3
has body: I am trying to remove a path and it the circles that are placed on it when a text label is clicked. The line is removed on click but I am having trouble removing the circles too. The d3 code to remove the path is as follows. .on("click", function () { // Determine if current line is visible var active = d.active ? false : true; var newOpacity = active ? 0 : 1; // Hide or show the elements based on the ID d3.select("#line" + d.key.replace(/\s+/g, '')) .transition().duration(500) .style("opacity", newOpacity); // Update whether or not the elements are active d.active = active; }) Please see the Plunker link for a better example for the whole code. Plunker link
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27335089

http://stackoverflow.com/comment/43147876
score: 0
type: AnswerComment
has text: Paste it please. Maybe we can help you.
type: Comment
comment on: http://stackoverflow.com/a/27346353

http://stackoverflow.com/q/27456407
accepted answer: http://stackoverflow.com/a/27457790
has title: Dynamic append and remove table rows not working
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27457790
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
type: Question
has body: I work in wordpress with WPMVC. I am adding table rows dynamically in the form to add a record to the table. Code: views/admin/edit.php Edit Geozone <?php echo $this->form->create($model->name); ?> <?php echo $this->form->input('geozone_name'); ?> <?php echo $this->form->input('state'); ?> <?php echo $this->form->input('ordering'); ?> <?php echo $this->form->end('Update'); ?> Country Zone Remove I tested the code with plnkr.co and it was successful. But here in my application, it is not even entering the script. What could be the flaw in this code?

http://stackoverflow.com/comment/43097489
has text: Same question I asked Paul Roub, using your method, how would I append the same objects and values to another dropdown list? Please advise.
comment on: http://stackoverflow.com/a/27318644
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27323772
has title: JavaScript function and UI updates
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27323934
type: AnsweredQuestion
score: 3
tagged with: settimeout
upvote count: 3
has comment: http://stackoverflow.com/comment/43107058
has body: I have a following function which slides a relatively positioned element 1000px off of where it is now. for (var i = 0; i &lt; 1000; i++) { $('.my-element').css( 'left', parseInt($('.my-element').css('left'), 10) + 1 ); } This does not produces a sliding effect. Rather, by the end of the execution, the element moves abruptly 1000px to its right. Now, if I wrap the UI updates in setTimeout like below: for (var i = 0; i &lt; 1000; i++) { setTimeout(function () { $('.my-element').css( 'left', parseInt($('.my-element').css('left'), 10) + 1 ); }, 0); } This produces the visual effect of the element sliding 1000px to its right. Now, according to my understaning and this SO thread, Why is setTimeout(fn, 0) sometimes useful?, UI updates are queued in the browser event queue in the same way async callbacks are queued like setTimeout callback. So, in case first, basically, a queue of 1000 UI updates are made when the for loop is executed. And in case second, first, a queue of 1000 setTimeout callbacks is created, which on execution, creates another queue of 1000 UI updates. So, eventually, both cases create the same queue of 1000 UI updates. Then why the difference in the visual result? I must be looking over some important JavaScipt and browser rendering concept here. Anyone who can enlighten me will be much appreciated. Note: Above examples are purely for understanding purpose and not an attempt to create a JS function to slide a DOM element.
type: Question
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/779379
has answer: http://stackoverflow.com/a/27323934
has comment: http://stackoverflow.com/comment/43107202

http://stackoverflow.com/a/27338849
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27338748
downvote count: 0
type: Answer
has body: in css .moon-orbit{ margin-bottom : -14px; }

http://stackoverflow.com/comment/43227152
has text: you can publish the cal to rss/xml and use a tool like YQL to consume the XML and turn it into jsonp, which you can fetch onto your page and then turn into html.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27389084
score: 0

http://stackoverflow.com/comment/43162365
comment on: http://stackoverflow.com/q/27354625
score: 0
type: QuestionComment
has text: Yes. I have added it. Edited my question, also attached images for reference.
type: Comment

http://stackoverflow.com/a/27397490
has body: You can't achieve this result directly, but there are work arounds that might prove effective: Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
answers question: http://stackoverflow.com/q/27396158
type: Answer
score: 0

http://stackoverflow.com/comment/43219288
score: 0
type: Comment
type: AnswerComment
has text: @WouterHuysentruit Downvote posts, not people. Don't be a jerk just because you are wrong and I pointed it out. This is in the rules of this site. I watched your reputation decrease by 1 in the exact instant that you deleted your answer and my received a downvote.
comment on: http://stackoverflow.com/a/27385487

http://stackoverflow.com/comment/43216962
comment on: http://stackoverflow.com/q/27383179
has text: What are you seeing in the DOM ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27443188
type: Question
accepted answer: http://stackoverflow.com/a/27445914
tagged with: javascript
tagged with: gruntjs
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/27445914
possible better answer: http://stackoverflow.com/a/27445878
has title: grunt watch and stylus
has answer: http://stackoverflow.com/a/27445878
favorite count: 0
tagged with: stylus
type: AnsweredQuestion
score: 3
has body: can't figure how nesting grunt watch and stylus compiler (livereload will come later) I tried also using the "new" grunt newer, but there must be something wrong in my code. Any suggestion? grunt.initConfig({ stylus: { compile: { options: { paths: ['stylus'], import: [ 'nib/*' ] }, files: { 'css/style.css': 'stylus/style.styl', }, }, }, watch: { stylus: { files: ['*/*.*'], task: ['newer:stylus:compile'], options : { livereload: true }, }, }, }); grunt.loadNpmTasks('grunt-contrib-stylus'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-newer'); grunt.registerTask('compile', ['newer:stylus:all']); Also, if i run grunt watch, it works good but do nothing. And, if i run grunt stylus, it compile my css perfectly.
downvote count: 0

http://stackoverflow.com/a/27393848
has body: &lt;script src="js/sample.js"&gt;&lt;/script&gt; is better. Javascript will be loaded and save in client computer as cache. So it will call code from cache in client computer. But PHP code will load code from server that makes it slower and your server will work harder.
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27393340

http://stackoverflow.com/a/27317230
score: 0
answers question: http://stackoverflow.com/q/27317193
type: Answer
has body: I cannot think of any tag that wouldn't support the id attribute, neither can the HTML5 spec: 3.2.5 Global attributes The following attributes are common to and may be specified on all HTML elements (even those not defined in this specification): ... id ...

http://stackoverflow.com/comment/43198683
type: Comment
has text: Yes right sorry ;) thanks
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/27373995

http://stackoverflow.com/comment/43364559
has text: @suchit: Not sure what you mean. What will be opposite if what is possible?
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27464131

http://stackoverflow.com/a/27432448
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27427679
answers question: http://stackoverflow.com/q/27427679
upvote count: 1
has body: Note: You load three times the jQuery library. You only need it once. What you are trying to do is the "old" way toggle() used to work. You can read in the API description: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Because you are using a version of jQuery newer than 1.8, the toggle() function only shows/hides an element. You have several options: you could use a plugin, but I like Dom's solution which is using a variable to keep track of the state. Your JavaScript code would become: var oddClick = true; // &lt;-- The variable to keep track of the state $("#myMenu").click(function () { if (oddClick) {h $(".letterT").animate({ marginLeft: "-200px", borderWidth: "10px" }, 1000); $(".letterH").animate({ marginLeft: "400px", position: "absolute", borderWidth: "10px" }, 1000); $("nav").fadeIn(2000); } else { // We put it back as it was before. $(".letterT").animate({ marginLeft: "0", }, 1000 ); $(".letterH").animate({ marginLeft: "-0.3em", position: "absolute", }, 1000 ); $("nav").fadeOut(500); } oddClick = !oddClick; // We toggle the variable everytime the button is clicked. }); I created a jsFiddle to show you: http://jsfiddle.net/grd7z1g8/1/
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/27351954
has body: Because xxx_val is a string not a number, so it doesn't have methods like toFixed() function fn_1() { var xxx_val = document.getElementById('xxx').value var n = xxx_val.indexOf("."); var res = xxx_val.replace(".", ""); var res_length = res.length; var decimal_length = (res_length - n); if (n != '-1') { if (decimal_length &gt; '1') { // 2 decimal and morethan // //var x = parseFloat(Math.round(xxx_val * 100) / 100).toFixed(2); var x = Math.floor(+xxx_val * 100) / 100 } else { // 1 decimal // var x = (+xxx_val).toFixed(2) } } else { // not decimal // var x = (+xxx_val).toFixed(2) } alert(x); } &lt;input type="text" id="xxx" onchange="fn_1()" /&gt;
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27351894
answers question: http://stackoverflow.com/q/27351894
type: Answer

http://stackoverflow.com/a/27399100
has body: Try with .filter(fn): $('#abcd div').filter(function(){ return this.textContent !== "Hello" }).remove(); Fiddle Updated as per comment by skobaljic: $('#abcd div').filter(function () { return $(this).index() !== 0 }).remove(); The above code snipped removes all the divs except the first one as required in the question. Updated Fiddle. .filter() lets you return the selectors on the basis of different attributes, so in this case we are using .text() &amp; .index(). so it will return all the divs which does not contains the text Hello and just chain it with .remove() method to remove.
upvote count: 1
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/27398959
has comment: http://stackoverflow.com/comment/43248252
type: Answer
has comment: http://stackoverflow.com/comment/43280981
has comment: http://stackoverflow.com/comment/43276795

http://stackoverflow.com/a/27338572
has body: If an ajax call can get the data, then any rogue or customized script can also get the data via the same ajax call and it only takes an elementary look at your web page to see what the ajax call is that gets the data. Or, anyone who just opens the Chrome developer tools and looks at the network tab can see the contents of all ajax calls made by the browser. In addition, anyone who knows how to use a browser debugger can watch anything your code does (like storing ajax contents into a variable) so even encryption over the wire doesn't prevent someone seeing your data who is at the receiving browser. If you want your server data to be secure, you will need a different design. The secure way to test user input vs. some secret on the server is to send the client data to the server and have the server compare the client data to the server master and thus never send the server data to the client. Think of it like a password. You'd never send the master password to the client and have the client compare what the user entered. Instead, you'd send what the client typed to the server and have the server do the comparison securely. This same approach will protect your data.
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27338465
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43134336
accepted answer of: http://stackoverflow.com/q/27338465

http://stackoverflow.com/comment/44135223
type: QuestionComment
has text: as per http://www.dropzonejs.com/ you should give 'dropzone' class to your tag. let me know if it solves your issue
comment on: http://stackoverflow.com/q/27380096
score: 0
type: Comment

http://stackoverflow.com/comment/43280123
has text: I tried to implement this, however it gives me the same effect as my example, the images are not getting wrapped inside an anchor tag.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27418432

http://stackoverflow.com/comment/43122667
has text: The direct generation of your object via JSP would generate the HTML and JS already containing the serialized object. Upon page load the browser would automatically load the object from the JS. This route has nothing to do with AJAX. I added the AJAX option in because the question was broad and wanted to outline the option. AJAX is for making async calls to the server -- It can be done synchronously as well. It is a good practice to abstract functionality away and to have a specific servlet instance (with proper parameter passing) to return JSON strings, especially in REST architecture.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27328410
type: AnswerComment

http://stackoverflow.com/a/27338253
accepted answer of: http://stackoverflow.com/q/27337147
answers question: http://stackoverflow.com/q/27337147
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has body: This is how you can create a grid of mouse-over-able rectangles: var ctx = canvas.getContext("2d"), cw = 32, ch = 32, w = canvas.width, h = canvas.height; ctx.translate(0.5, 0.5); ctx.beginPath(); // not neede here, but if in a larger project for(var y = 0; y &lt; h; y += ch) { for(var x = 0; x &lt; w; x += cw) { ctx.rect(x, y, cw-2, ch-2); // give 1px space } } ctx.fillStyle = "gray"; ctx.strokeStyle = "#000"; ctx.lineWidth=1; ctx.fill(); ctx.stroke(); canvas.onmousemove = function(e) { var rect = this.getBoundingClientRect(), x = e.clientX - rect.left, y = e.clientY - rect.top, cx = ((x / cw)|0) * cw, //quantize mouse pos to grid cy = ((y / ch)|0) * ch; ctx.fillStyle = "red"; ctx.fillRect(cx+1, cy+1, cw-3, ch-3); }; &lt;canvas id=canvas width=320 height=320&gt;&lt;/canvas&gt; You should be able to adopt the principles shown to your need. Hope this helps!
type: Answer

http://stackoverflow.com/a/27359031
downvote count: 1
upvote count: 307
accepted answer of: http://stackoverflow.com/q/27358966
has comment: http://stackoverflow.com/comment/127541847
has comment: http://stackoverflow.com/comment/117606132
has body: You can't set X-Frame-Options on the iframe. That is a response header set by the domain from which you are requesting the resource (google.com.ua in your example). They have set the header to SAMEORIGIN in this case, which means that they have disallowed loading of the resource in an iframe outside of their domain. For more information see The X-Frame-Options response header on MDN. A quick inspection of the headers (shown here in Chrome developer tools) reveals the X-Frame-Options value returned from the host.
type: AcceptedAnswer
score: 306
type: Answer
has comment: http://stackoverflow.com/comment/57802815
answers question: http://stackoverflow.com/q/27358966

http://stackoverflow.com/comment/43134904
type: QuestionComment
comment on: http://stackoverflow.com/q/27339132
has text: you are missing a comma after first field i.e. icon: {'http://...' ,type_name: 'East'}
score: 0
type: Comment

content-length
type: Tag
tag name: content-length
tags question: http://stackoverflow.com/q/27382765

http://stackoverflow.com/q/27383448
type: Question
has comment: http://stackoverflow.com/comment/43215673
has comment: http://stackoverflow.com/comment/43215657
possible better answer: http://stackoverflow.com/a/27383763
has answer: http://stackoverflow.com/a/27383763
score: 0
accepted answer: http://stackoverflow.com/a/27383570
has comment: http://stackoverflow.com/comment/43215581
answer count: 3
has comment: http://stackoverflow.com/comment/43215620
tagged with: javascript
tagged with: jquery
has body: Basically I am trying to check if something has been created and if it has the value of an attribute assigned. So for this, I am basically looking for all the $('.item') classes and for this example these items have an attribute like data-value="1" and each item in the html has a unique value for this attribute such as: Item 1 Item 2 Item 3 To trigger our JQuery we will have a button that is designed to correspond to an item: Button for Item 1 Button for Item 2 Button for Item 3 Button for Item 4 So now in jQuery I will like to look through them and run a function to create a new one if it doesn't exist. This is how I interpret this but it doesn't work: (lets presume this is within a function triggered by the click. var itemClicked = $(this); var findItem = $('.item').each(function() { if ($(this).attr('data-value') == itemClicked.attr('data-value')) { return true; } }); if (!findItem) { // create new item } So in theory, button 1, button 2 and button 3 would pass the test and a new item wouldn't be created. However button 4 would fail the check and create a new item essentially. But i can't get the check to work how can I go about it?
type: AnsweredQuestion
has title: JQuery Loop through classes and then compare an attribute and determine if any matches were found
has answer: http://stackoverflow.com/a/27383674
has answer: http://stackoverflow.com/a/27383570

openlayers-3
type: Tag
tag name: openlayers-3
tags question: http://stackoverflow.com/q/27389138
tags question: http://stackoverflow.com/q/27441219
tags question: http://stackoverflow.com/q/27393794

http://stackoverflow.com/a/27466733
has comment: http://stackoverflow.com/comment/43390938
upvote count: 3
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27465581
answers question: http://stackoverflow.com/q/27465581
score: 3
has body: Seems the solution implies to use anchors and timeout. Inspired by this post I've updated your plunkr. Here is a link: http://plnkr.co/edit/GDdm7Z4OEzfh7ZwnQce7?p=preview app.directive('autoScroll', function($document, $timeout) { return { restrict: 'AE', link: function(scope, elem, attrs) { var delay = false; $document.on('mousewheel DOMMouseScroll', function(e) { e.preventDefault(); if (delay) return; delay = true; $timeout(function() { delay = false }, 100) var wd = e.originalEvent.wheelDelta || -e.originalEvent.detail; var a = angular.element('a'); if (wd &lt; 0) { for (var i = 0; i &lt; a.length; i++) { var t = a[i].getClientRects()[0].top; if (t &gt;= 40) break; } } else { for (var i = a.length - 1; i &gt;= 0; i--) { var t = a[i].getClientRects()[0].top; if (t &lt; -20) break; } } angular.element('html,body').animate({ scrollTop: a[i].offsetTop }, 500); }); } } });
has comment: http://stackoverflow.com/comment/43426293
type: AcceptedAnswer

http://stackoverflow.com/q/27429671
has comment: http://stackoverflow.com/comment/43300699
favorite count: 0
has comment: http://stackoverflow.com/comment/43300731
type: UnansweredQuestion
has body: I am trying to check if a folder name is unique or not. it works correctly if I put in a Name that already exist, but if I put in a name that doesn't exist yet it crashes. // Determines if the folder's name is unique // @param {String} name folder name // @return {Boolean} true if unique function isFolderNameUnique(name) { name = name.toLowerCase(); if(RESERVED_FOLDER_NAMES.indexOf(name) !== -1) { return false; } var i = folders.length; while(i--) { if(folders[i].name.toLowerCase() === name) { return false; } } return true; } it crashes at the if(folders[i].name.toLowerCase() with TypeError: undefined is not a function 'M[r].name.toLowerCase()')
upvote count: 0
has comment: http://stackoverflow.com/comment/43300654
type: Question
has comment: http://stackoverflow.com/comment/43300630
has title: Javascript check to see is name already exists
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/43300732
has comment: http://stackoverflow.com/comment/43300903
downvote count: 2
has comment: http://stackoverflow.com/comment/43300632
answer count: 1
has answer: http://stackoverflow.com/a/27429987
has comment: http://stackoverflow.com/comment/43300587
has comment: http://stackoverflow.com/comment/43301325

http://stackoverflow.com/a/27357164
upvote count: 1
downvote count: 0
has body: Try console.log(array2.slice(0, array.length).join('')); Though I don't see any point in having the first array. You could use just var len = 3;.
type: Answer
answers question: http://stackoverflow.com/q/27357080
has comment: http://stackoverflow.com/comment/43166852
score: 1

http://stackoverflow.com/a/27413831
score: 35
upvote count: 35
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27413764
type: Answer
has body: I found your problem. Change these: link(rel='stylesheet', href='css/bootstrap.css') link(rel='stylesheet', href='css/style.css') To this: link(rel='stylesheet', href='/css/bootstrap.css') link(rel='stylesheet', href='/css/style.css') You always want to use a preceding slash in your markup relative paths. Preceding your relative paths with a slash always refers to the application root. If you omit the slash then it tries to look at the path relative to the page you are on. Check it out: Because you left out the preceding slash in your link tags it tried to look for your spreadsheet relative to "song", not the application root. Omitting the trailing slash in the URL makes the relative path on the page look in the same relative path (which just happens to be the application root in your case, so it works). If your URL was https://edmtl.herokuapp.com/song/something then it would again look for bootstrap.css at https://edmtl.herokuapp.com/song/css/bootstrap.css. Adding the trailing slash to the page URL would make it look for it at https://edmtl.herokuapp.com/song/something/css/bootstrap.css. Including the preceding slash in your page URLs will always ensure it looks in the app root at https://edmtl.herokuapp.com/ :) PS - This is true for all web apps, not just express/MEAN apps.
answers question: http://stackoverflow.com/q/27413764

http://stackoverflow.com/q/27356601
type: Question
accepted answer: http://stackoverflow.com/a/27356662
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/73061767
answer count: 2
has answer: http://stackoverflow.com/a/27356662
downvote count: 0
favorite count: 0
tagged with: deferred
tagged with: ajax
has answer: http://stackoverflow.com/a/73061767
has body: I have 3 functions which handle data pulled in from AJAX, they update the page after the ajax function is called. When the AJAX function is called I show a loader, I want to hide the loader after the AJAX has completed and the functions have completed. How can I use deferred with when and then in jQuery to test once all 3 function are completed. Here is my AJAX code, this hides the loader on AJAX success at the moment, ideally this would be after the 3 functions have been completed / were successful. The 3 functions receive data to process and display on the page, they are not AJAX functions. function setUpStocking() { $.ajax({ url: url, cache: false, beforeSend: function(){ // Show loader $('.loader').show(); }, success: function(data){ updateMyList(data.gifts); updateRecievedGift(data.recieved); updateGiftsOpenedToday(data.opened); // Hide loader $('.loader').hide(); } }); } The functions are outside the AJAX function: function updateMyList(gifts) { // Get data, process it and add it to page } function updateRecievedGift(recieved) { // Get data, process it and add it to page } function updateGiftsOpenedToday(opened) { // Get data, process it and add it to page }
type: AnsweredQuestion
score: 1
upvote count: 1
has title: How to tell when multiple functions have completed with jQuery deferred
tagged with: .when

http://stackoverflow.com/q/27321179
has comment: http://stackoverflow.com/comment/43101631
has comment: http://stackoverflow.com/comment/43101786
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27321988
tagged with: java
type: Question
possible better answer: http://stackoverflow.com/a/27321369
has comment: http://stackoverflow.com/comment/43101671
linked to: http://stackoverflow.com/q/13777108
has answer: http://stackoverflow.com/a/27321369
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/43101747
has title: JavaScript style array filling in Java
tagged with: arraylist
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27321988
has body: In JavaScript, the following: var a = []; a[20] = "hello"; console.log(JSON.stringify(a)); would yield: [null,null,null,null,null,null,null,null,null,null, null,null,null,null,null,null,null,null,null,null,"hello"] Is there a list type in Java that will auto expand when setting values beyond it's current bounds? A map isn't practical because I also need to know the array dimension.
has comment: http://stackoverflow.com/comment/43101976
has comment: http://stackoverflow.com/comment/43101805
has answer: http://stackoverflow.com/a/27321289
has comment: http://stackoverflow.com/comment/43101972

http://stackoverflow.com/a/27359535
accepted answer of: http://stackoverflow.com/q/27326220
score: 1
has body: By using columnDefs. Define your grid in html like this: &lt;div id="grid1" ui-grid="gridOptions" class="grid"&gt;&lt;/div&gt; And your app code like this: var app = angular.module('app', ['ui.grid']); app.controller('MainCtrl', ['$scope', function($scope) { $scope.myData = [{ "x": "1", "y": "2", }, { "x": "3", "y": "4", }]; $scope.gridOptions = { data: 'myData' }; $scope.gridOptions.columnDefs = [{ name: 'y' }, { name: 'x' }, ]; } ]); Note how columnDefs uses y for the first column and x for the second one. Here is a Plunker
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27326220
upvote count: 1

http://stackoverflow.com/q/27349257
possible better answer: http://stackoverflow.com/a/51788905
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27349611
has body: I have one div with bootstrap's class list-group and its populated with the basic example Bootstrap provides, and I have another one which I want to populate with list-group-items obtained from ajax get request. The populate is being right, but when trying to switch between the active element it doesn't switch the active element. The first div (example of boostrap) switch the active element correctly, but the second div (my own) doesn't. Here is the HTML: TEST Cras justo odio Dapibus ac facilisis in Morbi leo risus Porta ac consectetur ac Vestibulum at eros Geolocation And here is the Javascript: $(document).ready(function(){ var counter=0; var alert; $("#boton1").click(function() { for(var i=0; i<5; i++){ counter++; if (counter===1){ alert = "<a class='list-group-item active' "; }else{ alert = ""; // Titulo de la alerta alert+=" "; alert+="Alerta #"+counter; alert+=" "; // Texto de la alerta alert+=" "; alert+="HOLIIISSS"; alert+=" "; alert+=""; $("#ticker").append(alert); } }); $('.list-group-item').on('click',function(e){ var previous = $(this).closest(".list-group").children(".active"); previous.removeClass('active'); $(e.target).addClass('active'); }); }); Here is the fiddle: http://jsfiddle.net/txfjjzsm/
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27349611
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/51788905
type: Question
has title: Auto-generated list-group-items not responding to active class
answer count: 2

http://stackoverflow.com/a/27365162
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27365009
type: Answer
score: 2
has body: What I am trying to achieve is ... This seems like a job for Object.assign: var imgCollection = { catImage: Object.assign(document.createElement("img"), { src: "http://whatever.source.com/image.png", width: 30, height: 30, }) }; Object.assign copies the properties of the other arguments to the first argument and returns the first argument. Follow the link for a polyfill.
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/27365009

jvectormap
tags question: http://stackoverflow.com/q/27327768
type: Tag
tag name: jvectormap
tags question: http://stackoverflow.com/q/27326531

http://stackoverflow.com/a/27381084
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43350806
accepted answer of: http://stackoverflow.com/q/27380962
answers question: http://stackoverflow.com/q/27380962
type: Answer
has body: just mark what you want with capturing group: /^magnet:\?xt=urn:btih:([a-z\d]{40})\&amp;$/im Also I recomend to not use regexp here. Try followed: tesst.split(':')[3].slice(0, -1); slice(0, -1) used for remove last '&amp;', you can use any other method, like slice(0, 40), replace(/[^\w]/g, '') or any other.

http://stackoverflow.com/comment/43165554
has text: Detail: Why don't you just do `elements.push(element);` instead of `elements[topOfmyStack] = element;`?
comment on: http://stackoverflow.com/q/27356384
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/27438289
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27425717
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43337773
answers question: http://stackoverflow.com/q/27425717
has body: Why not just upsert? var storeData = function(APIResponse, id, callback) { var record = { id: id, title: APIResponse.title }; Record.findOneAndUpdate({ id: id }, record, { upsert: true }, function(err, doc) { if(err) { throw err; } callback(null, APIResponse, doc); }); };

http://stackoverflow.com/comment/43305288
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27431762
has text: @PeeHaa Why not? In any case, I'm learning javascript syntax and this is an exercise from a book
score: 1

http://stackoverflow.com/comment/43225818
type: AnswerComment
comment on: http://stackoverflow.com/a/27388859
score: 0
type: Comment
has text: Are you sure your generating the right name? The name is `icdf_1_3_-1_6077_-1`, which has an underscore before the last character set (`-1`), but your generating code doesn't add that. It does this `name[4] + name[5]`. Would that cause the name to be `icdf_1_3_-1_6077-1`?

http://stackoverflow.com/comment/76323125
score: 11
comment on: http://stackoverflow.com/a/27466117
type: AnswerComment
type: Comment
has text: The most likely fix for most such cases is @Anirudh's answer below.

http://stackoverflow.com/q/27331669
downvote count: 0
score: 1
type: Question
has body: I am trying to work on a sample web application using HTML5 boostrap express js angular and jquery. I have been fighting with the source tags to the js and css files I am trying to include and just cannot get them to work unless I use one that is hosted online. If any one has some spare time here is what my header code looks like index.html &lt;script type="text/javascript" src="/bower_components/jquery/dist/jquery.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.css"/&gt; &lt;script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="style.css"/&gt; ------------------------------------------------------------------------------------ app.js var express = require('express'); var path = require('path'); var app = express(); //config app.set('views', __dirname + ''); app.engine('html', require('ejs').renderFile); //routes app.get('/',function(req,res){ res.render('index.html') }); //server app.listen(1337,function(){ console.log('ready on port 1337'); }) This is a screenshot of of my file stucture My server is running in the app.js located in the root folder. I have tried many variations of ../ and no slash and even the ~ to attempt to get this to operate. Thank you for your time in advance. EDIT So while I have been messing around I realized if I open the index.html file without running it on my express server it works just fine. I have updated the code portion above to include my app.js. SOLVED A big thanks to suchit,dfsq,and Anubhav. So since I was using express I needed to tell express how to properly path to my static src files "aka the js and css" inside of my app.js. So the answer I provide is only relevent if you are running your application on an express server. I will provide the code that was added to my app.js file and to my index.html file to come to a solution. app.js app.use(express.static(__dir…
has comment: http://stackoverflow.com/comment/43121160
has comment: http://stackoverflow.com/comment/43121368
tagged with: javascript
has comment: http://stackoverflow.com/comment/43121341
tagged with: express
accepted answer: http://stackoverflow.com/a/27331896
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43121361
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/27331896
has title: I am having issues getting the src tags for my js and css files to work
has comment: http://stackoverflow.com/comment/43121224
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/27324768
type: Question
has title: Execute function after the user finishes using the slider
has comment: http://stackoverflow.com/comment/43108901
answer count: 2
has body: I want to execute some function after the user has finished using the slider and not while the slider is being manipulated. Only after the handle stops, then start the function. I remember doing this using setTimeout and clearTimer but I don't remember how to do it exactly. $('#slider').on('slide', function(){ some_function(); }); Note that I am using nouislider and not jquery.
tagged with: javascript
tagged with: slider
has answer: http://stackoverflow.com/a/27324856
tagged with: nouislider
score: 0
possible better answer: http://stackoverflow.com/a/27324837
has answer: http://stackoverflow.com/a/27324837
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27324856

http://stackoverflow.com/comment/43207099
comment on: http://stackoverflow.com/a/27378672
type: Comment
has text: This is helpful @Aminul , Can you please help with how to display a progress bar(Loading bar) till the time when CSS div is hidden ?
score: 0
type: AnswerComment

http://stackoverflow.com/q/27350739
has answer: http://stackoverflow.com/a/27350769
has body: I have set up downloading of a zip file via an anchor tag as follows. sample.zip The file download works fine if the file is present in the download directory then a file download dialog opens and the user can download the file. If the file is not present then it results in a 404 error if the file is present and the user has to login again. Is there a way to cause this download to happen in a new page or check the existence of this file in javascript and control whether the download functionality should be not allowed.
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27350769
has title: Downloading a file via an Anchor Tag
type: AnsweredQuestion
type: Question
tagged with: hyperlink

http://stackoverflow.com/comment/43090431
type: Comment
comment on: http://stackoverflow.com/q/27315087
score: 0
has text: Apart of what @spender said - I believe you have a typo in your code. You didn't close the `reader.onload` curly bracket (`}`). Additionaly, `reader.readAsDataURL(inputFile);` should be _outside_ of the `onload` event handler.
type: QuestionComment

http://stackoverflow.com/q/27423950
has comment: http://stackoverflow.com/comment/43291355
has body: From here In general, a Controller shouldn't try to do too much. It should contain only the business logic needed for a single view. I can't understand why it's controller. It must be model. Please,explain. EDIT: This is the example from official developer guider: angular.module('invoice1', []) .controller('InvoiceController', function() { this.qty = 1; this.cost = 2; this.inCurr = 'EUR'; this.currencies = ['USD', 'EUR', 'CNY']; }); Invoice: Quantity: Costs: {{c}} What I don't understand is that controller = model here. Am I not right?
upvote count: 4
has comment: http://stackoverflow.com/comment/43292244
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43290455
has comment: http://stackoverflow.com/comment/43290223
has comment: http://stackoverflow.com/comment/43291208
has answer: http://stackoverflow.com/a/27716223
tagged with: model-view-controller
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43291435
has title: Angular controller - why do they name it controller?
has comment: http://stackoverflow.com/comment/43291185
score: 1
has comment: http://stackoverflow.com/comment/43290191
has comment: http://stackoverflow.com/comment/43290615
has answer: http://stackoverflow.com/a/27424185
linked to: http://stackoverflow.com/q/11112608
has comment: http://stackoverflow.com/comment/43290351
type: Question
linked to: http://stackoverflow.com/q/20286917
has comment: http://stackoverflow.com/comment/43291658
possible better answer: http://stackoverflow.com/a/27424185
tagged with: javascript
has comment: http://stackoverflow.com/comment/43292111
has comment: http://stackoverflow.com/comment/43291328
has comment: http://stackoverflow.com/comment/43291147
has answer: http://stackoverflow.com/a/27424122
has comment: http://stackoverflow.com/comment/43292428
accepted answer: http://stackoverflow.com/a/27424122
favorite count: 0
has comment: http://stackoverflow.com/comment/43291615
has comment: http://stackoverflow.com/comment/43291126
has comment: http://stackoverflow.com/comment/43290492
has comment: http://stackoverflow.com/comment/43291018
answer count: 3
downvote count: 3
has comment: http://stackoverflow.com/comment/43291290
linked to: http://stackoverflow.com/q/13067607
has comment: http://stackoverflow.com/comment/43290165

http://stackoverflow.com/comment/43364658
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27464169
has text: Oh! I was unknown of that.

http://stackoverflow.com/comment/43164202
comment on: http://stackoverflow.com/q/27355718
score: 0
type: Comment
type: QuestionComment
has text: Plunker link http://plnkr.co/edit/ROACCzIMBpukJimtBQnI

http://stackoverflow.com/a/31039873
upvote count: 16
has body: Your primary concerns will be "is it ok if the user has my source code?" Usually it is fine, as users can deobfuscate things anyways. That said, if you're using Sentry, you can actually use the releases API to avoid this problem. You'll still need to generate the artifacts, and set URLs (or something that the API can handle), but you don't have to expose them to the internet.
type: Answer
answers question: http://stackoverflow.com/q/27345520
score: 15
downvote count: 1

http://stackoverflow.com/a/27408341
downvote count: 0
score: 1
type: Answer
has body: this.functionName is a reference to the function object. This can be useful if you want to check for the existence of the function before calling it, e.g. if (typeof(this.functionname) == 'function') { this.functionname(); } this.functionName() actually invokes the function.
upvote count: 1
answers question: http://stackoverflow.com/q/27408295

http://stackoverflow.com/q/27365441
has comment: http://stackoverflow.com/comment/43182910
type: Question
has answer: http://stackoverflow.com/a/27365567
tagged with: javascript
tagged with: jquery
has title: Use an element's text for parent heading's ID value
score: 0
possible better answer: http://stackoverflow.com/a/27365567
answer count: 3
has answer: http://stackoverflow.com/a/27365717
has answer: http://stackoverflow.com/a/27365548
has body: On my page I have the following HTML: Services HTML piece is a list and therefore is more common on a page with different types of content. What I want is this: jQuery(document).ready(function(){ //loop trough entire page .Module-item .AnchorContainer h1 span //if span contains text, take value and use it as ID for h1, but this could also be H2,H3,H4,H5 and H6 //and if span contains text with spaces, remove the spaces so 'Our Services' becomes 'Ourservices' }); I hope someone can show me how this can be done on a correct way,
has comment: http://stackoverflow.com/comment/43182798
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27365548

http://stackoverflow.com/q/27450867
linked to: http://stackoverflow.com/q/8668174
tagged with: javascript
favorite count: 0
answer count: 5
has comment: http://stackoverflow.com/comment/43340370
has comment: http://stackoverflow.com/comment/43340382
score: 25
has answer: http://stackoverflow.com/a/27451016
type: AnsweredQuestion
downvote count: 0
has title: How to correctly use JavaScript indexOf in a date array
has answer: http://stackoverflow.com/a/27450935
has answer: http://stackoverflow.com/a/27450996
type: Question
has comment: http://stackoverflow.com/comment/43340379
has answer: http://stackoverflow.com/a/27450967
tagged with: indexof
accepted answer: http://stackoverflow.com/a/27450967
possible better answer: http://stackoverflow.com/a/27450974
tagged with: date
has answer: http://stackoverflow.com/a/27450974
upvote count: 25
has body: Here is the code: var collection = [new Date(2014, 11, 25), new Date(2014, 11, 24)]; var d=new Date(2014, 11, 24); var idx= collection.indexOf(d); I guess the variable idx should have a value of 1 since it is the second value in the array collection. But it turns out to be -1. Why is that? Is there any special thing for the JavaScript Date type I need to pay attention? Here is a snippet: (function() { var collection = [new Date(2014, 11, 25), new Date(2014, 11, 24)]; var d = new Date(2014, 11, 24); var idx1 = collection.indexOf(d); var intArray = [1, 3, 4, 5]; var idx2 = intArray.indexOf(4); $('#btnTry1').on('click', function() { $('#result1').val(idx1); }); $('#btnTry2').on('click', function() { $('#result2').val(idx2); }); })(); Index: Find index in a date array Index: Find index in a regular array

http://stackoverflow.com/q/27437088
type: AnsweredQuestion
score: 1
has title: Updating bar chart in d3 generating multiple charts
linked to: http://stackoverflow.com/q/8171371
type: Question
has comment: http://stackoverflow.com/comment/43315242
downvote count: 0
tagged with: javascript
answer count: 1
has body: I'm following the given tutorial on D3 bar chart -2 I've setup my code in two functions one is init and one is update var xScale = null; var chart = null; function init(w, c) { xScale = d3.scale.linear() .range([0, w]); chart = d3.select(c) .append('svg') .attr('width', w); function update(data) { xScale.domain([0, d3.max(data, function(d) { return +d.value; })]); chart.attr('height', 20 * data.length); var bars = chart.selectAll('g') .data(data); bars.exit().remove(); bars.enter().append('g') .attr('transform', function(d, i) { return 'translate(0,' + i * 20 + ')'; }); bars.append('rect') .attr('width', function(d) { return xScale(+d.value); }) .attr('height', 18); bars.append('text') .attr('x', function(d) { return xScale(+d.value); }) .attr('y', 10) .attr('dy', '.45em') .text(function (d) { return d.name; }); } When I call update first time, the bar chart is created correctly, on subsequenet update calls, it creates rect and text elements under tags instead of updating My data is a dict {'name': a, 'value': 12, .....} The number of elements per update can be different. There might be same keys(names) with different values in each update
favorite count: 0
has answer: http://stackoverflow.com/a/27437588
accepted answer: http://stackoverflow.com/a/27437588
tagged with: d3.js
upvote count: 1

http://stackoverflow.com/q/27438070
type: Question
tagged with: javascript
has title: Run command line program from php file
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43316387
tagged with: shell
tagged with: command-line
has body: I want to execute any command from php file. I have one nodejs file and when I give command to execute something. it works fine. i.e. abc.js argument this works fine from terminal and execute some task but, I want to execute same task from php file which runs my command. I tried with exec('filename argument') that does not work. If I give exec(ls -l) that gives me output. Please let me know your suggestions. Thanks
tagged with: php
accepted answer: http://stackoverflow.com/a/27438162
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43316410
has answer: http://stackoverflow.com/a/27438162

http://stackoverflow.com/comment/74263719
type: AnswerComment
has text: I think this is the answer people are looking for and it's also done the right way.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28803778

http://stackoverflow.com/a/27403468
has body: Try this (function($){ $("#bottle").on('click', function() { $('#container_inner01').fadeIn(1100); $('#container_inner02,#container_inner03,#container_inner04,#container02').fadeOut(1100); }); })(jQuery);
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27403312

http://stackoverflow.com/comment/137271687
type: Comment
has text: In my case, I'm using Vue and it adds things like `[data-v-628430e3]` to the selector. To solve this, I simply used a combination of .startsWith() and .endsWith() like so: if I had to select `#headerOffsets[data-v-628430e3] > :first-child::after` I would use: `if (r.selectorText?.startsWith("#headerOffsets") && r.selectorText?.endsWith(" > :first-child::after")) {`. Of course, you could use a .includes() or whatever string manipulation method you want.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27358311

http://stackoverflow.com/q/27386673
has answer: http://stackoverflow.com/a/27386809
answer count: 1
tagged with: css
score: 0
has body: I am trying to set the ng-class with multiple conditions. I have something like {{product.productName}} I have multiple conditional on my div. My problem is that I want to stop toggling the add class when the expire class name is used which is in product.type='expire' condition. Is there anyways to do this? Thanks a lot!
accepted answer: http://stackoverflow.com/a/27386809
tagged with: javascript
type: AnsweredQuestion
has title: How to set multiple class for an element
tagged with: angularjs
type: Question

http://stackoverflow.com/comment/43326762
has text: Have you tried other json_encode flags, for example second arguments like JSON_FORCE_OBJECT to see if it change something ?
type: Comment
comment on: http://stackoverflow.com/a/27442910
score: 0
type: AnswerComment

http://stackoverflow.com/a/27396835
score: 0
answers question: http://stackoverflow.com/q/27396784
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27396784
type: Answer
has body: Change if (answer = "A") { and } else if (answer = "B")) { To if (answer == "A") { and } else if (answer == "B")) {
has comment: http://stackoverflow.com/comment/43240491
has comment: http://stackoverflow.com/comment/43240435
has comment: http://stackoverflow.com/comment/43240330

http://stackoverflow.com/a/27424951
type: Answer
answers question: http://stackoverflow.com/q/27424163
score: 0
accepted answer of: http://stackoverflow.com/q/27424163
has body: The version of Backbone-Forms you are using and referencing in jsfiddle example haven't submitButton feature yet. Read the master changelog and you will see. As I saw from official repo this is a new feature and currently available only on master branch. You can download and use that one from official repo. Here is the link of the latest one.
type: AcceptedAnswer

http://stackoverflow.com/q/27444238
has answer: http://stackoverflow.com/a/27444239
favorite count: 0
tagged with: drag-and-drop
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: jquery-ui
has body: A simple way to drag and drop html elements or content on a web page? The goal is to drag the element and drop it on a container. Once the element is dropped it will dynamically add html content based on its id.
tagged with: javascript
score: -1
has title: Add HTML Dynamically on Drag N Drop
upvote count: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/43412605
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27489684
has text: that was my problem "window.location.hash" mine was "location.hash"

http://stackoverflow.com/q/27464153
accepted answer: http://stackoverflow.com/a/27464854
has title: run Xpath on xml stored in variable (getting "Uncaught TypeError: undefined is not a function")
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27464854
type: Question
has body: I'm trying to evaluate the XML stored in a variable using and Xpath expression, but I'm getting a console error "Uncaught TypeError: undefined is not a function" JSFiddle $(document).ready(function () { var data = ' ABC Smith, John Science Fiction DEF Jones, Tom Biography '; var title = data.evaluate('//books/book[1]/title', data, null, XPathResult.ANY_TYPE, null); alert(title); });
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: xpath

http://stackoverflow.com/comment/43218031
comment on: http://stackoverflow.com/a/27384356
has text: @FossArduino It's probably best not to think of the value after the `as` as an alias. It's more like giving the controller instance a name you can use to access it. If you don't use the `as ...`, there isn't a name you can use to access the controller (AFAIK).
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/27405127
downvote count: 1
has comment: http://stackoverflow.com/comment/62543720
has comment: http://stackoverflow.com/comment/62546141
accepted answer of: http://stackoverflow.com/q/27404800
has comment: http://stackoverflow.com/comment/62544878
has comment: http://stackoverflow.com/comment/43256654
upvote count: 5
answers question: http://stackoverflow.com/q/27404800
score: 4
has comment: http://stackoverflow.com/comment/62545551
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/62544065
has body: You can simply wrap your class inside a module The module itself will be global, but if you don't export the class, there is little worry about polluting the global scope with a single module name. So this TypeScript: module MyModule { class MyClass { constructor(){} } } Will produce the following JS: var MyModule; (function (MyModule) { var MyClass = (function () { function MyClass() { } return MyClass; })(); })(MyModule || (MyModule = {}));
has comment: http://stackoverflow.com/comment/43255392
has comment: http://stackoverflow.com/comment/43255664

http://stackoverflow.com/comment/117233534
type: Comment
score: 4
type: AnswerComment
comment on: http://stackoverflow.com/a/30654451
has text: FWIW, passing `true` (these days, at least) effects a _minor_ collection: https://github.com/nodejs/node/blob/5421e15bdc6122420d90ec462c3622b57d59c9d6/deps/v8/src/extensions/gc-extension.cc#L65-L71

http://stackoverflow.com/comment/43260622
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27407997
has text: Can you expand a little? How would I use $watch? Are you saying that in the directive I would set a watcher on some part of the model?
score: 0

http://stackoverflow.com/q/27356370
has title: passing an array element in yii google chart it , it passes null value intead of its values
answer count: 0
score: 1
type: Question
tagged with: google-visualization
tagged with: yii
tagged with: javascript
downvote count: 0
favorite count: 0
has body: View: &lt;?php $nodes = $gw-&gt;searchNodes(); foreach($nodes as $node) { $user= $node-&gt;getpdsout(); foreach($user as $key=&gt;$val){ $ls = $val['elapsed']; var_dump($ls);// } } ?&gt; I got: output :- NULL string(16) "16.3080555555556" NULL NULL I thought it passes only the first NULL , it is not able to pass other values ,even if I try with php filter , but it doesn't work , someone has suggested me to use $ls = (float) val['ealsped'] , then on that it shows float(0) float(16.308055555556) float(0) float(0) Java script file: &lt;div class="row"&gt; &lt;div class="span6" &gt; &lt;?php //very useful google chart $this-&gt;widget('ext.Hzl.google.HzlVisualizationChart', array('visualization' =&gt; 'PieChart', 'data' =&gt; array( array('Occupied ', 'Hours per Day'), array('Occupied',$ls),// here got ["Occupied",null],instead of ["Occupied", 16.3080555555556] array('Not Occupied', 16.3080555555556), array('Occupied', 5.45388888888889), ), 'options' =&gt; array('title' =&gt; 'Occupancy Sensor'))); ?&gt; &lt;/div&gt; &lt;/div&gt; output log using fire bug: - google.visualization.arrayToDataTable([["Occupied ","Hours per Day"],["Occupied",null],["Not Occupied",16.308055555556],["Occupied",5.4538888888889]]);
type: UnansweredQuestion
upvote count: 1
tagged with: php

http://stackoverflow.com/comment/114117358
type: Comment
has text: awesome solution
score: 1
comment on: http://stackoverflow.com/a/56163823
type: AnswerComment

http://stackoverflow.com/a/27404921
answers question: http://stackoverflow.com/q/27403797
type: Answer
has body: Isn't this a possible security issue? Yes, this is called Cross-Site-Scripting (XSS). It is most definitely a security issue. Bottom line, never include code, from any domain, that you don't trust. End of story. If an attacker can get code running on your domain, it's game-over. Shouldn't this trigger the same-origin-policy protection? No. The same-origin-policy basically means that the script can only ever view/modify the DOM of the domain to which it was loaded. So you can't create an iframe to an arbitrary site and read that DOM from the parent unless CORS is on, or your script is running there too. Perhaps, are there user agents that prevents a Javascript, hosted on a different domain, to access elements in the page that executes the script? The only way to do this, is to sandbox that javascript inside of an iframe which is on a different domain. So you could create a sandbox.example.com domain, which generates a wrapper page which includes the javascript. Then, instead of linking to the JS directly, create an iframe to the sandbox domain. The JS will have access to that domain, and everything in that DOM, but nothing outside of the iframe. You still have to be careful to set cookies properly (don't do wildcard domains, etc). But it can help.
score: 6
upvote count: 7
downvote count: 1

http://stackoverflow.com/q/27328193
has title: Override variable in different controller Angularjs
has answer: http://stackoverflow.com/a/27328322
downvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/43115686
has body: I used ng-show="splash" and for my first splash but the loader come out even when I'm in my second controller. Why? I try to set it to false but it seem doesn't work. My secondCtrl only active when the $state is actived. app.controller('mainCtrl', ['$scope', '$http', function($scope, $http){ $scope.splash = true; }]); app.controller('secondCtrl', ['$scope', function($scope){ $scope.splash2 = true; $scope.splash = false; }]);
type: Question
tagged with: javascript
score: -1

python
tags question: http://stackoverflow.com/q/27338163
tags question: http://stackoverflow.com/q/27414233
tags question: http://stackoverflow.com/q/27430250
tags question: http://stackoverflow.com/q/27386588
tag name: python
tags question: http://stackoverflow.com/q/27452280
tags question: http://stackoverflow.com/q/27439655
tags question: http://stackoverflow.com/q/27447363
tags question: http://stackoverflow.com/q/27322267
tags question: http://stackoverflow.com/q/27393649
tags question: http://stackoverflow.com/q/27350110
tags question: http://stackoverflow.com/q/27384156
tags question: http://stackoverflow.com/q/27452210
tags question: http://stackoverflow.com/q/27391607
tags question: http://stackoverflow.com/q/27413644
tags question: http://stackoverflow.com/q/27319042
tags question: http://stackoverflow.com/q/27392434
type: Tag
tags question: http://stackoverflow.com/q/27410655
tags question: http://stackoverflow.com/q/27472363
tags question: http://stackoverflow.com/q/27373831
tags question: http://stackoverflow.com/q/27432800
tags question: http://stackoverflow.com/q/27352485
tags question: http://stackoverflow.com/q/27381399
tags question: http://stackoverflow.com/q/27335078
tags question: http://stackoverflow.com/q/27382492
tags question: http://stackoverflow.com/q/27372526
tags question: http://stackoverflow.com/q/27384042
tags question: http://stackoverflow.com/q/27382871

http://stackoverflow.com/comment/43266491
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27410945
type: Comment
has text: Could you give the whole error ? That undefined is not a function should be followed by the function that is not defined.

http://stackoverflow.com/q/27413034
has comment: http://stackoverflow.com/comment/43270364
has comment: http://stackoverflow.com/comment/43270383
tagged with: syntax-error
answer count: 2
downvote count: 4
upvote count: 0
has answer: http://stackoverflow.com/a/27413063
has body: function look() { var desc = ""; switch(currentLoc) { case 0 = name.Starting Room; break; case 1 = name.Forest; break; case 2 = name.Seagulls; break; case 3 = name.Ocean; break; case 4 = name.Resort; break; case 5 = name.Rock; break; case 6 = name.Wise Turtle; break; case 7 = name.Palm Tree; break; case 8 = name.Iglo; break; case 9 = name.sandBurrow; break; case 10 = name.End; break; default: desc = "You cannot go that way"; } disable_btns(); } this is for a project of mine. I dont know how to fix this problem. If you want to see the full code cause this used to work till i added in a matrix and changed the locations format for my game so im pretty sure it has something to do with that but i dont know what. you can take a look at the full code here https://github.com/rileyjgr/Games if you have the time. Thanks for the help >.&lt; i dont know what i fucked up with.
tagged with: javascript
score: -4
favorite count: 0
has title: What did i do wrong here? Uncaught ReferenceError: Invalid left-hand side in assignment
has comment: http://stackoverflow.com/comment/43270435
type: UnansweredQuestion
tagged with: referenceerror
type: Question
has answer: http://stackoverflow.com/a/27413241

http://stackoverflow.com/q/27376630
has comment: http://stackoverflow.com/comment/43203517
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43204035
accepted answer: http://stackoverflow.com/a/27379568
type: Question
has comment: http://stackoverflow.com/comment/43203981
tagged with: browser
tagged with: debugging
has comment: http://stackoverflow.com/comment/43203218
has comment: http://stackoverflow.com/comment/43204377
tagged with: javascript
has answer: http://stackoverflow.com/a/27379568
has body: I am using camera with getUserMedia and I get a few errors I want to fix. The thing is Visual Studio only allows me to debug JavaScript (I mean hitting breakpoints) with IE, and IE does not support getUserMedia.
upvote count: 2
answer count: 1
has title: Use Chrome/Firefox while debugging client-side
favorite count: 0
tagged with: visual-studio-2013

http://stackoverflow.com/q/27432947
score: 0
has body: I need to have a clickable cell within a table, so it will show a description of a TV show. I have it feeding in the XML to make the table called 'tvGuide1' and a tooltip like function shows a brief description. The XML create the first row with the first 5 elements within XML. XML EXAMPLE <Programs> <Time>08:00 Breakfast The latest news, sport, business and weather from the team. Also in HD. [S] Including regional news at 25 and 55 minutes past each hour. Fake Britain Matt Allwright investigates the activities of conmen, revealing the fake high-EndTimesome farmers' markets and looking at counterfeit bike parts. Family Guy Hilarious show about a modern family ITV News Your latest news, sport and weather Homes Under the Hammer People buy rubbish houses and give them a make over then sell them ' Time 24hr Clock BBC 1 BBC 2 Comedy Central ITV Channel 4 ' The problem the XML will create the table and pull in the data but I have no idea how to implement the modal to display the description from the XML Any help would be great.
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27433919
tagged with: http://stackoverflow.com/tag/html
has title: Table must have clickable cells to display more options from XML file
tagged with: http://stackoverflow.com/tag/xml
type: Question
answer count: 1

http://stackoverflow.com/comment/43367496
has text: Personally I believe the angularjs tag should be removed. This is a javascript syntax question, not an angularjs question.
comment on: http://stackoverflow.com/q/27465691
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27388743
has comment: http://stackoverflow.com/comment/43226050
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/494035
score: -1
has comment: http://stackoverflow.com/comment/43225498
linked to: http://stackoverflow.com/q/494035
answer count: 3
upvote count: 0
has body: I get it to work on just replacing one instance with this code: var someString = ['He', 'Test', 'of']; var x = 0; for (i = 0; i &lt; 2; i++) { document.body.innerHTML = document.body.innerHTML.replace(''+someString[i]+'', 'text'); } How to get it to replace all the instances? I tried this: /+someString[x]+/g /'+someString[x]+'/g since using a normal string, /Test/g would work how to i format it when the string is a variable string.
has title: How to use a variable with innerHTML.replace I.e innerHTML.replace(/var/g, 'var)
possible better answer: http://stackoverflow.com/a/27388812
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27388826
has comment: http://stackoverflow.com/comment/43225909
has answer: http://stackoverflow.com/a/27388841
accepted answer: http://stackoverflow.com/a/27388841
has answer: http://stackoverflow.com/a/27388812
has comment: http://stackoverflow.com/comment/43226138
downvote count: 1
type: Question

http://stackoverflow.com/q/27449230
has comment: http://stackoverflow.com/comment/43337298
has comment: http://stackoverflow.com/comment/43337430
has answer: http://stackoverflow.com/a/27449269
has comment: http://stackoverflow.com/comment/43337269
score: 2
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43337387
accepted answer: http://stackoverflow.com/a/27449269
type: AnsweredQuestion
has title: Parsing JSON in javascript coming from Java Jackson JSON
upvote count: 2
tagged with: java
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/43337183
has body: I followed this example to generate a json string to be later parsed in javascript package example; import org.codehaus.jackson.map.ObjectMapper; import java.util.HashMap; import java.util.Map; public class Example { public static void main(String[] args) { Map&lt;String,String&gt; map = new HashMap&lt;&gt;(); ObjectMapper mapper = new ObjectMapper(); map.put("key1","value1"); map.put("key2","value2"); String json = mapper.writeValueAsString(map); System.out.println(json); } } in Javascript: $http.get('/rest/json-example'). success(function(data) { //$scope.count = data.length; console.log(data.key1); //console.log(JSON.parse(data)); }).error(function(error) { console.log(error); }); I don't know how to parse the string, this is how it gets printed using console.log(data) // Object {key1: "value2", key2: "value1"} If I use JSON.parse(data); // I get an error "unexpected SyntaxError: Unexpected token o at Object.parse (native)..." if I try to access it like: console.log(data[0]); // I get undefined
tagged with: javascript
tagged with: jackson

http://stackoverflow.com/a/27376577
has comment: http://stackoverflow.com/comment/43203396
type: Answer
has body: try following: for (var i = 0; i&lt;split.length(); i++){ if( $(this).val().indexOf(split[i]) != -1){ } } Not 100% sure about the commands i used, but see this as an idea ;)
upvote count: 1
has comment: http://stackoverflow.com/comment/43239181
has comment: http://stackoverflow.com/comment/43202911
has comment: http://stackoverflow.com/comment/43208713
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27376525

http://stackoverflow.com/comment/43129208
type: Comment
type: AnswerComment
has text: Works in Chrome in http://codepen.io/ckuijjer/pen/dPGNRb. I'm afraid I'm out of ideas, sorry mate!
comment on: http://stackoverflow.com/a/27335806
score: 0

http://stackoverflow.com/a/27464934
downvote count: 0
has body: The problem is that while Array.prototype.slice() will create a separate copy of the original array, its items will still be references to the same object instances. So modifying an item in one array ends up modifying the corresponding item in the cloned array. If your items are simple data objects (no functions), this workaround might do the trick for you: // instead of "var player_array = playerList.slice();" var player_array = JSON.parse(JSON.stringify(playerList));
answers question: http://stackoverflow.com/q/27464864
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/27464864
type: AcceptedAnswer

http://stackoverflow.com/comment/43316889
score: 0
type: Comment
type: QuestionComment
has text: *"Why?"* Because **A**jax is **asynchronous**. *"What is the right way to access the object outside the `$.get` request?"* Passing it to a function *from* the `$.get` request.
comment on: http://stackoverflow.com/q/27438442

http://stackoverflow.com/comment/43451427
type: Comment
type: QuestionComment
has text: Could `Activity` itself be a view? You speak of an "array of activities" in one of your comments. Are activities merely object literals with a few properties, or something more formal? The question revolves a little bit around architecture. Are we building a generic *relative timer*, or specifically an *activity relative timer*? Also, you might want to consider the global timer approach when developing that module. See this SO question http://stackoverflow.com/q/2698866/3174746.
comment on: http://stackoverflow.com/q/27422359
score: 0

http://stackoverflow.com/comment/43248868
type: AnswerComment
comment on: http://stackoverflow.com/a/27401812
has text: Instead of appending to `document.body`, append to the node you want. I suggest you read some documentation on basic JavaScript and DOM manipulation. [MDN](https://developer.mozilla.org/) is a good source.
type: Comment
score: 0

http://stackoverflow.com/q/27414955
tagged with: javascript
tagged with: sql
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43273936
favorite count: 0
has answer: http://stackoverflow.com/a/27415109
has comment: http://stackoverflow.com/comment/43273919
type: UnansweredQuestion
downvote count: 2
type: Question
has title: Can someone resolve the error in this code
score: -2
has comment: http://stackoverflow.com/comment/43274337
has body: rs = stmt.executeQuery("select c1.itemname,c1.itemcalorie,p.restname,p.location from categorie1 c1 ,Place p where p.pincode = '" + pincode1 + "' and c1.itemid IN ("select c1.itemid from categorie1 c1 where c1.itemcalorie &lt;='" + cal1 + "' and c1.itemcalorie &gt;='" + cal1-400 + "' and c1.restid = p.restid ") ");

http://stackoverflow.com/q/27371243
has body: I have a form that I have shortended for simplicty but the concept is the same. // These input are where people enter // numbers. They then click on //calculate and the results appear //in the below table Result one // Result two Calculate save The form works fine . The maths for the form is performed using javascript. I get the values of the results in the result one and two as expected . Now for my problem After I have clicked calculate and got my results I click on the save button and want it to post all of the inputs including the hidden ones to a PHP script. I am having problems posting the hidden feilds. It works if I place a figure in the value attribute but what I want and have been struggling all night with is how can I post the result one and two feilds to my PHP script via the hidden feild. I have been trying in vain to get the variable from my js script to act as the value for the hidden feild but keep getting undefined index error in PHP. I think it may be because the page has already loaded. I have attached the variable that holds the value for result one and result two to onChange event etc but can not get this to work. As a summary - how can I pass a td inner HTML (result 1 and result 2) to hidden inputs value for posting to a PHP script. I am open to other solutions Thanks in advance for your help. var a = document.getElementByID('result one id').value; var b = document.getElementByID('HIDDEN INPUT ID').value; I want a = b but am struggling
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/43194164
has comment: http://stackoverflow.com/comment/43193995
tagged with: forms
has comment: http://stackoverflow.com/comment/43194362
has comment: http://stackoverflow.com/comment/43194277
type: Question
has comment: http://stackoverflow.com/comment/43194036
has title: passing td data to a hidden input and then posting with PHP
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43194823
score: 0
tagged with: sql
has comment: http://stackoverflow.com/comment/43193916
has answer: http://stackoverflow.com/a/27371381

http://stackoverflow.com/comment/43363730
score: 0
type: QuestionComment
has text: Oh man, thats a lots of line of code that working together, i will do this tomorrow, now i am not able to do this, Sorry
type: Comment
comment on: http://stackoverflow.com/q/27463726

http://stackoverflow.com/q/27366494
favorite count: 0
type: UnansweredQuestion
downvote count: 2
tagged with: selenium-webdriver
tagged with: selenium
score: -1
upvote count: 1
has answer: http://stackoverflow.com/a/27375059
type: Question
has body: My application contains html5 webpage.I am trying to inspects and trying to get ids/classname locators. But I am not able get locators of the required web elements in HTML 5. I saw most of them contains .js are assigned to SRC attribute. Can any one suggest me how can I automate HTML 5 webpage.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43188787
has comment: http://stackoverflow.com/comment/43185245
has title: can we automate html5 webpage using selenium webdriver?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/43187241

http://stackoverflow.com/a/27455193
downvote count: 0
type: Answer
score: 2
has body: First of all, there is no JavaScript compiler (except perhaps the Closure Compiler etc., but that's still not a JavaScript compiler in the traditional sense of a compiler). There are only JavaScript interpreters. Second, yes. JavaScript always creates a prototype object for every function that you create. That's just the way it is. Luckily, this doesn't make the language slow because of some very smart optimizations that JavaScript interpreters make use of (I hope). Either way, you really don't need to worry about it. Ignorance is blss. Third, nice diagrams. I drew some diagrams in a previous answer of mine, but they are horrible. when a function is not intended to be a constructor why does javascript still generate its prototype? It generates prototypes for every function. In what scenarios this prototype, c/would be used in javascript if the function is not intended to be a constructor? It's just a normal object. I suppose it can be used for just about anything. However, if people want to create an object then the usually just use object literals instead of messing about with useless prototypes created by JavaScript on the fly. Or, is it the case that the compiler doesn't know better, and just creates a prototype object anyway in case we want to use the function as a constructor? Yes.
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27455124
answers question: http://stackoverflow.com/q/27455124
type: AcceptedAnswer

http://stackoverflow.com/comment/43183886
type: Comment
comment on: http://stackoverflow.com/a/27365953
score: 0
type: AnswerComment
has text: While this works, it is not as good of a solution as that presented by @Scimonster

http://stackoverflow.com/a/27368064
upvote count: 2
type: AcceptedAnswer
has body: You can add computed property to your controller which filters your projects by category. webCategoryProjects: function() { return this.get('model').filterBy('category', 'web'); }.property('model.@each.category'), logoCategoryProjects: function() { return this.get('model').filterBy('category', 'logo'); }.property('model.@each.category'), {{#each project in webCategoryProjects}} &lt;h3&gt;{{project.title}}&lt;/h3&gt; &lt;p&gt;{{project.description}}&lt;/p&gt; {{/each}} ... {{#each project in logoCategoryProjects}} &lt;h3&gt;{{project.title}}&lt;/h3&gt; &lt;p&gt;{{project.description}}&lt;/p&gt; {{/each}}
accepted answer of: http://stackoverflow.com/q/27367357
type: Answer
answers question: http://stackoverflow.com/q/27367357
score: 2
downvote count: 0

http://stackoverflow.com/a/27461926
type: Answer
downvote count: 0
score: 1
has body: Good grief, from reading the other answers from you guys I think I have it licked for (arrayIndex = 0; arrayIndex < userInputName.length; arrayIndex++) { tableData = " " + userInputName[arrayIndex] + " "; totalCount = userInputName.length; } output.innerHTML += tableData; outputTotal.innerHTML = " Total Number of Strings: " + totalCount + " "; form.string.select(); return false; This way the totalCount acted as the array's length when it went through the loop, then outside in the innerHTML statement I could display it and have it constantly update whenever a new string was submitted. Thank you for all of your feedback
answers question: http://stackoverflow.com/q/27454557
upvote count: 1

http://stackoverflow.com/q/27469497
has comment: http://stackoverflow.com/comment/43374897
has comment: http://stackoverflow.com/comment/43374333
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43374450
tagged with: css
has comment: http://stackoverflow.com/comment/43374277
answer count: 0
has comment: http://stackoverflow.com/comment/43380468
has body: http://postimg.org/image/sadzaa0up/ I'm trying to get the JS navigation buttons to fall inline with a full width background/box so the buttons aren't just floating. When I try to set this in the CSS I find the buttons aren't in line with this background/box/container. They sit slightly above it. I've tried altering margins etc but had no luck. I'm not sure if the issue is related but I'm finding I can't position the nav bar directly beneath the logo container/header. It's being pushed so it's a 150px or so below the logo with a big gap between. Then finally, the main body content area won't stretch to the width on the left side. I've sorted the right side using margins, yet the left side won't get rid of the gap. Any help on this is greatly appreciated. document.getElementById("nav01").innerHTML = "&lt;ul id='menu'&gt;" + "&lt;li&gt;&lt;a href='Index.html'&gt;HOME&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href='Customers.html'&gt;SECTIONS&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href='About.html'&gt;HOWS&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href='About.html'&gt;OUR EXPERIENCE&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href='About.html'&gt;TESTIMONIALS&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href='About.html'&gt;NEWS&lt;/a&gt;&lt;/li&gt;" + "&lt;li&gt;&lt;a href='About.html'&gt;CONTACT US&lt;/a&gt;&lt;/li&gt;" + "&lt;/ul&gt;"; document.getElementById("foot01").innerHTML = "&lt;p&gt;&amp;copy; lumi " + new Date().getFullYear() + " All rights reserved.&lt;/p&gt;"; /* Check how to edit nav main background colour */ #container { position: absolute; top: 0px; left: 0px; background-color: #73008C; background-image: url("banner.jpg"); background-size: 100%; width: 100%; height: 800px; content: 60px padding: 5px; border: 5px #73008C; margin-left: 0px; margin-right: 0px; z-index: -2; } #header { position: absolute; opacity: 0.6; background-color: #ffffff; width: 100%; height: 90px; margin: auto; z-index: -1; } #logo { position: center top; margin: 0; z-index: 2; } ul#menu {…
type: Question
has comment: http://stackoverflow.com/comment/43374160
has title: CSS content and menu positioning
has comment: http://stackoverflow.com/comment/43374325
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43376864
has comment: http://stackoverflow.com/comment/43374474
has comment: http://stackoverflow.com/comment/43374410

http://stackoverflow.com/q/27429909
tagged with: javascript
has comment: http://stackoverflow.com/comment/43301190
tagged with: ubuntu
has answer: http://stackoverflow.com/a/28957289
answer count: 2
has comment: http://stackoverflow.com/comment/43301126
has comment: http://stackoverflow.com/comment/43497133
has body: I am having permission problems with the npm config command. It seems that for some reason it is trying to change the owner of my ~/.npmrc file. When running npm config set color false, I get the following error: npm ERR! Error: EPERM, chown '/home/bamboo/.npmrc' npm ERR! { [Error: EPERM, chown '/home/bamboo/.npmrc'] errno: 50, code: 'EPERM', path: '/home/bamboo/.npmrc' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Linux 3.13.0-32-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "config" "set" "color" "false" npm ERR! cwd /home/bamboo npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! path /home/bamboo/.npmrc npm ERR! code EPERM npm ERR! errno 50 npm ERR! stack Error: EPERM, chown '/home/bamboo/.npmrc' npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/bamboo/npm-debug.log npm ERR! not ok code 0 The file .npmrc has the right permissions and I can edit it manually but I need to do it from the npm config command since it is part of an automated build. I can't seem to find valuable information on that matter. I set the prefix to a directory I own and can install globally without any problem but can't run configure! I am running Ubuntu 14.04. Does anybody have some ideas?
has comment: http://stackoverflow.com/comment/43304980
has comment: http://stackoverflow.com/comment/43301105
downvote count: 0
has comment: http://stackoverflow.com/comment/43301138
has comment: http://stackoverflow.com/comment/43303226
favorite count: 0
possible better answer: http://stackoverflow.com/a/27890847
has comment: http://stackoverflow.com/comment/43303141
tagged with: npm
has comment: http://stackoverflow.com/comment/43440513
tagged with: node.js
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/27890847
accepted answer: http://stackoverflow.com/a/28957289
type: Question
has title: npm config permission error

http://stackoverflow.com/a/27437906
downvote count: 0
has body: try something like this with your form: see what I'm getting at? just spit the form up into dialogs, add data to jsonObject when moving from dialogs. At the end you could display this, and then allow user to submit. Submit $("form#data").submit(function(){ var formData = new FormData($(this)[0]); colsole.log(formdata); $.ajax({ url: window.location.pathname, type: 'POST', data: formData, async: false, success: function (data) { alert(data) }, cache: false, contentType: false, processData: false }); return false; });
has comment: http://stackoverflow.com/comment/43352988
has comment: http://stackoverflow.com/comment/43352082
type: Answer
has comment: http://stackoverflow.com/comment/43371435
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27437768
has comment: http://stackoverflow.com/comment/43371282
has comment: http://stackoverflow.com/comment/43316053
has comment: http://stackoverflow.com/comment/43351202
has comment: http://stackoverflow.com/comment/43351953
has comment: http://stackoverflow.com/comment/43354767
has comment: http://stackoverflow.com/comment/43351181

http://stackoverflow.com/q/27324241
type: UnansweredQuestion
answer count: 0
has body: I'm creating a ng-grid with a editable column like this: {field:'quantity', displayName:'Quantity', enableCellEdit:true, cellTemplate:'myCellTemplate.html'} myCellTemplate.html: {{row.getProperty(col.field)}} The ng-click doesn't work (i.e. no popup), also the ng-mouseover doesn't work either. How do I get this template to react to mouse events? Thanks
type: Question
has comment: http://stackoverflow.com/comment/43108512
has title: ng-grid row template mouse events don't work for an editable row
tagged with: javascript
tagged with: ng-grid
has comment: http://stackoverflow.com/comment/43143246
score: 0
tagged with: angular-ui
tagged with: angularjs

http://stackoverflow.com/comment/43320119
has text: While you're at it, you probably want to use an async request, get rid of deprecated `center`, use proper naming conventions (no initial caps) and decide whether you're using HTML or XML (doctype is HTML, but XML namespace attribute is present and self-terminating tags have slashes at the end). Also, *message*, not massage.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27439479
type: QuestionComment

http://stackoverflow.com/a/27454047
type: Answer
answers question: http://stackoverflow.com/q/27453974
downvote count: 0
score: 3
has body: okay sorry that i miss something, this question is already been asked in here so i just put a link to the answer Images not responsive by default in Twitter Bootstrap 3? so just add img { display: inline-block; height: auto; max-width: 100%; } just add this css line in the very bottom of your bootstrap.css or just make a new css file and named it mystyle and put it after every css link in your head (i do it like that so keep the original bootstrap.css file clean)
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27453974

http://stackoverflow.com/comment/43213011
comment on: http://stackoverflow.com/q/27382114
score: 0
type: Comment
type: QuestionComment
has text: This is to do with the type of filesystem running on the hard drives or ssds

http://stackoverflow.com/comment/43277216
type: Comment
type: QuestionComment
has text: When I try to echo something in the index() of Login Controller, it will display on the page. I tried echo "This will appear";. And it will appear above the nav bar.
score: 0
comment on: http://stackoverflow.com/q/27416640

http://stackoverflow.com/comment/43101613
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27321107
has text: All right guys, thanks a lot. I'll change it to class instead of ID, using the "body".on("click" ..) as rfornal suggested - Thanks!
score: 0

http://stackoverflow.com/comment/43377959
has text: No, if you append the container again in one at the end. It can be faster when doing a lot of DOM operations, but can be slower as well. You will have to test if it improves performance in your use case.
comment on: http://stackoverflow.com/a/27470733
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27360575
type: AnsweredQuestion
type: Question
tagged with: internet-explorer
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27361256
downvote count: 4
answer count: 3
has comment: http://stackoverflow.com/comment/43173533
upvote count: 0
has answer: http://stackoverflow.com/a/27360805
favorite count: 0
has comment: http://stackoverflow.com/comment/43173291
has body: Would really appreciate if anyone could take a look at my site and let me know why the elements on my landing page don't show up in Internet Explorer. Everything works fine in Firefox, Safari and Chrome at least, but nothing appears at all in IE. I think the elements are there they are just invisible as if the mouse hovers over where the button or input box should be, the cursor changes. I've tried cancelling out various parts of the HTML and CSS to see if anything triggers it to come back in, but to no avail so I'm truly stumped. Really appreciate any help. http://fitmumscoaching.co.uk/landing Cheers, Pinchy
score: -4
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27360805
has comment: http://stackoverflow.com/comment/43174275
has title: Elements not appearing in Internet Explorer
tagged with: css
has answer: http://stackoverflow.com/a/27361256
has comment: http://stackoverflow.com/comment/43173494
has answer: http://stackoverflow.com/a/27361339

http://stackoverflow.com/q/27363583
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/43179144
type: Question
has comment: http://stackoverflow.com/comment/43179214
has comment: http://stackoverflow.com/comment/43179152
has comment: http://stackoverflow.com/comment/43179501
has comment: http://stackoverflow.com/comment/43179062
has comment: http://stackoverflow.com/comment/43179865
has body: Okay, so I have an iput and a button that when I click I want ajax to run a script in the background and update another div with the script in the php file. Here's the button and input &lt;button type="button" id="calculate" onclick="jQuery('#modal-2').modal('show');" class="btn btn-purple btn-icon"&gt; &lt;span&gt;calculate&lt;/span&gt; &lt;i class="fa-money"&gt;&lt;/i&gt; Ajax in the same file: &lt;script&gt; $(document).ready(function() { $('calculate').click(function(){ $.ajax({ type: 'GET', url: '/system/calculate.php', data: 'ammount=' + $('ammount').val() , success: function(msg) { $('#modal-body').html(msg); } }); }); }); &lt;/script&gt; and php file running in the background &lt;?php //edit, do not leave like this. $ammount = $_POST['ammount']; $btcvalue = $_POST['price']; $total = ($btcvalue * $ammount) * (1 - $system-&gt;fee()); echo $fee; echo 'kjhgjkj'; ?&gt; &lt;div class="modal fade custom-width" id="modal-2"&gt; &lt;div class="modal-dialog" style="width: 60%;"&gt; &lt;br/&gt;&lt;Br/&gt;&lt;br/&gt;&lt;Br/&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title"&gt;&lt;?php echo $lang['totalpriceof']; ?&gt; &lt;?=$coin;?&gt; to buy&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-white" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-info"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; I've added an alert to the php file calculate and it's not alerting, I've not a clue of the ajax function is working. debbugged Remote Address:[::1]:80 Request URL:system/calculate.php Request Method:POST Status Code:200 OK Request Headersview source Accept:/ Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8 AlexaToolbar-ALX_NS_PH:AlexaToolbar/alxg-3.…
upvote count: 3
answer count: 2
tagged with: php
downvote count: 1
has title: ajax click button run form in background
has answer: http://stackoverflow.com/a/27363724
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43179202
score: 2
has comment: http://stackoverflow.com/comment/43179748
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27363675

http://stackoverflow.com/q/27426177
upvote count: 2
type: UnansweredQuestion
tagged with: php
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/391979
has comment: http://stackoverflow.com/comment/43294208
score: 1
has title: Getting user IP when using Jquery
has comment: http://stackoverflow.com/comment/43297311
has comment: http://stackoverflow.com/comment/43294209
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27426289
favorite count: 0
has body: Okay, so I am using a jquery script to use a get method to pull information from another file like so: $(document).ready(function() { $('#calculate').click(function(){ $.ajax({ type: 'GET', url: '/system/calculate.php', data: 'amount=' + $('#buyamount').val() + '&amp;coin=&lt;?php echo $coin; ?&gt;' , success: function(msg) { $('#totalprice').html(msg); } }); }); }); I want to inert their ip address in the database, but I can't set it in that calculate file because they aren't actually visiting that page to set the IP address. Now, I don't want to use the get function to send their IP address because they could simply edit the ?ip= to whatever they want. I tried setting it in the calcuate file, but their ip is set as ::1 tl;dr: using jquery to run scrip from another file, can't set IP because they don't visit that page personally.
has comment: http://stackoverflow.com/comment/43294157

http://stackoverflow.com/comment/43378320
type: Comment
comment on: http://stackoverflow.com/q/27471845
type: QuestionComment
score: 3
has text: my first step would be trying. like literally anything at all.

http://stackoverflow.com/comment/43129200
has text: There's nothing obviously wrong now. What does the JS console say? What does the Net tab in your developer tools say?
comment on: http://stackoverflow.com/a/27324696
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/27387897
type: Answer
has comment: http://stackoverflow.com/comment/43224529
upvote count: 2
answers question: http://stackoverflow.com/q/27387752
has body: To display a disabled texfield, you should output: echo '&lt;input type="email" name="name_of_field" value="email_to_display@gmail.com" disabled&gt;'; Example: See here (and have a look at the code): Example Perhaps if we had a link to the website we could have a look a it :)
has comment: http://stackoverflow.com/comment/43224346
score: 2
has comment: http://stackoverflow.com/comment/43224224
has comment: http://stackoverflow.com/comment/43224509
has comment: http://stackoverflow.com/comment/43223879
downvote count: 0
has comment: http://stackoverflow.com/comment/43224040
has comment: http://stackoverflow.com/comment/43223807

http://stackoverflow.com/comment/43186441
type: QuestionComment
comment on: http://stackoverflow.com/q/27366961
type: Comment
score: 0
has text: If this is really your case why don't you just check for `!value || value == '0'`?

attributes
tags question: http://stackoverflow.com/q/27415742
tag name: attributes
tags question: http://stackoverflow.com/q/27473650
type: Tag
tags question: http://stackoverflow.com/q/27428922

http://stackoverflow.com/q/27426037
linked to: http://stackoverflow.com/q/15141762
answer count: 0
has title: How to detect date and time of a specific timezone by javascript
has body: one guy suggest this to me If you know the UTC offset then you can pass it and get the time using following function: function calcTime(city, offset) { // create Date object for current location var d = new Date(); // convert to msec // subtract local time zone offset // get UTC time in msec var utc = d.getTime() - (d.getTimezoneOffset() * 60000); // create new Date object for different city // using supplied offset var nd = new Date(utc + (3600000*offset)); // return time as a string return "The local time for city"+ city +" is "+ nd.toLocaleString(); } alert(calcTime('Bombay', '+5.5')); but i know the user pc timezone like "Asia/Kolkata" or "Europe/London" then how could i fetch date and time using any js library. moment.js can do that if yes so please give me some moment.js related code where i will pass time zone id and get that timezone date &amp; time. thanks
has comment: http://stackoverflow.com/comment/43320811
type: Question
has comment: http://stackoverflow.com/comment/43317535
has comment: http://stackoverflow.com/comment/43337962
has comment: http://stackoverflow.com/comment/43293861
has comment: http://stackoverflow.com/comment/43294074
tagged with: javascript
has comment: http://stackoverflow.com/comment/43321127
score: 0
linked to: http://stackoverflow.com/q/1091372
tagged with: datetime
type: UnansweredQuestion
tagged with: timezone
has comment: http://stackoverflow.com/comment/43302738
has comment: http://stackoverflow.com/comment/43338496
duplicate of: http://stackoverflow.com/q/15141762
has comment: http://stackoverflow.com/comment/43293972

http://stackoverflow.com/q/27455740
type: Question
tagged with: canvas
tagged with: javascript
tagged with: jquery
has title: get width/height of two selected points in canvas
score: 0
has body: I have a canvas which display a picture that The user has uploaded.What I want to do is to ask the client to give me the width and height between two points that he/she has selected on canvas in cm .For example,The client click on top left on canvas and then select top right .after that he/she should enter the width between those two selected points. How should I do that? Sorry for my bad English. Thanks
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27455835

http://stackoverflow.com/a/27423787
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27423715
answers question: http://stackoverflow.com/q/27423715
type: Answer
upvote count: 1
score: 1
has body: Use setTimeOut(function(){ messageHide(); fullReset(); }, 5000);

http://stackoverflow.com/q/27317785
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43096533
has body: I have been troubling with finding the way to click on EDIT link under particular item: item name Contains: Last modified: Dec 5, 2014 edit So I need to find correct item by item name and to click on the edit link. This is what I have so far but it's not finding anything: element(by.cssContainingText('.ng-binding', 'item name')). element(by.linkText('edit')). click();
tagged with: protractor
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/27383051
has comment: http://stackoverflow.com/comment/43169026
favorite count: 0
has comment: http://stackoverflow.com/comment/43181973
score: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27383051
has title: Click on a link in repeater with Protractor
upvote count: 1

http://stackoverflow.com/a/27465495
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43367104
type: Answer
upvote count: 2
downvote count: 1
answers question: http://stackoverflow.com/q/27465474
score: 1
has comment: http://stackoverflow.com/comment/43367096
has body: There is no workaround because socket.on's callback function will be called asynchronously after the rest of the script is run. Therefore the line with undefined result will be run before any code in the callback.
accepted answer of: http://stackoverflow.com/q/27465474
has comment: http://stackoverflow.com/comment/43368683

http://stackoverflow.com/a/27317969
downvote count: 0
score: 1
type: Answer
upvote count: 1
has body: use each() for loop. $('#Stage_game_page1').children().each(function(index) { // your code here with index starts from 0 }); or this using jquery attribute starts with selector $('#Stage_game_page1').find('[id^="cube"]').each(function(index) { // your code here });
answers question: http://stackoverflow.com/q/27317716

http://stackoverflow.com/comment/43209041
type: AnswerComment
has text: also not work , i will post my code , please check it , tell me why it is not working .
type: Comment
comment on: http://stackoverflow.com/a/27379703
score: 0

http://stackoverflow.com/comment/43094270
score: 0
type: AnswerComment
type: Comment
has text: Paragraph does not add return line. Information is misleading.
comment on: http://stackoverflow.com/a/27317309

http://stackoverflow.com/q/27473450
has comment: http://stackoverflow.com/comment/43381458
has answer: http://stackoverflow.com/a/27473516
tagged with: javascript
has body: Hear is my code. I need to done the job without using a function name. Although functions cannot be named, they can be passed as parameters to another function. And I dont want to use arguments.callee. Can any one help me. Actually its my task to do. that I need to do recursion in anonymous function. and I cant use any function name. but I can pass the function name as parameter to another function. Is there any way to replace arguments.callee. var n=5; // The result should be 15 console.log((function sum(n) { if (n ==0) return n; else return n + sum(n-1); })(n));
has title: Doing recursion by anonymous function
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43381540
has comment: http://stackoverflow.com/comment/43381593
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27473499
type: Question
has answer: http://stackoverflow.com/a/37541610

http://stackoverflow.com/a/27472278
type: Answer
accepted answer of: http://stackoverflow.com/q/27472214
has comment: http://stackoverflow.com/comment/43379820
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43379461
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27472214
has body: Try this var finder = function(needle, haystack) { if (haystack.length == 0) return false if (haystack[0] == needle) return true return finder(pin, haystack.slice(1)) } Or var finder = function(pin, haystack) { return (haystack[0] == pin) || (haystack.length != 0) &amp;&amp; finder(pin, haystack.slice(1)) } Recursion FTW

http://stackoverflow.com/comment/43211441
type: AnswerComment
has text: You need to provide array list in `$scope.eventSources = [];` i.e 4th line in the code(inside controller). This is where calendar looks for events, which is empty in your case.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27381189

http://stackoverflow.com/comment/43142697
comment on: http://stackoverflow.com/q/27343604
score: 0
has text: inside your function ajaxSearch you should do this `search.onreadystatechange = handleSearchSuggest;` take a [look](http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27328642
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27328693
has body: I'd like to know if there is a way to use this with CSS pseudo selectors - (AKA nested elements) in jQuery. Here's what it might look like. $('#element').click(function(){ $(this' .nested').css('height','100px'); }); But this isn't how the syntax works. I'd just like to know how it would work.
possible better answer: http://stackoverflow.com/a/27328655
score: 0
linked to: http://stackoverflow.com/q/2421782
has answer: http://stackoverflow.com/a/27328659
type: Question
accepted answer: http://stackoverflow.com/a/27328659
has answer: http://stackoverflow.com/a/27328702
has title: Using this with pseudo selectors jquery
tagged with: this
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27328655
tagged with: pseudo-class
tagged with: css
answer count: 4

text
tags question: http://stackoverflow.com/q/27342877
tags question: http://stackoverflow.com/q/27389622
tags question: http://stackoverflow.com/q/27417524
tags question: http://stackoverflow.com/q/27391951
type: Tag
tags question: http://stackoverflow.com/q/27321652
tags question: http://stackoverflow.com/q/27347626
tags question: http://stackoverflow.com/q/27474122
tags question: http://stackoverflow.com/q/27434686
tag name: text

http://stackoverflow.com/comment/43172131
score: 0
type: Comment
has text: Possibly encoding the url parameters so they become unreadable is a better option?
type: QuestionComment
comment on: http://stackoverflow.com/q/27359173

http://stackoverflow.com/comment/43253521
comment on: http://stackoverflow.com/a/27403734
score: 1
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/66587/discussion-between-darksaint2014-and-emma).
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27386307
score: 0
has comment: http://stackoverflow.com/comment/43221377
has body: I'm creating a parallax site using stellar.js and am using viewport height to determine the height of elements. Each section is vertically stacked on the section before it, each with height: 50vh On the third container down I am trying to give the inner content a fixed position, so it does not move while the rest of the site moves around (and over) it. However I am struggling to figure out how to achieve this. I've tried giving it top: 125vh and used top: 50% which is as close as I've got but the effect is undesirable and I've had issues with overlapping, which may be a separate issue (but one I may run into with any fix, so help is appreciated). The desired effect can be seen on this site http://www.mohi.me/ in the about section. Thanks!
has comment: http://stackoverflow.com/comment/43221129
type: Question
has comment: http://stackoverflow.com/comment/43220953
tagged with: javascript
has title: Fixed content with viewport height
has comment: http://stackoverflow.com/comment/43224827
tagged with: parallax
tagged with: stellar.js
type: UnansweredQuestion
answer count: 0

http://stackoverflow.com/a/27390215
upvote count: 2
type: Answer
has body: @Teemus' answer almost does it all. Use transform with translate3d instead of top/left. translate3d enables hardware acceleration. container.style.transform = 'translate3d(' + container.x + 'px, ' + container.y + 'px, 0)'; A live demo at jsFiddle.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27356273

http://stackoverflow.com/comment/43116250
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27328816
score: 0
has text: where are your attempts on making this happen?

http://stackoverflow.com/q/27449844
has answer: http://stackoverflow.com/a/27449955
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27450056
has title: Input Class undefined, but Input id works
tagged with: dom
type: Question
has body: Not sure why the result is undefined here, when I change the following items, &lt;input type="text" id="myText" to &lt;input type="text" class="myText" and document.getElementById("myText") to document.getElementsByClassName("myText") http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_text_value
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/43338420
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27373130
downvote count: 0
tagged with: javascript
has body: I have a very simple socket.io server setup. My needs are to be able to communicate between server and client over sockets, but always on a one-to-one mode. As such I created something simple as this on the client: var socket = io(); socket.on('connect',function(){ socket.emit('connected', UserName); }); And than on the server: io.on('connection', function (socket) { socket.on('connected', function (userName) { if (userName !== null) { socket.join("RoomFor:"+ userName); } }); }); So, each user has his own room I can now communicate with, and I can do this using my applicative userName (not socket id). Now, on the same socket IO server, I also have express listening, with something like this: app.get('/notify', function(req, res) { var data = querystring.parse(req.url.split('?')[1]); var userName = data.clientId; io.sockets.to('RoomFor:'+ userName).emit('notice', {event: data.event }); res.writeHead(returnCode, {'Content-Type': 'text/plain'}); res.end(); }); So, a very simple server side signaling solution. However, something in this setup is leaking badely, I have created heapdumps and tried to compare the results, but couldn't make out anything out of it. Any thoughts? (Btw, I went over all the threads related to node + socket.io memory leaks, none is my case... I don't use redis store, I am running with up to date node and socket.io versions.)
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: memory-leaks
upvote count: 1
tagged with: node.js
score: 1
has title: A severe memory leak with Socket.io 1.2.1 (and earlier)
tagged with: socket.io
type: Question

http://stackoverflow.com/comment/43249151
comment on: http://stackoverflow.com/a/27401893
has text: Yes; `close` is fired, when the corresponding file descriptor is closed. In fact, not all streams emit `close` event.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27464308
has answer: http://stackoverflow.com/a/27464381
downvote count: 2
accepted answer: http://stackoverflow.com/a/27464381
answer count: 1
has comment: http://stackoverflow.com/comment/43364790
favorite count: 0
has comment: http://stackoverflow.com/comment/43364844
has body: so I have code with SHOULD change background color by clicking on button, but the problem is that is don't. I don't get any consol log. Here is the code: window.addEventListener("load", function(){ var buttonRandomBackGround = document.getElementById("buttonBackground"); var dice = new Audio(); var body = document.body.style.backgroundColor; var backgroundColor = ["red", "brown"]; dice.src="diceRoll.mp3"; buttonRandomBackGround.addEventListener("click", test, false) function test(){ dice.play(); setTimeout(waitTillEndSound, 2000); } function waitTillEndSound(){ myNumber = Math.floor(Math.random()*1); console.log("test"); body.src = backgroundColor[myNumber]; console.log(backgroundColor, body); } }); Thank you.
type: AnsweredQuestion
upvote count: 0
type: Question
has title: Javascript change background by button
score: -2
tagged with: javascript

http://stackoverflow.com/comment/43344841
has text: The description on your question doesn't seem to match up with your code. You say that you are 'checking if at least one of the values is true' but your code is looking for if one of your values is false. So just because `airportVal` is true doesn't mean that `desAirportVal` is also true and therefore not going to enter the if statement. [I threw a plunk together that shows that your code should work if it is getting the correct values](http://plnkr.co/edit/6aR0RGMh622BCUTSXIxH?p=preview).
comment on: http://stackoverflow.com/q/27452887
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/27330147
has comment: http://stackoverflow.com/comment/43119682
has comment: http://stackoverflow.com/comment/43135662
has answer: http://stackoverflow.com/a/27339068
score: 1
has title: when ngView changed by links within itself, my functions are stripped from $scope
type: Question
answer count: 2
has body: New to ngView, I wrote some code a little bit different from sample code about ngView. Usually the URL to manipulate ngView is outside of it, whereas in my code the link is within the ngView template. The problem is when I click on the ShowOrder link below, I get a TypeError, function $scope.show() is not defined. I printed the $scope object both before and after I click the link. My suspect is confirmed. Before the click $scope has function Show() defined, afterward $scope becomes naked as is just born by angular, without any customized properties. Please help me to find out where I did wrong, maybe a little bit inside on how the ngView is loaded, destroyed within a scope. Thanks. Here is the main html code: App.js: var sampleApp = angular.module('sampleApp', ['ngRoute']); sampleApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/ShowOrder', { templateUrl: 'templates/show_order.html', controller: 'ShowOrderController' }); }]); sampleApp.controller('ShowOrderController', function($scope) { $scope.show = function {console.log("here")} }); template code: Show Orders Show Order {{show()}}
tagged with: javascript
has answer: http://stackoverflow.com/a/27399882
has comment: http://stackoverflow.com/comment/43118583
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43124055
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/43151875
type: QuestionComment
has text: You need to give more precisions: what is the max size of the phrase (how many words)? Do you want to take the case, the punctuation in account?
type: Comment
comment on: http://stackoverflow.com/q/27348595
score: 0

http://stackoverflow.com/a/27367846
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27367786
upvote count: 1
has body: This should call a javascript method when you click the link: Categories
type: Answer

http://stackoverflow.com/comment/43206981
comment on: http://stackoverflow.com/a/27378505
type: Comment
has text: ` ` didn't help
type: AnswerComment
score: 0

http://stackoverflow.com/a/27402635
has body: processData has to be off to send binary data. The FormData element is completely used as binary data, while data:{} needs to be processed. Additional parameters have to be appended to the formData in this case! var data = new FormData(); data.append('archivo',file); data.append('functionName','saveProfileImage'); jQuery.ajax({ url: '/services/rpc.php', type: 'post', data: data, contentType:false, processData:false, });
score: 2
answers question: http://stackoverflow.com/q/27401583
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27401583
upvote count: 2
type: Answer

http://stackoverflow.com/comment/43088647
comment on: http://stackoverflow.com/a/27314257
type: Comment
score: 0
type: AnswerComment
has text: JQuery is such a confusing language but from what I can see it's very efficient.

http://stackoverflow.com/comment/43128428
score: 0
type: Comment
has text: @Dundar Your jsFiddle gave me headhache, try using in console command `debugger;` and see what's going on when clicking/changing element value. Or check in dev tool `Event Listeners` tab or post more minimalistic sample on jsFiddle
comment on: http://stackoverflow.com/a/27335667
type: AnswerComment

http://stackoverflow.com/comment/43249561
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27400188
score: 0
has text: See [this jsfiddle](http://jsfiddle.net/4Lp65je6/). It works. Are you sure this is the complete code you are using and you didn't post a snippet taking out the error?

http://stackoverflow.com/comment/43241826
comment on: http://stackoverflow.com/a/27343335
type: AnswerComment
score: 0
type: Comment
has text: I need it to be linked with a javascript timer so that i can pause / resume the animation, so CSS only is not the solution im looking for :/

http://stackoverflow.com/q/27378299
has comment: http://stackoverflow.com/comment/43206117
accepted answer: http://stackoverflow.com/a/27378455
has answer: http://stackoverflow.com/a/27378542
has comment: http://stackoverflow.com/comment/43206277
answer count: 3
tagged with: arrays
favorite count: 0
tagged with: php
has title: Javascript array to PHP with json.stringify
score: -1
possible better answer: http://stackoverflow.com/a/27378408
has answer: http://stackoverflow.com/a/27378455
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27378408
has body: I have an array of divs is js: [div#heaolu, div#edu, div#usk, div#lootus, div#heaenergia] I need to pass that to PHP. JS: function send(){ console.log(sendarray); JSON.stringify(sendarray); } PHP: $posts = json_decode($_POST['sendarray']); print_r($posts); echo json_last_error(); print_r return nothing and json_last_error returns 0 in firefox In chrome it throws me: Uncaught TypeError: Converting circular structure to JSON
downvote count: 2
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43206004
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript

http://stackoverflow.com/a/27316570
has comment: http://stackoverflow.com/comment/43094334
score: 0
has comment: http://stackoverflow.com/comment/43092952
answers question: http://stackoverflow.com/q/27316490
type: Answer
has comment: http://stackoverflow.com/comment/43093250
has comment: http://stackoverflow.com/comment/43093060
has body: Use regular expression: /^-?([1-9]\d+|\d)(\.\d+)?$/.test("1234"); // true /^-?([1-9]\d+|\d)(\.\d+)?$/.test("asdf"); // false /^[a-zA-Z]+$/.test("asdf"); // true /^[a-zA-Z]+$/.test("1234"); // false Or you just want two functions with the same name as PHP: function ctype_alpha(input) { // this works for both upper and lower case return /^[a-zA-Z]+$/.test(input); } function is_numeric(input) { // this works for integer, float, negative and positive number return /^-?([1-9]\d+|\d)(\.\d+)?$/.test(input); } ctype_alpha("asdf"); // true is_numeric("1234"); // true is_numeric("-1234"); // true is_numeric("12.34"); // true is_numeric("0.4"); // true is_numeric("001"); // false So finally a port to JS of your code usage: var input = "your_string" function ctype_alpha(input) { // this works for both upper and lower case return /^[a-zA-Z]+$/.test(input); } function is_numeric(input) { // this works for integer, float, negative and positive number return /^-?([1-9]\d+|\d)(\.\d+)?$/.test(input); } if(ctype_alpha(input.substring(0, 2)) &amp;&amp; is_numeric(input.substring(2, 4))) { //do smthing }
has comment: http://stackoverflow.com/comment/43093202
has comment: http://stackoverflow.com/comment/43094040

busboy
tags question: http://stackoverflow.com/q/27452259
type: Tag
tag name: busboy

http://stackoverflow.com/a/27427068
has body: You will have to use Ajax when you click the .modal-link: $(".modal-link").click(function (event) { var mUrl = '@(Url.Action("DetailsForModal", "Home", null, Request.Url.Scheme))?accountNumber=' + accountNumber; $.ajax({ url: mUrl, success:function(result){ // result should contain PartialView from Controller //Assign Modal DIV the PartialView $('#detailsModal').html(result); $('#detailsModal').modal('show'); } }); } Put your Modal Logic in a Partial View, then Create a function in Home Controller: Something like this: public ActionResult DetailsForModal(int accountNumber){ var model = new PartialModalDialogViewModel(); // Load Modal Data return PartialView("PartialViewName", model); } EDIT: Try removing this from the Modal Partial View and put in somewhere in the _Layout.cshtml &lt;div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel" aria-hidden="true"&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/43297552
score: 1
has comment: http://stackoverflow.com/comment/43297114
upvote count: 1
has comment: http://stackoverflow.com/comment/43297003
answers question: http://stackoverflow.com/q/27426822
accepted answer of: http://stackoverflow.com/q/27426822
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43299833
has comment: http://stackoverflow.com/comment/43297172
type: Answer
has comment: http://stackoverflow.com/comment/43297144

http://stackoverflow.com/a/30560672
answers question: http://stackoverflow.com/q/27471474
upvote count: 5
has body: Under the hood the ES6 engine will load bar.js when it evaluates import { Bar } from 'javascripts/bar';, and block upon return of that module over HTTP? Or is bar.js downloaded prior to evaluation of the script in index.html? There is no correct answer to this yet, because there is no specification for how modules are loaded. ES2015 only specifies the module syntax, but how runtimes interpret that is not yet standardized. For example, it's very unlikely any loader specification that is eventually implemented will allow you to omit the .js as you do. And it's also very unlikely that &lt;script&gt; tags will be allowed to use import. However, setting aside any syntactic missteps you made, I can tell you in general terms what is likely to be standardized for the browser loader. It is the latter: imports are determined and downloaded ahead of time, before any script execution happens. (For the Node.js loader, however, it is likely to be blocking.) Because bar.js is loaded using the import keyword, the globals in bar.js are scoped to that module and are not visible globally? That depends on what you mean by globals. If you declare a global with e.g. window.x = 5, that will still mutate the global object. Modules do not get separate global objects to mess with. However, if you mean "accidental" globals like those declared with var or function declarations at the top-level, the answer is that in modules top-level var and function declarations do not cause global properties to be defined. (Note that in both modules and scripts, top-level let and const declarations do not create properties on the global object.) Now if I want to concatenate modules, I will continue to need to wrap my modules in IIFEs, so that their scopes remain distinct (or at least use a build step that does this under the hood)? If you want to concatenate modules, you're going to have a lot bigger problems than those you describe. For example, import and export are only usable at the top level, and not in…
downvote count: 0
type: Answer
score: 5

http://stackoverflow.com/comment/43189997
type: Comment
type: AnswerComment
has text: there is a scope for directives? because I'm binding to window, not an element
score: 0
comment on: http://stackoverflow.com/a/27368912

http://stackoverflow.com/comment/43319548
comment on: http://stackoverflow.com/a/27438043
type: AnswerComment
score: 0
has text: Yes I was able to insert the style-sheet with the above code. Thank you
type: Comment

http://stackoverflow.com/q/27367531
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have some list items. Followings are some scenarios: If I click any list item it become selected and add a class .slected If I click another list item previous list become unselected and new list become selected If I click the list item which already been selected it become unselected FIDDLE Those scenarios working perfectly. But problem occurs when I press the Edit link. I don't wanted to Unselect during Edit mode. It should remain selected during I perform edit actions. How I can do this matching those 3 conditions ? what wrong I am doing here ? Any help with this will save my day. Thanks in advance. JS $("body").on('click', '.list-group-item', function() { if ($(this).hasClass('selected')) { $(this).removeClass('selected'); } else { $(".list-group-item").removeClass('selected'); $(this).addClass('selected'); } });
accepted answer: http://stackoverflow.com/a/27367877
has comment: http://stackoverflow.com/comment/43187039
has title: Issue with jQuery class toggling
favorite count: 0
score: 2
possible better answer: http://stackoverflow.com/a/27367718
upvote count: 2
has answer: http://stackoverflow.com/a/27367718
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27367877
type: Question
answer count: 2

http://stackoverflow.com/q/27314944
tagged with: css
type: AnsweredQuestion
score: 0
possible better answer: http://stackoverflow.com/a/27315637
has body: I have added a side menu layer to my HTML app taking refrence this link http://www.uiupdates.com/sidebar-menu-layer-with-jquery/. When i press menu button & side menu appers. My following div class "buttoncls_scrollableCenter" & "buttoncls_fotter" is able to move right when menu appears . But this div "buttoncls_scrollable" does not moves to the right when side menu appears. How to make this div "buttoncls_scrollable" move when side menu appears ? Code :-- My item list Fruits Automobile Cloth Menu Normal Vegitable Green Vegitable brinjal cauliflower tomato ladyfinger radish ginger List of Items Actual Html page:-- side Menu appears, top div is not moving :--
has answer: http://stackoverflow.com/a/27315637
type: Question
tagged with: javascript
has title: side menu appears -- div not moving
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/27315251
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13712697
accepted answer: http://stackoverflow.com/a/27315251

http://stackoverflow.com/comment/43374897
type: Comment
has text: I'll have a look at that now, thanks. I just added a screenshot to show it better too.
comment on: http://stackoverflow.com/q/27469497
score: 0
type: QuestionComment

http://stackoverflow.com/q/27472608
accepted answer: http://stackoverflow.com/a/27472789
downvote count: 1
tagged with: node.js
type: AnsweredQuestion
type: Question
upvote count: 0
has answer: http://stackoverflow.com/a/27472789
answer count: 1
tagged with: javascript
has body: I define a method that will get a value from the Database, I named it as getParam () as the following: function getParam( tableName, paramName, id){ var param=0; var query = client.query('SELECT '+ paramName + ' AS myparam FROM ' + tableName + ' where contest_id = ' + id); query.on('row', function(row) { param= row.myparam; }); return param; } But I have a problem; the callback function param= row.myparam; it returns param as undefined then it executes the callback function function(row) { param= row.myparam;}. However I want the callback function to run first then it returns the value in param. How can I do it since Node JS is asynchronous?
favorite count: 0
has title: non-blocking in Node JS
tagged with: asynchronous
has comment: http://stackoverflow.com/comment/43379835
score: -1

http://stackoverflow.com/a/27474113
type: Answer
downvote count: 0
has body: Either pass the function name directly: $(".editIncome").click(editIncome); Or when calling the the function, use call to set the value of this inside the function: $(".editIncome").click(function() { editIncome.call(this); }); Since the update: ... The value of this inside editIncome will be the HTML element.
score: 1
has comment: http://stackoverflow.com/comment/43382739
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27474091
answers question: http://stackoverflow.com/q/27474091

http://stackoverflow.com/a/27399123
answers question: http://stackoverflow.com/q/27398959
has comment: http://stackoverflow.com/comment/43245033
has comment: http://stackoverflow.com/comment/43245211
accepted answer of: http://stackoverflow.com/q/27398959
type: Answer
score: 2
has body: Another different answers suitable for the OP questions $("#abcd .myclass").not(":eq(0)").remove(); or $("#abcd .myclass").not(":lt(1)").remove(); or $("#abcd .myclass").not(":first").remove(); or $("#abcd").find(".myclass:not(:contains('Hello'))").remove(); or $("#abcd .myclass").not(":nth-child(1)").remove(); or $("#abcd .myclass").not(":nth-of-type(1)").remove(); or $("#abcd .myclass").nextAll().remove(); or $("#abcd .myclass").nextUntil().remove(); Fiddle
upvote count: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/43203033
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27376574
has text: From the question, He wants to highlight all period even if in multiple rows having class blocked.
type: AnswerComment

oop
tags question: http://stackoverflow.com/q/27382844
tags question: http://stackoverflow.com/q/27385181
tag name: oop
tags question: http://stackoverflow.com/q/27390009
tags question: http://stackoverflow.com/q/27347175
tags question: http://stackoverflow.com/q/27374380
tags question: http://stackoverflow.com/q/27388077
tags question: http://stackoverflow.com/q/27373771
tags question: http://stackoverflow.com/q/27328225
tags question: http://stackoverflow.com/q/27452531
tags question: http://stackoverflow.com/q/27386638
tags question: http://stackoverflow.com/q/27424325
tags question: http://stackoverflow.com/q/27317589
tags question: http://stackoverflow.com/q/27450515
tags question: http://stackoverflow.com/q/27376169
type: Tag
tags question: http://stackoverflow.com/q/27456973
tags question: http://stackoverflow.com/q/27339703

http://stackoverflow.com/q/27435721
type: Question
tagged with: javascript
has title: PDFView.page.getViewport() not defined?
has answer: http://stackoverflow.com/a/27956520
has body: So I'm using the normal viewer.html and the following function included in a separate .js: function selectedPosition() { var visible = PDFView.getVisiblePages(); var firstPage = visible.first; var pageNumber = firstPage.id; var currentPage = PDFView.pages[pageNumber - 1]; var selecion = window.getSelection(); var range = selecion.getRangeAt(0); var rect = range.getBoundingClientRect(); var div = $('#viewer'); var viewport = currentPage.getViewport(div.width / currentPage.getViewport(1.0).width); // Uncaught TypeError: undefined is not a function var point1 = viewport.convertToPdfPoint(rect.left - div.offset().left, rect.top - div.offset().top); var point2 = viewport.convertToPdfPoint(rect.right - div.offset().left, rect.bottom - div.offset().top); console.log(point1); console.log(point2); } What the code should do, is calculate the rectangle points with respect to the pdf so that they are independent on scrolling and zoom. The code is mostly copied from the viewer.js, so why is getViewport not defined? Trying console.log(currentPage.getViewport(1.0)); yields the same error. What am I missing?
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/44322766
favorite count: 0
has comment: http://stackoverflow.com/comment/44362400
tagged with: pdf.js
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/44367370

http://stackoverflow.com/comment/43342141
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27437266
score: 0
has text: I think this may be close to what I want, I'm still quite new with the javascript/php programming and will try to implement it and get back to you. Thanks

http://stackoverflow.com/comment/43091536
type: QuestionComment
has text: But the issue is more about if the user clicks autosuggest for one address but changes it, it won't update the autocompleted fields
comment on: http://stackoverflow.com/q/27315479
score: 0
type: Comment

http://stackoverflow.com/comment/43383765
type: AnswerComment
has text: another reference to "Reference(s)" https://github.com/unionups/ember-cli-bootstrap-sass/issues/11
comment on: http://stackoverflow.com/a/27474327
score: 0
type: Comment

http://stackoverflow.com/comment/64574655
comment on: http://stackoverflow.com/a/32063946
type: Comment
has text: Thank you for this perfect answer.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43150218
has text: "Even if server wanted to restrict connections from other domains, it's impossible to do this using capabilities of HTTP protocol. I suggest using tokens for that." If you could AJAX request arbitrary cross-domain content, you could obtain those tokens.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27347656
score: 0

http://stackoverflow.com/comment/43371026
score: 0
type: AnswerComment
type: Comment
has text: So what helped exactly and in what way helped if it's still not working? ;)
comment on: http://stackoverflow.com/a/27467746

http://stackoverflow.com/q/27398641
score: 0
has body: Is there some way, or some flash plugin or php script that can render font-face text out as a bitmap graphic? Transparent would be great but even if you could define foreground colour or background colour. The reason being is I need some dynamic data to be displayed in an html font and ideally in the actually font rather than a web safe font. Thanks Josh
type: Question
type: AnsweredQuestion
tagged with: flash
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28015395
answer count: 1
has title: Turn font-face text into bitmap rendered graphic?
tagged with: php
tagged with: font-face
has answer: http://stackoverflow.com/a/28015395
has comment: http://stackoverflow.com/comment/43251047

http://stackoverflow.com/q/27352458
upvote count: 3
type: UnansweredQuestion
tagged with: navigator
has title: How can I spoof the navigator.platform property in Safari? - Safari Extension
type: Question
downvote count: 0
tagged with: javascript
has body: I would like to spoof the navigator.platform property in Safari so that I can make websites think that I am running on a Windows architecture. I created a Safari extension that attempts to do this. The plugin simply contains a blank "global.html" file and a file "spoof.js" that is injected as a "start script" (basically it executes on every page before the content of that page loads). The contents of spoof.js are: //Copied from http://stackoverflow.com/questions/2166540/how-can-i-fool-a-site-that-looks-at-the-javascript-object-navigator-to-see-tha new_navigator = {}; for (var i in navigator) { new_navigator[i] = navigator[i]; } new_navigator.platform = 'Windows'; navigator = new_navigator; //alert(navigator.platform); If I uncomment the last line the alert box will say "Windows" every time I load a page, but when I test the extension using this page the website always reads the navigator.platform property as "MacIntel". I found this excerpt in Apple's Safari extension developer's guide. Injected scripts have an implied namespace—you don’t have to worry about your variable or function names conflicting with those of the website author, nor can a website author call functions in your extension. In other words, injected scripts and scripts included in the webpage run in isolated worlds, with no access to each other’s functions or data. Does this mean that there is no way that I can edit the navigator item with a Safari extension? Is there any way that I can set the navigator object using an extension?
favorite count: 0
has comment: http://stackoverflow.com/comment/43158742
score: 3
tagged with: macos
tagged with: safari-extension
has comment: http://stackoverflow.com/comment/43283187
tagged with: safari
linked to: http://stackoverflow.com/q/2166540
answer count: 0

http://stackoverflow.com/comment/43186214
type: QuestionComment
comment on: http://stackoverflow.com/q/27365727
score: 0
has text: If problem remains after renaming this .htaccess then problem is somewhere isn't it?
type: Comment

http://stackoverflow.com/comment/43224842
has text: Please show some actual code. Your `FileList` example is not javascript.
type: QuestionComment
comment on: http://stackoverflow.com/q/27388402
score: 0
type: Comment

http://stackoverflow.com/a/27380043
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43228609
answers question: http://stackoverflow.com/q/27379903
has body: Your javascript is wrote wrong. It should be a double quote for the location ..."'.$location.'"... echo ' '; die();

http://stackoverflow.com/a/27361795
upvote count: 2
answers question: http://stackoverflow.com/q/27361680
type: Answer
downvote count: 0
has body: If you press the on button multiple times that could happen. The reason is even though the reference for a new interval replaces the first one, the first interval is not cleared then. Try this, var refreshInterval; function refreshAuto() { clearInterval(refreshInterval); if($("#refresh-select").val() == "off") { console.log("I'm here !"); } else { refreshInterval = setInterval("console.log('bip')", $("#refresh-select").val()); } }
score: 2
has comment: http://stackoverflow.com/comment/43175666

http://stackoverflow.com/q/27428831
tagged with: javascript
duplicate of: http://stackoverflow.com/q/9380077
tagged with: jquery
has title: Error converting a Number to a String
has comment: http://stackoverflow.com/comment/43299064
favorite count: 0
has comment: http://stackoverflow.com/comment/43299063
answer count: 0
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/43299141
has body: I'm trying to do 458.toString() and its giving error (Uncaught SyntaxError: Unexpected token ILLEGAL). Then after trying/searching some other process they worked. eg. 458 .toString(); 458..toString(); (458).toString(); I understand #3, but not well about #1 and #2. Please help me with explanation of #1 and #2 statement.
upvote count: 3
type: Question
linked to: http://stackoverflow.com/q/9380077
score: 2

http://stackoverflow.com/comment/43227869
type: QuestionComment
comment on: http://stackoverflow.com/q/27389319
score: 0
has text: @ceejayoz im only targeting 1 country at a time and since some countries have multiple languages i need control over which language is displayed
type: Comment

http://stackoverflow.com/comment/43095719
has text: Could we get some source code? It does sound like an async issue though where some html isn't being modified if it doesn't exist.
type: Comment
comment on: http://stackoverflow.com/q/27318094
type: QuestionComment
score: 0

http://stackoverflow.com/q/27406145
type: AnsweredQuestion
has title: Angular active class on ng-click
type: Question
has answer: http://stackoverflow.com/a/27406682
answer count: 1
tagged with: javascript
has body: In my angular app I have three buttons, each representing a different state. <li ng-class="{'active': devices.length < 5 && tariffTypeSelection !== 'welcome'}">1 - 4 {{ params.device_name }}s = 5}">5 - 19 {{ params.device_name }}s 20 + {{ params.device_name }}s The current rule for the tabs becoming active is based on the length of devices. In addition to this though I want the buttons to be clickable and onclick, the clicked tab has the active class. There should only be one active class at one time between all three buttons. Pretty standard, simple stuff but what's the best-practise Angular way to make this happen?
score: 0
accepted answer: http://stackoverflow.com/a/27406682
tagged with: angularjs

http://stackoverflow.com/comment/43181969
type: Comment
type: QuestionComment
has text: Please don't dot-out your question. If you want to delete your question, please use the delete link under your question so the question is removed from the Stackoverflow questions list. Thanks!
score: 1
comment on: http://stackoverflow.com/q/27360457

http://stackoverflow.com/comment/43263337
type: AnswerComment
comment on: http://stackoverflow.com/a/27408986
has text: Thank you very much, hugely appreciated!
type: Comment
score: 0

http://stackoverflow.com/comment/44480747
score: 0
has text: Just submitted an answer.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27418255

http://stackoverflow.com/q/27436673
has comment: http://stackoverflow.com/comment/43314078
has comment: http://stackoverflow.com/comment/43314210
has answer: http://stackoverflow.com/a/27436760
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27436760
has title: Make Title Bar Blink faster with Jquery Plugin, Interval is not working in Chrome
type: Question
has body: I found this jquery plugin from https://github.com/heyman/jquery-titlealert Can you help me set the speed for the title message to blink faster in Chrome? I tried lessening the interval but it did not blink too fast enough. It seems to work fine in Mozilla though. &lt;script&gt; $.titleAlert(".", { requireBlur:false, stopOnFocus:false, duration:3000, interval:30, }); &lt;/script&gt; I appreciate your help on this one! Sorry guys I'm a newb here :)
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1

http://stackoverflow.com/q/27414495
has comment: http://stackoverflow.com/comment/43273273
tagged with: popupwindow
tagged with: google-chrome-extension
answer count: 1
has body: I'm writing a chrome extension and I want to manage all of the data/variables with chrome storage. From what I understand, I should be able to use chrome.storage across my extension. I want to set something in browser_action script and then access it in the window created by the background script. The HTML and JS files all have corresponding names. This is what I have tried with no luck: //manifest.json { "manifest_version": 2, "name": "extension", "description": "my extension", "version": "0.1", "permissions": [ "tabs", "storage" ], "background": { "scripts": ["background.js"], "persistent": false }, "browser_action": { "default_icon": { "38": "images/icon38.png" }, "default_popup": "settings.html" } } //background.js chrome.windows.create({'url': chrome.extension.getURL("newPage.html"),'type': "detached_panel",'focused': true}, function(){ //created newPage.html which has newPage.js }); //setting.js document.addEventListener('DOMContentLoaded', function(){ chrome.storage.local.set({'enabled': 'TRUE'}); }); //newPage.js chrome.storage.local.get('enabled', function(result){ document.getElementById("myId").innerHTML += "&lt;br&gt;script loaded... and status: " + result.enabled; }); When I do this, newPage.html displays "script loaded... and status: undefined". Even with it being asyncronous, the storage value should be populated on running the script a second time, right? I may just be using this incorrectly. If that's the case, what's the correct way to set something with chrome storage to access in my new window? Any help would be appreciated!
favorite count: 0
has comment: http://stackoverflow.com/comment/43273334
has title: chrome.storage between popup and browser action window
upvote count: 2
has answer: http://stackoverflow.com/a/27414785
tagged with: google-chrome-storage
type: AnsweredQuestion
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/43273324
accepted answer: http://stackoverflow.com/a/27414785
score: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43273449

http://stackoverflow.com/comment/43269523
has text: This looks radically simpler than previous suggestions! However, I am confused: where is the object referenced -- for which we desire to convert its 3D coordinates into 2D ones?
type: AnswerComment
comment on: http://stackoverflow.com/a/27412386
type: Comment
score: 2

http://stackoverflow.com/comment/43166644
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27357129
has text: I can't do it because I have other select option and I store all the selected option value in the array

http://stackoverflow.com/comment/43362320
has text: @Aperçu See edit above... I see why the confusion :)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27459899

http://stackoverflow.com/q/27330434
possible better answer: http://stackoverflow.com/a/27330511
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27330516
type: Question
has comment: http://stackoverflow.com/comment/43118975
tagged with: javascript
has answer: http://stackoverflow.com/a/27330483
score: 0
has answer: http://stackoverflow.com/a/27330516
has body: I create combobox dynamically using javascript. Here the code(or here!!!): function CreateComboBox() { var selectElem = document.createElement('select'); var optionElem0 = document.createElement('option'); var optionElem1 = document.createElement('option'); var optionElem2 = document.createElement('option'); var optionElem3 = document.createElement('option'); var optionElem4 = document.createElement('option'); selectElem.onchange = 'myFunction()'; optionElem0.value=10; optionElem0.innerHTML="10"; optionElem1.value=15; optionElem1.innerHTML="15"; optionElem2.value=20; optionElem2.innerHTML="20"; optionElem3.value=25; optionElem3.innerHTML="25"; optionElem4.value=50; optionElem4.innerHTML="50"; selectElem.appendChild(optionElem0); selectElem.appendChild(optionElem1); selectElem.appendChild(optionElem2); selectElem.appendChild(optionElem3); selectElem.appendChild(optionElem4); document.getElementById('ComboArea').appendChild(selectElem); } function myFunction() {alert('HELLO!');} After combobox is created if I select a element from the created combo I want the myFunction() to be fired.But it not work, the function myFunction() not fired any idea why?What I'm doing wrong?
has answer: http://stackoverflow.com/a/27330547
has title: Created dynamically combobox not working
has answer: http://stackoverflow.com/a/27330511
answer count: 5
has answer: http://stackoverflow.com/a/27330513

http://stackoverflow.com/comment/43169322
type: Comment
comment on: http://stackoverflow.com/a/27355466
score: 0
has text: are you connected to internet.if not then you will have problem.I'll suggest download these jquery files and save them in your project.
type: AnswerComment

http://stackoverflow.com/a/27397678
has body: The problem is in your views. You are not converting the response_data to json properly. Here's what you can do: views.py if request.method == 'POST': response_data = {} response_data['label_thumb_up_1'] = c.num_of_liked data = json.dumps(response_data) return HttpResponse(data, content_type='application/json') JS/jQuery ... success: function(data) { alert(data.label_down_3); $('#label_down_3').text(data.label_down_3); console.log('success'); }, ... To prevent the page from refreshing Add return false; after the $.ajax function. $.ajax({ ... }); return false;
score: 0
answers question: http://stackoverflow.com/q/27341619
type: Answer

http://stackoverflow.com/q/27408244
has answer: http://stackoverflow.com/a/27408765
score: 0
answer count: 2
tagged with: ng-bind-html
linked to: http://stackoverflow.com/q/22445290
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43261166
accepted answer: http://stackoverflow.com/a/27408765
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11408668
type: Question
has body: I've got a list of messages of which the text includes some html which I want to display. So as suggested here and here what I'm currently trying is this: &lt;div ng-repeat="message in messages"&gt; {{ message.sender_name }} - &lt;div ng-bind-html="message.text"&gt;&lt;/div&gt; &lt;/div&gt; It displays the message.sender_name, but not the message.text. When I simply do {{ message.text }} it displays the text correctly (but displaying the raw &lt;br&gt;s without rendering them). Does anybody know why this is not working?
has title: Combining ng-repeat and ng-bind-html?
possible better answer: http://stackoverflow.com/a/27410180
tagged with: javascript
has answer: http://stackoverflow.com/a/27410180
has comment: http://stackoverflow.com/comment/43261720
has comment: http://stackoverflow.com/comment/43261520

http://stackoverflow.com/a/27333500
type: Answer
has comment: http://stackoverflow.com/comment/43124715
upvote count: 3
has comment: http://stackoverflow.com/comment/43124661
has body: First modify the plugin $.fn.horizontal = function(didgeridoo) { this[didgeridoo]('mousewheel', fn); function fn(e, delta) { this.scrollLeft -= (delta * 40); e.preventDefault(); } }; then to activate $mainDiv.on('click', function() { $(this).find($scrollableContainer).horizontal('on'); }); and deactivate $(document).on('click', function() { $(this).find($scrollableContainer).horizontal('off'); }); It is rather strange to use a variable in find, unless that variable holds a selector as a string ? Note that there is no delta as a second argument, and that the mousewheel event is non-standard, and according to MDN shouldn't be used? Are you using another plugin to provide non-standard functionality ? There are however deltaX and deltaY properties of the event in Chrome and IE, they can be accessed like this function fn(e) { e.preventDefault(); var delta = e.originalEvent.deltaX; this.scrollLeft -= (delta * 40); } And MDN has a polyfill that should work cross-browser.
has comment: http://stackoverflow.com/comment/43124750
has comment: http://stackoverflow.com/comment/43124608
downvote count: 0
answers question: http://stackoverflow.com/q/27333336
has comment: http://stackoverflow.com/comment/43124570
score: 3

http://stackoverflow.com/comment/43174283
type: Comment
has text: I have more then 1 table in my website so i have to use something like $jQ('.Required > tbody > tr > td').each(function(index){};
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27361053

http://stackoverflow.com/q/27316065
linked to: http://stackoverflow.com/q/23483787
has title: Unix Timestamp conversion to JavaScript wrong output
has comment: http://stackoverflow.com/comment/43115629
type: Question
score: 0
has answer: http://stackoverflow.com/a/27317486
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43094067
has comment: http://stackoverflow.com/comment/43094242
has comment: http://stackoverflow.com/comment/43121970
has body: I am storing Unix Timestamp in Firebase server and it is saving as 1417780144675. When I am converting epochconverter the output is: Assuming that this timestamp is in milliseconds: GMT: Fri, 05 Dec 2014 11:49:04 GMT Your time zone: 12/5/2014, 5:19:04 PM GMT+5:30 But when I am converting in JavaScript, the output is: Fri Aug 30 46897 15:27:55 GMT+0530 (IST) So output from epochconverter is correct whereas in JavaScript it's coming wrong. Please how to get correct output using JavaScript.
has comment: http://stackoverflow.com/comment/43094177
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27317486

http://stackoverflow.com/comment/43343463
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27452210
score: 0
has text: If you want the user to be able to supply the csv (rather than the server) then you need to look into the file API (and the drag and drop API if you want a nice UX)

http://stackoverflow.com/a/27396425
has comment: http://stackoverflow.com/comment/43254367
has comment: http://stackoverflow.com/comment/43251079
has comment: http://stackoverflow.com/comment/43250778
has comment: http://stackoverflow.com/comment/43248304
has comment: http://stackoverflow.com/comment/43241699
has comment: http://stackoverflow.com/comment/43239708
downvote count: 0
has comment: http://stackoverflow.com/comment/43251101
has comment: http://stackoverflow.com/comment/43251057
has comment: http://stackoverflow.com/comment/43239887
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43239632
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27396290
type: Answer
has comment: http://stackoverflow.com/comment/43241709
has body: user_id and event_id are only defined as parameters within your peopleattending function. when you call the code like this: peopleattending(user_id,event_id); Your basically saying peopleattending(undefined,undefined); You could set your variables on pageload within your javascript block instead of within your anchor tag's function reference &lt;script&gt; var _user_id = '&lt;?php $_COOKIE['user'] ?&gt;'; var _event_id = '&lt;?php $_COOKIE['evnt_id'] ?&gt;'; $(document).ready(function() { function peopleattending(user_id,event_id) { console.log(_user_id); console.log(_event_id); $.ajax({ type:"GET", url:"{{get_hash_attend(user_id,event_id) }}", success: function(data) { $("#attend").text("Attending"); } }); } peopleattending(_user_id,_event_id); }); &lt;/script&gt; And then your anchor tag would look like this &lt;a href="#" onclick="peopleattending(_user_id,_event_id);"&gt; For Symfony: &lt;script&gt; var _user_id = '{% app.request.cookies.get('user') %}'; var _event_id = '{% app.request.cookies.get('event_id') %}'; I note there was a typo in your question, evnt_id instead of event_id. If this typo is also in your code then you'll need to fix it or change it in the javascript If your vars are numbers and not strings, you can remove the quotes &lt;script&gt; var _user_id = {% app.request.cookies.get('user') %}; var _event_id = {% app.request.cookies.get('event_id') %}; If you want to use JQuery to read the cookies directly you can use the Cookie plugin for jQuery &lt;script&gt; var _user_id = $.cookie("user"); var _event_id = $.cookie("event_id"); Although at this point you could drop the variables and call $.cookie("user") directly anywhere its needed.
answers question: http://stackoverflow.com/q/27396290
has comment: http://stackoverflow.com/comment/43251124
score: 2
has comment: http://stackoverflow.com/comment/43248280

http://stackoverflow.com/q/27365526
has body: My current script looks like this (pseudo code): casper.start(some_sample_url, function(){ a_list_of_data = JSON.parse(this.getPageContent()) for(var i = 0; i &lt; a_list_of_data.length; i++){ entry = a_list_of_data[i]; entry_url = entry.get_url(); result = __utils__.sendAJAX(entry_url, "POST", {some: "data"}, false, {some: "option"}); casper.download(result, ...); } }); casper.run(); I've learned that __utils__.sendAJAX should be put in a this.evaluate which in turn should be in a casper.then. However, after I change my code to that form it seems all the POST requests simply not sent out. Can anyone point me to the right direction?
score: -1
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27366579
tagged with: code-organization
has title: How to organize my casperjs script
tagged with: casperjs
type: UnansweredQuestion
downvote count: 1
type: Question
tagged with: phantomjs

http://stackoverflow.com/comment/43194899
type: Comment
type: QuestionComment
has text: I don't understand your example output. How do you get 55,60 and 5 for the time ranges shown?
comment on: http://stackoverflow.com/q/27371798
score: 0

http://stackoverflow.com/q/27379780
has body: I'm trying to install this datetimepicker for bootstrap: https://github.com/Eonasdan/bootstrap-datetimepicker/wiki/Installation I've got this in the header of my document: And this in the footer: And here is the code using the picker: The problem is that .datetimepicker is an "unresolved function". Why? Edit: The IDE (PHPStorm) says that it's unresolved function. And actually running it in Chrome confirms: bootstrap-datetimepicker.min.js:1 Uncaught TypeError: undefined is not a function myfile.php:42 Uncaught TypeError: undefined is not a function bootstrap-datetimepicker.min.js:1 Uncaught Error: Must choose at least one picker Edit2: I updated the header/footer. Header: Footer: Now IDE recognizes datetimepicker() as a function, but still the same problem in Chrome! (see above)
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27379907
tagged with: bootstrap-datetimepicker
has answer: http://stackoverflow.com/a/27379907
has title: Jquery function doesn't load - undefined is not a function
accepted answer: http://stackoverflow.com/a/27379915
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43208778
score: 0
has answer: http://stackoverflow.com/a/27379957
has comment: http://stackoverflow.com/comment/43208842
has answer: http://stackoverflow.com/a/27380483
answer count: 4
has answer: http://stackoverflow.com/a/27379915
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43208961

http://stackoverflow.com/comment/43159138
comment on: http://stackoverflow.com/q/27352088
type: Comment
type: QuestionComment
score: 0
has text: @torazaburo sorry.. I'm new to JavaScript... I'm unable to get the corresponding value when I use object[key]

http://stackoverflow.com/q/27338599
possible better answer: http://stackoverflow.com/a/27338617
has answer: http://stackoverflow.com/a/27338617
tagged with: twitter-bootstrap
has title: Responsive Checkbox or Toggle for boolean value
type: Question
type: AnsweredQuestion
tagged with: forms
accepted answer: http://stackoverflow.com/a/27339392
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm making a CMS for my website and I have columns in my blogs database for whether or not the blog post is visible or not, and if comments are enabled or not. At the moment in my form I've got Comments <input type="text" class="form-control" name="blogcomments" id="blogcomments" placeholder="1 or 0" required maxlength="1" value="<?php echo ($data['blog']->blogcomments)?>"> so if I'm editing a blog it will already pull the value, otherwise it'll just show the placeholder. I can then either type 1 or 0 and submit. What I want to do it have a checkbox or a toggle (I was looking at bootstrap-switch), but I'm really not sure how to implement this. I guess I could just have a default value in the column of 0 and have the checkbox value to 1? I don't really like that idea though. I've also no idea how to check the existing value (if there is one) and set the checkbox/button/whatever accordingly (so if the value is already 1 in the column it would be checked already). I'm guessing at this point I'd need javascript?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27339392

http://stackoverflow.com/q/27400179
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1968167
has comment: http://stackoverflow.com/comment/43245727
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27400370
tagged with: datejs
duplicate of: http://stackoverflow.com/q/1968167
type: Question
linked to: http://stackoverflow.com/q/2587345
has answer: http://stackoverflow.com/a/27400559
score: 0
has comment: http://stackoverflow.com/comment/43245843
answer count: 3
has body: I am trying to find the difference between two dates. The dates are got with jquery and I am using datejs too. When using datejs it picks up my date as US thinking it is MM/DD/YYYY instead of dd-mm-yyyy. My result for difference is NaN. How do I work this out. Am I miles out or anywhere near close? var msMinute = 60*1000, msDay = 60*60*24*1000; start = $('#reconcile_start_date').val(); // 10-12-2014 | dd-mm-yyyy end = $('#reconcile_end_date').val(); // 15-12-2014 | dd-mm-yyyy start = new Date(start); end = new Date(end); console.log(Math.floor((end - start) / msDay) + ' full days between ' + end + ' and ' + start); difference = Math.floor((end - start) / msDay); if(difference &gt; 30){}
has comment: http://stackoverflow.com/comment/43245570
has title: Find difference between two dates with javascript
linked to: http://stackoverflow.com/q/10430321
has comment: http://stackoverflow.com/comment/43246359
tagged with: javascript
tagged with: date
has answer: http://stackoverflow.com/a/27400552
accepted answer: http://stackoverflow.com/a/27400559
has answer: http://stackoverflow.com/a/27400370

web-services
type: Tag
tags question: http://stackoverflow.com/q/27375572
tags question: http://stackoverflow.com/q/27459705
tags question: http://stackoverflow.com/q/27354337
tags question: http://stackoverflow.com/q/27381989
tag name: web-services

http://stackoverflow.com/a/27356503
has body: Use transform instead of top/left: container.style.transform = 'translate(' + container.x + 'px, ' + container.y + 'px)'; A live demo at jsFiddle.
has comment: http://stackoverflow.com/comment/43170960
downvote count: 1
has comment: http://stackoverflow.com/comment/43228249
has comment: http://stackoverflow.com/comment/43175245
has comment: http://stackoverflow.com/comment/43236321
has comment: http://stackoverflow.com/comment/43230297
answers question: http://stackoverflow.com/q/27356273
type: Answer
upvote count: 43
has comment: http://stackoverflow.com/comment/43175113
has comment: http://stackoverflow.com/comment/43176447
has comment: http://stackoverflow.com/comment/43174837
score: 42

http://stackoverflow.com/comment/43209197
comment on: http://stackoverflow.com/a/27347212
type: AnswerComment
score: 0
type: Comment
has text: The solution is correct and it should not affect other parts of your application.

http://stackoverflow.com/q/27465159
has answer: http://stackoverflow.com/a/27465447
type: AnsweredQuestion
score: 1
has body: I'm working on a basic news feed app. What I need is for a specific news article, entry.content, to display in a separate view after a click. Both controllers have access to the data, but I need a synchronized click event so the second controller knows which specific article to display. I've been working on this for awhile & couldn't find relevant links on google or here where a secondary view was involved. I need a separate view b/c I have to add a lot more HTML to that page & eventually click(previous/next) between articles. I have an example which is working where the click event happens, but the content displays in the current view then hides after click. I have a Plunker: http://plnkr.co/edit/lk66pRb7A6DkGM7NQKF7?p=preview Here is the index.html code: News Feed Here is the home.html code: <h3 ng-repeat="entry in new.entries" ng-if="$index < 3"> {{entry.title}} Display this story Desired: click this Link, go to #/article & display this story Currently, in the article.html file I only have a back button as I'm not sure what to put in there. All other code is in the Plunker, but I can add here if it will help. I was thinking this might be be solved using current $index value, but I just don't know at this point. Any help is appreciated.
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27465447
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: angularjs-ng-repeat
favorite count: 0
has title: AngularJS ng-repeat display content in separate view
upvote count: 1

http://stackoverflow.com/q/27440011
tagged with: iframe
has body: I want dynamically set the height of an iframe when it will have been loaded. For this purpose I wrote this piece of JavaScript code, which in my dream can do it. But, in reality it can not. Here is my code var iframes = (function () { /* jQuery object of an iframe container */ var obj = null, /* Constructor function */ initialize = function (obj) { this.obj = obj; } initialize.prototype = { content: null, setContents: function (callback) { var self = this; this.obj.load(function () { self.content = self.obj.contents(); if (callback) {callback();} }); }, /* Returns content of iframe */ getContents: function () { return this.content; }, setHeight: function () { var height = this.content.find('html').height(); this.obj.css('height', height); }, /* Changes an element attribute in an iframe * * param selector: String id or class name to find an element * param attrName: String an attribute's name to be changed * param attrVal: String value that should be applied to the attribute */ changeAttr: function (selector, attrName, attrVal) { this.content.find(selector).attr(attrName, attrVal); }, /* Changes an element styles * * param selector: String id or class name to find an element * param styles: Object styles to be applied */ changeStyle: function (selector, styles) { this.contents.find(selector).css(styles); }, }; return initialize; }()); I sent the setHeight method as a callback function, but looks like jQuery.contents() is asynchronous, but it has no any arguments, so I can't send a callback to the jQuery.contents() Please, help me find the solution. EDITED I am not a Frontend developer, and I have poor experience with JavaScript, but I've tried to apply best practice. So I've used module pattern to create an Object. After all I do var ifrm = new iframes($('#ifrm')); ifrm.setContents(setHeight); It does not work(
has comment: http://stackoverflow.com/comment/43319798
has answer: http://stackoverflow.com/a/27440104
type: Question
has title: How to wait while jquery.contents() complete?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43319747
has comment: http://stackoverflow.com/comment/43320154
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43319814
type: UnansweredQuestion

http://stackoverflow.com/a/27332304
score: 0
type: Answer
has body: Just to cover the basics you need to go to the xampp control panel and click start where Apache is. Check if your firewall is blocking the Apache process from starting (I had this error when using Comodo firewall). Then if thats ok you should do what Cups said above. If that does not work you should open up a terminal (in Linux/OSX) or Command Prompt (in Windows) and type: ping localhost If that give an error you need to look into your Hosts file.
answers question: http://stackoverflow.com/q/27332130

http://stackoverflow.com/a/27458955
score: 1
accepted answer of: http://stackoverflow.com/q/27458896
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27458896
has body: Make your function return the value: var dt = new Date(); var now = dt.valueOf(); function date1() { return Math.ceil( // &lt;=== Change, using return rather than setting a variable (Math.abs(now - dt.setUTCFullYear(2005))) / (1000*3600*24*365) ); } Then call the function when you need the value: function res() { document.write(date1()).value; // Change -----^^^^^^^ } Side note: As far as I'm aware, document.write doesn't have any return value, so the .value on the end of your document.write line doesn't make any sense, and will probably result in a TypeError complaining that you're trying to access a property on undefined. Side note 2: In general, document.write isn't a great way to put information on web pages, use the DOM instead. Like most rules, there are exceptions.

http://stackoverflow.com/comment/43104133
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27322474
has text: Facebook fetches these with a specific user agent (something like `facebookexternalhit`).
score: 0

http://stackoverflow.com/comment/43252272
score: 1
comment on: http://stackoverflow.com/q/27402291
has text: @deemeetree I've added some more code to my answer to show you how to process nested arrays should the need arise.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27368188
possible better answer: http://stackoverflow.com/a/27368406
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27368270
tagged with: css
type: AnsweredQuestion
downvote count: 1
has body: I'm new to JavaScript and I want this to get into my paragraph with id output with But I don't get any output when I'm doing it that way. Here's the code, I want to change all document.write to document.getElementById('output').innerHTML = blablabla; JavaScript
type: Question
accepted answer: http://stackoverflow.com/a/27368270
score: -1
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/27368406
has title: Document write to document get element
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/27319647
has comment: http://stackoverflow.com/comment/43098916
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43098858
has comment: http://stackoverflow.com/comment/43098702
has title: How to check if a string is an array before parsing?
has body: I have a an arbitrary string that I would like to test if it is in array format before parsing. Here is what my string looks like: var stringVar = "[{id:123,abc:123,xyz:987},{id:456,abc:789,xyz:1}]" To parse this into an array, I am doing: var arrayVar = eval(stringVar); I am worried of malicious code, so I want to check if stringVar is an intended array before running eval on it. Any idea on how to approach this?
tagged with: arrays
answer count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43098928
type: UnansweredQuestion
tagged with: string
has comment: http://stackoverflow.com/comment/43098614
type: Question
tagged with: eval

http://stackoverflow.com/q/27446037
accepted answer: http://stackoverflow.com/a/27446523
has body: I'm using the jQuery UI slider for a casino game project I am working on. I need to be able to change the "max" value based upon the players current bankroll. At first, the slider works correctly, it sets the "max" slider value to 1000, the players starting bankroll. Bust as the 'currentBankroll' variable changes, the sliders "max" value does not update. I inserted a console.log() line of code to check the value of the variable 'currentBankroll', which confirms the value is changing, but the slider "max" value stays at the initial value of 1000 and does not update. To further confuse me, I tried a solution I found here to change the "max" value. $('#slider-range-max2').slider("option", "max", 300); This line of code will change the sliders "max" value if I put a number in it (like 300), but will not work if I use a variable (like 'currentBankroll"). How can I change the sliders value using a variable? $(function() { console.log("Current Bankroll: " + currentBankroll); $("#slider-range-max2").slider({ range: "max", max: 0, min: 1, max: currentBankroll, value: 2, slide: function( event, ui ) { $("#amount").val( ui.value ); sliderValue = (ui.value); }, slide : function(event, ui) { skillLevelSlots(ui.value); wagerAmount = (ui.value); $('.wager').html("$" + wagerAmount); } }); $('#slider-range-max2').slider("option", "max", 300); });
has comment: http://stackoverflow.com/comment/43331320
upvote count: 1
type: AnsweredQuestion
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/43331127
has title: jQuery UI-slider changing "max" value
score: 1
type: Question
has comment: http://stackoverflow.com/comment/43331146
has answer: http://stackoverflow.com/a/27446523
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43331652
favorite count: 0

random
tags question: http://stackoverflow.com/q/27415040
tags question: http://stackoverflow.com/q/27391590
tags question: http://stackoverflow.com/q/27391527
tags question: http://stackoverflow.com/q/27379947
tags question: http://stackoverflow.com/q/27450389
tag name: random
tags question: http://stackoverflow.com/q/27338448
tags question: http://stackoverflow.com/q/27432820
tags question: http://stackoverflow.com/q/27447494
type: Tag
tags question: http://stackoverflow.com/q/27421717

http://stackoverflow.com/comment/43351228
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27456969
has text: Thanks Ryan Nghiem :)

http://stackoverflow.com/comment/43125716
type: AnswerComment
has text: Is there a name for this syntax?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27334274

http://stackoverflow.com/q/27350110
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27350401
type: Question
has comment: http://stackoverflow.com/comment/43161985
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Submitting POST request from Cordova app to Google App Engine not reaching server at all
score: 0
has body: I have a Cordova app (HTML/Javascript-files wrapped into iOS WebView) which is exhibiting some weird behaviour. I submit forms to a python-script on Google App Engine, and this works sometimes, but not all the time. When the form includes base64 encodes images, it is more likely that the it won't work. What I mean with not working is that it doesn't reach the server at all. The server logs show that no request to the "/submit"-handler has been made. This is only for the iOS-version of the app. The Android-version works fine with the same code. My biggest suspicions was the cross-domain issue. Here's my jQuery code which sends the form: $.ajax({ type: 'POST', url: "http://myapp.appspot.com/submit", data: submittedEntryString, crossDomain: true, cache: false }).done(function(data) { console.log(data); }).fail(function(jqXHR, textStatus, errorThrown) { console.log(textStatus); console.log(errorThrown); console.log(jqXHR.responseText); }); However I have added the header to my response. I suppose this is the correct way to do it(?) self.response.headers['Access-Control-Allow-Origin'] = '*' self.write("form submitted! form id is: " + str(s.form_id)) Any ideas what would cause this kind of behaviour?
tagged with: cordova
has answer: http://stackoverflow.com/a/27350401
tagged with: google-app-engine
tagged with: python
has comment: http://stackoverflow.com/comment/43170831

http://stackoverflow.com/q/27381452
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43211979
score: 1
has comment: http://stackoverflow.com/comment/43212675
has answer: http://stackoverflow.com/a/27382143
has comment: http://stackoverflow.com/comment/43212530
has title: Wrapping existing inline SVG <g> element with element
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/3642035
favorite count: 0
has comment: http://stackoverflow.com/comment/43211962
accepted answer: http://stackoverflow.com/a/27382143
tagged with: http://stackoverflow.com/tag/svg
has body: I’d like to wrap a series of &lt;g&gt; elements with &lt;a&gt; elements so they are tabbable. I've tried using jQuery but encountered the namespace problem so have been looking at a more vanilla JS approach. The SVG was created in Illustrator and loaded into the page with an AJAX call. I then use jQuery to bind events etc. I know I can add them in Illustrator with Image Map but I’d like to find a way to get it done programmatically. This is what I’d like to do: $('g').wrap(function() { var anchor = document.createElementNS('http://www.w3.org/2000/svg', 'a'); anchor.setAttribute('xlink:href', 'javascript:void(0);'); return anchor; }); This gets it into the DOM but doesn't render so I'm assuming a namespace problem still. I’m more than likely doing something obviously wrong so any help would be greatly appreciated! Thanks. Here's a pure JS fiddle (same problem as code above): http://jsfiddle.net/bigwigal/pqe3o93e/.
has comment: http://stackoverflow.com/comment/43212963
has comment: http://stackoverflow.com/comment/43213861
upvote count: 1

http://stackoverflow.com/q/27395012
has answer: http://stackoverflow.com/a/27402495
type: UnansweredQuestion
has body: I'm trying to get my javascript function that creates a html table in my content div on my website. The problem is, that it is not displayed inside the div but under it. How can I put it inside? Start Schichtplan Rechnung Kontakt Test page 1 Test page3 Test page4 This is my basic website with the navigationbar. When I run it with xampp the js function tableCreate(); is displayed after the panel-container div closes. Here is my js code: function tableCreate(){ //var schicht=["datum","schicht","schicht","schicht","dispo","schicht","schicht","schicht","schicht","schicht","schicht","dispo"]; var body=document.getElementsByTagName('body')[0]; var tbl=document.createElement('table'); tbl.style.width='100%'; tbl.setAttribute('border','1'); var tbdy=document.createElement('tbody'); for(var i=0;i<28;i++){ var tr=document.createElement('tr'); for(var j=0;j<12;j++){ if(i==27 && j==12){ break } else { var td=document.createElement('td'); td.appendChild(document.createTextNode('schicht')) tr.appendChild(td) } } tbdy.appendChild(tr); } tbl.appendChild(tbdy); body.appendChild(tbl) Thanks in advance.
has answer: http://stackoverflow.com/a/27395632
has comment: http://stackoverflow.com/comment/43236850
has comment: http://stackoverflow.com/comment/43236779
has answer: http://stackoverflow.com/a/27396533
has comment: http://stackoverflow.com/comment/43249602
linked to: http://stackoverflow.com/q/1413952
has comment: http://stackoverflow.com/comment/43237666
has title: Rendering HTML table inside using javascript function
type: Question
has comment: http://stackoverflow.com/comment/43237656
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/27395906

http://stackoverflow.com/q/27334551
has comment: http://stackoverflow.com/comment/43148868
has body: Is there a way to import OL methods of pan and zoom to canvas element of html5? I am using this code to load an image into the canvas element. Is there a way that i can use the pan and zoom method from open layers to zoom and pan my image inside the canvas element?
tagged with: javascript
score: 0
tagged with: canvas
tagged with: pan
tagged with: openlayers
tagged with: zooming
has title: How to use Open Layers methods to canvas element?
answer count: 0
has comment: http://stackoverflow.com/comment/43138030
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43149515

header
type: Tag
tags question: http://stackoverflow.com/q/27379903
tag name: header
tags question: http://stackoverflow.com/q/27354692

http://stackoverflow.com/comment/43252884
has text: I fail to see how either of those two writes could possibly convert bootstrap.min.js and a path into "js/messages.js".
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27403719

http://stackoverflow.com/a/27463759
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27463264
has body: Ok I found the solution,as usual it was trivial and now I feel like I shot myself in leg. The thing was that I was very stupid and didn't follow good practices as NAMING CONVENTION from the BEGINING of the project ! In my index.html file there was an issue because few controllers were named by lowercase like myController.js and their real name on server was different like MyController.js so there's a problem. I worked with git,merged branches and stuff and probabbly git messed up something with names(explains how it worked on localhost I guess) but that wouldn't happen if I had followed rules from the start. To every wannabe Angular.js developer like me there are some great design guides and good practices described on link below. Use them ! https://github.com/mgechev/angularjs-style-guide Tnx everyone who tried to help me, Angular has really great community.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27463264
type: Answer

http://stackoverflow.com/comment/43145256
type: AnswerComment
comment on: http://stackoverflow.com/a/27344482
score: 0
has text: It seems to be not available with `matches` on many browsers, but rather with prefix `moz-matches` : http://caniuse.com/#feat=matchesselector ... This is annoying to have to deal with this...
type: Comment

http://stackoverflow.com/comment/43167044
type: QuestionComment
has text: Do you have the logging level set lower than "info"? Is this the built-in console of FireBug?
comment on: http://stackoverflow.com/q/27357277
score: 1
type: Comment

http://stackoverflow.com/q/27358019
score: 0
has answer: http://stackoverflow.com/a/27358394
has title: How do I use form names in Angular to get input data?
tagged with: javascript
type: Question
accepted answer: http://stackoverflow.com/a/27358394
has comment: http://stackoverflow.com/comment/43168613
type: AnsweredQuestion
has body: In this tutorial by Jenkov, he asserts that you can give a form a name, and then access it in the controller by $scope.FORM_NAME.INPUT_NAME For example like &lt;form name="myFormNg" ng-submit="myForm.submitTheForm()" &gt; &lt;input name="firstName" type="text" ng-model="myForm.firstName"&gt; &lt;/form&gt; and then in Angular $scope.myFormNg.firstName However, when I try it, instead of getting what I typed into the input box (abc), I get this whole object: {"$viewValue":"abc","$modelValue":"abc","$$rawModelValue":"abc","$validators":{},"$asyncValidators":{},"$parsers":[],"$formatters":[null],"$viewChangeListeners":[],"$untouched":false,"$touched":true,"$pristine":false,"$dirty":true,"$valid":true,"$invalid":false,"$error":{},"$$success":{"parse":true,"required":true},"$name":"email","$options":null,"$$lastCommittedViewValue":"abc"} Why? Is there a cleaner way to do it that Jenkov omits?
has comment: http://stackoverflow.com/comment/43168469
tagged with: angularjs
answer count: 1
tagged with: angular-ngmodel
has comment: http://stackoverflow.com/comment/43168407
has comment: http://stackoverflow.com/comment/43168570

http://stackoverflow.com/q/27325524
has title: Is it possible to combine members of multiple types in a TypeScript annotation?
tagged with: interface
upvote count: 141
has answer: http://stackoverflow.com/a/27414363
tagged with: typescript
linked to: http://stackoverflow.com/q/18988188
has comment: http://stackoverflow.com/comment/87737391
has answer: http://stackoverflow.com/a/66875294
answer count: 7
has answer: http://stackoverflow.com/a/27326935
has answer: http://stackoverflow.com/a/72375765
has body: It seems that what I am trying to do is not possible, but I really hope it is. Essentially, I have two interfaces, and I want to annotate a single function parameter as the combination of both of them. interface ClientRequest { userId: number sessionKey: string } interface Coords { lat: number long: number } And then, in the function, I want to do something like this: function(data: ClientRequest&amp;Coords) { ... } So that my 'data' object could contain all of the members from both types. I saw something referenced in a spec preview, under "Combining Types' Members", but it seems like this hasn't made it in yet. If it isn't possible, my solution might look like this: interface ClientRequest&lt;T&gt; { userId: number sessionKey: string data?: T } function(data: ClientRequest&lt;Coords&gt;) { ... } Which would work in this case, although it's not as dynamic as I would like. I would really like to be able to combine multiple (2+) types in the annotation itself: function(data: TypeA&amp;TypeB&amp;TypeC) { ... } I would guess that the conventional solution is to define a type that extends those types, although that seems less flexible. If I want to add a type, I would have to either (a) go back to the declaration and rewrite it, or (b) create an entirely new interface. Not sure I agree with the extra overhead. Any TypeScript experts care to point me in the right direction?
tagged with: javascript
has answer: http://stackoverflow.com/a/59637788
score: 141
has answer: http://stackoverflow.com/a/27354853
has answer: http://stackoverflow.com/a/44576176
linked to: http://stackoverflow.com/q/171251
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27326935
possible better answer: http://stackoverflow.com/a/44576176
favorite count: 0
type: Question

http://stackoverflow.com/a/27431559
answers question: http://stackoverflow.com/q/27431383
score: 0
type: Answer
has body: Several comments on your code: 1) the function you are looking for is String.prototype.split: var string = "firstName lastName"; string.split(" "); // returns an array: ["firstName","lastName"] 2) don't call your array Array. This is a "reserved word"* for the Array prototype! You are overwriting the prototype, if you do so! 3) Keep the naming of your parameters consistent. This way you avoid error like you did in your code. Handing over an array and call the parameter string is a bad idea. string[0] returns the first symbol of the string, array[0] the first element of your array. Also, name the function appropriately. Your code should look like this: var array = ["firstName lastName" , "anotherString"]; function returnSplitString(string){ return string.split(" "); } var splitStringArray = returnSplitString(array[0]); * In the strict technical sense it is not, because you CAN name your variable that way, however it's a bad idea to do so.

http://stackoverflow.com/q/27350598
duplicate of: http://stackoverflow.com/q/3463833
has title: What is wrong with this very simple switch statement?
has body: The evaluations in the console print in the second line seem correct, but the switch statement won't work. And I am not getting any errors. for (var i = 0; i &lt; 100; i++) { console.log(i % 3 === 0, i % 5 === 0); switch (i) { case i % 3 === 0: console.log(i, " by three"); break; case i % 5 === 0: console.log(i, " by five "); break; } } http://jsfiddle.net/vL4omdxs/
has comment: http://stackoverflow.com/comment/43155559
has answer: http://stackoverflow.com/a/27350658
accepted answer: http://stackoverflow.com/a/27350658
answer count: 4
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3463833
has answer: http://stackoverflow.com/a/27350666
has answer: http://stackoverflow.com/a/27350616
type: Question
possible better answer: http://stackoverflow.com/a/27350664
has answer: http://stackoverflow.com/a/27350664
tagged with: javascript
score: 0

http://stackoverflow.com/q/27440437
accepted answer: http://stackoverflow.com/a/27440529
has answer: http://stackoverflow.com/a/27442256
has title: Async load inside replace function
tagged with: asynchronous
favorite count: 0
has comment: http://stackoverflow.com/comment/43320553
type: AnsweredQuestion
upvote count: 5
has answer: http://stackoverflow.com/a/27440529
has body: I am working with replacements in Javascript. I did something like this: var replacedText = originalText.replace(regex, function(value, i) { return value + 'some_additional_data'; }); return replacedText; But now I need to load a HTML template inside the replace method. The load method is called in this way: res.render(location, json, function(error, html) { //i have the html loaded with my json data }); I need to load it inside my replace method, but I am unable to do it: var replacedText = originalText.replace(media, function(value, i) { var json = buildJSON(value); res.render(location, json, function(error, html) { //how could i return the "html" object for the replace function? }); }); I have tried something like this, but it didn't work: var replacedText = originalText.replace(media, function(value, i) { var json = buildJSON(value); return res.render(location, json, function(error, html) { return html; }); }); Any help would be appreciated Thank you very much in advance
tagged with: replace
type: Question
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43321040
tagged with: callback
has comment: http://stackoverflow.com/comment/43321542
possible better answer: http://stackoverflow.com/a/27442256

http://stackoverflow.com/comment/43340489
type: Comment
type: QuestionComment
has text: create some plunker pls
comment on: http://stackoverflow.com/q/27450517
score: 0

http://stackoverflow.com/q/27360545
tagged with: javascript
has comment: http://stackoverflow.com/comment/43173098
accepted answer: http://stackoverflow.com/a/27360729
has comment: http://stackoverflow.com/comment/43173321
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43173118
has body: So I try to do something like Java to solve class name conflict problem. What I try is: function com_mycompany_my_package(){ function Class1(){ this.field1=0; } Class1.prototype.increase=function(){ this.field1=1; } function Class2(){ this.field1=0; } Class2.prototype.descrease=function(){ this.field1=-1; } } var class1=new ? How can I get new instance of Class1? Is my way good or bad? What is other way to solve class name conflict problem?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27360729
has title: Javascript: java like package and class conflict issue
type: Question

http://stackoverflow.com/a/27427838
accepted answer of: http://stackoverflow.com/q/27426147
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43302302
has comment: http://stackoverflow.com/comment/43307395
type: Answer
has comment: http://stackoverflow.com/comment/43303166
has body: You could use this library - https://github.com/caolan/async#eachSeries. The method is eachSeries Your code would look like this: var async = require('async'); router.route('/user/:_id/host/:_id/joineeList').get(function (req, res) { var finalList = []; Host.findOne({ _id: req.params._id }, function (err, host) { if (err) { res.send(err); } else { var count = host.joinees.length; var limits = []; for (var i = 0; i &lt; count; i++) { limits.push(i); } async.eachSeries(limits, function (i, callback) { console.log(host.joinees[i].userid); var ID = host.joinees[i].userid; var CODE = host.joinees[i].status_code; User.findOne({ _id: host.joinees[i].userid }, function (err1, user) { if (err1) { console.log(err1); } else { finalList.push({ "userId": ID, "name": user.name, "profilepic": user.profilepic, "status": CODE }); callback(); } }); }, function() { console.log(finalList); }); } }); }); Let me know if it helped
answers question: http://stackoverflow.com/q/27426147

http://stackoverflow.com/q/27336704
has comment: http://stackoverflow.com/comment/43130275
downvote count: 0
has comment: http://stackoverflow.com/comment/43130330
has comment: http://stackoverflow.com/comment/43131330
has comment: http://stackoverflow.com/comment/43130122
favorite count: 0
type: UnansweredQuestion
has title: After closing the WinJS appbar , content becomes unscrollable
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/43131306
has comment: http://stackoverflow.com/comment/43130345
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43130171
has comment: http://stackoverflow.com/comment/43130697
has comment: http://stackoverflow.com/comment/43130161
tagged with: winjs
has comment: http://stackoverflow.com/comment/43130631
has comment: http://stackoverflow.com/comment/43130093
tagged with: javascript
has body: I'm creating my first app here's a picture of what I'm talking about: After I click on the appbar and then I close it , I can't scroll down to see the rest of the text. Here's how the code for the appbar looks: command1 command2 command3 command4 I use fragments to navigate using the appbar and I display the fragments in the main_content so idk why it has problems.

http://stackoverflow.com/comment/43145528
type: Comment
type: QuestionComment
score: 0
has text: So far, you're not doing anything related to AJAX, you're just passing a querystring value along on your URL. Researching on how to retrieve a querystring value via JavaScript will help you quite a bit.
comment on: http://stackoverflow.com/q/27345037

http://stackoverflow.com/comment/43155792
score: 0
type: Comment
type: QuestionComment
has text: @Todd thanks. ive never used jsfiddle. Im new to this since i'm in college. I added the link.
comment on: http://stackoverflow.com/q/27350551

http://stackoverflow.com/q/27376724
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: -3
has title: Align text inside div using CSS?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27376972
favorite count: 0
tagged with: tinymce
type: Question
has comment: http://stackoverflow.com/comment/43203724
tagged with: css
answer count: 1
downvote count: 3
has body: How to align the two parts of equation in a single line. Please look the picture given, Both parts are inside a div. The HTML structure is like this.. &lt;div&gt; &lt;table&gt; //the first part here(red circle) &lt;/table&gt; second part here(blue circle) &lt;/div&gt; I can only access the div. Rest of them are dynamically created. So by providing a style to div how can I align the both parts in a single line. I can't change the structure. This alignment issue is only occurs in TinyMCE editor. When i print the equation in normal div, this is aligned properly. Please give me a solution using CSS or tinyMCE feature which is really helpful. Thank you.
has comment: http://stackoverflow.com/comment/43203496

http://stackoverflow.com/comment/43250265
score: 0
type: Comment
has text: Thx for the hint. After a search i found this solution http://jsbin.com/yaxujizorexo
type: AnswerComment
comment on: http://stackoverflow.com/a/27402656

http://stackoverflow.com/comment/43376300
has text: can `ember-cli-pagination` make queries like `posts/1/comments?page=3`.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27470631

http://stackoverflow.com/comment/43108506
type: Comment
comment on: http://stackoverflow.com/a/27324059
type: AnswerComment
has text: it should be working, are you sure of the js file name and path?!
score: 0

http://stackoverflow.com/a/27351928
answers question: http://stackoverflow.com/q/27351523
has comment: http://stackoverflow.com/comment/43194487
score: 0
has comment: http://stackoverflow.com/comment/43158317
has comment: http://stackoverflow.com/comment/43159105
type: Answer
has comment: http://stackoverflow.com/comment/43158091
has comment: http://stackoverflow.com/comment/43158258
has body: I think the issue is here: function init() { // var classname = document.getElementsByClassName("files"); // alert(classname); document.querySelector('#files').addEventListener('change', handleFileSelect, false); /* for (var i = 0; i &lt; classname.length; i++) { alert(classname.length); classname[i].addEventListener('change', handleFileSelect, false); }*/ } document.querySelector('#files') is an ID selector and its attaching to the file inputs properly. You should select all of the file inputs using the class name instead like so: var f = document.querySelectorAll('.files'); for (var i = 0; i &lt; f.length; i++) { f[i].addEventListener("change", handleFileSelect, false); }
has comment: http://stackoverflow.com/comment/43158671
has comment: http://stackoverflow.com/comment/43158421
has comment: http://stackoverflow.com/comment/43158626
has comment: http://stackoverflow.com/comment/43159325
has comment: http://stackoverflow.com/comment/43176389

http://stackoverflow.com/a/27399579
score: 0
has comment: http://stackoverflow.com/comment/43248771
has body: You can use root scope.Root scope is shared among all controllers and all html templates.so just store your user profile data in root scope.
type: Answer
answers question: http://stackoverflow.com/q/27398111
has comment: http://stackoverflow.com/comment/43275592

http://stackoverflow.com/comment/43171203
score: 0
has text: Do you have a link to the actual link of the page? Or could you create a jsfiddle to demonstrate the error? Otherwise it's difficult for us, for example $window could be undefined
comment on: http://stackoverflow.com/q/27359524
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27359487
has comment: http://stackoverflow.com/comment/43171963
has body: I am trying to add a second class to my element Before Text After Text here is my javascript code (tried but no success): window.onload = function() { document.getElementById('class1').className = 'class2'; }; UPDATE actually, all of your answers work, but since this (class1) is a click event, by running the codes it temporarily adds the second class (class2) to the class1 but when page is reloaded , it has disappeared. I need to implement it via a click event by clicking class1. How do I do it? 2nd UPDATE actually the site users have the ability to change this class, so I am trying to make this happen: that a user changes a class by clicking on class1 and making it "class1 class2"
answer count: 2
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27359509
favorite count: 0
has comment: http://stackoverflow.com/comment/43171088
has comment: http://stackoverflow.com/comment/43171084
type: AnsweredQuestion
has title: javascript add class to an anchor when page loaded
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/27359509
has answer: http://stackoverflow.com/a/27359543
type: Question
score: -2
possible better answer: http://stackoverflow.com/a/27359543
tagged with: javascript

http://stackoverflow.com/a/27374661
downvote count: 0
has body: Not being funny - but why must it be a regular expression? Is there are reason why you couldn't simplify the process using URL (or webkitURL in Chrome and Safari) - the URL constructor simply takes a string and then contains properties for each part of the URL. Whether it supports all the host types that you want to support, I don't know. Granted, you might still need a regex after that (although really you'd just be checking that the hostname ends with either yahoo.com or google.com), but you would just be running it against the hostname of the URL object rather than the whole URI. The API is not ubiquitous, but seems reasonably well supported and, anyway, if this is client-side validation then I hope you're checking it on the server, too, because sidestepping javascript validation is easy.
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/27374283
type: Answer
has comment: http://stackoverflow.com/comment/43209554

http://stackoverflow.com/a/27387778
type: Answer
has body: Well my ignorance is showing again. It looks like the problem stems from my not understanding how console.log works. It seems that console.log has some goofy behavior when you try to use it to display an object's property values. console.log will not display the value of the objects properties that exist when the console.log line is executed. Though the location in the output will be consistent with the location of the console.log call, the values reported will be those that exist in the object at the end of script execution. Here is a more complete description: console.log object at current state Thanks.
score: 1
answers question: http://stackoverflow.com/q/27363205
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/27453015
has body: I'm missing something using UI-Router. In my views it will load the partial &amp; JSON when the page loads. On state change, the partial loads but the console states "Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!". main.js - config .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('main', { url: '/main', templateUrl: 'partials/main/main.html', controller: 'mainController' }) .state('main.start', { url: '/start', templateUrl: 'partials/main/start.html', controller : 'startController' }) .state('main.end', { url: '/end', templateUrl: 'partials/main/end.html', controller : 'endController' }) //default state $urlRouterProvider.otherwise('/main/start'); }); controllers.js .controller('mainController', function($scope, $http) { $scope.sectionMain = 'partials/main.html'; }); .controller('startController', function($scope, $http) { // Get Data $http.get('data/start.json').success(function(datafile) { $scope.data = datafile; }); }); .controller('endController', function($scope, $http) { // End Data $http.get('data/end.json').success(function(datafile) { $scope.data = datafile; }); }); Markup &lt;div ng-repeat="d in data"&gt; &lt;p&gt;{{ d.heading }}&lt;/p&gt; &lt;/div&gt; Again, if I hit refresh on any of the views it loads both the partial and the data. When I switch via the ui-sref attributes it just loads the partial with the aforementioned error. Thanks in advance.
answer count: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43344958
type: Question
has comment: http://stackoverflow.com/comment/43358336
tagged with: javascript
tagged with: jquery
has title: Angular ui-router only runs controller's http.get on page load not state change
score: 0
has comment: http://stackoverflow.com/comment/43345586
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/43129842
type: QuestionComment
comment on: http://stackoverflow.com/q/27336047
has text: @putvande, I think window.innerWidth will not work in IE8 and below, but the expressions mentioned in this post will work in IE8 and below.
score: 0
type: Comment

http://stackoverflow.com/a/27465349
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/27465030
has comment: http://stackoverflow.com/comment/43367365
answers question: http://stackoverflow.com/q/27465030
has body: The problem is that contents is the same for leftDrawer and rightDrawer. Therefore, if you append it twice, it will me moved but not copied. You must copy it yourself: drawer.appendChild(contents.cloneNode(true)); function Modeler () { var modeler = document.createElement('div'); modeler.id = 'modeler'; document.body.appendChild(modeler); } function Drawer (id, side, contents) { var drawer; this.id = id; this.side = side.toLowerCase(); drawer = document.createElement('div'); drawer.className = 'drawer' + ' ' + 'drawer' + (side[0].toUpperCase() + side.slice(1)); drawer.id = id; if (contents) drawer.appendChild(contents.cloneNode(true)); else console.log('No content given to Drawer'); document.getElementById('modeler').appendChild(drawer); } var modeler = new Modeler, thing = document.createElement('div'); thing.innerHTML = 'hello world'; var leftDrawer = new Drawer('leftDrawer', 'left', thing), rightDrawer = new Drawer('rightDrawer', 'right', thing);

http://stackoverflow.com/q/27469885
favorite count: 0
upvote count: 2
has title: Pass Socket to Module in Node.js using Socket.io
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27470667
has body: I have a Module var exports = module.exports = {}; exports.refresh = function (msg) { socket.emit('refresh', { message: msg }); } exports.lock = function (msg) { socket.emit('lock', { message: msg }); } and in my server.js I defined var io = require("socket.io").listen(server); and call the module var period = require('./server/functions/period.js'); How can I pass Socket to the Module (period.js) so that I have access on the socket methods, for example socket.emit, broadcast and io.sockets.emit.
tagged with: socket.io
type: Question
score: 2
downvote count: 0
tagged with: websocket
tagged with: javascript
has answer: http://stackoverflow.com/a/27470667
answer count: 1

http://stackoverflow.com/q/27335338
has comment: http://stackoverflow.com/comment/43127857
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27335475
has comment: http://stackoverflow.com/comment/43127709
tagged with: angularjs
has body: I have something like this in the view: &lt;div ng-repeat="thread in threads"&gt; &lt;div id="conversation-{{thread.id}}"&gt; &lt;img src="{{ imageloader.image }}"/&gt; &lt;/div&gt; &lt;/div&gt; and in the controller (imageloader) function which set imagesloader.image = 'path/to/image'; I need to refer only for particular imageloader.image not all of them, from all boxes. Because at this moment (i.e when I have 10 divs), and run controller function then image show up in all divs from repeat. Any ideas?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43127970
has answer: http://stackoverflow.com/a/27339333
has title: How to refer to particular variable in scope, using ng-repeat
type: Question

http://stackoverflow.com/a/27330276
has comment: http://stackoverflow.com/comment/43136005
answers question: http://stackoverflow.com/q/27330149
score: 0
has comment: http://stackoverflow.com/comment/43119352
has comment: http://stackoverflow.com/comment/43119111
has body: You need a server side script to handle modifications to anything at the server you cannot just use client side jQuery. The script will also check who is authorized to write to the file or otherwise anyone can modify/update your XML file which is a security problem and probably is what you don't want. Please could you include all of your code? I mean what is vvmUrl ? Are you using some web service? Is your code making call to another domain, why crossDomain: true? EDIT: This should work in jQuery 1.7.2+ var username = 'myUser'; var password = 'myPassword'; $.ajax ({ type: "PUT", url: vvmsUrl, contentType: 'application/xml', async: false, crossDomain: true, username: username, password: password, data: xmlData, success: function (){ alert('Works!'); } });
type: Answer
has comment: http://stackoverflow.com/comment/43119038
has comment: http://stackoverflow.com/comment/43118880

http://stackoverflow.com/q/27399208
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery-plugins
has answer: http://stackoverflow.com/a/27449048
accepted answer: http://stackoverflow.com/a/27449048
has title: Move to Last tab on Click jQuery
answer count: 2
has answer: http://stackoverflow.com/a/27399393
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am using jquery tabs for my site.Now i want to move to last tab on certain conditions.For that i write some code but didn't work.My tab code is : Step 1 Step 2 Step 3 Step 4 I am trying to move from step1 to step4.I am using this code to move next.I am calling that function like this change('step1');.But when i try like this change('step4'); its not working.It moves to second step instead of 4th. jQuery('a.btn').each(function () { jQuery('.wizard a[data-toggle="tab"]').removeClass('current'); jQuery('.wizard a[href="#'+hrf+'"]').click(); }); Some other code : jQuery(document).ready(function(jQuery) { jQuery('.wizard a[data-toggle="tab"]').each(function () { jQuery(this).on('shown.bs.tab', function () { jQuery('.wizard a[data-toggle="tab"]').removeClass('current'); jQuery(this).addClass('current'); }); });
score: 1
has comment: http://stackoverflow.com/comment/43243959
possible better answer: http://stackoverflow.com/a/27399393
upvote count: 1
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/27467151
accepted answer: http://stackoverflow.com/a/27467696
score: 2
has title: Trigger a html button inside a web browser control
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27467696
tagged with: vb.net
type: Question
possible better answer: http://stackoverflow.com/a/27467924
tagged with: c#
has body: in my web browser control i am accessing a form: Submit How can i trigger this button automatically from vb.net application? how can i set text to the text area? am accessing the text box as follows: WebBrowser1.Document.GetElementById("InputEmail1").SetAttribute("value", "Sample") WebBrowser1.Document.GetElementById("InputPassword1").SetAttribute("value", "Sample") i cannot access button and text area since it does not have an id or name? is their any possibility to do like this?
upvote count: 2
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: webbrowser-control
favorite count: 0
has answer: http://stackoverflow.com/a/27467924
tagged with: winforms

http://stackoverflow.com/a/27317796
type: Answer
upvote count: 2
score: 2
downvote count: 0
has body: You can use jquery's serialize function for that purpose like this: $('form#login').serialize() It will create query string which can be handled in back end. Official document can be found here. If you need actual code for query string to JSON you can use plugin or following function function QueryStringToJSON(query_string) { var pairs = query_string.split('&amp;'); var result = {}; pairs.forEach(function(pair) { pair = pair.split('='); result[pair[0]] = pair[1]; }); return JSON.parse(JSON.stringify(result)); } Note: In your html you did not set name attribute for inputs. You should set them in order to get query string.
answers question: http://stackoverflow.com/q/27317718

http://stackoverflow.com/a/27316204
type: Answer
answers question: http://stackoverflow.com/q/27313861
has body: You have to add all javascript's files used in your view in the working order using script method of Html object in your header section or at the end of your ctp file. For example: I will suppose that you have not added jquery and your addnumber before, so at the end of your ctp file: &lt;?php echo $this-&gt;Html-&gt;script(array('jquery','addNumber')); ?&gt; Regard the order, i.e jquery must be before addNumber and both of them must be in webroot/js/
score: 0

http://stackoverflow.com/comment/43214504
type: QuestionComment
comment on: http://stackoverflow.com/q/27382604
score: 0
has text: This is a bit special. I tested it in the embedded chromium engine v8 in Adobe InDesign and found this problem. In parallel, I have just tested it in firefox, chrome and safari, and this works fine. Maybe a bug in InDesign chromium engine?
type: Comment

http://stackoverflow.com/comment/43332274
score: 0
type: Comment
type: QuestionComment
has text: So there has to be some 'event'? Can this be from the server and not just called in the browser by javascript?
comment on: http://stackoverflow.com/q/27446371

http://stackoverflow.com/comment/43133081
score: 1
has text: actually, show us the whole code, you might be binding the buttons too early (something jQuery doesn't warn/complain about)
comment on: http://stackoverflow.com/q/27338259
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27464756
has answer: http://stackoverflow.com/a/27618905
has comment: http://stackoverflow.com/comment/43377264
has comment: http://stackoverflow.com/comment/43376287
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43371876
has title: Use Javascript to export snapshots from a PDF's bookmarks
has body: I would like to make a PDF bookmarks outline into a series of snapshots of those bookmarks (with their name as the text of the bookmark). For instance, a PDF with the following 3 bookmarks: Book_root sub_bookmark_1 sub_bookmark_2 Would turn into 3 snapshots named "Book_root", "sub_bookmark_1", "sub_bookmark_2". The snapshots would be of the view in the PDF that the bookmark points to. I can program in python and other programming languages, but cant seem to find any practical reference guide on how to start this task. I don't know yet how to program what I want, but the logic would start similar to this pseudo python code: count = 0 for bookmark in root_bookmark.subtree(): go_to_bookmark_view() count = count+1 save_snapshot_as_png("c:/exported_pdf/"+bookmark.tittle()+str(count)) Where could I check the methods I need, possibly with code examples? Thank you very much for reading.
has comment: http://stackoverflow.com/comment/43371028
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/pdf
has comment: http://stackoverflow.com/comment/43370997
has comment: http://stackoverflow.com/comment/43366334

http://stackoverflow.com/q/27465135
tagged with: javascript
has title: Add space separator to number in input box
tagged with: jquery
has answer: http://stackoverflow.com/a/27465444
upvote count: 4
answer count: 2
accepted answer: http://stackoverflow.com/a/27465444
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43366622
type: AnsweredQuestion
score: 4
has answer: http://stackoverflow.com/a/27465206
type: Question
has body: I'm trying to get an input box to display numbers with space separator. Like this: 20 000 and 20 000 000 instead of 20000 and 20 000 000 The thing is that I want this to happen as you type. So when you type a number into an input element I want this spacing to be added on the fly. Does anyone have a good solution for this? I'm using this function to do this on static outputs, but it doesn't work well when getting the value from a textbox, running it through the function and then putting it back, for some reason. function delimitNumber(number) { var delimiter = " "; number = new String(number); var parts = number.split('.', 2); var decimal = parts[1]; var i = parseInt(parts[0]); if(isNaN(i)) return ''; var minus = ''; if (i &lt; 0) minus = '-'; i = Math.abs(i); var n = new String(i); var a = []; while(n.length &gt; 3) { var nn = n.substr(n.length-3); a.unshift(nn); n = n.substr(0,n.length-3); } if (n.length &gt; 0) a.unshift(n); n = a.join(delimiter); if (typeof decimal === 'undefined' || decimal.length &lt; 1) number = n; else number = n + '.' + decimal; number = minus + number; // Assemble the number with negative sign (empty if positive) return number; }
possible better answer: http://stackoverflow.com/a/27465206

http://stackoverflow.com/comment/43339759
type: QuestionComment
score: 3
has text: What's this got to do with ColdFusion? It's a JS question.
comment on: http://stackoverflow.com/q/27450438
type: Comment

http://stackoverflow.com/q/27315799
upvote count: 2
has comment: http://stackoverflow.com/comment/43091575
tagged with: http://stackoverflow.com/tag/json
score: -4
has answer: http://stackoverflow.com/a/27315855
tagged with: mysql
type: Question
tagged with: javascript
has body: I am making a quiz in PHP. I have many questions in my database, User will select the category, and the questions from that category will be displayed. I have two questions regarding this: Can I display questions one by one in php without using java script? When there are two users on my site, and they select two different categories, will the variable I am posting to the database be overwritten?
has comment: http://stackoverflow.com/comment/43091598
answer count: 3
accepted answer: http://stackoverflow.com/a/27315855
favorite count: 0
has answer: http://stackoverflow.com/a/27315896
has comment: http://stackoverflow.com/comment/43091595
tagged with: php
downvote count: 6
possible better answer: http://stackoverflow.com/a/27315844
has title: Can the variables in my php website over written, if there are two users from different locations?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27315844

http://stackoverflow.com/comment/43337572
type: Comment
type: QuestionComment
has text: for starters try `ng-if="group.children.length"`
score: 2
comment on: http://stackoverflow.com/q/27449241

http://stackoverflow.com/q/27372544
has body: I want to access the following code using java script. Can anyone help me please? I'm a beginner to JavaScript. &lt;input type="text" name="username" /&gt; I wish to access the element from its name property. An alert box needs to be shown if the length of element value is less than 6.
has answer: http://stackoverflow.com/a/27372743
has comment: http://stackoverflow.com/comment/43196036
type: Question
has comment: http://stackoverflow.com/comment/43221547
has comment: http://stackoverflow.com/comment/43196660
has answer: http://stackoverflow.com/a/27372925
tagged with: javascript
has answer: http://stackoverflow.com/a/27372717
has answer: http://stackoverflow.com/a/27372584
favorite count: 0
has answer: http://stackoverflow.com/a/27372928
answer count: 5
has comment: http://stackoverflow.com/comment/43221553
has comment: http://stackoverflow.com/comment/43196066
score: -1
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43197108
downvote count: 3
has comment: http://stackoverflow.com/comment/43196240
has title: Accessing Input element through input name in javascript

http://stackoverflow.com/q/27443254
has answer: http://stackoverflow.com/a/27443337
has answer: http://stackoverflow.com/a/27443425
has answer: http://stackoverflow.com/a/27443448
has comment: http://stackoverflow.com/comment/43325739
has body: I want to start to learn the client side scripting to make a web page more dynamic while collecting some information about, came to know some programming languages like javascript, ajax are out there and I figured that jquery is javascript library(may be I'm wrong) but still I'm not sure (concepts are not cleared) that what actually are those. There are a lot of question to ask like : What is javascript and what can i do with it ? Details about jquery and do I need to know javascript for working with jquery ? What is angularjs and what can i do with it ? What is ajax and what can i do with it ? what is bootstrap and what can i do with it ? I basically work with PHP i.e. server side scripting and know a little bit of HTML and CSS. Do I need to be an expert in HTML and CSS to work with the language mentioned above ? Finally it will be helpful if a starting point to learn the client side scripting is suggested I mean from where I can start ?? A little bit of a guide line will be much appreciated. Too much confusion !!
has comment: http://stackoverflow.com/comment/43395593
type: Question
has title: bootstrap, javascript, jquery and ajax what are those?
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/27443634
downvote count: 3
answer count: 5
has answer: http://stackoverflow.com/a/27443371
upvote count: 0
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
score: -3

http://stackoverflow.com/a/27418049
has comment: http://stackoverflow.com/comment/43280950
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43286019
has comment: http://stackoverflow.com/comment/43280163
score: 7
answers question: http://stackoverflow.com/q/27417938
has comment: http://stackoverflow.com/comment/43289415
accepted answer of: http://stackoverflow.com/q/27417938
has comment: http://stackoverflow.com/comment/43288009
has comment: http://stackoverflow.com/comment/43287282
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43287503
has body: You can use insertBefore method. Something like this: var div = document.createElement('div'), // Create a new div script = document.scripts[document.scripts.length - 1]; // A reference to the currently running script div.innerHTML = 'Hello'; // Add some content to the newly-created div script.parentElement.insertBefore(div, script); // Add the newly-created div to the page A live demo at jsFiddle. Notice, that you can use external scripts as well.

http://stackoverflow.com/comment/43264680
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27408890
has text: @Steve I totally agree scopes of the directives are confusing. I found this doc giving a good overview: http://www.ng-newsletter.com/posts/directives.html
score: 0

http://stackoverflow.com/comment/43154452
comment on: http://stackoverflow.com/a/27349306
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the help. This works great! How could I put minutes in there as well?

http://stackoverflow.com/comment/43255910
type: Comment
type: QuestionComment
score: 1
has text: _"And, when I want to reference to it, I have: ` Interior `"_ No you don't. `href="#pageHome"` should do it.
comment on: http://stackoverflow.com/q/27405610

http://stackoverflow.com/q/27383368
has answer: http://stackoverflow.com/a/27383398
tagged with: javascript
tagged with: prototype
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43216086
has title: JS: prototypal inheritance child method gives me the function body
type: Question
accepted answer: http://stackoverflow.com/a/27383398
tagged with: prototypal-inheritance
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/27327408
has body: So i have this constructor function and some prototype methods: var test = function(name, surname){ this.name = name this.surname = surname } test.prototype.hello = function(){ console.log("hello " + this.name) } test.prototype.hi = function(name){ console.log("hi " + this.name) } test.prototype.hi.surname = function(){ console.log("hi " + this.surname + this.name) } And i call it like this: var hii = function(){ var x = new test("kevin", "vanhove") x.hello() x.hi.surname() }() Why is it that the call to x.hi.surname() is giving me this output (function body)? hello kevin hi function (){ console.log("hi " + this.surname + this.name) }
possible better answer: http://stackoverflow.com/a/27383560
has answer: http://stackoverflow.com/a/27383560

http://stackoverflow.com/comment/43179152
comment on: http://stackoverflow.com/q/27363583
has text: This is a semantic error (incorrectly formed code) not sure why it has been upvoted as a question. You should be using a debugger.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/43295783
score: 1
type: AnswerComment
has text: @PSL: Yea but problem is that if we dont have the data other than in html, we need to access it to get the desired values. It doesnt have to be in the controller, but it needs to be somewhere.
type: Comment
comment on: http://stackoverflow.com/a/27426980

http://stackoverflow.com/a/27415157
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
has body: This seems to work $('input, textarea').powerTip({ manual: true }); // have to prevent default plugin $('input, textarea').on({ 'select': function() { var selectedText = window.getSelection().toString(); $(this).powertip('show'); }, 'blur': function() { $.powerTip.hide(); } });
has comment: http://stackoverflow.com/comment/43343329
accepted answer of: http://stackoverflow.com/q/27414639
answers question: http://stackoverflow.com/q/27414639

http://stackoverflow.com/a/27403686
score: -1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27403257
has body: I would recommend throwing regex at it. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&amp;redirectslug=JavaScript%2FGuide%2FRegular_Expressions Search "data" for matches to: your ERROR text, then any characters, then newline. And then just loop through and print out the matches, for example in paragraph tags. EDIT -- here's how... function filter(file) { var pattern = /ERROR.*/g var matches = file.match(pattern); for (var match in matches) { $('#myTarget').append('&lt;p&gt;'+match+'&lt;/p&gt;'); } } I would personally add error checking and CSS classes, and build all of the HTML as an array then append it all at once, and other cool things -- but then I'd just be doing your job for you. :) Kieron
upvote count: 0

http://stackoverflow.com/comment/43097401
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27319043
has text: IMHO no you can't :)

http://stackoverflow.com/comment/43274382
has text: I guess you are talking about the scope where the method is called, and I'm talking about the scope inside the method, as it's executing.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27414940
type: AnswerComment

http://stackoverflow.com/q/27466306
has title: xPath - Extracting a contents of a href from an anchor link
accepted answer: http://stackoverflow.com/a/27466337
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am having difficulty extracting the contents of a href from an anchor tag with xPaths. I want to extract the contents of the href only, not the text contained within the anchor elements. This is what I've come up with so far but it doesn't seem to be working. //a/@href[contains("@", 'mailto')]/text() I also tried: //a/href[contains("@", 'mailto')]/text() Anyone have any suggestions, greatly appreciated!
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: xpath
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27466337
upvote count: 1
type: Question
score: 1

http://stackoverflow.com/a/27355164
downvote count: 0
has comment: http://stackoverflow.com/comment/43163443
has body: You need to event.stopPropagation() in the click: $('#global-nav li:has(ul)').click(function(e){ e.stopPropagation(); // it stops the event to bubble up to the parent elems $(this).find('&gt; ul').stop().slideToggle(400); });
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27355004

http://stackoverflow.com/comment/43218769
comment on: http://stackoverflow.com/a/27381319
type: AnswerComment
has text: concat uses the through module and uglify the through2 one. That might [cause some trouble](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)
type: Comment
score: 0

http://stackoverflow.com/comment/43419461
has text: Actually, `0.9999999999999999` will be rounded to the nearest Double, which is `0.99999999999999988897769753748434595763683319091796875`, or *exactly* 1-2^-53
type: Comment
comment on: http://stackoverflow.com/a/27483931
score: 1
type: AnswerComment

http://stackoverflow.com/q/27346037
tagged with: javascript
answer count: 3
tagged with: jquery
favorite count: 0
has title: Replacing JS animate by jquery ui fold effect
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: I'm currently using the code below, which works great. However I'm experiencing a few issues/limtations that make me think that it would be more appropriate to use jQuery UI fold effect instead of js animate function. As I'm not very familiar with JS could you please help me to adapt the code below to use jQuery UI fold effect rather than animate function? Many thanks http://jsfiddle.net/rnjea41y/ JS: $("a").click(function () { var page = $(this).data("page"); if ($('div:animated').id != page) { var active = $(".fold.active"); // if there is visible fold element on page (user already clicked at least once on link) if (active.length) { active.animate({ width: "0" }, 200) .animate({ height: "0" }, 200, function () { // this happens after above animations are complete $(this).removeClass("active"); }); // clicking for the first time }; if (active.attr("id") != page) { $("#" + page) .addClass("active") .animate({ height: "500px" }, 1000, 'linear') .animate({ width: "500px" }, 400, 'linear') } } });
has answer: http://stackoverflow.com/a/27388012
has answer: http://stackoverflow.com/a/27508186
has answer: http://stackoverflow.com/a/27389855
has comment: http://stackoverflow.com/comment/43446495
downvote count: 1
possible better answer: http://stackoverflow.com/a/27388012
type: Question
accepted answer: http://stackoverflow.com/a/27389855
score: 8
upvote count: 9

http://stackoverflow.com/a/27342397
accepted answer of: http://stackoverflow.com/q/27342359
score: 1
has comment: http://stackoverflow.com/comment/43140871
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27342359
has body: IE < 9 doesn't 'know' Array.indexOf, so you'll need a polyfill for it. You can find that @MDN You can also use Array.filter to remove the array containing '2.4.1' (see snippet): arr = arr.filter( function (v) { return v[0] !== '2.4.1'; } ); For IE < 9 you need this polyfill. // check for presence of Array.filter and if necessary add it polyfills(); // declarations var str = '2.4.1'; var arr = [ ['1.1.3', 1001003, 'XXX', 'aaa', 'a3'], ['1.1.1', 1001001, 'XXX', 'aaa', 'a1'], ['1.3.1', 1003001, 'XXX', 'ccc', 'c1'], ['2.4.2', 2004002, 'YYY', 'ddd', 'd2'], ['2.4.1', 2004001, 'YYY', 'ddd', 'd1'], ['1.2.2', 1002002, 'XXX', 'bbb', 'b2'], ['1.2.1', 1002001, 'XXX', 'bbb', 'b1'], ]; var result = document.querySelector('#result'); // show original result.innerHTML = 'arr initially: ' + arr.map( function (v) { return v.join(); } ).join(' '); // remove using filter arr = removesub(arr, str); // show array after removal result.innerHTML += ' arr after removing: '+ arr.map( function (v) { return v.join(); } ).join(' '); // removal function function removesub(arr2RemoveFrom, str2Remove) { arr2RemoveFrom = arr2RemoveFrom.filter( function (v) { return v[0] !== str2Remove; } ); return arr2RemoveFrom; } function polyfills() { // source MDN. Removed.comments if (!Array.prototype.filter) { Array.prototype.filter = function(fun/*, thisArg*/) { 'use strict'; if (this === void 0 || this === null) { throw new TypeError(); } var t = Object(this); var len = t.length >>> 0; if (typeof fun !== 'function') { throw new TypeError(); } var res = []; var thisArg = arguments.length >= 2 ? arguments[1] : void 0; for (var i = 0; i < len; i++) { if (i in t) { var val = t[i]; if (fun.call(thisArg, val, i, t)) { res.push(val); } } } return res; }; } if (!Array.prototype.map) { Array.prototype.map = function(callback, thisArg) { var T, A, k; if (this == null) { throw new TypeError(' this is null or not defined'); } var O = Object(this); var len = O.length >>> 0; if (typeof callback !== 'function') { throw ne…
has comment: http://stackoverflow.com/comment/43140489
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43318373
has text: @user2202257 You are confusing HTML and jQuery with DOM. DOM is a standard for XML representation and manipulation of documents. So you **are** looking for DOM. You should use DOMParser as described in this answer.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27438695
type: AnswerComment

http://stackoverflow.com/comment/43340284
score: 0
type: AnswerComment
has text: I was thinking that this may be the solution but it just seems like there HAS to be something that I'm missing that would make it not update appropriately. Constantly triggering an apply seems wasteful and seems like more of a hacked solution. It may be my only one though.. I'll try it out
type: Comment
comment on: http://stackoverflow.com/a/27450327

http://stackoverflow.com/comment/43400741
score: 0
type: AnswerComment
has text: @hny2015 ok, thanks for providing the HTML. I've updated the xpath, please recheck.
type: Comment
comment on: http://stackoverflow.com/a/27435588

http://stackoverflow.com/a/27437123
has body: You've got some answers of RegExp. Alternatively, you could just find the index of the point and retrieve a substring, if you don't care about rounding. var str = '-81.82297519999997'; var truncated = str.substring(0, str.indexOf('.') + 9); // this will give you 8 fractions console.log(truncated); // "-81.82297519"
accepted answer of: http://stackoverflow.com/q/27434437
answers question: http://stackoverflow.com/q/27434437
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43339816
type: Answer
upvote count: 1

http://stackoverflow.com/a/27354570
score: 1
answers question: http://stackoverflow.com/q/27354139
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: There are some definite advantage of using eventing: Decoupling is the first as you highlighted. Events allows us to add more subscribers in the future. For example on someEvent you not only want to log something but also do something else, then create a subscriber to handle the new scenario. Eventing does have some disadvantages: Execution is not linear anymore, hence debugging becomes a little difficult. Too many events and debugging can become a nightmare. This also affects code readability as you are not sure what exactly is happening just by reading parts of the code. We should not depend upon order of execution of events. If we want ordered execution eventing is not a right fit. I personally use eventing for taking care of scenarios which are not part of main process flow. Logging is a good example of such a feature.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27354139

http://stackoverflow.com/q/27350817
score: 0
answer count: 2
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27350869
has answer: http://stackoverflow.com/a/27455304
has comment: http://stackoverflow.com/comment/43155951
has title: Reload html page with new title
has comment: http://stackoverflow.com/comment/43348114
tagged with: jquery
has body: I have same page (or anchor tag) links in a single html document. When a user clicks these links, they open that same html document in a new tab. How can that new tab have a new document title? The problem with my code below is that it renames the current tab's title (not the new one just opened). There is a default title for my page that I want to have when you first load the page. Of course, all subsequent new pages loaded set this for their title. Default title click me
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/43238639
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27395598
has text: @galovics can you please explain why it's not good to keep business logic code in JSP?? m new to JSP

http://stackoverflow.com/a/27384207
answers question: http://stackoverflow.com/q/27356681
score: 1
upvote count: 1
has body: Although you can get document.location and navigation to work (and note that it's document.location, not window.location), the recommended approach is to implement the app like a single-page web application, meaning that you "navigate" by dong DOM replacement inside default.html/index.html. That is, you're page context is always the default HTML page, so that you preserve the JavaScript context across "pages" and also keep the ability to navigate content in and out of the page smoothly. (document.location and links transition through a black screen and reset the JS context.) There are various ways to go about DOM replacement, but the mechanism built into WinJS is called WinJS.UI.Pages. The best way to explore the mechanism is to create a new app project using the Navigation template. What this gives you is, briefly: A main page, default.html, that is the single HTML page context. This declares a single div containing an Application.PageControlNavigator control, which is initialized with a reference to the "home" page. A pages folder in which there's a home/home.html, .js, and .css (these will be split across shared folders in a universal app project, mind you). A navigator.js file within the js folder, which is loaded from default.html by default. This is the piece of code that listens to WinJS.Navigation.navigate calls and uses the WinJS.UI.Pages mechanism to load and navigate to another page using DOM replacement (you actually stay within default.html). It specifically looks for the PageControlNavigator control inside default.html, and all the DOM replacement happens within that div. In this model, home.html is your first page. To create additional pages, right click on the pages folder and select Add > New Item > JavaScript > Page Control. This will give you another set of HTML, CSS, and JS files for another WinJS "page", specifically with the JS containing a WinJS.UI.Pages.define call to set up the necessary object structure. You can move these files around--jus…
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27356681
type: Answer

http://stackoverflow.com/q/27377176
has title: Get values from json array using javascript or php
type: Question
has answer: http://stackoverflow.com/a/27377297
has comment: http://stackoverflow.com/comment/43203920
tagged with: javascript
upvote count: 1
answer count: 1
duplicate of: http://stackoverflow.com/q/7364150
favorite count: 0
linked to: http://stackoverflow.com/q/7364150
has body: Here is my code: var newval =[{"new_id":"1","new_no":"1","total":"N.A"},{"new_id":"2","new_no":"3","total":"4"},{"new_id":"2","new_no":"4","total":"5"}]; from this json value how to get details based on new_no value using javascript or php. function passfun(new_no) { alert(newval[0].plot_no); } I tried like this but its working based on json array values i not getting exact values based on new_no
tagged with: php
has comment: http://stackoverflow.com/comment/43204037
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27377297
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/43629574
score: 0
has text: I am not exactly sure what you need, can you explain in steps? --- "And now the normal tags are disabled. For normal tags without href="#" or target_blank I want the popup box to appear when clicking them." Change `if(isanchor || isblank){` to `if(!isanchor || !isblank){`
type: Comment
comment on: http://stackoverflow.com/a/27458952
type: AnswerComment

http://stackoverflow.com/a/27468080
type: AcceptedAnswer
downvote count: 0
has body: I think your problem is that when you change the ng-src to null the older value is retained in the image source. This is the proper angular behavior. You can find the details on this thread : https://stackoverflow.com/a/22094392/1649235 If you go through this thread you will also find a workaround i.e. don't put your image path as null where it is supposed to be empty, put it equal to '//:0'.
type: Answer
answers question: http://stackoverflow.com/q/27466872
accepted answer of: http://stackoverflow.com/q/27466872
upvote count: 1
score: 1

http://stackoverflow.com/comment/43150506
score: 1
comment on: http://stackoverflow.com/a/27347823
type: AnswerComment
type: Comment
has text: Also, here's a [quick update](http://jsfiddle.net/acjwqpsL/3/) to show "owner" in the bubble instead of "size".

http://stackoverflow.com/comment/43228701
type: AnswerComment
has text: why the downvote? This is exactly what you asked for in the question. Don't select as correct -- that would be fine. But to downvote is a bit harsh when the question was ambiguous.
type: Comment
comment on: http://stackoverflow.com/a/27390186
score: 0

http://stackoverflow.com/comment/43099360
score: 0
has text: You can see by using a regexp explainer, for example: http://rick.measham.id.au/paste/explain.pl
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27320022

http://stackoverflow.com/a/27418901
has comment: http://stackoverflow.com/comment/43285269
has comment: http://stackoverflow.com/comment/43284895
type: Answer
has comment: http://stackoverflow.com/comment/43284542
answers question: http://stackoverflow.com/q/27418805
has comment: http://stackoverflow.com/comment/43284993
has comment: http://stackoverflow.com/comment/43285165
has body: 1. Use view.getDocumentByKey(theUserName) to find a user document in your view. It returns the user document as NotesDocument or null if user is not in view. The view has to have a first sorted column with the usernamens. 2. As of Notes Domino version 9 you can debug SSJS.
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43285088
has comment: http://stackoverflow.com/comment/43284377
accepted answer of: http://stackoverflow.com/q/27418805

http://stackoverflow.com/comment/43346054
comment on: http://stackoverflow.com/a/27453906
type: AnswerComment
type: Comment
score: 1
has text: `My problem I don't know how to store 3 objects together. ` This is how you could store those objects together. Do you understand arrays / objects in JS?

http://stackoverflow.com/q/27334698
accepted answer: http://stackoverflow.com/a/27334892
tagged with: javascript
has comment: http://stackoverflow.com/comment/43127262
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43126636
has comment: http://stackoverflow.com/comment/43126553
type: Question
has body: So I am facing this issue which to me seems quite weird. Can't seem to understand what's going on here. I create a new Array. Pass it to as a parameter to a function which populates it. Then log the array on the console. It displayes the values properly. But on the very next line, if I log the length of the array , It gives me a 0 } else { var path = new Array(); fetchPath(arr[index].parentId,path); console.log(path); console.log(path.length); } This is fetchPath function fetchPath( id, path ) { chrome.bookmarks.getSubTree(id, function(subtree) { path.push(subtree[0].title); if(subtree[0].hasOwnProperty('parentId')) { fetchPath(subtree[0].parentId,path); } }); This is what I get on the console Array[4] 0:"India" 1:"News" 2:"Bookmarks Bar" 3:"" length:4 &gt;_proto_:Array[0] 0 Why is the length reported to be zero ? Infact no matter what I try and do with the array it fails because I've leterally lost it. I've put the entire JS file here http://jsfiddle.net/1u4zngko/
has answer: http://stackoverflow.com/a/27334793
answer count: 2
linked to: http://stackoverflow.com/q/23667086
has comment: http://stackoverflow.com/comment/43126621
has answer: http://stackoverflow.com/a/27334892
has title: Losing Javascript Array in the Next Line
has comment: http://stackoverflow.com/comment/43127274
possible better answer: http://stackoverflow.com/a/27334793
has comment: http://stackoverflow.com/comment/43126423
score: 0
has comment: http://stackoverflow.com/comment/43127422

http://stackoverflow.com/q/27363835
score: 0
tagged with: haml
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43179645
favorite count: 0
has comment: http://stackoverflow.com/comment/43232158
has title: Haml injecting `%tr` tags in `%thead`
has body: I'm currently debugging a jquery.tablesorter application, where tables can be automatically augmented with a UX for sorting its contents. It requires a particular schema: Col1 Col2 1 2 3 4 Notice the section under . Here is the Haml file I'm testing with: %table#foo.tablesorter %thead %th Col1 %th Col2 %tbody %tr %td 1 %td 2 %tr %td 3 %td 4 However, this is the Html being generated: Col1 Col2 1 2 3 4 There is an extra in our ! How should I go about sidestepping this? I'm sure Haml provides functionality for enumerating Ruby arrays into table rows, but I really need this to be more standard.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43179687
answer count: 0
has comment: http://stackoverflow.com/comment/43179600
tagged with: tablesorter
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43179723
has comment: http://stackoverflow.com/comment/43179667
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43184302

http://stackoverflow.com/comment/43187381
has text: If you can't trust the security of a file on disk, you've got bigger problems. Lock down your system properly and this is a non-issue.
type: AnswerComment
score: 3
type: Comment
comment on: http://stackoverflow.com/a/27366930

http://stackoverflow.com/comment/43203425
type: Comment
has text: It still doesn't consider that one period can have dates in different table rows.
score: 0
comment on: http://stackoverflow.com/a/27376689
type: AnswerComment

http://stackoverflow.com/comment/43346714
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27453683
has text: I changed to this ````{ parent: $(this).val() }```` as you said and still doesn't work.
type: Comment

http://stackoverflow.com/q/27335921
has answer: http://stackoverflow.com/a/27336098
tagged with: respond-to
possible better answer: http://stackoverflow.com/a/27336098
tagged with: http-redirect
has answer: http://stackoverflow.com/a/27336952
tagged with: ruby-on-rails
type: AnsweredQuestion
has body: There's this link: = link_to "Close", close_ticket_path(:id =&gt; ticket.id), :onclick =&gt; $(this).closest('tr').remove()", :remote =&gt; true which routes to tickets_controller#close: def close @ticket = Ticket.find(params[:id]).update_attribute(:status, "closed") end By default, this action will redirect to views/tickets/close. How to disable this default redirect? I know how to specify custom redirect, but this is not what I need. The view is managed by the script and the db is modified in the action, so no more action is needed and I don't want the page to refresh. render won't work neither, as the content in question is loaded dynamically, so basically doing precisely nothing is what I need. I found this workaround to e.g. include respond_to :js and create empty close.js.erb file, or to move above :onclick to this file, but I want to do it idiomatically. As a matter of fact, the link works now as desired with the respond_to :js in the action (not included here), but console throws Missing template error, which is not very nice. I looked in Rails Redirecting, in JS with Rails, Rendering guide, and some more, but to no avail.
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27336952
tagged with: javascript
score: 0
has title: cancel default controller action's redirect

http://stackoverflow.com/comment/43367039
has text: Very well done. Please add an explanation of how this works, if you're after some rep :)
type: Comment
comment on: http://stackoverflow.com/a/27465444
score: 0
type: AnswerComment

http://stackoverflow.com/q/27454229
type: Question
tagged with: digest
has comment: http://stackoverflow.com/comment/45659458
has comment: http://stackoverflow.com/comment/43354913
tagged with: cycle
tagged with: animation
has title: Counting Angular's $digest Cycles
accepted answer: http://stackoverflow.com/a/28705349
answer count: 1
upvote count: 16
has comment: http://stackoverflow.com/comment/45544078
has comment: http://stackoverflow.com/comment/43346810
has comment: http://stackoverflow.com/comment/43346975
has comment: http://stackoverflow.com/comment/45616562
has comment: http://stackoverflow.com/comment/43358696
has comment: http://stackoverflow.com/comment/45562118
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45616976
favorite count: 0
score: 16
has answer: http://stackoverflow.com/a/28705349
has body: tl;dr: I want to have angular trigger css animations on page load. Is there a way to count angular's digest cycles within say, a controller or directive? long version: I have some angular animations which I want to run when the page loads, using ng-enter, ng-leave, ng-move and so on... with an ng-repeat directive. As of 1.3.6, I know that angular waits to apply any animations until after 2 digest cycles occur, so these animations aren't happening at all because the data is (almost always)loaded into the view on the first digest cycle of my application. (sauce: https://docs.angularjs.org/api/ngAnimate#css-staggering-animations) I'm wondering if there's some way that I can count digest cycles and either trigger the animations, or load the data in after the 2nd digest cycle? Also, if I wait until 2 digest cycles, is there a risk that the second cycle wont occur in some instances meaning that my data wouldn't load into the view? If this is the case, is there a way that I can guarantee that at least 2 digest cycles will occur every time? As a temporary fix, I'm using $timeout to load my data in after 500ms, but I know this is a really bad idea. relevant code: (changed some of the names of certain things because of an NDA on this project) html: &lt;div ng-repeat="pizza in pizzas" class="za" ng-click="bake(pizza)"&gt;&lt;/div&gt; css/sass (browser prefixes removed for brevity): .za { //other styles &amp;.ng-enter, &amp;.ng-leave, &amp;.ng-move { transition: all 1s $slowOut; transform: translate(1000px, 0px) rotateZ(90deg); } &amp;.ng-enter, &amp;.ng-leave.ng-leave-active &amp;.ng-move, { transform: translate(1000px, 0px) rotateZ(90deg); } &amp;.ng-enter.ng-enter-active, &amp;.ng-leave, &amp;.ng-move.ng-move-active { transform: translate(0, 0) rotateZ(0deg); } &amp;.ng-enter-stagger, &amp;.ng-leave-stagger, &amp;.ng-move-stagger { transition-delay: 2s; transition-duration: 0s; } } js: // inside a controller timeout(function() { scope.pizza = [ // actually injecting 'myData'…
tagged with: angularjs

http://stackoverflow.com/a/27441234
has comment: http://stackoverflow.com/comment/43322380
has comment: http://stackoverflow.com/comment/140250327
has comment: http://stackoverflow.com/comment/43322767
downvote count: 0
has comment: http://stackoverflow.com/comment/43323211
type: Answer
score: 6
has body: function titleCase(s) { return s .replace(/([^A-Z])([A-Z])/g, '$1 $2') // split cameCase .replace(/[_\-]+/g, ' ') // split snake_case and lisp-case .toLowerCase() .replace(/(^\w|\b\w)/g, function(m) { return m.toUpperCase(); }) // title case words .replace(/\s+/g, ' ') // collapse repeated whitespace .replace(/^\s+|\s+$/, ''); // remove leading/trailing whitespace } Example: ['UPPER CASE', 'camelCase', 'snake_case', 'lisp-case'].map(titleCase) // result: ["Upper Case", "Camel Case", "Snake Case", "Lisp Case"]
upvote count: 6
has comment: http://stackoverflow.com/comment/43322286
answers question: http://stackoverflow.com/q/27440917

http://stackoverflow.com/q/27321679
has body: I am trying to write regular expression to capture data, but struggling to finish it. From the data: Code:Name Another-code:Another name I need to get an array: ['Code:Name', 'Another-code:Another name'] The problem is that Codes can be almost anything but space. I know how to do it without using regular expressions, but decided to give them a chance. UPDATE: Forgot to mention that number of elements can vary from one to infinity. So the data: Code:Name -&gt; ['Code:Name'] Code:Name Code:Name Code:Name -&gt; ['Code:Name', 'Code:Name', 'Code:Name'] is also suitable.
has comment: http://stackoverflow.com/comment/43102956
has answer: http://stackoverflow.com/a/27321713
has answer: http://stackoverflow.com/a/27321834
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43102638
type: Question
possible better answer: http://stackoverflow.com/a/27321713
tagged with: javascript
has answer: http://stackoverflow.com/a/27321740
accepted answer: http://stackoverflow.com/a/27321740
has title: Regular expression improvement
score: 0
answer count: 3
tagged with: regex
has comment: http://stackoverflow.com/comment/43102618

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/27399988
tags question: http://stackoverflow.com/q/27404386
tags question: http://stackoverflow.com/q/27416966
type: Tag

http://stackoverflow.com/comment/43182136
comment on: http://stackoverflow.com/q/27365082
has text: you can put anything between parenthesis. `(a = 2)`. `a = (2)` `(a) = 32`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43142370
has text: I want to convert my json object values from p1 to their number notation.
score: 0
comment on: http://stackoverflow.com/a/27343226
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/135977273
has text: It's also possible to `let a, b; const { c } = { a, b } = { a: 1, b: 2, c: 3 };`, combining declaration and reassignment in the same expression. `const` can be `var`, `let`, or `const` as preferred. In Typescript, the variables can be typed according to need as well, and the compiler will catch any invalid type assignments.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/62849217

http://stackoverflow.com/a/27336098
answers question: http://stackoverflow.com/q/27335921
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43129965
has body: Try this: def close @ticket = Ticket.find(params[:id]).update_attribute(:status, "closed") render nothing: true, :status =&gt; 200 end
downvote count: 0
type: Answer

http://stackoverflow.com/a/27452334
answers question: http://stackoverflow.com/q/27452229
has body: This will get you the ids of all inputs that are checkboxes on the page into an array containing the value of the id. $(function() { var arr = new Array(); $("input[type='checkbox']").each(function(i, v) { arr.push($(v).attr("id")); }); })
has comment: http://stackoverflow.com/comment/43343292
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43343335
has comment: http://stackoverflow.com/comment/43343233
has comment: http://stackoverflow.com/comment/43343326

http://stackoverflow.com/comment/43185993
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27366848
score: 0
has text: It has been discussed in some other threads. Example: http://stackoverflow.com/questions/22348705/best-way-to-store-db-config-in-node-js-express-app What you can do is pass the db password as parameter to the node app (example: node myapp.js password_from_mysql)

http://stackoverflow.com/a/27379992
type: Answer
upvote count: 1
score: 1
has body: In your code, this refers to the document object, which doesn't have a name property, hence the error you are seeing. You need to initialize the autocomplete differently: var filter = "products"; $(".autocomplete").each(function(i, el) { $(el).autocomplete({ source: "http://example.com/autocomplete/" + filter + "/" + el.name, minLength: 2 }); }); And that should work.
accepted answer of: http://stackoverflow.com/q/27377568
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27377568

http://stackoverflow.com/comment/43296692
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27427495
has text: @MarcellFülöp I don't want to do that, I have my reasons, I need to do it inside the partial
type: Comment

http://stackoverflow.com/comment/43149708
has text: Browser doesn't reflow until the end of the function anyway, does it?
type: Comment
comment on: http://stackoverflow.com/a/27347460
score: 0
type: AnswerComment

http://stackoverflow.com/q/27465038
favorite count: 0
downvote count: 2
has answer: http://stackoverflow.com/a/27465138
has answer: http://stackoverflow.com/a/27465357
accepted answer: http://stackoverflow.com/a/27759355
upvote count: 1
has comment: http://stackoverflow.com/comment/43366838
has comment: http://stackoverflow.com/comment/43366533
type: AnsweredQuestion
has title: Combine divs within a for loop
type: Question
possible better answer: http://stackoverflow.com/a/27465077
tagged with: for-loop
has body: Is it possible to use a JavaScript for loop to combine a number of div's? I have 16 sets of these I am wanting to put into a for loop. The problem I am having is that its HTML not JavaScript I am trying to do this with. I haven't seen anything so far on how to go about this. Thanks for any help or suggestions. What the following code does is catch the data pre-defined from a 16X17 table and inserts it into one cell in my document. I then have have other code using the div id's that makes visible just the one I need. Update: Pulling data from table <!--Change "<Col1;" equala columns--> for (var x = 1; x<Col1; x++){window["aa"+x] = document.getElementById("part1Table").rows[0].cells[x+1].innerHTML;} <!--Change "<Row1;" equals rows--> for (var y = 1; y<Row1+1; y++){window["rows"+y] = document.getElementById("part1Table").rows[y].cells[1].innerHTML;} <!-- "<Col1;" equals columns----> for (var z1 = 1; z1 <Col1; z1++) {window["tab1a"+z1] = document.getElementById("part1Table").rows[1].cells[z1 +1].innerHTML;} for (var z2 = 1; z2 <Col1; z2++) {window["tab2a"+z2] = document.getElementById("part1Table").rows[2].cells[z2 +1].innerHTML;} for (var z3 = 1; z3 <Col1; z3++) {window["tab3a"+z3] = document.getElementById("part1Table").rows[3].cells[z3 +1].innerHTML;}
has answer: http://stackoverflow.com/a/27465077
has comment: http://stackoverflow.com/comment/43366609
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27759355
has comment: http://stackoverflow.com/comment/43366378
tagged with: http://stackoverflow.com/tag/html
answer count: 4

http://stackoverflow.com/a/27336688
type: Answer
has body: The problem is that you are storing the input element, not the value of the input element. The value can change while the input element stays the same. To store the value, you should do this: oldVal = $(this).closest('tr').find('input').val(); //... if (!result.result) { $(this).closest('tr').find('input').val(oldVal); }
answers question: http://stackoverflow.com/q/27336616
score: 0

http://stackoverflow.com/a/27350390
has body: First off, Backbone.navigate doesn't exist. Backbone.history.navigate does. But you still have another issue. Check out the Backbone.Router.navigate API: the first argument is the route you want to re-route to, NOT the function you want it to hit. This is what you are trying to do: var sampleA = function(){}; Backbone.history.navigate(sampleRouteA, {trigger: true}); This will not work. You need to define the router handler, then navigate to the specified route, which Backbone will handle. The following will (probably) work: var sampleA = function(){}; var someRoutes = Backbone.Router.extend({ routes: { 'sampleRoute/A': 'doSampleA', 'sampleRoute/B': 'doSampleB' }, 'doSampleA': function(){ sampleA(); }, 'doSampleB': function(){ }, }); Backbone.history.navigate('sampleRoute/A', {trigger: true}); Here is the corresponding jsFiddle. Open your devtools (F12 on Chrome), and watch the log as you type in an id and click the button. The url of the iframe will change to match the route, along with the id you provide. This is how Backbone routing should work.
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43225265
answers question: http://stackoverflow.com/q/27349990
has comment: http://stackoverflow.com/comment/43172094
accepted answer of: http://stackoverflow.com/q/27349990
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/43316349
type: Comment
comment on: http://stackoverflow.com/a/27438029
type: AnswerComment
score: 0
has text: oh my bad , when i test your code ,i did not change the href to '#', your code works great, thank you so much. and please help me understand why href="javascript:;" wont work

http://stackoverflow.com/comment/43112447
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27326490
has text: @Bhojendra-C-LinkNepal: Sorry, I forgot to put `.length` on the end of the `$.grep`, which is needed because it returns the filtered collection.
type: AnswerComment

http://stackoverflow.com/comment/43198449
type: Comment
has text: `return false;` means ignore this key input.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27373990

http://stackoverflow.com/q/27416125
has title: How to create a tooltip to select in HTML?
type: Question
tagged with: javascript
downvote count: 4
upvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43276853
has body: I want to create a tool-tip when clicking on the menu. But it is not working properly. It gives the output as below image. But I want it as the below image. Here is my HTML code. Default Format* PlayStation 4 PlayStation 3 XBox One XBox 360 We will always try to end games from your default format Here is my CSS code. label.atooltip {outline:none; } label.atooltip strong {line-height:30px;} label.atooltip:hover {text-decoration:none;} label.atooltip span { z-index:10;display:none; padding:14px 20px; margin-top:-30px; margin-left:28px; width:300px; line-height:16px; } label.atooltip:hover span{ display:inline; position:absolute; color:#111111; border:2px solid #eeeeee; background:#ffffff; } .callout { z-index:20; position:absolute; top:30px; border:0; left:-12px; } label.atooltip span { border-radius:4px; box-shadow: 5px 5px 8px #CCC; }
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/484137
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27416883
score: -4
accepted answer: http://stackoverflow.com/a/27416883

http://stackoverflow.com/comment/43177521
has text: I have added an example above.
comment on: http://stackoverflow.com/q/27362751
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43315021
has text: are you getting markers.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27436806

http://stackoverflow.com/a/27372720
type: Answer
score: 0
has body: Default mean selected first option of select value, as you have have 0 value on first index so you will need to assign 0 for default index And selector seems wrong, support the select box inside loop so use right selector like $(".sel_ad_{$smarty.section.sect.iteration}").val('0');
answers question: http://stackoverflow.com/q/27372671

http://stackoverflow.com/comment/43179802
type: AnswerComment
has text: For what it's worth, I've been A/B testing the Google CDN vs. a local copy of jQuery served from my Linode for nearly two years now and logging timing data about how long it takes to move beyond that script reference (cache hits being close to 0). The Google CDN is hands-down the winner, on average, and dramatically so many geographic locations.
type: Comment
comment on: http://stackoverflow.com/a/27361523
score: 1

ecmascript-harmony
tag name: ecmascript-harmony
tags question: http://stackoverflow.com/q/27470212
type: Tag

http://stackoverflow.com/q/27404787
has answer: http://stackoverflow.com/a/27405111
score: 4
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/43255001
upvote count: 5
tagged with: http://stackoverflow.com/tag/json
has body: I have the following index.html: http://jsfiddle.net/fxyfwv8L/ Notice that I use the Facebook SDK initialization along with the jQuery Face Detection one. For some reason, these two are conflicting and throw some exceptions such as: (index):1 Uncaught SyntaxError: Unexpected token _ (index):1 Uncaught SyntaxError: Unexpected token _ These seem to be generated by a JSON parse(), but I'm not able to understand why and how the FB SDK and jQuery Face Detection conflict. A live demo is available here: http://stormy-river-6729.herokuapp.com/ (make sure to check the JavaScript console).
accepted answer: http://stackoverflow.com/a/27405111
has comment: http://stackoverflow.com/comment/43255057
type: AnsweredQuestion
tagged with: javascript
has title: Facebook SDK: Uncaught SyntaxError: Unexpected token _
favorite count: 0
type: Question
tagged with: facebook
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/63656162
has text: @Freeez hi and thank you - a further question: what if you want another child in the child?
comment on: http://stackoverflow.com/a/27440958
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27388445
upvote count: 3
type: Question
tagged with: google-maps
downvote count: 0
tagged with: javascript
tagged with: google-maps-api-3
has body: .Hello I have a random problem I haven't been able to figure out. I have a map with markers that show infowindows when you hover over them which are supposed to close when you move your mouse away. For some reason the second part (closing the infowindow on mouseout) only gets applied to the last marker. If anyone could explain to me where I'm going wrong and how to fix my code so that all of the infowindows will close when the user moves their mouse away from the marker it'd be greatly appreciated! Thanks! Here is my setMarkers snippet function setMarkers(map, locations) { for (var i = 0; i &lt; locations.length; i++) { var item = locations[i]; var myLatLng = new google.maps.LatLng(item[1], item[2]); var address1 = item[5]; var marker = new google.maps.Marker({ position: myLatLng, map: map, }); var content = address; var infowindow = new google.maps.InfoWindow() google.maps.event.addListener(marker, 'mouseover', (function (marker, content, infowindow) { return function () { infowindow.setContent(content); infowindow.open(map, marker); }; })(marker, content, infowindow)); google.maps.event.addListener(marker, 'mouseout', function () { infowindow.close(); }); } } google.maps.event.addDomListener(window, 'load', initialize);
tagged with: infowindow
has answer: http://stackoverflow.com/a/27388652
answer count: 1
favorite count: 0
has title: Google Maps Mouseout only applied to last infowindow
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/27388652

http://stackoverflow.com/comment/43272335
has text: Welcome to [so]. It appears you haven't converted the arguments to radians.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27414085

http://stackoverflow.com/comment/43229920
type: QuestionComment
has text: You could pass in the $http dependency and send an ajax request to the server from Angular. The web server on the other side would invoke the sh command and optionally return information or a status response. You can easily set up a "promise" similar to a call back in angular to handle the response.
score: 1
comment on: http://stackoverflow.com/q/27387620
type: Comment

http://stackoverflow.com/comment/43274952
type: Comment
comment on: http://stackoverflow.com/a/27400042
has text: i hope this time you got my question kindly help me in this
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43130577
comment on: http://stackoverflow.com/q/27336935
score: 0
type: Comment
type: QuestionComment
has text: I think you're out of luck if you don't want to rely on user interaction and yet modify dynamically added DOM objects. You can listen to DOM mutation events, tho: https://developer.mozilla.org/en/docs/Web/API/MutationObserver

http://stackoverflow.com/comment/43282672
comment on: http://stackoverflow.com/a/27419816
score: 0
has text: From the prospective of sample code, I observed this should be required.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43115645
score: 0
type: Comment
has text: Okay thank you i did like this var datetime = new Date(data.created_at * 1000); multiplied with 1000. Now it's working fine...
comment on: http://stackoverflow.com/a/27317486
type: AnswerComment

http://stackoverflow.com/q/27389187
has answer: http://stackoverflow.com/a/30598916
has answer: http://stackoverflow.com/a/27389376
upvote count: 3
type: UnansweredQuestion
type: Question
score: 3
has comment: http://stackoverflow.com/comment/43226332
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has title: orderBy not working in angularjs with object name with a dash
tagged with: angularjs
has body: I'm trying to sort by ascending order some dates I have in the object start-date. It seems to not work if there are dashes, according to some sources. data-ng:repeat="medicationItem in medication | orderBy:['start-date','name']"&gt; I am first trying to sort by date and then by alphabet. Is there something I am doing incorrectly? Thank you in advanced.

http://stackoverflow.com/q/27351568
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: php
tagged with: video
has comment: http://stackoverflow.com/comment/43157707
type: Question
tagged with: thumbnails
has body: I'm currently making a website that displays links to videos from another website. I already created the layout of the site. However, I find it tedious to capture a still image of a video just to add a thumbnail unto my website. Is there a way to retrieve video thumbnails automatically when links are added to the site? I saw a few PHP codes that do it but are meant strictly for Youtube. My source of videos for my site however is different. Can someone please assist by posting an example of the code and how/where to place it in the site (PHP file / CSS). I'm not a professional web developer so I would better understand with an example. Java script would be great if possible.
has comment: http://stackoverflow.com/comment/43157751
has answer: http://stackoverflow.com/a/27352661
tagged with: javascript
has title: Automatically retrieve video thumbnails from other sites
score: 0
has comment: http://stackoverflow.com/comment/43157673
has comment: http://stackoverflow.com/comment/43157455

http://stackoverflow.com/comment/43481321
type: AnswerComment
has text: Yes it is for you please check your console.
type: Comment
comment on: http://stackoverflow.com/a/27424645
score: 0

http://stackoverflow.com/comment/43270984
score: 0
type: Comment
has text: Sorry your version is right, now it's better, thank you!
comment on: http://stackoverflow.com/a/27413275
type: AnswerComment

http://stackoverflow.com/comment/43409319
score: 0
type: AnswerComment
has text: Graphie and the op's code may be executed as a part of an anonymous function and therefore invisible from the global scope.
type: Comment
comment on: http://stackoverflow.com/a/27475237

http://stackoverflow.com/a/27408340
score: 5
type: AcceptedAnswer
downvote count: 0
has body: this.functionName reads the value of property functionName of the object this. this.functionName() reads the value of property functionName of the object this and tries to call it as a function. It will throw an error if the value of this.functionName is not a function. Decompose the statement as this.functionName() \____callee_____/ \_CallExpression__/ "callee" can be any expression but must resolve to a function object. Check out the AST if you are curious.
type: Answer
upvote count: 5
accepted answer of: http://stackoverflow.com/q/27408295
answers question: http://stackoverflow.com/q/27408295

http://stackoverflow.com/q/27442464
has comment: http://stackoverflow.com/comment/43324335
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
has body: I have a SVG-Image, now, when there is an update, the Server sends me the update image, and I want to reload the image in the Browser without seeing a blinking (white space instead of the image for like 100ms). My first approach: $("#svg").html(newSVG); // With blinking My second approach: Loading the updated SVG in Frame2, then put it in Frame1. Still with the blinking. // Load SVG in frame2 $("#svg .frame2").hide().html(content).delay(500).show(); // Overwrite frame1 content with frame2 content $("#svg .frame1").delay(500).hide().html(content).delay(500).show(); // Remove frame2 content $("#svg .frame2").hide().html("").show(); Is there any way to to in in a clean way, so the user dont sees a white, empty image for a short time? I can work with jQuery and AngularJS. Thank you very much!
score: 3
has title: How to update a SVG-Image without seeing a "blinking"
upvote count: 3
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27445729
has comment: http://stackoverflow.com/comment/43324155
has answer: http://stackoverflow.com/a/27442547
favorite count: 0

code-generation
tag name: code-generation
tags question: http://stackoverflow.com/q/27376165
type: Tag

http://stackoverflow.com/q/27337181
type: Question
accepted answer: http://stackoverflow.com/a/27341896
tagged with: javascript
has answer: http://stackoverflow.com/a/27341896
score: 0
has title: Ember Simple Auth - How To Update The Stored Token
tagged with: ember.js
answer count: 1
has body: On each request my application makes, a token is returned inside the response. This is the token that needs to be used for the next request. This works (partially). When I refresh the App it runs the restore function but uses the wrong token. var Parent = this; Ember.$(document).ajaxComplete(function(Event, Response) { Parent.session.content.Token = Response.responseJSON.Token; }); It would seem that the above code updates the token in memory but not in the store which the authenticator uses upon "restoring" the session using the restore function. How can I update the token in the localStorage to use this token for all requests/re-validations?
tagged with: ember-simple-auth
type: AnsweredQuestion

http://stackoverflow.com/comment/53691423
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27344969
has text: Are you sure that we can use `expect(...).toBe(...)` inside of the async callback?

http://stackoverflow.com/q/27344454
has comment: http://stackoverflow.com/comment/43144509
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43144391
has comment: http://stackoverflow.com/comment/43144599
has comment: http://stackoverflow.com/comment/43145476
score: 0
has comment: http://stackoverflow.com/comment/43145078
has answer: http://stackoverflow.com/a/34279389
has title: Convert Jquery Plugin into Angular Directives
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43144445
type: UnansweredQuestion
has body: I'm having problem when converting my jquery plugin into angular directives, here's my jquery plugin call: $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, width: "100%", height: 400, colModal: [ { width: 50, align: 'center' }, { width: 110, align: 'center' }, { width: 170, align: 'left' }, { width: 250, align: 'left' }, { width: 100, align: 'left' }, { width: 70, align: 'left' }, { width: 100, align: 'left' }, { width: 100, align: 'center' }, { width: 90, align: 'left' }, { width: 400, align: 'left' } ], sort: true }); And when I convert it into angular directives it will look like this: myApp.directive('fixedTable', function () { return { restrict: 'AE', link: function (scope, element, attrs) { element.fxdHdrCol({ fixedCols: attrs.fixedCols, width: attrs.width, height: attrs.height, colModal: [ { width: 80, align: 'left'}, { width: 250, align: 'left'}, { width: 100, align: 'left'}, { width: 100, align: 'left'}, { width: 130, align: 'left'}, { width: 100, align: 'left'}, { width: 150, align: 'left'}, { width: 130, align: 'center'}, { width: 100, align: 'left'}, { width: 150, align: 'left'} ] }); } }; }) here's my error -> "TypeError: Cannot read property 'width' of undefined" I know I have mistake in converting but I don't know how to convert it correctly. Any help is very appreciated. Thanks
has comment: http://stackoverflow.com/comment/43144975
type: Question

http://stackoverflow.com/comment/43090184
has text: I don't understand. How can mapping value to value (i.e. `$contentArray[this.value] = this.value;`) be of any use whatsoever? You'd need to know the key to look up the value. But the value of the key would have to be the actual value that's stored against it, making a lookup completely pointless.
score: 0
comment on: http://stackoverflow.com/q/27315084
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27457416
has comment: http://stackoverflow.com/comment/43379503
answers question: http://stackoverflow.com/q/27456454
type: Answer
has comment: http://stackoverflow.com/comment/43369597
has comment: http://stackoverflow.com/comment/43477667
has comment: http://stackoverflow.com/comment/43428243
has comment: http://stackoverflow.com/comment/43427046
has comment: http://stackoverflow.com/comment/43390888
has body: its not totally correct.I does not know jquery.But I think this can be done by html5 canvas. first of all you will have to make a circle of radius R in canvas and then use blue colored arc function in canvas to make arc of D degree.Obviously there should be a javascript function that take the value D and make the appropriate arc and then you can place the blue dot at x = xCenter + radius * cos(angle) y = yCenter + radius * sin(angle). I will provide you the exact code after some time.
has comment: http://stackoverflow.com/comment/43430781
score: 0
has comment: http://stackoverflow.com/comment/43432130

http://stackoverflow.com/q/27437089
type: Question
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
has body: I am not familiar with Inline Anchor styles(link), how can we make it works to show fashion? Javascript/JQuery coding or missing something? [ http://codepen.io/anon/pen/dPMNVE ] To hover "smells" for example in this paragraph below: Inside Vardö harbour walls, then, to a mooring we came, and the smells of the place closed round us and took possession. Bobbling about on the harbour swell around us were some two hundred vessels of strange Northern rig, and almost all connected with the trade in fish. I would appreciate with your guide.
has answer: http://stackoverflow.com/a/27437951
has answer: http://stackoverflow.com/a/27437195
tagged with: css
possible better answer: http://stackoverflow.com/a/27437195
type: AnsweredQuestion
has title: Inline Anchor Not Working
accepted answer: http://stackoverflow.com/a/27437951

http://stackoverflow.com/a/27377280
downvote count: 1
has body: You should change the currentTime field of the media element, as you can see here in the API doc. There is also an example code here, at MDN For reference, the sample code there: var mediaElement = document.getElementById('mediaElementID'); mediaElement.seekable.start(); // Returns the starting time (in seconds) mediaElement.seekable.end(); // Returns the ending time (in seconds) mediaElement.currentTime = 122; // Seek to 122 seconds mediaElement.played.end(); // Returns the number of seconds the browser has played where the mediaElementID is the id of the audio or video tag. Edit: It seems I've misread your question. I will take a further look.
has comment: http://stackoverflow.com/comment/43206195
type: Answer
score: 2
upvote count: 3
answers question: http://stackoverflow.com/q/27376563

http://stackoverflow.com/comment/43173618
has text: try change mimetype to 'application/json'
comment on: http://stackoverflow.com/q/27360778
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/43100239
type: Comment
has text: Sorry, that's a typo. I have it correctly written in CSS.
type: QuestionComment
comment on: http://stackoverflow.com/q/27320314
score: 0

http://stackoverflow.com/a/27372141
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27368725
has body: Only graphics elements can be the target of pointer-events such as click. If you set it on a parent such as a &lt;g&gt; element then all its graphical children become possible targets but not the &lt;g&gt; itself.
answers question: http://stackoverflow.com/q/27368725
type: Answer
upvote count: 3

http://stackoverflow.com/comment/43140959
type: AnswerComment
comment on: http://stackoverflow.com/a/27333630
score: 0
type: Comment
has text: I came up with my own solution by picking out selectedmodel and selectedmanufacturer from each array inside $scope.devices, push these into their own arrays and then save these into localstorage. Thanks for your help!

http://stackoverflow.com/comment/43204337
has text: Ok try this /[a-z]*\.([0-9]\.?){0,3}/i. Weird but javascript regex is not working with {,3}. Try this out http://rubular.com/ for your tests
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27377295

http://stackoverflow.com/q/27445442
answer count: 1
tagged with: hammer.js
tagged with: angularjs
type: UnansweredQuestion
type: Question
tagged with: ios
tagged with: javascript
has body: I have a webpage with HammerJS on it. I am also using the angular directive from the hammerjs website. I have swipe and pan on an element. But in doing this, it is stopping me clicking links or form elements in iOS only. What's odd is that on the links, the CSS hover effect will occur, but the href isn't fired. Also on form elements, I cant select the text box to see a blinking cursor and keyboard. Has anyone had similar issues or able to assist with what settings might be causing this? The below code recognises the swiping, and fires the function, but disables the link firing. Contact
score: 0
has title: HammerJS (v2) swipe and pan are disabling links being fired in iOS
has answer: http://stackoverflow.com/a/27445495

http://stackoverflow.com/comment/43226600
comment on: http://stackoverflow.com/a/27388456
type: AnswerComment
score: 0
type: Comment
has text: I see now that my selectors with `querySelectorAll()` with a `.style` selector afterwards are the ones not working, thanks. There are other issues, too, but thanks for clearing that up. I will investigate more. I'm a newbie on pure JS, no need for those who did to downvote me 5 times, that's cruel.

http://stackoverflow.com/q/27350362
favorite count: 0
has comment: http://stackoverflow.com/comment/44582889
type: Question
score: 5
has title: Using Cordova plugins with Meteor.js
has answer: http://stackoverflow.com/a/27351869
tagged with: cordova
has body: After adding a Cordova plugin using meteor add cordova:org.apache.cordova.dialogs@0.2.10, I see this plugin installed using meteor list. However on the desktop browser console, I can't seem to find any methods exposed by cordova:org.apache.cordova.dialogs, such as navigator.notification.alert. How do we do something like navigator.notification.confirm( 'Hello there', onConfirm, 'Welcome', ['Hey'] ) Also tried cordova:org.apache.cordova.device@0.2.12 and the device object the plugin is supposed to expose globally cannot be found. Meteor.startup(function() { console.log(device.cordova) // Uncaught ReferenceError: device is not defined })
answer count: 1
upvote count: 5
accepted answer: http://stackoverflow.com/a/27351869
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: meteor

http://stackoverflow.com/a/27437406
accepted answer of: http://stackoverflow.com/q/27437365
type: Answer
downvote count: 0
score: 2
has comment: http://stackoverflow.com/comment/43337674
upvote count: 2
answers question: http://stackoverflow.com/q/27437365
type: AcceptedAnswer
has body: Move var randTeamName = ... inside your displayRandName() function: function displayRandName() { var randTeamName = "The" + " " + nameAdjective[Math.floor(Math.random() * nameAdjective.length)] + " " + nameNoun[Math.floor(Math.random() * nameNoun.length)]; //Just for me to see in the editor console.log(randTeamName); document.getElementById("output").innerHTML = randTeamName; }

http://stackoverflow.com/comment/43313380
type: Comment
comment on: http://stackoverflow.com/a/27436307
type: AnswerComment
score: 0
has text: Nothing related to angular here, it's a plain js issue: http://stackoverflow.com/questions/4994201/is-object-empty?lq=1

http://stackoverflow.com/q/27432679
score: 0
has body: I am getting endless 'render' in the console... Why does this happen? I can't figure it out! :( I've been at this all day mostly. Can you guys see what the problem is? Console: turnEvent render 10 times render Infunction: 150.458ms 6534 and counting times render Code: var turnEvent = function turnEvent(AnX, AnY) { var first = true; console.time('Infunction'); var lengd = rects.length, i; one30 = 10, one40 = 10, one301 = false, one401 = false; for (i = 0; i &lt; lengd; i += 1) { if (collides([rects[i]], AnX, AnY)) { var rightBox = rects[i]; var rectangle = rects2[i]; } } console.log("turnEvent"); rounded_rect(rectangle.x, rectangle.y, 90, 110, 10, 'black', 'black'); function render() { console.log("render"); &lt;----------- ENDLESS CONSOLE LOGS -----some canvas drawings here------ ....... ----if and else conditions---- if (one301 &amp;&amp; one401) { rounded_rect(rectangle.x, rectangle.y, 90, 110, 10, null, 'black'); console.timeEnd('Infunction'); } } (function animloop(){ requestAnimationFrame(animloop); render(); })(); }
type: Question
tagged with: requestanimationframe
tagged with: javascript
has answer: http://stackoverflow.com/a/27432768
tagged with: canvas
answer count: 1
accepted answer: http://stackoverflow.com/a/27432768
tagged with: recursion
type: AnsweredQuestion
has title: Endless console logs, javascript wont leave the function requestAnimationFrame

http://stackoverflow.com/comment/43268755
type: QuestionComment
type: Comment
has text: I tried [this](http://knockoutjs.com/examples/animatedTransitions.html), and I get it the checkbox matter, but the sorting using a value is too much complicated than an internet example. Greetings
comment on: http://stackoverflow.com/q/27411167
score: 0

http://stackoverflow.com/comment/43190428
has text: Well as I said it before, It doesn't recognize anything after "dlIndex". Only dlIndex.ClientID is recognized and throws me a "undefined". btw I like the <input type="text" id="fname" value="<%=myInstance.artikli_na_skladistu.skladista.Adresa%>"> answer ... it's a shame ...
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27369001

http://stackoverflow.com/comment/43295848
score: 0
type: QuestionComment
has text: @Teemu That's correct, it should open it without passing the full path. The example I gave to JamesThorpe works (opening this page in a popup). So I know it's not internet explorer's fault. However, it doesn't produce any error on other browsers, they just work.
type: Comment
comment on: http://stackoverflow.com/q/27426401

http://stackoverflow.com/a/27358029
answers question: http://stackoverflow.com/q/27357819
type: Answer
upvote count: 4
downvote count: 0
has body: If you know the index of the element inside the table :nth-child(index) can be a solution, $("table tr:nth-child(2)").fadeOut(); And if you know the id only, not the index then get the index of that element, // added 1 as .index() is indexed with 0 but in :nth-child(n) n is indexed 1 var elementIndex = $("#20").parent().index() + 1; $("table tr:nth-child(" + elementIndex + ")").fadeOut(); jsFiddle Resources : :nth-child(index), .index()
score: 4

http://stackoverflow.com/a/27331283
type: Answer
has body: I think you are using $.POST wrong. 'data' can never have any value in your code. It is and will be undefined. Look at the code from the documentation: http://api.jquery.com/jquery.post/ Here is a snipped that should work: $.post( "ajax/test.html", function( data ) { alert(data); // Go ahead with your code. }); So use an anonymous function that takes (data) and proceed from there.
upvote count: 0
has comment: http://stackoverflow.com/comment/43120373
has comment: http://stackoverflow.com/comment/43120407
answers question: http://stackoverflow.com/q/27331182
downvote count: 3
score: -3

http://stackoverflow.com/a/27365904
has body: The script tag you include programatically has to be parsed by the browser. Just by inserting the script tag the included code is not parsed by the JavaScript interpreter. If you explain what you want to finally achieve I am pretty sure that must be a simpler way to do it.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27365742
has comment: http://stackoverflow.com/comment/43183855

http://stackoverflow.com/q/27404439
has title: Change tagname with javascript
downvote count: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27404481
possible better answer: http://stackoverflow.com/a/27404602
favorite count: 0
has answer: http://stackoverflow.com/a/27404602
answer count: 3
has comment: http://stackoverflow.com/comment/43253511
has body: Is there away to change text here to a text here I know how to add classes and change the style, but there is something in this code that has coded it to be a H4 when I want it to really be a H1
score: 2
type: AnsweredQuestion
upvote count: 2
linked to: http://stackoverflow.com/q/918792
has answer: http://stackoverflow.com/a/27404481
type: Question
has comment: http://stackoverflow.com/comment/43253568
tagged with: javascript
has answer: http://stackoverflow.com/a/27404523

http://stackoverflow.com/comment/43275631
type: QuestionComment
has text: If you are using ajax to fetch data then you need to initialize the owl carousel in the success method of ajax.
score: 0
comment on: http://stackoverflow.com/q/27415477
type: Comment

http://stackoverflow.com/q/27463897
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43364002
type: Question
has title: Register event for all elements in a div
has answer: http://stackoverflow.com/a/27463948
tagged with: javascript
has comment: http://stackoverflow.com/comment/43363985
upvote count: 2
has answer: http://stackoverflow.com/a/27463969
downvote count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43364036
has answer: http://stackoverflow.com/a/27463978
has comment: http://stackoverflow.com/comment/43363986
has answer: http://stackoverflow.com/a/27463963
answer count: 4
has body: I am trying to register same event for all &lt;button&gt; elements in a div as i have 24 of them so i tried to use Jquery's $.each() in this way and it reads the div as the element instead of the button $("#online-hours").each(function () { var element = this; $(element).click(function () { if ($(element).hasClass('btn-success')) { $(element).toggleClass('btn-success'); $(element).addClass('btn-danger'); } else if ($(element).hasClass('btn-danger')) { $(element).toggleClass('btn-danger'); $(element).addClass('btn-success'); } }); });

http://stackoverflow.com/a/27326974
has comment: http://stackoverflow.com/comment/43178675
score: 0
has comment: http://stackoverflow.com/comment/43132969
type: Answer
answers question: http://stackoverflow.com/q/27326644
has body: Actually, I believe you have what you need ... document.selection.createRange() is replaced with document.getSelection() ... There is also a note here that ... document.selection is replaced with window.getSelection ...
has comment: http://stackoverflow.com/comment/43113010

http://stackoverflow.com/q/27415959
has title: AngularJs LoginController not found
tagged with: batarang
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43276200
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43276013
has comment: http://stackoverflow.com/comment/43276363
has body: I am getting this strange error : Error: The controller function for LoginController could not be found. Is the function registered under that name? Here is my login controller code : define( [ 'app', ], function (app) { var LoginController = function ($rootScope,$scope,AuthFactory,$location) { $scope.login = function(data) { } }; LoginController.$inject = ['$rootScope','$scope','AuthFactory', '$location']; app.register.controller('LoginController', LoginController); }); The same code is working fine on Chromium browser, but not on Chrome and firefox. In the console I see that there is some kind of hint.js being called on top of my application. I am not sure from where is this hint.js file coming from. Google Chrome Version - Version 39.0.2171.95 (64-bit), Firefox Version - 34.0 Update : After some googling i found Chrome extension hint.js &amp; ngHintModules which helped me to solve my problem. My next concern is what if we develop our application and there is AngularJs Batarang enabled on the users system??
tagged with: google-chrome
linked to: http://stackoverflow.com/q/27393367
type: Question

http://stackoverflow.com/q/27402291
tagged with: javascript
has comment: http://stackoverflow.com/comment/43252272
favorite count: 0
has comment: http://stackoverflow.com/comment/43250095
has comment: http://stackoverflow.com/comment/43249278
answer count: 3
has comment: http://stackoverflow.com/comment/43249296
possible better answer: http://stackoverflow.com/a/27402402
has answer: http://stackoverflow.com/a/27402402
accepted answer: http://stackoverflow.com/a/27402902
linked to: http://stackoverflow.com/q/9229645
score: -3
downvote count: 3
duplicate of: http://stackoverflow.com/q/9229645
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43249319
has body: I have the following script that's supposed to uniqualize array: function uniques(arr) { var a = []; for (var i=0, l=arr.length; i&lt;l; i++) for (var j = 0; j &lt; arr[i].length; j++) { if (a.indexOf(arr[i][j]) === -1 &amp;&amp; arr[i][j] !== '') { a.push(arr[i][j]); } } return a; } However, when it receives only one element, it just breaks it into the letters (which is understandable). Do you know how I make it check if it's receiving only one element and then returns it back? Thanks!
has comment: http://stackoverflow.com/comment/43250046
has comment: http://stackoverflow.com/comment/43249949
has title: Uniqualize array in Javascript?
type: Question
has comment: http://stackoverflow.com/comment/43249418
upvote count: 0
has answer: http://stackoverflow.com/a/27402557
has comment: http://stackoverflow.com/comment/43249893
tagged with: arrays
has answer: http://stackoverflow.com/a/27402902

http://stackoverflow.com/comment/43115852
has text: updated the sample code.. No Need to add another switch over these two just use If since there are only two checks
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27328197
score: 0

http://stackoverflow.com/comment/43178480
type: Comment
has text: Seeing it for myself was useful. I've made an edit which includes a fix. This was an interesting one!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27362592

http://stackoverflow.com/comment/43124750
has text: I chose square brackets to be able to pass in a variable, and yes, `switch` would probably be a better name for the variable, except it's a reserved keyword, so it would have to be something like `swap` etc. instead.
comment on: http://stackoverflow.com/a/27333500
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/27380921
has comment: http://stackoverflow.com/comment/43212018
score: 0
has comment: http://stackoverflow.com/comment/43212121
has comment: http://stackoverflow.com/comment/43210983
has body: post your code to get more useful feedback, but the gist of it is this, you want to be able to load your partial conditionally upon load. The code to delete the row, and reload the parent page, should pass a flag (query parameter) to the enclosing page to let it know this is a special case (e.g. reloadPartial=true) You then pass that flag back in your ViewModel to your parent view, which will use it to enable the conditional load of the partial. Again, will be much easier to explain with your code posted.
has comment: http://stackoverflow.com/comment/43211523
has comment: http://stackoverflow.com/comment/43211267
type: Answer
has comment: http://stackoverflow.com/comment/43211475
answers question: http://stackoverflow.com/q/27380447
has comment: http://stackoverflow.com/comment/43212189

http://stackoverflow.com/comment/43235099
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27394022
has text: `var quotes =JSON.strigify(json); quotes =JSON.parse(quotes)`
type: Comment

http://stackoverflow.com/comment/43281779
type: AnswerComment
has text: Nothing there contradicts what I've posted. You can set the array length to any number you like (within the limit you've noted). Doing that doesn't create any properties, it just sets the length. ;-)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27418540

http://stackoverflow.com/comment/43213067
comment on: http://stackoverflow.com/q/27382162
type: Comment
type: QuestionComment
score: 2
has text: Please add meaningful code and a problem description here. Don't just link to the site that needs fixing - otherwise, this question will lose any value to future visitors once the problem is solved. Posting a [Short, Self Contained, Correct Example (SSCCE)](http://www.sscce.org/) that demonstrates your problem would help you get better answers. For more info, see [Something on my web site doesn't work. Can I just paste a link to it?](http://meta.stackexchange.com/questions/125997/) Thanks!

http://stackoverflow.com/a/27364262
type: Answer
has comment: http://stackoverflow.com/comment/43181785
has comment: http://stackoverflow.com/comment/43182346
has comment: http://stackoverflow.com/comment/43180501
has comment: http://stackoverflow.com/comment/43180924
accepted answer of: http://stackoverflow.com/q/27363959
answers question: http://stackoverflow.com/q/27363959
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43181624
has body: I think ko.toJSON($data, null, 2) should accomplish what you are looking for

http://stackoverflow.com/a/27381607
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27381393
answers question: http://stackoverflow.com/q/27381393
type: Answer
has body: UnderscoreJS has _.pluck() _.pluck(yourArray,'bar') =&gt; [foo,baz,foo] From UnderscoreJS docs for _.pluck(): _.pluck(list, propertyName) A convenient version of what is perhaps the most common use-case for map: extracting a list of property values. var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}]; _.pluck(stooges, 'name'); =&gt; ["moe", "larry", "curly"]

http://stackoverflow.com/a/27467748
has comment: http://stackoverflow.com/comment/43371019
has comment: http://stackoverflow.com/comment/43371040
score: 0
has comment: http://stackoverflow.com/comment/43371085
has body: I think the problem is in your success.you have written If it does exist, it should echo 0. If it does not exists, it should echo 1.you should use: success: function (data) { //Receives the data from the php code if (data == '"0"') { //register if user exists. $("#registerform").submit(); } else { alert("Username Unavailable"); }
answers question: http://stackoverflow.com/q/27467647
type: Answer
has comment: http://stackoverflow.com/comment/43372368
has comment: http://stackoverflow.com/comment/43371005

http://stackoverflow.com/a/27331201
downvote count: 0
has comment: http://stackoverflow.com/comment/43120554
has comment: http://stackoverflow.com/comment/43121638
has comment: http://stackoverflow.com/comment/43121690
upvote count: 2
has body: If you are only needing this for images and need to track transforms, then I would suggest using only canvas for this. Insert a canvas element inside that div instead of the images, and paint onto it the images you need with the respective transform (translate, rotate etc.). From there it's simply to call toDataURL() to save everything as a single image. Note that CORS restrictions applies (images must be loaded from same server as page, or given permission to be used outside CORS by the hosting server - one exception are images uploaded through a input field). There exists many examples on SO for how to setup a canvas and draw images with rotation/transforms.
type: Answer
has comment: http://stackoverflow.com/comment/43120384
score: 2
has comment: http://stackoverflow.com/comment/43120395
answers question: http://stackoverflow.com/q/27331110

http://stackoverflow.com/comment/43330327
score: 0
has text: @SW4: I've inherited enough crap code like that to want to vehemently discourage it. ;)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27445613

http://stackoverflow.com/comment/43284294
type: Comment
type: QuestionComment
has text: I got only one html file, index.html. My app already send request on each route in order to get the corresponding html file, that is stored on my backend server
comment on: http://stackoverflow.com/q/27420482
score: 0

http://stackoverflow.com/comment/43141948
has text: So set your logic in ajax relevant callback (success?) once element content has been modified
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27343241
score: 1

http://stackoverflow.com/comment/43395593
type: QuestionComment
has text: http://stackoverflow.com/tags/javascript/info | http://stackoverflow.com/tags/jquery/info | http://stackoverflow.com/tags/ajax/info | http://stackoverflow.com/tags/angularjs/info | http://stackoverflow.com/tags/twitter-bootstrap/info
comment on: http://stackoverflow.com/q/27443254
score: 0
type: Comment

http://stackoverflow.com/comment/43358955
type: QuestionComment
has text: `make`. See https://algorithms.rdio.com/post/make/, or http://www.sitepoint.com/using-gnu-make-front-end-development-build-tool/. Granted, this falls in the territory of religious wars.
score: 0
comment on: http://stackoverflow.com/q/27459333
type: Comment

http://stackoverflow.com/comment/43272987
type: Comment
comment on: http://stackoverflow.com/q/27414295
type: QuestionComment
has text: I'm don't understand what you mean by that.
score: 0

http://stackoverflow.com/q/27461226
has answer: http://stackoverflow.com/a/27461312
type: UnansweredQuestion
upvote count: 1
has body: I have html page which is appearing properly but it has some dynamic text which is coming, and it is under no tag. how can i remove that text using jquery. The text is coming as: &lt;div id="Container2" class="tab default-tab" style="display: block; margin-top: -15px; overflow: auto; width: 990px; height: 400px;"&gt; &lt;!-- start --&gt; Search Setup 1 FIA - need to remove this {the text appearing is dynamic} &lt;style&gt;other contents go here
type: Question
has comment: http://stackoverflow.com/comment/43358781
has comment: http://stackoverflow.com/comment/43358784
answer count: 2
has answer: http://stackoverflow.com/a/27461328
has title: remove text from the page which is under no tag
downvote count: 0
has comment: http://stackoverflow.com/comment/43358836
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43358850
tagged with: css

http://stackoverflow.com/comment/43138093
type: Comment
has text: I think you misread the question. I don't need help with gathering the data, I need it to stop the page jumping to the anchor.
comment on: http://stackoverflow.com/a/27341142
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43308932
score: 0
type: Comment
type: QuestionComment
has text: The problem seems to be that the arduino indeed gives JSON instead of JSONP, which causes it not to parse as its not expecting the colon... But I'm absolutely clueless...
comment on: http://stackoverflow.com/q/27433383

http://stackoverflow.com/comment/43369144
type: Comment
has text: Thanks for reply, i tryed something like this but it didnt's work, edited the post with the script i tryed that didn't work.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27466594

http://stackoverflow.com/a/27364991
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43183195
has comment: http://stackoverflow.com/comment/43183282
type: Answer
accepted answer of: http://stackoverflow.com/q/27364911
answers question: http://stackoverflow.com/q/27364911
downvote count: 1
has comment: http://stackoverflow.com/comment/43181855
has body: It think that you can realise it with storing the login credintials with PHP in a session or something like this. If the user visits the website again your PHP-script sees that there is a session with credentials and you can show them to the user. An other method would be to save this data in a localStorage on the device of the visitor but I wouldn't use this method because not all browser are accepting localStorages.
score: -1
upvote count: 0

http://stackoverflow.com/a/27335001
upvote count: 1
answers question: http://stackoverflow.com/q/27334951
type: Answer
downvote count: 0
score: 1
has body: you can find out if a value is inside of an array by using indexOf(). for example: animals.indexOf('dog'); this will return the index of the string 'dog'. if it doesn't exist, it will return a value of -1.

http://stackoverflow.com/a/27477544
has body: You can do smthing like:
has comment: http://stackoverflow.com/comment/43397264
type: Answer
has comment: http://stackoverflow.com/comment/43397019
has comment: http://stackoverflow.com/comment/43397790
score: 0
answers question: http://stackoverflow.com/q/27468684

http://stackoverflow.com/comment/43381066
score: 0
has text: Can multiple be opened at once? That determines where you put the flag.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27473220

http://stackoverflow.com/comment/43465800
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27488216
type: AnswerComment
has text: Okay, I've been reading up on triggers, messing with the script from rckrd above, and I'm stuck. I know that with the onedit() trigger, this script can't be tested in the code editor. I'm just not sure how to actually get it to run on my spread sheet. I'm used to using .openbyId which obviously goes out and open the spreadsheet and starts the function. Is there anything that I need to add to this script to get it to work? I'm confused as to what Im supposed to do in the editor now. I know that these are all beginner questions, Sorry guys. I'm totally addicted now & trying to learn. Thx

http://stackoverflow.com/a/27434712
answers question: http://stackoverflow.com/q/27434616
score: 0
type: Answer
has body: Try this: $("button").on("click", function() { $('#file_upload').uploadifive({ 'auto' : true, 'checkScript' : 'check-exists.php', 'formData' : { 'timestamp' : '&lt;?php echo $timestamp;?&gt;', 'token' : '&lt;?php echo md5('unique_salt' . $timestamp);?&gt;', 'first' : $("#firstName").val(), 'last' : $("#lastName").val(), 'level' : $("#gradeLevel").val(), 'drop' : $("#dropTest option:selected").val() }, 'queueID' : 'queue', 'uploadScript' : 'uploadifive.php', 'onUploadComplete' : function(file, data) { console.log(data) } }); }); }); If you want it to happen when a select option is changed then try this $("select").on("change", function() { //Your code here } Basically this will allow the javascript to execute after DOM load.
has comment: http://stackoverflow.com/comment/43338110

http://stackoverflow.com/a/27578285
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27458934
has body: You can track it using Google Analytic Cordova Plugin. https://github.com/danwilson/google-analytics-plugin example You just call it one time only everytime the app launch. document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { // Now safe to use device APIs window.analytics.startTrackerWithId('UA-XXXX-YY') } Track screen you need to insert each page that you want to track. Page 1 window.analytics.trackView('Page 1') Page 2 window.analytics.trackView('Page 2') Page 3 window.analytics.trackView('Page 3') User Id is your user that use your app. You can grab it from your database. window.analytics.setUserId('1')

http://stackoverflow.com/a/27376766
answers question: http://stackoverflow.com/q/27369795
has comment: http://stackoverflow.com/comment/43208646
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/43203327
has comment: http://stackoverflow.com/comment/43203513
has comment: http://stackoverflow.com/comment/43208550
has comment: http://stackoverflow.com/comment/43203249
has body: You have a naughty comma after the var paper line, it should be a semicolon, as you aren't defining a variable on the next line. var paper = Snap(500,500); //&lt;-- this semicolon Snap.load('ringing-phone.svg', ....
type: Answer
accepted answer of: http://stackoverflow.com/q/27369795

http://stackoverflow.com/comment/43274943
has text: @whatzi77 whether your code is in a window resize handler... if not move it to `$(window).resize(function(){...})`
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27414787

http://stackoverflow.com/a/27400130
has body: Try this: for (var i = 1; i &lt;= 54; i++) { $('.product tr:nth-child(' + i + ') .knop',window.parent.document).bind("click", function() { $('#edit-submitted-data-cursus').val($('.product tr:nth-child(' + i + ') .cursus a', window.parent.document).html()); $('#edit-submitted-data-cursusdatum').val($('.product tr:nth-child(' + i + ') .datum', window.parent.document).html()); $('#edit-submitted-data-opleidingscode').val($('.product tr:nth-child(' + i + ') .code', window.parent.document).html()); $('#edit-submitted-data-cursuslocatie').val($('.product tr:nth-child(' + i + ') .loc', window.parent.document).html()); $('#edit-submitted-data-cursustarief').val($('.product tr:nth-child(' + i + ') .tarief', window.parent.document).html()); }); }
has comment: http://stackoverflow.com/comment/43245523
answers question: http://stackoverflow.com/q/27400028
type: Answer
has comment: http://stackoverflow.com/comment/43245466
score: 0

http://stackoverflow.com/q/27427492
tagged with: javascript
has comment: http://stackoverflow.com/comment/43296811
has title: Custom function for Google Spreadsheet always return the same result
accepted answer: http://stackoverflow.com/a/27427823
tagged with: google-drive-api
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43296945
has body: I am trying to build a simple script to work with a Google Spreadsheet that looks like this: It shows me which of my clients use which modules of each layer. Each client may use how many modules he wants to. What I need to do is count how many clients have all the modules installed (or the three layers, it's the same). I've tried to do this using the built-in functions but have not succeed. Now I'm trying to do my own function, that looks like this: function countTotalModByClient(values) { var quantMod=0; var quantClient=0; for (var i=0; i&lt;values.length; i++) { for(var j=0; j&lt;values.length; j++) { if(values[i][j]=="X") { quantMod++; } } if(quantMod==15) { // total number of modules quantClient++; } quantMod=0; } return quantClient; } But it always return the same result: 0. At my sheet, I'm calling the function like this: =countTotalModByClient(B3:P6) P.S.: Sorry about the magic number in the code, I´ll fix this. =)
type: Question
has answer: http://stackoverflow.com/a/27427823
has comment: http://stackoverflow.com/comment/43296723
tagged with: google-sheets
answer count: 1

http://stackoverflow.com/q/27380584
accepted answer: http://stackoverflow.com/a/27380882
has comment: http://stackoverflow.com/comment/43210414
has body: I'm having a bit of difficulty trying to isolate quite a few things with this accordion. One, I can't seem to get anything other than 'slideToggle' to work, which seems odd to me. I have one ul and a sub ul. I want only the active instance of the sub-menu to be viewable when the parent ul li is clicked. Here's my CSS .ca-menu { padding: 0; margin-bottom:1px; width: 300px; } ul.ca-menu li { width: 300px; overflow: hidden; display: block; background: #001e47; -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); margin-bottom:0px; border-left: 10px solid #cfcfcf; -webkit-transition: all 300ms ease-in-out; -moz-transition: all 300ms ease-in-out; -o-transition: all 300ms ease-in-out; -ms-transition: all 300ms ease-in-out; transition: all 300ms ease-in-out; } ul.ca-menu li:last-child { margin-bottom: 0px; } ul.ca-menu li a { text-align: left; display: block; width: 100%; height: 100%; color: #cfcfcf; position:relative; } ul.ca-icon { font-family:'FontAwesome'; font-size: 25px; text-shadow: 0px 0px 1px #333; line-height: 40px; position: absolute; top:10px; width: 90px; left: 0px; text-align: center; -webkit-transition: all 300ms linear; -moz-transition: all 300ms linear; -o-transition: all 300ms linear; -ms-transition: all 300ms linear; transition: all 300ms linear; } .ca-content { position: relative; left: 70px; width: 230px; height: 20x; top: 5px; line-height:6px; } .ca-main { font-size: 12px; font-family: Century Gothic; -webkit-transition: all 300ms linear; -moz-transition: all 300ms linear; -o-transition: all 300ms linear; -ms-transition: all 300ms linear; transition: all 300ms linear; line-height:4px; } .ca-sub { font-size: 16px; color: #666; -webkit-transition: all 300ms linear; -moz-transition: all 300ms linear; -o-transition: all 300ms linear; -ms-transition: all 300ms linear; transition: all 300ms linear; font-family:myriad pro; } ul.ca-menu li:hover { border-color: #001e4…
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: accordion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27380882
tagged with: css
has title: jQuery sub-menu Accordion
type: AnsweredQuestion
downvote count: 1
type: Question

http://stackoverflow.com/q/27416640
linked to: http://stackoverflow.com/q/19183311
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1445385
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/43277410
type: Question
has comment: http://stackoverflow.com/comment/43277635
has body: Im having an issue on my CI code. I cant access the authenticate method of my Login controller. There's a 404 error appearing in my browser window. Here's my code Brand This is the Login Controller with the authenticate() method. <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Login extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('user'); } public function index() { $this->load->view('login'); $this->template->set_layout('default'); $this->template->set_partial('nav', 'partials/nav'); $this->template->append_metadata(' '); $this->template->build('login'); } public function authenticate() { $error=0; $username = $this->input->post('username'); $password = $this->input->post('password'); if ($this->user->login($username, $password)) { $error=0; echo json_encode(array('status' => 'success', 'error' => $error)); } else{ $error=1; echo json_encode(array('status' => 'error', 'error' => $error)); } echo json_encode(array('status' => 'success', 'error' => $error)); } } Im calling the controller using AJAX with the url: "login/authenticate" and the default controller is set to Login. I have no problem with the model. I'm sure that I have configured it properly. Thank You.
has comment: http://stackoverflow.com/comment/43277501
tagged with: javascript
has comment: http://stackoverflow.com/comment/43277484
has comment: http://stackoverflow.com/comment/43276882
has comment: http://stackoverflow.com/comment/43276981
has comment: http://stackoverflow.com/comment/43277216
has comment: http://stackoverflow.com/comment/43277275
score: 0
has comment: http://stackoverflow.com/comment/43276903
tagged with: ajax
has title: Code Igniter Controller-JS (AJAX) issue
has comment: http://stackoverflow.com/comment/43277097

http://stackoverflow.com/a/31202548
score: 0
has body: As of GWT 2.7.0, this isn't possible. You might want to follow this GWT bug. The -XmethodNameDisplayMode Full only applies to the browser's dev tools. So if you set this parameter and set a breakpoint in the source code, the method names of the call stack will be displayed correctly in dev tools. This doesn't affect the call stack produced by log output (which is what you posted in your question).
type: Answer
answers question: http://stackoverflow.com/q/27320573

http://stackoverflow.com/comment/43248169
type: AnswerComment
score: 0
has text: my bad, forgot to add the index ;-) should work now
comment on: http://stackoverflow.com/a/27401579
type: Comment

http://stackoverflow.com/comment/43206493
score: 0
comment on: http://stackoverflow.com/q/27378210
type: Comment
type: QuestionComment
has text: @JamesDonnelly I am new to this place. Thank you for correcting me. That wont be repeated.

http://stackoverflow.com/comment/43210652
type: AnswerComment
score: 0
type: Comment
has text: It returns `date` because this is attribute. Try `$("input").prop("type")` and you will see `text`. Check my answer about difference between attributes and properties. http://jsfiddle.net/6mnqfhe4/2/
comment on: http://stackoverflow.com/a/27358946

http://stackoverflow.com/comment/43288122
score: 0
type: Comment
has text: @vsync I would attach all my events to the document if it meant my page loaded 200ms faster (even if I incurred a 50ms lag when the events actually fire).
type: AnswerComment
comment on: http://stackoverflow.com/a/27364987

http://stackoverflow.com/q/27431368
tagged with: css
score: 2
type: AnsweredQuestion
downvote count: 0
type: Question
has title: using html and styling within javascript
has body: Hello I am building a flask web application and including a web text editor called ckeditor into it. I figured out how to include custom resume templates into my application by modifying a file called default.js. I think anyone who knows a lot about javascript could help me out, without knowing about ckeditor specifics My issue is that I want to style the html such as name in the h1 tag etc but am not sure how to do this. The default.js file uses a javascript array to render templates. How would I link a css stylesheet to the html I have in default.js and actually have it be styled. Any help would be appreciated! Here is the script I have in that default.js, which currently renders one template // Register a template definition set named "default". CKEDITOR.addTemplates( 'default', { // The name of the subfolder that contains the preview images of the templates. imagesPath : CKEDITOR.getUrl( CKEDITOR.plugins.getPath( 'templates' ) + 'templates/images/' ), // Template definitions. templates : [ { title:'Resume Simple', image:'resume1.jpg', html: ' Name ' + ' [Address, City, ST Zip Code][Telephone][Email]'+ ' Education '+ ' [Degree][Date Earned][School] '+ ' Skills & Abilities ' } ] });
tagged with: javascript
tagged with: ckeditor
upvote count: 2
has answer: http://stackoverflow.com/a/27433675
accepted answer: http://stackoverflow.com/a/27433675
answer count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/27454211
has comment: http://stackoverflow.com/comment/43422465
has comment: http://stackoverflow.com/comment/43437734
type: Question
has comment: http://stackoverflow.com/comment/43367522
tagged with: javascript
has comment: http://stackoverflow.com/comment/43390498
has comment: http://stackoverflow.com/comment/43393579
has comment: http://stackoverflow.com/comment/43424558
answer count: 2
tagged with: google-chrome-extension
has title: How to get (not set) the background color of selected text in Chrome via an extension?
downvote count: 0
has answer: http://stackoverflow.com/a/27555331
has answer: http://stackoverflow.com/a/27454286
has comment: http://stackoverflow.com/comment/43371550
favorite count: 0
has body: I've seen lots of questions about setting the background color of selected text in Chrome and other browsers using the ::selection selector, but I haven't been able to find anything that discusses getting the color currently being used by the browser on the user's OS. For a Chrome extension I've created a fake input element, and would like to style the "selected" text in that element with the same foreground and background colors as used in real input elements. So I'm wondering if there's an extension API in Chrome that lets JavaScript look up the colors currently being used by the browser for selected text. Given different combinations of platform, OS version and desktop theme, those colors may change from user to user, so simply hard-coding a couple of values isn't sufficient (though that's what I'm doing currently). One approach might be to render an input with selected text into a canvas and sample the colors, though I haven't investigated whether taking what's essentially a screenshot is possible via an extension without user interaction (the desktopCapture API seems to show a dialog to the user). So I'm hoping there's an API for looking up the colors used by various UI elements. Simply getting access to the browser's default user agent style sheet would suffice.
has comment: http://stackoverflow.com/comment/43371578
has comment: http://stackoverflow.com/comment/43352720
tagged with: css
has comment: http://stackoverflow.com/comment/43536767
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43463750
has comment: http://stackoverflow.com/comment/43514105
upvote count: 1
has comment: http://stackoverflow.com/comment/43367548
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/43422371

http://stackoverflow.com/q/27466401
tagged with: cookies
has answer: http://stackoverflow.com/a/27466451
accepted answer: http://stackoverflow.com/a/27466451
has title: Javascript substitute for cookies
type: Question
has body: In javascript, is there a clear and concise substitute for cookies? I am currently storing game saves in cookies, and looking for a way to make them harder to accidentally (or purposely) delete.
tagged with: javascript
score: 0
answer count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43368796

http://stackoverflow.com/q/27363652
has answer: http://stackoverflow.com/a/27364086
tagged with: calendar
has title: Calendar not loading in web app
type: Question
tagged with: javascript
tagged with: jquery
answer count: 1
type: UnansweredQuestion
has body: This is the code which I used. $(document).ready(function () { function runAjax(selYearOptVal, selMonthOptVal) { $.ajax({ type: 'GET', url: "./calendar.xml", dataType: "xml", success: function (xml) { // For Year var optYearValue; if ($('#selectYear option').length == 0) { var select = $('#selectYear'); $(xml).find('year').each(function () { optYearValue = $(this).attr('whichyear'); if (optYearValue == selYearOptVal) { select.append("&lt;option value='" + optYearValue + "' selected=\"selected\"&gt;" + optYearValue + "&lt;/option&gt;"); } else { select.append("&lt;option value='" + optYearValue + "'&gt;" + optYearValue + "&lt;/option&gt;"); } }); } } }); } } Here, calendar.xml contains the list of holidays for each month. But calendar isn't loading, only holiday lists are loading. How can I fix this?
score: 0

http://stackoverflow.com/a/27464238
answers question: http://stackoverflow.com/q/27463992
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43406533
has comment: http://stackoverflow.com/comment/43364660
has body: (I'm assuming in all of this that 'thisurl' is an actual url and you just gave us sampledata of 'thisurl')> Okay first, you can't use tags inside strings so this &lt;cfset regeneratelink = insert('&lt;cfoutput&gt;#address#&lt;/cfoutput&gt;','thisUrl',case1)&gt; should be this &lt;cfset regeneratelink = insert('#address#','thisUrl',case1)&gt; But even can be this &lt;cfset regeneratelink = insert(address,'thisUrl',case1)&gt; Straight from wiki docs, the format to use the Insert function is this Insert(substring, string, position) So, when you search cfhttp.filecontent for thisURL, you're finding it at position 13,048. You're then trying to insert the address into the string thisURL as position 13,048 and it only has a length of 7. So it seems like you actually want to use.. &lt;cfset regeneratelink = insert(address, cfhttp.filecontent, case1)&gt; But that will will actually insert the substring into the string at the first character where &lt;cfset regeneratelink = insert(address, cfhttp.filecontent, case1+len('thisurl'))&gt; However, if you're doing all that you can just use replace &lt;cfif find('thisUrl',cfhttp.filecontent)&gt; &lt;cfset regeneratelink = Replace(cfhttp.filecontent,'thisUrl','thisurl' &amp; address,"ONE")&gt; &lt;cfelse&gt; &lt;!--- 'thisURL' was not found, do something else? ---&gt; &lt;/cfif&gt; Which replaces just the first occurrence.
has comment: http://stackoverflow.com/comment/43364746
score: 1
upvote count: 1

http://stackoverflow.com/comment/43459869
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27473354
type: Comment
has text: Take the example I give you and copy paste it into an enpty file: JC027.html and open it. This DOES NOT LOOP in IE and Chrome. Could you confirm?

http://stackoverflow.com/comment/43335036
score: 1
comment on: http://stackoverflow.com/a/27447807
type: Comment
has text: Thanks I really like your suggestions! Also, could you explain to me a situation where you would use .data()?
type: AnswerComment

http://stackoverflow.com/comment/43101144
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27320846
score: 0
has text: What's the status code (do bear in mind everything necessary to answer the question needs to be in the question, not on jsfiddle)

http://stackoverflow.com/comment/112431605
type: AnswerComment
comment on: http://stackoverflow.com/a/31924309
score: 0
type: Comment
has text: One drawback of the first method is if you have unsaved changes: calling `cancelChanges()` will restore the data to the state of the latest `dataSource.data(dataItems)` calls. If that's a problem, you must remember `_pristineData` and restore it later.

popup
tags question: http://stackoverflow.com/q/27423715
type: Tag
tags question: http://stackoverflow.com/q/27327191
tag name: popup
tags question: http://stackoverflow.com/q/27422796
tags question: http://stackoverflow.com/q/27458776
tags question: http://stackoverflow.com/q/27406703
tags question: http://stackoverflow.com/q/27444628
tags question: http://stackoverflow.com/q/27386024
tags question: http://stackoverflow.com/q/27419646
tags question: http://stackoverflow.com/q/27428229
tags question: http://stackoverflow.com/q/27356196

http://stackoverflow.com/comment/43255643
score: 0
comment on: http://stackoverflow.com/a/27405452
type: AnswerComment
has text: @Egor - the `prepend` is not the *only* problem... Read Pointy's entire comment
type: Comment

http://stackoverflow.com/a/27373995
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/27373938
has comment: http://stackoverflow.com/comment/43198623
score: 2
has comment: http://stackoverflow.com/comment/43198519
has body: First you need to fix bugs in your code: space between new and Date (new Date). typo in var currenTime -> var currentTime missing +after minutes in var currentTime Later, in case you want to make a real time clock, you need to use setInterval to call updateTime every second. setInterval(updateTime, 1000); Like this. And of course define &lt;div id="counter"&gt;&lt;/div&gt; in your html. $(document).ready(function() { function updateTime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var seconds = now.getSeconds(); var currentTime = hours + ':' + minutes + ':' + seconds; var counter = document.getElementById('counter'); counter.innerHTML = currentTime; } updateTime(); setInterval(updateTime, 1000); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="counter"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/43198658
downvote count: 0
has comment: http://stackoverflow.com/comment/43198683
has comment: http://stackoverflow.com/comment/43198609

http://stackoverflow.com/comment/43143424
comment on: http://stackoverflow.com/a/27343871
type: AnswerComment
has text: @scraaappy: No, `toFixed` rounds, ***period***, if it can't fit the number in the space you give it. See the snippet at the beginning of the answer above. See [my comment](http://stackoverflow.com/questions/27343789/how-to-get-number-with-2-decimal-and-not-rounding-using-javascript/27343871?noredirect=1#comment43143377_27343789) on the question. Read [the spec](http://www.ecma-international.org/ecma-262/5.1/#sec-15.7.4.5). Or [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed). All of these will show you that it rounds.
score: 0
type: Comment

http://stackoverflow.com/q/27416595
has answer: http://stackoverflow.com/a/27451895
tagged with: mysql
upvote count: 1
type: Question
has title: How to pre populate a forms fields from a database using a link?
tagged with: database
tagged with: javascript
tagged with: forms
answer count: 2
has answer: http://stackoverflow.com/a/27416719
downvote count: 0
has body: Ok so I have an html form. This form is used to collect user/members information. It uses a database with several columns 2 of importance "user_email" &amp; "invoice_id". In my form the "user_email" input is hidden and upon page load is equal to the the value of a logged in users provided email address on file. When a user submits multiple form submissions, multiple records with the same user_email are created in my database. So say for instance if user1 submitted 3 forms there would be 3 records in my database all with their "user_email" column value equal to that of logged in user1's email. Trying to figure out a way to display a list of links that when clicked on will pre populate the form with with info from each record available in the database. So if user1 is logged in and has 3 records, 3 links would be generated/displayed and each link when clicked on would pre populate the form with record data from the database. And this is where the "invoice_id" input comes in...the links generated need to be labeled or titled with the value/text of whatever the users "invoice_id" value is for each particular record. Note that the "user_id" input value is already auto generated and pre filled with a unique serial number ALSO upon page load... Any help or point in the right direction to achieving this would be great. Thanks. &lt;form action="xxx.php" class="well" id="xxx" name"xxx" method="post"&gt; &lt;input type="hidden" id="user_email" name="user_email" value="xxx@email.com"&gt; &lt;input type="text" id="invoice_id" name="invoice_id"&gt; &lt;input type="text" id="other1" name="other1"&gt; &lt;input type="text" id="other2" name="other2"&gt; &lt;input type="submit" value="Submit"&gt;
score: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/43310040
comment on: http://stackoverflow.com/a/27433526
type: Comment
type: AnswerComment
has text: I can't get this to work. It's not adding attributes when doing submissions. Here is my question on that http://stackoverflow.com/questions/27434183/java-htmlunit-attributes-not-being-added-before-submitting-form
score: 0

http://stackoverflow.com/a/27325925
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43111025
upvote count: 2
type: Answer
has body: Here's a pretty simple way to do it: ([a-zA-Z]+)(?=,|\)) This looks for any word that is succeeded by either a comma or a close-parenthesis. var s = "DoNotFindMe('DoNotFindMe')\nDoNotFindMe(FindMe)\nDoNotFindMe(FindMe,FindMe)\nDoNotFindMe(FindMe,FindMe,FindMe)"; var r = s.replace(/([a-zA-Z]+)(?=,|\))/g, "'$1'" ); alert(r); Used the same test code as the other two answers; thanks!
has comment: http://stackoverflow.com/comment/43111035
has comment: http://stackoverflow.com/comment/43111012
downvote count: 0
answers question: http://stackoverflow.com/q/27325450
accepted answer of: http://stackoverflow.com/q/27325450
score: 2

http://stackoverflow.com/q/27332227
answer count: 3
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: Suppress the stack trace in Karma (AngularJS)
type: UnansweredQuestion
upvote count: 6
has answer: http://stackoverflow.com/a/39572073
tagged with: karma-runner
has answer: http://stackoverflow.com/a/65744549
has body: Does anyone know of a way to suppress the stack trace given by Karma when testing AngularJS? (Either via a config option or plugin). Ideally I want my test report to be nothing more than a list of single line test case failures with the usual summary. I like writing out my test for a given module in one go and then using this as a straight forward todo list when writing actual code. This is how I usually have it setup when unit testing other stuff. Instead I get lines and lines of a trace and have to scroll around searching for the only line I care about: "browser version (os) my useful test case FAILED" I have tried various karma config logLevel options, but I still get a trace dump. Please note: I am not looking for a debate on the merits of stack traces. I have a specific question and only care about a specific answer. If you know of a plugin that will provide similar or perhaps superior reporting to what I am looking for then please do share!
score: 6
tagged with: stack-trace
tagged with: unit-testing
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/46753763

http://stackoverflow.com/comment/43374086
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27469518
score: 0
has text: can you show us the html code?

http://stackoverflow.com/q/27413408
score: 0
tagged with: toastr
has answer: http://stackoverflow.com/a/27529889
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43272748
has body: I issued toastr.error("a message") but got this error. It happens in _setContainer when it does $animate.enter().then(function()). What am I missing? function _setContainer(options) { if(container) { return containerDefer.promise; } // If the container is there, don't create it. container = angular.element('&lt;div&gt;&lt;/div&gt;'); container.attr('id', options.containerId); container.addClass(options.positionClass); container.css({'pointer-events': 'auto'}); var body = $document.find('body').eq(0); $animate.enter(container, body).then(function() { containerDefer.resolve(); }); return containerDefer.promise; }
has comment: http://stackoverflow.com/comment/43297983
has comment: http://stackoverflow.com/comment/43286094
type: UnansweredQuestion
has title: Getting 'Cannot read property 'then' of undefined' using toastr
type: Question

http://stackoverflow.com/q/27347656
score: 3
has title: Understanding CORS security: what's the use of server allowing browser cross-domain access?
upvote count: 4
tagged with: cross-domain
tagged with: cors
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
tagged with: security
has answer: http://stackoverflow.com/a/27347724
has comment: http://stackoverflow.com/comment/43150115
has body: I just found out that in order to allow cross-domain AJAX calls, Access-Control-Allow-Origin header should be set on SERVER side. This looks frustrating to me, let me explain why: 1) Typical use case is that the client wants to make a cross-domain request. I have never heard of a server trying to restrict access from alien webpages. Oh, I remember 'prevent images hotlinking', a funny feature of my hosting, which can be easily beaten by sending fake 'Referrer` header. 2) Even if server wanted to restrict connections from other domains, it's impossible to do this using capabilities of HTTP protocol. I suggest using tokens for that. 3) What's the use of blocking XMLHttpRequests while you still can use jsonp? Can you explain why is this done that way? For those who are still reading, there's a bonus question: 4) Do you know a way to prevent any cross-domain request from a webpage? Imagine a junior web developer creating a login form on a page having ads or other scripts potentially sniffing passwords? Isn't this the essence of web security? Why anyone is talking about that?
type: AnsweredQuestion
downvote count: 1
accepted answer: http://stackoverflow.com/a/27347724
type: Question
has comment: http://stackoverflow.com/comment/43150218

http://stackoverflow.com/comment/43227628
comment on: http://stackoverflow.com/q/27388435
score: 0
type: Comment
has text: I have tried swapping the timeout for digest to no effect. syarul, I'm just showing the one test case and the relevant parts of the controller and factory classes. just so you can see that the Chart.get returns a promise, that vm.chartData is populated after the promise returns, etc. I assumed I was missing something obvious having to do with jasmine, sorry for upsetting you.
type: QuestionComment

http://stackoverflow.com/q/27448784
upvote count: 28
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43336546
has body: Why do we still have to use quoted string literal to switch on strict in JS? Surely something a little more strongly 'typed' could be used here, like calling a built in function, say, Object.UseStrict()or something like that. What is the reason behind having to resort to a string literal?
tagged with: use-strict
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27448817
downvote count: 1
linked to: http://stackoverflow.com/q/1335851
has comment: http://stackoverflow.com/comment/43336367
type: Question
accepted answer: http://stackoverflow.com/a/27448817
duplicate of: http://stackoverflow.com/q/1335851
tagged with: ecmascript-5
tagged with: javascript
score: 27
has title: Why is "use strict" still a string literal?

http://stackoverflow.com/a/27367166
answers question: http://stackoverflow.com/q/27351976
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27351976
type: Answer
score: 4
has body: You're printing a dumper to the log basically, not the browser. Your stash is not used in the render because you're not referencing it. Use inline render type and the "dumper" helper. Try: $self-&gt;stash(commandsets =&gt; \@commandsets ); $self-&gt;render( inline =&gt; '&lt;%= dumper $commandsets %&gt;' );
upvote count: 4

http://stackoverflow.com/comment/43256715
comment on: http://stackoverflow.com/a/27404960
score: 0
has text: Re. alternate solution: no, it does not suggest that you add another class on body and create another set of namespaced rules. Just remove the class and the first stylesheet rules will match no more.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27449360
has body: another scripting noob playing with fire :) I have a SVG to which I appended a rectangle. The rectangle has a background image which appears but is blurry (oddly more so in IE than Chrome). I've played with different image types but encounter the same problem. Any idea how to prevent the image from being blurred ? Code attached below - my Fiddle:- http://jsfiddle.net/FarinU/22jcj3vc/ var spaceWidth = 600; var spaceHeight = 300; var myContainer = d3.select('#abc1') .append('svg') .attr('class', 'box') .attr('width', spaceWidth) .attr('height', spaceHeight); var pattern = myContainer.append("defs") .append("pattern") .attr("id", "bg") .attr("patternUnits", "userSpaceOnUser") .attr('width', "200px") .attr('height', "200px") .append("image") .attr("xlink:href", "http://www.bbc.co.uk/commissioning/images/img-bbc-one-logo-small.gif") .attr('width', "200px") .attr('height', "200px"); var rectangle = myContainer.selectAll("rectangle") .data([{ }]) .enter() .append('svg:rect') .attr("x", 10) .attr("y", 10) .attr("width", 300) .attr("height", 200) .style("fill", "url(#bg)") .style("stroke", "green") .style("stroke-width", "5"); Thanks.
accepted answer: http://stackoverflow.com/a/27449529
answer count: 1
favorite count: 0
tagged with: d3.js
has answer: http://stackoverflow.com/a/27449529
type: AnsweredQuestion
downvote count: 0
score: 1
has title: D3: SVG Background: Blurry
type: Question
upvote count: 1
tagged with: javascript

http://stackoverflow.com/q/27334690
score: 1
has answer: http://stackoverflow.com/a/27348527
favorite count: 0
possible better answer: http://stackoverflow.com/a/27335134
has comment: http://stackoverflow.com/comment/43126413
has answer: http://stackoverflow.com/a/27335134
has answer: http://stackoverflow.com/a/27334810
tagged with: php
answer count: 4
type: AnsweredQuestion
has title: PHP validation form
tagged with: forms
upvote count: 1
accepted answer: http://stackoverflow.com/a/27348527
has comment: http://stackoverflow.com/comment/43126737
type: Question
has comment: http://stackoverflow.com/comment/43126944
has answer: http://stackoverflow.com/a/27335156
has body: I have been trying to get validation messages from my login.php to display on the page with the form, where am I going wrong? I did try JavaScript at one point to display the information with no luck, it keeps displaying as seen in the image below. I know it could be added to the same page for the result I want but I'm trying to do it as a clean page, with no jQuery, some vanilla JavaScript at very most. The aim is to have the validation messages above the form, at first I was thinking spans but I'm not sure where to look for tutorials on how to output results from another file while staying on the same page. http://snag.gy/SI9lq.jpg Username: Password: Register <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; $errors = array(); if ($username&&$password) { $connect = mysql_connect("localhost","root","") or die ("Could not connect"); mysql_select_db ("login") or die ("Could not find database"); $query = mysql_query("SELECT * FROM users WHERE username ='$username'"); $numrows = mysql_num_rows($query); if ($numrows !=0) { while ($row =mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($username==$dbusername&&$password==$dbpassword) { echo header( 'Location: member.php' ) ; $_SESSION['username']=$dbusername; } else echo" "; } else die("That user dosen't exist"); } else die("Please enter a username and a password"); ?> EDIT I attempted to add JavaScript although it had the same effect.
tagged with: javascript
has comment: http://stackoverflow.com/comment/43126562
downvote count: 0

http://stackoverflow.com/q/27377986
type: AnsweredQuestion
tagged with: average
type: Question
has answer: http://stackoverflow.com/a/27378603
tagged with: javascript
has body: Someone helped my with this earlier, but didn't give me 100% what I wanted. This program averages the grades that are entered, but what if no grades were entered? How do I detect whether or not the user entered grades into the promptbox, and if they didn't, how can I display that No Grades were entered in place of where it says "The Average of the grades you've entered is:" Here's the Javascript Here's the HTML Prompt The average of the grades you've entered is:
accepted answer: http://stackoverflow.com/a/27378603
answer count: 1
score: 0
has title: How can I edit this code so that I can get the program to detect if no grades were entered when the prompt box is empty or cancel is hit?

http://stackoverflow.com/comment/43333476
type: QuestionComment
has text: @Stokedout How do I go about loading the images in the way I am asking?
comment on: http://stackoverflow.com/q/27446875
score: 0
type: Comment

http://stackoverflow.com/comment/43388474
type: Comment
comment on: http://stackoverflow.com/a/27473510
type: AnswerComment
has text: Thanks for the answer Elijah! Before this I was actually thinking about placing a transparent circle which overlaps the two, but that would generate unnecessary overhead.
score: 0

http://stackoverflow.com/comment/43189486
score: 1
type: AnswerComment
type: Comment
has text: As soon as I have the reputation to I certainly will! Thanks again.
comment on: http://stackoverflow.com/a/27337999

http://stackoverflow.com/comment/43282645
has text: hi added the hide(); method after the function in both my question and my jsfiddle, I am quite new at developing so I have to ask must I out the selector divs in to. Thanks again for the help.
comment on: http://stackoverflow.com/q/27395907
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27437723
type: Question
tagged with: angular-ui-router
tagged with: angularjs-scope
score: 0
has title: Reloading a page in angularjs application looses data
answer count: 1
has answer: http://stackoverflow.com/a/27437904
tagged with: angular-ui
tagged with: javascript
has body: Background: I have a multi page angularjs application. I have a service factory object that I load with values in my initial page. The values loaded to the service factory object are available in the different views or pages via their corresponding controller js. The value provided by the user is lost if the user tries to do a browser refresh by clicking F5 button. My issue: When the application is loaded the 'loginView' is displayed, the userId and password entered by the user is passed to the second view (summaryView.html). And i can see the userId and password displayed correct in the second page. But if i refresh my second view (summaryView.html) then I loose all the values. The application is sort of reset. I would like to retain the user supplied data even after the browser is refreshed or reloaded. My code: **index.html** &lt;div ng-app="offlineInspectionApp"&gt; &lt;div ng-view&gt;&lt;/div&gt; &lt;/div&gt; &lt;script&gt; var mainApp = angular.module("offlineInspectionApp", ['ngRoute']); mainApp.factory( 'AuthService', function() { var userCore = {userId : "anonymous" , password: "password", status :"online"}; return {userCore: function() { return userCore; }}; }); mainApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/summary', { templateUrl: 'summaryView.html', controller: 'SummaryViewController' }). when('/login', { templateUrl: 'loginView.html', controller: 'LoginViewController' }); }]); **LoginViewController.js** angular.module("offlineInspectionApp").controller('LoginViewController', function($scope,$http,$location, AuthService) { $scope.authenticateUser = function() { AuthService.userCore.userId = $scope.userId; AuthService.userCore.password = $scope.password; $location.path( "/summary" ); } }); **SummaryViewController.js** angular.module("offlineInspectionApp").controller('SummaryViewController', function($scope,$http,$location, AuthService) { $scope.syncInspectionDetails = function(inspectionId) { alert(AuthService.userCo…
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/43165976
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27356662
type: Comment
has text: I assume you're already got one if they are making AJAX requests, just use `return $.ajax({ /* settings */ });`

http://stackoverflow.com/q/27353680
tagged with: javascript
tagged with: angularjs-validation
has comment: http://stackoverflow.com/comment/43161090
has comment: http://stackoverflow.com/comment/43161164
has title: TypeError: Unable to get value of the property '$dirty': object is null or undefined
linked to: http://stackoverflow.com/q/27382799
favorite count: 0
has comment: http://stackoverflow.com/comment/53417554
answer count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43161394
type: UnansweredQuestion
upvote count: 1
has body: My AngularJS application is working perfectly in Firefox but not in Internet Explorer(9). The form validation is done using $dirty. $scope.hasError = function(field, validation){ if(validation){ return ($scope.myForm[field].$dirty &amp;&amp; $scope.myForm[field].$error[validation]) || ($scope.submitted &amp;&amp; $scope.myForm[field].$error[validation]); } return ($scope.myForm[field].$dirty &amp;&amp; $scope.myForm[field].$invalid) || ($scope.submitted &amp;&amp; $scope.myForm[field].$invalid); }; The issue I face in IE9 is that validation doesn't work and the console says TypeError: Unable to get value of the property '$dirty': object is null or undefined. What went wrong? Please help!
score: 1
has comment: http://stackoverflow.com/comment/43161356
type: Question
downvote count: 0

http://stackoverflow.com/q/27405762
downvote count: 0
has comment: http://stackoverflow.com/comment/43262607
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/43264127
has title: How to handle a Backbone.Model sync that requires several ajax calls?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43257350
answer count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43256564
type: Question
has comment: http://stackoverflow.com/comment/43263174
has body: Let's say I have a Backbone.Model that has the attributes id, a, and b. When I make a call to the server (let's say it returns json but is not a standard REST server) to fetch the data for id, it returns json that contains the values for a and b. The json is parsed in my override of the parse() function. At this point life is good. Then I do something like the following: myModel.set('a', 'foo'); myModel.set('b', 'blah'); myModel.save(); But the server api is not consistent, and I need to call one api endpoint to update 'a' and a different api endpoint to update 'b'. I've overridden the sync() function of my model, would it be correct to call Backbone.sync() twice from my override of the sync() function? Once for updating a and once for b? One issue with this is that I can only return the result of one of the Backbone.sync() calls. Is there are better way to handle this situation?
tagged with: javascript
has comment: http://stackoverflow.com/comment/43256187
has comment: http://stackoverflow.com/comment/43257036
tagged with: ajax

http://stackoverflow.com/comment/43365700
comment on: http://stackoverflow.com/a/27464265
has text: Almost right. You implement your object access using getters and setters **in case** you ever want to associate additional logic with the setting/retrieval of a property. This might include abstraction (see decorator pattern) access control and side effects.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43241493
type: Comment
has text: Still stuck with this bug.
comment on: http://stackoverflow.com/a/27390825
type: AnswerComment
score: 0

http://stackoverflow.com/q/27328556
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27328570
accepted answer: http://stackoverflow.com/a/27328570
duplicate of: http://stackoverflow.com/q/7486085
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43116678
upvote count: 1
type: Question
has title: Modifying one array modifies another one I made from it
has body: var allCoords = [{ x: 2, y: 3 }, { x: 3, y: 4 }]; var emptySpaces = allCoords; emptySpaces.splice(0, 1); console.log(allCoords.length); console.log(emptySpaces.length); I do not understand why both of these output "1". Why is the original array, allCoords being modified, when I only want the second one, emptySpaces to be edited?
score: 1
tagged with: arrays
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43197208
type: QuestionComment
type: Comment
has text: no I'm not, just a normal html view page with razor syntax.
comment on: http://stackoverflow.com/q/27373196
score: 0

http://stackoverflow.com/a/27405565
score: 1
has comment: http://stackoverflow.com/comment/43256140
downvote count: 0
answers question: http://stackoverflow.com/q/27405408
has body: var i=1; $(".plans-description").each(function() { $("ul li:nth-child("+ i +")").prepend( $(this).clone(true)); i++; }); @Olli K: Actually $.each provides the index for you, so you can just write: $(".plans-description").each(function(i) { $("ul li:nth-child(" + (i + 1) + ")").prepend($(this).clone(true)); }); http://jsfiddle.net/washington_guedes/br1034r6/8/
type: AcceptedAnswer
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43256643
accepted answer of: http://stackoverflow.com/q/27405408

http://stackoverflow.com/comment/43178989
score: 0
type: Comment
type: QuestionComment
has text: Actually I was doing like that but I wanted to try regex.
comment on: http://stackoverflow.com/q/27363331

http://stackoverflow.com/q/27424705
tagged with: uri
tagged with: javascript
tagged with: jquery
score: 0
has title: jQuery IF/ELSE based on URI in WordPress not working
answer count: 0
type: UnansweredQuestion
tagged with: wordpress
has body: I've got a website, http://mxaward.org, and it's a WordPress site. For some reason, the first page and the 'Artikelen' page do not have the current-menu-item class which indicates that you are on a certain page. It does work for the 'Partners' and 'Contact' pages. I decided to make a jQuery xcript in the header that would check the URI and if it was == "/", it would select the first menu item and it would addClass('current-menu-item'). If URI == "/artikelen/", it would select the second menu item and add the class. I put this in the head: &lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ var uri = "&lt;?php echo $_SERVER['REQUEST_URI'] ?&gt;"; if (uri == "/"){ jQuery('ul.mx-nav li:first').addClass('current-menu-item'); } else {}; if (uri == "/artikelen/"){ jQuery('ul.mx-nav li:nth-child(2)').addClass('current-menu-item'); } else{} }); &lt;/script&gt; The weird thing now is that the index-part works beautifully (first menu item is selected and the class is added), but the 'artikelen' part doesn't. I used to have an if(){} else if(){} else {} instead of if(){}else twice, but it had thesame effect. I echo'd the URI, the uri is fine. I tried li:eq(1) and several selector variants. I've even switched the two if/elses to see if it would only pick the first or second if/else. I'm completely lost, does anyone have a solution for me? Thanks, -Sean
has comment: http://stackoverflow.com/comment/43327612
has comment: http://stackoverflow.com/comment/43305509
type: Question
tagged with: addclass

http://stackoverflow.com/a/27536195
has body: Obviously you need to return something from your getWhatsNew() function. Your code works out to be the same as this: function getWhatsNew() { $.ajax({ type: 'POST', url: 'http://10.76.116.54:8080/whatsnew', data: null, dataType: 'json', async: false, success: function (response) { return response; } }); return null; } You could get around this by adding the following to your SWF's initialization: ExternalInterface.addCallback("receiveUpdate", receiveUpdate); And your ajax "success" function: success: function (response) { getSWF("whatsNewSWF").receiveUpdate(response); } See the Adobe documentation for more detail.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27462196

http://stackoverflow.com/comment/43308800
type: Comment
type: QuestionComment
score: 0
has text: Looks like you're using `$http.jsonp()` which expects back a function call. That's just plain JSON.
comment on: http://stackoverflow.com/q/27433383

http://stackoverflow.com/a/27371913
downvote count: 0
score: 1
upvote count: 1
has body: kinldy follow and check the link hopefully you will get to understand what you are trying to achieve. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON after value get returned as json you can save it to PHP variable.
type: Answer
answers question: http://stackoverflow.com/q/27371839

http://stackoverflow.com/a/27446033
downvote count: 0
score: 1
type: Answer
has body: If you take a look at the accordion API you'll see that there's no option called speed, you need to use animate. The equivalent to a duration setting of fast for slideUp and slideDown, in milliseconds, is 200, so you can just use that as a number value: $(".faq-accordion &gt; div").accordion({ header: "h4", collapsible: true, active: false, animate:200 }); Here's your fiddle updated with this: http://jsfiddle.net/z3Lx1o0y/
answers question: http://stackoverflow.com/q/27445907
upvote count: 1

http://stackoverflow.com/a/27528871
has body: Try updating your less files a bit, to simplify. This is a common design pattern, and it works very well for me: /*main.less*/ @import "somefile.less" @import "some/deep/nested/file.less" In your other less files, those will be where you keep your actuall less code. Then in your gulpfile.js you will want to modify a bit: ... gulp.task('less', function () { gulp.src(['less/main.less']) //only pull in your main.less file .pipe(less()) .pipe(autoprefixer()) .pipe(minifyCSS()) .pipe(gulp.dest('asset/')); }); ... gulp.task('watch', function() { gulp.watch('javascript/*.js', ['js']); gulp.watch('less/*.less', ['less']); //this remains the same - you want to watch for all changes }); Note: gulp.watch will not find new files - you will need to restart when you have new files, or use something like gulp-watch. This will solve all kinds of headaches for you. Hope it helps!
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43549884
accepted answer of: http://stackoverflow.com/q/27411000
answers question: http://stackoverflow.com/q/27411000
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/27447353
answers question: http://stackoverflow.com/q/27443443
score: 0
type: AcceptedAnswer
has body: Assuming your schema definition of details being an array is what you want, you need to also make details an array when you create new docs. So your function should change to: function addTitle (kilometer, liter, kmLiter, callback){ var data = { kilometer: kilometer, liter: liter, kmLiter: kmLiter } detail.create({details: [data]}, callback); }
type: Answer
accepted answer of: http://stackoverflow.com/q/27443443

http://stackoverflow.com/a/27421793
downvote count: 0
answers question: http://stackoverflow.com/q/27421590
type: Answer
accepted answer of: http://stackoverflow.com/q/27421590
score: 2
has comment: http://stackoverflow.com/comment/43286033
upvote count: 2
has body: My trick is to move the arrow into a pseudo-element, and position it absolutely within the .styled-select element. See fiddle here: http://jsfiddle.net/teddyrised/bx131j42/3/ .styled-select { position: relative; overflow-x: hidden; width: 200px; padding: 5px; background-color: #6d6d6d; } .styled-select::before { pointer-events: none; content: ''; display: block; position: absolute; top: 0; bottom: 0; right: 0; width: 20%; background: #6d6d6d; background-image: (...); background-repeat: no-repeat; background-position: center center; } pointer-events: none is to ensure that the click event on the pseudo-element is ignored and passed to the &lt;select&gt; element lying underneath (which has a lower z-index). However, some browsers (IE10 and below, for example) do not support this. To circumvent this, you will have to use a real element (instead of a pseudo element, see my comment) and listen to the click handler on that element, and pass it off as a .focus() event on the &lt;select&gt; element, e.g.: Markup: &lt;div class="styled-select"&gt; &lt;span class="dummy-arrow"&gt;&lt;/span&gt; &lt;select&gt;&lt;!-- options --&gt;&lt;/select&gt; &lt;/div&gt; JS: $(function() { $('.dummy-arrow').click(function() { $(this).next('select').focus(); }); }); Some tips: &lt;select&gt; elements are notoriously hard to style because its appearance is highly OS specific. Some browsers/OS will honour the appearance: none declaration, but don't count on it. Instead, you might want to rely on a JS-based replacement/dummy. If you want to remove the blue border around the select element on focus, use outline: none. However, note that this might affect usability of the site (if your select menu is not visually obvious).
has comment: http://stackoverflow.com/comment/43285918
has comment: http://stackoverflow.com/comment/43286013
type: AcceptedAnswer

http://stackoverflow.com/a/51993984
downvote count: 0
has body: set closable property to false: $('.ui.sidebar').sidebar({ dimPage: false, closable: false }).sidebar('show');
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27405642

http://stackoverflow.com/q/27343796
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/27344665
accepted answer: http://stackoverflow.com/a/27344665
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has body: I would like to filter the msgs data by not displaying some message of corresponding userid. In the example below it only shows the message from Paul (userid: 11) &amp; Kate (userid:12). What I would like to do is to filter more than just one userid. Something like : {userid:["!10", "!11"]}; which should display only messages from userid 12 (In this case). Plunker : http://plnkr.co/edit/464FVab41YoV2BGFkgWt?p=preview $scope.msgs = [{name:"John", userid:10, text:"Hello"}, {name:"Paul", userid:11, text:"hi"}, {name:"Kate", userid:12, text:"Hey"}]; $scope.filter = {userid:"!10"}; &lt;div ng-repeat="msg in msgs | filter:filter"&gt; {{msg.name}} ({{msg.userid}}) : {{msg.text}} &lt;/div&gt;
tagged with: angularjs-filter
tagged with: angularjs-ng-repeat
tagged with: angularjs
downvote count: 0
has title: Angularjs: Filter multiple criteria in ng-repeat

http://stackoverflow.com/a/27347124
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27347089
downvote count: 0
has body: I can imagine getScript() spawns XHR and that runs indefinitely, and IE isn't smart enough to limit it. So you make new XHR every 5 seconds, which isn't very good, if you ask me. Maybe just dropping the interval would be good enough, if there's no specific reason for doing it this way. There's then also bug that you'd get new copy of the same script every 5 seconds if the link works, not good either. Try to find a way to set a timeout for it, or use another function, like $.ajax(), and create the script element by hand - or eval it. There you can set the timeout. Also, this might be related: 22206566
type: Answer

http://stackoverflow.com/comment/43339459
type: Comment
has text: missed you by a half of a second. Just added the array thing also. Thanks again.
type: AnswerComment
comment on: http://stackoverflow.com/a/27450480
score: 0

http://stackoverflow.com/comment/43283033
score: 1
has text: You don't need to use `$(that)`, since the argument is already a jQuery object. Just use `that.addClass(...)`.
comment on: http://stackoverflow.com/a/27420094
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43098702
type: QuestionComment
has text: That string is coming from another system so I don't have control over changing it. How can I take that string and convert it to proper JSON without crazy string manipulations?
comment on: http://stackoverflow.com/q/27319647
score: 0
type: Comment

http://stackoverflow.com/comment/43142174
has text: Can you add the data array as well
comment on: http://stackoverflow.com/q/27343345
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43260823
comment on: http://stackoverflow.com/a/27390763
type: Comment
has text: That answer depends on where / how you plan on using the HTML. Storing the data in a controller does not seem right. If you need the data in multiple different places in the app it would make more sense to store the data in a Service. Alternatively you could store the data in the controller of the directive although then only child directives could use it but it would also be available for use in the HTML directly.
score: 0
type: AnswerComment

http://stackoverflow.com/a/27440958
answers question: http://stackoverflow.com/q/27440317
has body: If you want to keep data attributes for your data source, you can do something like this function format ( dataSource ) { var html = ' '; for (var key in dataSource){ html += ' '+ ' ' + key +' '+ ' ' + dataSource[key] +' '+ ' '; } return html += ' '; } $(function () { var table = $('#example').DataTable({}); // Add event listener for opening and closing details $('#example').on('click', 'td.details-control', function () { var tr = $(this).closest('tr'); var row = table.row(tr); if (row.child.isShown()) { // This row is already open - close it row.child.hide(); tr.removeClass('shown'); } else { // Open this row row.child(format({ 'Key 1' : tr.data('key-1'), 'Key 2' : tr.data('key-2') })).show(); tr.addClass('shown'); } }); }); td.details-control { background: url('http://www.datatables.net/examples/resources/details_open.png') no-repeat center center; cursor: pointer; } tr.shown td.details-control { background: url('http://www.datatables.net/examples/resources/details_close.png') no-repeat center center; } Item 1 Item 2 Item 3 Item 4 data 1a data 1b data 1c data 1d data 2a data 2b data 2c data 2d
has comment: http://stackoverflow.com/comment/118972370
has comment: http://stackoverflow.com/comment/118973241
has comment: http://stackoverflow.com/comment/63656162
downvote count: 0
has comment: http://stackoverflow.com/comment/63760912
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/63752981
score: 6

http://stackoverflow.com/comment/43337588
has text: Ah, got it. Thanks @pep. Is there anyway to halt the script processing until the ajax completes?
comment on: http://stackoverflow.com/q/27449417
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27314893
possible better answer: http://stackoverflow.com/a/27315002
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27314945
has comment: http://stackoverflow.com/comment/43089743
type: Question
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
has title: Why is this Array and join is always N-1?
has answer: http://stackoverflow.com/a/27314945
favorite count: 0
has body: When using Array with join it always returns N-1 elements. Here is what I mean. In javascript console I do the below. Array(2).join('*') #=&gt; "*" but I was expecting "**" new Array(1).join('*') #=&gt; "" but I was expecting "*" Am I missing something?
has answer: http://stackoverflow.com/a/27315002
upvote count: 2

http://stackoverflow.com/a/27522433
type: Answer
answers question: http://stackoverflow.com/q/27420539
has body: Manage to solve the problem. Problem I think was that the youtube api didn't load properly on low bandwith so avoided it all together and used the function callPlayer instead. YouTube iframe API: how do I control a iframe player that&#39;s already in the HTML?
score: 0

http://stackoverflow.com/a/27466690
score: 0
type: Answer
has body: The answer to this is not simple as some of the comments have already indicated but I did find something that comes pretty close - HighCharts. They do have a con-centric donut chart that gives exactly the look and feel desired - infact LinkedIn uses them to display their dashboard statistics. The downside to Highcharts is that it is a paid library and its not cheap if you are planning to deploy on a commercial web application The alternative is to use MorrisCharts - http://morrisjs.github.io/morris.js/donuts.html They do have some good donut charts that come pretty close to the need.
answers question: http://stackoverflow.com/q/27325685
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27325685

http://stackoverflow.com/a/27327585
has comment: http://stackoverflow.com/comment/43134743
answers question: http://stackoverflow.com/q/27314855
has body: I got this to work on a ubuntu VM hosted on Windows 8.1, but when I tried directly on Linux Mint 17 got the same error. It worked when I started working on the partition hosted by Linux as I working on another drive and so probably a permission issue with NTFS or whatever. What OS are you using?
score: 0
type: Answer

http://stackoverflow.com/q/27343925
has body: I have an external php file included in my header. I need the url of the website it's on in a variable. $_SERVER['REQUEST_URI'] doesn't work because it gives me the url of the included php file. I tried: $currentPage = " "; Which, when echoed, gives me the correct url, but for reasons unbeknownst to me, doesn't give me the actual url when trying to see what's inside of the url, ie: url is www.website.com/front.php, if (strpos($currentPage,"front")) { echo "true"; }else { echo "false"; } will echo false How can I get the real url of the webpage and programmatically check it for a specific string, from within an external included php file?
has comment: http://stackoverflow.com/comment/43145040
has comment: http://stackoverflow.com/comment/43147240
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43149894
tagged with: php
has comment: http://stackoverflow.com/comment/43147452
type: Question
has comment: http://stackoverflow.com/comment/43149746
has comment: http://stackoverflow.com/comment/43145291
has title: Get a real/parent url from included php file
has comment: http://stackoverflow.com/comment/43149588
has comment: http://stackoverflow.com/comment/43146193
has comment: http://stackoverflow.com/comment/43149051
tagged with: url
tagged with: javascript
has comment: http://stackoverflow.com/comment/43145683
has comment: http://stackoverflow.com/comment/43145505
score: 0

http://stackoverflow.com/comment/123104236
type: Comment
score: 2
has text: Hi, you could edit your answer to describe what the ~~ operator is instead of that repeated text you wrote.
type: AnswerComment
comment on: http://stackoverflow.com/a/69646204

http://stackoverflow.com/comment/43378679
comment on: http://stackoverflow.com/a/27447162
has text: David: If the answer has a bug, edit the answer. Not everyone in the future will see your comment.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/66692473
has text: Thanks for coming back to this Peter! I don't know how I missed that - and it looks like it was in the version I would have been using in 2014. I scoured the docs but somehow missed it. I haven't had a chance to try this out, but as it's in the docs I'll mark it as the answer!
type: Comment
comment on: http://stackoverflow.com/a/39690138
score: 0
type: AnswerComment

http://stackoverflow.com/a/27355294
accepted answer of: http://stackoverflow.com/q/27355256
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: onclick is a function, you have to call it using () : x[i].onclick();
answers question: http://stackoverflow.com/q/27355256
has comment: http://stackoverflow.com/comment/43163421
score: 1

http://stackoverflow.com/q/27363951
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/27364114
has answer: http://stackoverflow.com/a/27364114
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
type: Question
has answer: http://stackoverflow.com/a/27364140
score: 1
has body: Using https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js I have the following to try and POST a JSON request to Google's URL Shortener $.ajax({ type: "POST", dataType: "json", contentType: "application/json", url: "https://www.googleapis.com/urlshortener/v1/url", data: { longUrl: "http://some.url" } }) .done(function( msg ) { console.log( msg ); }); This comes back as a 400 error because the request isn't formatted correctly. Looking at the request in fiddler, I can see it's like this; POST https://www.googleapis.com/urlshortener/v1/url HTTP/1.1 Host: www.googleapis.com Connection: keep-alive Content-Length: 29 Pragma: no-cache Cache-Control: no-cache Accept: application/json, text/javascript, */*; q=0.01 Origin: null User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Content-Type: application/json Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8,en-GB;q=0.6,fr;q=0.4 longUrl=http%3A%2F%2Fsome.url I can modify the request to the following, which works (excluding header); { longUrl=http://some.url } So why is ajax not formatting the data as a JSON?
has comment: http://stackoverflow.com/comment/43180107
linked to: http://stackoverflow.com/q/6587221
answer count: 3
duplicate of: http://stackoverflow.com/q/6587221
upvote count: 1
has answer: http://stackoverflow.com/a/27364026
accepted answer: http://stackoverflow.com/a/27364140
has title: AJAX not POST'ing in JSON format

http://stackoverflow.com/q/27450755
favorite count: 0
has answer: http://stackoverflow.com/a/45029340
has title: Semantic UI progress bar reset
answer count: 3
tagged with: semantic-ui
upvote count: 6
has body: I was trying to use the Semantic UI progress bar as a vote/poll graph. When I tried resetting the data-value to zero, the progress bar would not animate and change back to zero. $('#choiceA').progress({value:0, total:0}); It seems like setting value to some extremely small number makes the animation work though: $('#choiceA').progress({value:0.00000001, total:0}); Is this an acceptable fix to the problem? Or is there a better way to do this. edit: seems like the issue has been brought up here https://github.com/Semantic-Org/Semantic-UI/issues/1395
has answer: http://stackoverflow.com/a/27900846
type: UnansweredQuestion
score: 6
has answer: http://stackoverflow.com/a/45032516
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/27387499
has body: Im fairly new to JS, and I've the following if statement. When I debug it, I see that in sMethod, I have value "flush", and in oImpl I've the object in the png below, and when I debug it with those values, it runs the alert. Why???? In oImpl, I don't see the value in the debugger when I expand the object (to the first level), so what am I missing here? I thought if th if (oImpl[sMethod]) { alert("test") }
score: 2
has comment: http://stackoverflow.com/comment/43223199
downvote count: 0
favorite count: 0
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27387613
has comment: http://stackoverflow.com/comment/43223060
has comment: http://stackoverflow.com/comment/43223429
has title: Java script un-understood command
answer count: 1
has comment: http://stackoverflow.com/comment/43223086
has comment: http://stackoverflow.com/comment/43223528
has comment: http://stackoverflow.com/comment/43223196
has comment: http://stackoverflow.com/comment/43223583
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/q/27428416
has comment: http://stackoverflow.com/comment/43298386
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27428864
possible better answer: http://stackoverflow.com/a/27428523
has answer: http://stackoverflow.com/a/27428523
has comment: http://stackoverflow.com/comment/43298973
has title: How to get the id of a dynamically created form in jquery
has comment: http://stackoverflow.com/comment/43298322
type: AnsweredQuestion
score: 1
tagged with: forms
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/27428864
tagged with: asp.net-mvc
tagged with: javascript
has body: I am using a Bootstrap modal to display an ASP.Net MVC5 form, the form is inserted dynamically into a div using a jquery ajax call to the relevant controller and then opened. I need to intercept the submission of the form so I would like to bind to the submit event of the form in jquery but have so far only been able to bind to the submit event of all forms since the dynamic forms are of course not present when the main view is rendered e.g. $('form').submit(...) rather than $('#serverForm').submit(...) Whilst this sort of works, it has a problem in that I actually have 3 different dynamic forms in this view which can be shown using modal popups, thus I need to do one of 2 things: A) (ideally)manage to intercept the submit event for each form. B) in the global form event handler, identify which form has been submitted. I have tried every option I can imagine to use option A including adding the binding to the code which pops the modal. all without success. I am currently trying to go with option B so that I can then decide where to post the form. This does at least get called when a form is submitted but my problem is that I cannot get the id or name of the form which has been submitted and thus have no way of knowing which one it is. I have the following handler: &lt;script&gt; $(function () { $('form').submit(function(e) { // this is always null var id = $(this).attr('id'); $.ajax({ url: '@Url.Action("EditServer", "AccountAdmin")', data: new FormData(this), ... }); }); }); &lt;/script&gt; Within this handler I have tried the following (plus a few more!) to get the form's id: this.id $(this).id $(this).attr('id'); $(this).prop('id'); I have tried adding the handler after the ajax call to populate the modal like this: $(".server-link").click(function (event) { event.preventDefault(); $.ajax({ url: $(this).attr("href"), cache: false, type: "GET", dataType: "html", success: function (data, textStatus, XMLHttpRequest) { $('#serverDiv').html(data); $('#serverModal').mod…
has comment: http://stackoverflow.com/comment/43298575
answer count: 2

linechart
tag name: linechart
tags question: http://stackoverflow.com/q/27437883
type: Tag

http://stackoverflow.com/comment/43297732
comment on: http://stackoverflow.com/q/27428064
has text: Just dropped in some where for the time being.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27368081
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43188595
accepted answer: http://stackoverflow.com/a/27368149
has title: Check length of div excluding spaces
possible better answer: http://stackoverflow.com/a/27368165
has answer: http://stackoverflow.com/a/27368165
answer count: 4
type: AnsweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/4661481
has comment: http://stackoverflow.com/comment/43188171
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27368149
has comment: http://stackoverflow.com/comment/43188219
has answer: http://stackoverflow.com/a/27368140
score: 0
has answer: http://stackoverflow.com/a/27368464
has body: I have the following code to detect if there is content within a certain div: if ($(".bio").html().length &gt; 0) { $('.author-info').hide(); } The problem I run into is there are cases where a space may be in the .bio field. I want to check the length excluding spaces. In other words, check to see if the div has content but spaces do not count as content. How do I do this? Note: I am using jQuery 2.1.1.

http://stackoverflow.com/comment/43260660
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27408079
has text: @JonathanM i think this is just a snippet.

http://stackoverflow.com/q/27392371
type: Question
answer count: 2
tagged with: null
has body: I am prompting for 8 things and I want to have them appear in a alert box but only if the user enters something in the field otherwise I do not want it to include that info. All of the info should be displayed in one alert box after confirming that the user wants to review the info. Also if the user does not want to see the info the script will end. This is what I have so far: var name = prompt("Enter your fist and last name."); var address = prompt("Enter your address."); var city = prompt("Enter your city."); var state = prompt("Enter your state abbreviation code."); var zip_code = prompt("Enter your zip code."); var dob = prompt("Enter your date of birth in MM/DD/YYYY format."); var ssn = prompt("Enter your social security number as XXX-XX-XXXX."); var answer = confirm("Do you want to review the information you entered?"); if (name === null || name == "") null; if (address === null || address === "") null; if (city === null || city === "") null; if (state === null || state === "") null; if (zip_code === null || zip_code === "") null; if (dob === null || dob === "") null; if (ssn === null || ssn === "") null; else if (answer === true) { window.alert( "Your name is " + name + ".\n" + "Your address is " + address + ".\n" + "Your city is " + city + ".\n" + "Your state is " + state + ".\n" + "Your zip code is " + zip_code + ".\n" + "Your date of birth is " + dob + ".\n" + "Your social security number is " + ssn + "." ); } Please help me.
tagged with: javascript
has title: If a user leaves any information blank after being given prompts how can I exclude that data from the output (window.alert) in Javascript?
has comment: http://stackoverflow.com/comment/43232525
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/27392561
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27392804
downvote count: 3
score: -1

http://stackoverflow.com/comment/43262943
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27409254
type: Comment
has text: a quick try change `$('.fa')` with `$items.find('.fa')`

http://stackoverflow.com/q/27344134
possible better answer: http://stackoverflow.com/a/27344366
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27344366
has answer: http://stackoverflow.com/a/27344198
favorite count: 0
has title: Grab Amount from Specific String
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27344198
upvote count: 1
type: Question
has body: I need to grab all amount from a string and then add them in java-script. My string can be, "Discount 50GB + 1,000GB + Kit" My string format is fixed, means the amount will be found just before GB. I just need to grab all these amount and then add them. So the result I will get is 50 + 1000 = 1050
score: 1
answer count: 2
has comment: http://stackoverflow.com/comment/43143753

http://stackoverflow.com/comment/43251592
has text: Your second code ommits the fact that the OP is using fadeIn for #container_inner01 and fadeOut for the remaining containers
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27403476

http://stackoverflow.com/comment/43280812
type: Comment
has text: @mlinth thanks for the response. Yap, I am sure that both my coordinate and yours covered the shape. Actually self-zipping is one of my concern. I've tried a working zipped shapefile, uncompressed it, and compressed it again and the new zip file is not working...
score: 0
comment on: http://stackoverflow.com/q/27418105
type: QuestionComment

http://stackoverflow.com/a/27370058
has comment: http://stackoverflow.com/comment/43191882
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/27369982
answers question: http://stackoverflow.com/q/27369982
has body: .each() is a jQuery method and only acts on jQuery collections. For what you're doing you would have to use $.each( objectOrArray, callback ) To use jQuery's $.each() here is how to do it: $.each( 'hello world foo bar'.split(' '), function(i,word) { console.log( word ); }); /* OUTPUT hello world foo bar */ &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; References: jQuery.each() | jQuery API Documentation .each() | jQuery API Documentation

angularjs-scope
tags question: http://stackoverflow.com/q/27395926
tags question: http://stackoverflow.com/q/27457649
tags question: http://stackoverflow.com/q/27432193
tags question: http://stackoverflow.com/q/27369955
tags question: http://stackoverflow.com/q/27352980
tags question: http://stackoverflow.com/q/27444569
tags question: http://stackoverflow.com/q/27345202
tags question: http://stackoverflow.com/q/27466872
tags question: http://stackoverflow.com/q/27388691
tags question: http://stackoverflow.com/q/27400422
tags question: http://stackoverflow.com/q/27348853
tags question: http://stackoverflow.com/q/27411826
tags question: http://stackoverflow.com/q/27387966
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/27422409
tags question: http://stackoverflow.com/q/27384145
tags question: http://stackoverflow.com/q/27427484
tags question: http://stackoverflow.com/q/27446071
tags question: http://stackoverflow.com/q/27384729
tags question: http://stackoverflow.com/q/27393436
tags question: http://stackoverflow.com/q/27402522
tags question: http://stackoverflow.com/q/27437723
tags question: http://stackoverflow.com/q/27449426
tags question: http://stackoverflow.com/q/27371810
type: Tag

http://stackoverflow.com/q/27406377
has comment: http://stackoverflow.com/comment/43257362
favorite count: 0
has answer: http://stackoverflow.com/a/28726976
type: Question
score: 14
has answer: http://stackoverflow.com/a/52531053
has answer: http://stackoverflow.com/a/27406702
has answer: http://stackoverflow.com/a/27406462
has answer: http://stackoverflow.com/a/27407321
accepted answer: http://stackoverflow.com/a/27406684
downvote count: 2
has body: I'm generating random numbers from 1 to 20 by calling generateRandom(). How can I exclude some values, say 8 and 15? function generateRandom(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } var test = generateRandom(1, 20)
has answer: http://stackoverflow.com/a/71153568
has answer: http://stackoverflow.com/a/59403318
has answer: http://stackoverflow.com/a/47232944
upvote count: 16
has answer: http://stackoverflow.com/a/66022370
has answer: http://stackoverflow.com/a/48808401
has answer: http://stackoverflow.com/a/63808537
linked to: http://stackoverflow.com/q/5520835
has answer: http://stackoverflow.com/a/27406437
has answer: http://stackoverflow.com/a/48632068
linked to: http://stackoverflow.com/q/14935997
answer count: 15
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27406449
has answer: http://stackoverflow.com/a/27406684
has title: JavaScript generate random number except some values
possible better answer: http://stackoverflow.com/a/27406437
tagged with: javascript

http://stackoverflow.com/comment/43287848
comment on: http://stackoverflow.com/a/27422472
score: 0
type: AnswerComment
type: Comment
has text: Can you give me a console dump from firefox?

http://stackoverflow.com/a/27414394
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27413848
answers question: http://stackoverflow.com/q/27413848
type: Answer
has body: Save Firefox doesn't auto pass in the event for some reason, so you have to pass it from the markup. $scope.saveData = function (e) { if (confirm("Are you sure you want to save") === false) { e.preventDefault(); return; } // do saving };
upvote count: 1
score: 1

http://stackoverflow.com/q/27442178
has comment: http://stackoverflow.com/comment/43323999
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27442432
has title: How to edit JSON array after encoded
has comment: http://stackoverflow.com/comment/43323912
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43324247
has comment: http://stackoverflow.com/comment/43323846
has comment: http://stackoverflow.com/comment/43323742
possible better answer: http://stackoverflow.com/a/27442392
has answer: http://stackoverflow.com/a/27442392
has comment: http://stackoverflow.com/comment/43323821
has answer: http://stackoverflow.com/a/27442432
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43323940
has comment: http://stackoverflow.com/comment/43323744
has answer: http://stackoverflow.com/a/27442424
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/24770887
has body: How would I edit a JSON array after it's been encoded as JSON? I would like to edit the following JSON array : {"Status":"OK","Message":"API Call worked","Result":[{"interval":"2014-11-30", "leads":0,"name":"CarEnquiry","status":"NEW","appointment":0}, {"interval":"2014-11-30","leads":0,"name":"CarEnquiry","status":"CALL1","appointment":0}, {"interval":"2014-11-30","leads":0,"name":"CarEnquiry","status":"CALL2","appointment":0}]} To change it to this {"Result":"OK","Records":[{"interval":"2014-11-30", "leads":0,"name":"CarEnquiry","status":"NEW","appointment":0}, {"interval":"2014-11-30","leads":0,"name":"CarEnquiry","status":"CALL1","appointment":0}, {"interval":"2014-11-30","leads":0,"name":"CarEnquiry","status":"CALL2","appointment":0}]} How would I edit the array in Javascript?
type: Question

http://stackoverflow.com/a/27423035
answers question: http://stackoverflow.com/q/27422951
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: document.querySelector yields one element. You want to use document.querySelectorAll to get all matching elements, and then iterate over that collection. var editors = document.querySelectorAll('div[contenteditable]'); for(var i = 0, l = editors.length; i &lt; l; i++) { editors[i].addEventListener('paste', myCustomPasteFunction); } Fiddle
score: 4
accepted answer of: http://stackoverflow.com/q/27422951
type: Answer

http://stackoverflow.com/a/27396977
answers question: http://stackoverflow.com/q/27387475
score: 0
has comment: http://stackoverflow.com/comment/43258866
has body: According to documentation, inside event method you should refer to this instead of marker. Notice also name of opening popup method: .openPopup() not .openpopup(). Try code below: marker.on('click', function(e) { // HERE YOU GO this.openPopup(); var ll = this.getLatLng(); document.querySelector('#userLat1').value = ll.lat; document.querySelector('#userLng1').value = ll.lng; alert('You have selected a Marker that will be deleted'); });
type: Answer

http://stackoverflow.com/comment/43385767
has text: Yeah I found the documentation that referes to the new context that gets created with a new `SurfaceContainer` http://famo.us/university/lessons/#/famous-101/slideshow/31
type: Comment
comment on: http://stackoverflow.com/a/27473671
score: 0
type: AnswerComment

http://stackoverflow.com/a/27759145
upvote count: 1
has body: In my experience, IE, along with almost all other browsers, uses a cache mechanism separate from the cache of the page to prevent constant retrieval of favicons. This means that changes to the favicon can be unpredictable unless the url is changed and the cache for the domain cleared. The only reliable way I can see around this is to add a unique id to identify the tab for each session forcing IE to cache each sessions's icon separately. You can try a GET variable (i.e. yoursite.com/page?sessionid), however, in my experience, IE still cache's the favicon across page in the same domain regardless of GET variable. In fact, Microsoft's documentation says that you can use the link tag to get different pages to have different favicon's, however, I often find that IE's favicon cache won't update even if you change the link tag without clearing the cache. Also, IE won't display a favicon at all if you have all caching turned off. And, it appears that in some versions of IE, the link tag doesn't take precedence over whatever favicon is at the default location either. I have had some success with using a routing script to get requests to the right page and then appending the sessionid as part of the path (ie. yoursite.com/page/sessionid), however. This requires a bit of extra work in your routing script to ignore the sessionid but it is the only thing, in my experience, that worked simi-reliably to get IE to recognize different favicon's for different sessions.
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/44096131
score: 1
answers question: http://stackoverflow.com/q/27427661
has comment: http://stackoverflow.com/comment/44077485

http://stackoverflow.com/comment/43266939
score: 0
type: Comment
has text: Op wants to call `maleWidth` instead of `maleWidth()` to invoke the function.
comment on: http://stackoverflow.com/a/27411194
type: AnswerComment

http://stackoverflow.com/comment/43314175
type: QuestionComment
comment on: http://stackoverflow.com/q/27436335
type: Comment
has text: @JLRishe look at the answer below ...
score: 0

http://stackoverflow.com/a/27330554
answers question: http://stackoverflow.com/q/27330262
type: Answer
has body: just change your code, create a div on your document &lt;div id="t"&gt;&lt;/div&gt;, in your javascript create div first, then your input and append them to the document here is a working code for (i = 0; i &lt; 3; i++) { var div1 = document.createElement('div'); div1.setAttribute('id', "di" + i); document.getElementById('t').appendChild(div1) var tx = document.createElement('input'); tx.setAttribute('id', i); document.getElementById("di"+i).appendChild(tx); tx.onblur = function () { for (i = 0; i &lt; 3; i++) { var no = document.getElementById(i).value; num = Number(no); var d = document.getElementById('di' + i); for (x = 0; x &lt; num; x++) { var tx1 = document.createElement('p'); tx1.innerHTML = " p" + x; d.appendChild(tx1); } } }; }
score: 0

http://stackoverflow.com/comment/43285908
score: 0
has text: and if answer solves your problem the mark it checked.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27419727

http://stackoverflow.com/comment/43245431
comment on: http://stackoverflow.com/a/27399869
score: 0
type: AnswerComment
has text: @deostroll I'm glad I was able to clear that up. Bear in mind that the use of `arguments.callee` is not recommended, and it is prohibited in ES5 strict mode. Using a named function like you are doing in `fact()` is the preferred approach.
type: Comment

http://stackoverflow.com/q/27446348
has answer: http://stackoverflow.com/a/27446610
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/43331879
favorite count: 0
has comment: http://stackoverflow.com/comment/43331854
has answer: http://stackoverflow.com/a/27449323
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43331927
tagged with: node.js
score: 2
downvote count: 0
has title: async operations in nodejs express
has body: I am having a route app.get('/posts', function (req, res) { res.json([ // data ]); // what would happen to the code below // Suppose it is processing a million records processMillionRecords(); }); function processMillionRecords () { // process million records } Once the response is sent, another function is called which is quite an expensive operation. What would happen if this continues? Are there any implications? I know the ideal way of doing it is using background processes. So I replaced it with the below. res.json([ // data ]); var child = require('child_process'); child.fork('worker.js'); // worker.js function processMillionRecords () { // process million records } Which one is more preferred and in which cases?
tagged with: process
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43183282
has text: browser crashed or PC restart : in both case saving data to any local file works fine. And saving to database is safe for the users to fill up later.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27364991

http://stackoverflow.com/a/27406915
accepted answer of: http://stackoverflow.com/q/27406862
has comment: http://stackoverflow.com/comment/43258348
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43258406
has comment: http://stackoverflow.com/comment/43258836
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43258877
answers question: http://stackoverflow.com/q/27406862
has body: You can use the following code: $(":button").on("click", function() { //according your requirements element with class .sameClass and //data-category = fun that ancestor element has id second $("#second div.sameClass[data-category='fun']").append(" test "); }); .sameClass { background-color: #3e6687; width: 100px; height: 100px; float: left; margin-right: 10px; } #first, #second { margin-bottom: 10px; float: left; } #first { background-color: #8a94ae; } #second { background-color: #29375a; }

http://stackoverflow.com/q/27454291
tagged with: google-maps-api-3
score: 0
has title: Google map generated Java Script any dynamic loop
answer count: 1
has comment: http://stackoverflow.com/comment/43346851
has answer: http://stackoverflow.com/a/27454395
has comment: http://stackoverflow.com/comment/43346663
has comment: http://stackoverflow.com/comment/43346657
accepted answer: http://stackoverflow.com/a/27454395
type: Question
type: AnsweredQuestion
tagged with: asp.net-mvc
has body: Can anyone tell me the Google map generated Java Script any dynamically loop for each category items need to display the Google map icons in different colours. Also database table data value will change frequently.var list = @Html.Raw(Json.Encode(ViewBag.CourierList)). var marker = new google.maps.Marker { position: new google.maps.LatLng(-34.397, 150.644), map: map, title: 'Click me', icon: 'icons/yellow-dot.png', animation: google.maps.Animation.DROP, draggable: false }
tagged with: javascript

http://stackoverflow.com/q/27378647
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/27398577
tagged with: highcharts
downvote count: 0
score: 1
favorite count: 0
has title: Highcharts - nested sliced donut charts
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27380064
upvote count: 1
has body: I'm trying to create a nested pie / donut chart, where the inner ring displays a 'group' (e.g. a car manufacturer) and the outer ring displays a breakdown for that 'group' (e.g. the models made by each manufacturer). I need the individual segments to be exploded / sliced so that it looks like this: https://i.sstatic.net/cdGRn.jpg I have managed to get this working using the sliced and slicedOffset properties (the image above is actually a screenshot of my chart), however this creates strange effects (see the fiddle) when there are fewer 'groups'. I have put together a fiddle to demonstrate how the chart looks odd when there are fewer groups in the inner ring. It looks really bad when there are only one or two items in the inner ring: http://jsfiddle.net/danielcrisp/784jzLe2/ I would like to know if there is a better way of achieving the result I require? Probably sliced is not the right way to go as it isn't its intended use. How else can I get a gap between items? Note: the chart will be displayed over a photo so I can't use borders to create the effect. Update: It's ok if the spacing between segments is regular, e.g. 10px, unlike the irregular spacing shown in the first screenshot. Transparent borders should be the perfect solution but they don't mask the segment fill colour unfortunately. Thank you!
type: Question
possible better answer: http://stackoverflow.com/a/27380064
has answer: http://stackoverflow.com/a/27398577

http://stackoverflow.com/comment/43140915
has text: I'm not sure what you're saying. Can you elaborate?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27333453
score: 0

http://stackoverflow.com/comment/43189059
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27367289
has text: This works - ofcourse, but it's still not a 3-way data binding - just function updating firebase. I would need to call it everywhere I make a change, but I want it to be automatic, just like it is locally (2-way data binding). I know it can be done. I cannot figure out how.

http://stackoverflow.com/comment/43107944
comment on: http://stackoverflow.com/q/27324181
type: Comment
has text: It looks like it's saving now, so thank you for that. The results I'm pulling from the database look like this: Promise {cancel: function, PromiseStatus: "resolved", PromiseValue: Object}cancel: function (){return this}__proto__: PromisePromiseStatus: "resolved"PromiseValue: Objectoffset: 0rows: Array[3]total_rows: 3__proto__: Object Do you know how I can get the arrays of divs with that PromiseValue thing?
score: 0
type: QuestionComment

apache
tag name: apache
tags question: http://stackoverflow.com/q/27430557
type: Tag
tags question: http://stackoverflow.com/q/27342638

http://stackoverflow.com/a/29563786
has comment: http://stackoverflow.com/comment/101534282
type: Answer
has comment: http://stackoverflow.com/comment/49577522
downvote count: 0
has body: You will need to add this capability to dat.GUI yourself. Here are some guidelines and an example solution. Entries are represented with classes that are inherited from the Controller class. Each controller has a private member __li, that represents its &lt;li&gt; element in the gui. You can extend the Controller prototype and add a title function, that will add, update or remove the __li's title attribute. Here is the snippet: /* dat.GUI copies the prototype of superclass Controller to all other controllers, so it is not enough to add it only to the super class as the reference is not maintained */ var eachController = function(fnc) { for (var controllerName in dat.controllers) { if (dat.controllers.hasOwnProperty(controllerName)) { fnc(dat.controllers[controllerName]); } } } var setTitle = function(v) { // __li is the root dom element of each controller if (v) { this.__li.setAttribute('title', v); } else { this.__li.removeAttribute('title') } return this; }; eachController(function(controller) { if (!controller.prototype.hasOwnProperty('title')) { controller.prototype.title = setTitle; } }); // demo var Dummy = function() { this.foo = 12 }; Dummy.prototype.bar = function() { console.log('1'); }; var gui = new dat.GUI(); var d = new Dummy(); gui.add(d, 'foo').name('Foo').title('Foo\'s title'); gui.add(d, 'bar', 1, 13, 1).name('Bar').title('Bar\'s title'); &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head lang="en"&gt; &lt;meta charset="UTF-8"&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5/dat.gui.min.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt;
score: 7
accepted answer of: http://stackoverflow.com/q/27362914
upvote count: 7
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27362914
has comment: http://stackoverflow.com/comment/49607772

http://stackoverflow.com/comment/43146701
comment on: http://stackoverflow.com/a/27341713
type: AnswerComment
has text: @RokoC.Buljan i can see nothing in the console.Sir,actually i want this to be done on the click of a button
score: 0
type: Comment

http://stackoverflow.com/comment/43376736
type: AnswerComment
has text: wait... what the $ is?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27470763

http://stackoverflow.com/a/27441064
score: 0
answers question: http://stackoverflow.com/q/27440695
has body: &lt;pre class="js"&gt; $("#media").zAccordion({ timeout: 4000, slideWidth: 600, width: 960, height: 270 }); &lt;/pre&gt; Include above the code after ul tag. and remove "$" with "jQuery".
type: Answer
has comment: http://stackoverflow.com/comment/43326529

http://stackoverflow.com/comment/43198861
type: Comment
score: 0
type: AnswerComment
has text: Thanq JLRishe :) i got the context. Require assigns the return value of define function to myAppViewModel. According to knockout a module is a function so define function should return a function. If i remove return undefined is returned. So it says undefined is not a function.
comment on: http://stackoverflow.com/a/27373209

http://stackoverflow.com/q/27422950
downvote count: 0
has comment: http://stackoverflow.com/comment/43288770
score: 1
type: Question
tagged with: charts
tagged with: javascript
has answer: http://stackoverflow.com/a/27429519
accepted answer: http://stackoverflow.com/a/27429519
has title: How to dynamically set title in Pie Chart of Highcharts
tagged with: pie-chart
upvote count: 1
tagged with: highcharts
answer count: 1
favorite count: 0
has body: I want to set a dynamically passed text as title based on if else condition in a pie chart using high-charts plugin. I tried events attribute, as well as chart.setTitle({text:mydesiredtitle}), but it didn't help me out. I've surfed forums and blogs, nothing helped me. Here I'm attaching my code: var textElement; function RenderDonutChart(container,complete,incomplete,fillColor,nonfillColor) { var dataText = true; //complete and incomplete are integers //container is my div to load chart. if(!($.isNumeric(complete))) { dataText = false; complete = 0; incomplete = 100; } var chart = new Highcharts.Chart({ chart: { renderTo: container, type: 'pie', plotShadow: false, backgroundColor: null, spacing: [0, 0, 0, 0], margin: [0, 0, 0, 0] }, plotOptions: { pie: { animation: false, borderWidth: 0, innerSize: '90%', dataLabels: { enabled: false } }, series: { states: { hover: { enabled: true } } } }, credits: { enabled: false }, title: { text: '' }, title: { text: '', align: 'center', verticalAlign: 'middle', y: 10, }, events: { load: function () { alert("load works"); if(!(dataText)) { if(textElement != null) { textElement.destroy(); } alert("null dataText"); textElement = 'Not Applicable'; chart.setTitle({text: textElement}); } else { if(textElement != null) { textElement.destroy(); } alert("true dataText"); textElement = ' ' + complete + '% Completed'; chart.setTitle({text: textElement}); } } }, tooltip: { enabled: false }, exporting: { enabled: false }, series: [{ data: [complete,incomplete] }], colors: [fillColor, nonfillColor] }); }
type: AnsweredQuestion

http://stackoverflow.com/comment/43198589
comment on: http://stackoverflow.com/q/27372964
has text: you can ask me here if you have any doubt.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43178314
type: QuestionComment
score: 0
has text: I tried "$(this).closest("li").addClass('active')." yet the parent li is not getting an active class still.
comment on: http://stackoverflow.com/q/27363095
type: Comment

http://stackoverflow.com/q/27382114
answer count: 1
downvote count: 0
favorite count: 0
tagged with: linux
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43213713
has title: Case sensitivity on linux and windows for javascript imports in html
score: 4
has comment: http://stackoverflow.com/comment/43213011
has answer: http://stackoverflow.com/a/27382250
type: AnsweredQuestion
has body: I have follow: test.html: TEST test.js: var Test="test"; The question is why it works on Windows and doesn't work on Linux ( in other words why linux is case sensative for imports , but window isn't)? How can I switch off case sensitivity for javascript imports on Linux?
accepted answer: http://stackoverflow.com/a/27382250
tagged with: javascript
type: Question
upvote count: 4

http://stackoverflow.com/comment/43119061
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27330513
has text: IMO, this is a very bad practice. It might have its place, I'm sure, but not when all you need to do is passing a handler to an event. All the original question missed was how to call that function. @user2482616 offers the solution: http://stackoverflow.com/a/27330516/2788872

http://stackoverflow.com/comment/43248786
type: AnswerComment
type: Comment
has text: Its easy to learn the basics, just have a look at how the javascript stack works. Check out some articles on http and just find out stuff by simple testing :) good luck
comment on: http://stackoverflow.com/a/27401575
score: 0

http://stackoverflow.com/a/27376729
has body: In this case you can do some custom formatting separate year,month day hour .. and rearrange them to create a sql datetime compatible string here is the working Fiddle
has comment: http://stackoverflow.com/comment/43203195
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27376286
has comment: http://stackoverflow.com/comment/43205002
type: Answer
accepted answer of: http://stackoverflow.com/q/27376286
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43204637
has comment: http://stackoverflow.com/comment/43205584
has comment: http://stackoverflow.com/comment/43205265
upvote count: 2

http://stackoverflow.com/q/27314824
has comment: http://stackoverflow.com/comment/43089716
has comment: http://stackoverflow.com/comment/43089635
downvote count: 1
type: Question
has body: just trying to create a simple array swap in javascript and keep getting an error. var a = [4,1,2,3]; function swap(x,y){ var src=x; var dest = y; var tmp = a[src]; a[x] = a[y]; a[y] = tmp; return a; } document.write(swap(0,1)); Why is it this is not working? any help appreciated. thank you
upvote count: 0
has comment: http://stackoverflow.com/comment/43089675
tagged with: arrays
has comment: http://stackoverflow.com/comment/43089671
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/27315071
answer count: 1
has comment: http://stackoverflow.com/comment/43089666
favorite count: 0
type: UnansweredQuestion
has title: javascript array swapping function

http://stackoverflow.com/comment/43268207
has text: Select2 is a great jquery based option that also gives you the benefit of searching through options.
comment on: http://stackoverflow.com/a/27411785
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/43248087
score: 1
comment on: http://stackoverflow.com/q/27401379
has text: console.dir(function) give me this - BoundThis: div.note.note2
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43191859
has text: bind() also creates a new function, every time. if you used only pure functions, then they would be completely re-usable. it's still much nicer to report and maintain named functions however, so for that reason alone you should keep your code improvements. also, as long as a function is identical to another already-parsed function, the internal function can be re-used without duplication; that goes even for anons defined in a call, as long as they don't use closure.
comment on: http://stackoverflow.com/q/27369534
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27397685
has comment: http://stackoverflow.com/comment/43245079
has body: It is not Javascript error. It is 500 (Internal Server Error) which means that you have problems on your server side.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27397639
type: Answer
answers question: http://stackoverflow.com/q/27397639
score: 2
upvote count: 2

http://stackoverflow.com/comment/43130275
type: Comment
comment on: http://stackoverflow.com/q/27336704
has text: Chrome and Internet Explorer are behaving differently immediately on load. Chrome will scroll but IE will not. If I maximize Chrome, and then restore it, Chrome will no longer scroll either.
score: 0
type: QuestionComment

line
tags question: http://stackoverflow.com/q/27357991
tag name: line
type: Tag

http://stackoverflow.com/q/27420611
has body: The question is: how do I make the cursor look like a letter (eg. a chess figure "&amp;#9817")? I am aware of the possible "pointer" etc. and using an as a cursor but changing all of the letters to images seems too tedious and having to define it for every chess figure.. perhaps some CSS or JavaScript code? (cursor: "&amp;#9817" -- something like this except working)
answer count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27421146
tagged with: css
has answer: http://stackoverflow.com/a/27420828
has answer: http://stackoverflow.com/a/27420654
tagged with: cursor
type: Question
has title: Change cursor apearance to a letter
tagged with: javascript
score: 0
tagged with: appearance

http://stackoverflow.com/comment/43112877
comment on: http://stackoverflow.com/q/27326817
has text: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#.22Securing.22_JavaScript
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43159799
type: QuestionComment
has text: `var2=zin.1` not `var2=zin.2`?
comment on: http://stackoverflow.com/q/27353111
score: 0
type: Comment

http://stackoverflow.com/comment/43325464
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27442410
has text: When i click on Delete console give this notation: (...)dialog is not found. please explain.

http://stackoverflow.com/q/27349081
has body: in my main app.js, I define my app: var app = angular.module('ccApp', ['ngCookies', 'ngResource', 'ngSanitize', 'ngRoute']); In my various controller files, I define controllers: app.controller('LoginCtrl', function($scope, $log, $location, $rootScope, $window) {... These lines are all flagged as errors with jshint as "app not defined". The app works fine; when the scripts are all concatenated they see the variable definition. How do I get jshint to "understand" this and not flag this as an error?
type: Question
tagged with: jshint
answer count: 2
has answer: http://stackoverflow.com/a/27349117
tagged with: javascript
has answer: http://stackoverflow.com/a/27349108
has comment: http://stackoverflow.com/comment/43152841
has comment: http://stackoverflow.com/comment/43152816
tagged with: angularjs
upvote count: 1
favorite count: 0
downvote count: 0
type: UnansweredQuestion
has title: Getting jshint to play nice with Angular JS
score: 1

http://stackoverflow.com/q/27396504
type: AnsweredQuestion
has title: fadeout of background image changing?
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27396693
tagged with: javascript
tagged with: jquery
has body: by not using background like other for background image I am using this kind of style HTML: &lt;div id="bg"&gt; &lt;img id="bgChange" src="image/image.jpg" /&gt; &lt;/div&gt; CSS: #bg { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; } #bg &gt; div { position: absolute ; top: 0; left: 0; right: 0; bottom: 0; margin: auto; min-width: 50%; min-height: 50%; } and use a simple way to change image change the src JavaScript: var imageRotating = document.getElementById("bgChange"); var i = 0; setInterval(function imageRotator() { imageRotating.setAttribute("src", "image/image" + ++i + ".jpg"); if (i == 3) { i = -1; } }, 5000); what I want to ask is : using JQuery how to add .fadeOut() inside the script? I am beginner to JQuery so I hope I can have a bit detail answer.
score: 0
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/27396580
tagged with: css
has answer: http://stackoverflow.com/a/27396580
favorite count: 0
has comment: http://stackoverflow.com/comment/43239245
has comment: http://stackoverflow.com/comment/43239321
has answer: http://stackoverflow.com/a/27396693
has comment: http://stackoverflow.com/comment/43239351
has comment: http://stackoverflow.com/comment/43239265
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/43327476
comment on: http://stackoverflow.com/q/27444241
score: 4
type: Comment
type: QuestionComment
has text: Because `this` is different inside your callback.

http://stackoverflow.com/comment/43137101
score: 0
type: Comment
type: QuestionComment
has text: @JonathanLonowski thanks! it's not push a single item, it's more to merging 2 arrays, really thanks!
comment on: http://stackoverflow.com/q/27340374

http://stackoverflow.com/comment/43161335
type: QuestionComment
has text: In a nutshell, you want to open something like bootstrap modal window with some information yes?
type: Comment
comment on: http://stackoverflow.com/q/27354052
score: 0

http://stackoverflow.com/q/27349145
tagged with: asp.net
has body: I have a asp:RadioButton inside a asp:GridView: &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" GridLines="None"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;asp:RadioButton ID="RB" runat="server" Text='&lt;%#Eval("Name").ToString() %&gt;' AutoPostBack="true"/&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; I can change the background-color like this: $(function () { $("[id*=GridView1] td").hover(function () { $("td", $(this).closest("tr")).addClass("hover_row"); } }); but I don't know how to extract the value of the RadioButton on mouseover. I tried using the val() function but I always get 'undefined'
accepted answer: http://stackoverflow.com/a/27351671
type: AnsweredQuestion
score: 0
type: Question
tagged with: c#
has title: Get value from asp:RadioButton on mouseover
tagged with: javascript
has answer: http://stackoverflow.com/a/27351671
answer count: 2
possible better answer: http://stackoverflow.com/a/27363170
tagged with: jquery
has answer: http://stackoverflow.com/a/27363170

http://stackoverflow.com/q/27315163
tagged with: javascript
tagged with: jquery
has body: I want to call a function to change the values in text boxes of division named "firstdivision" in WebForm1 through jquery with ajax. This is the code i wrote but it's not working : &lt;asp:ScriptManager ID="scriptmanager" runat="server" EnableCdn="true" AjaxFrameworkMode="Disabled"&gt; &lt;Scripts&gt; &lt;asp:ScriptReference Path="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js"/&gt; &lt;/Scripts&gt; &lt;/asp:ScriptManager&gt; &lt;script type="text/javascript" lang="javascript"&gt; var pageurl = '&lt;%=ResolveUrl("~/WebForm1.aspx/Search()") %&gt;'; var srch = $("#&lt;%=list_Search.Text%&gt;"); var name = $("#&lt;%=txt_Name.Text%&gt;"); var empID = $("#&lt;%=txt_EmpID.Text%&gt;"); var address = $("#&lt;%=txt_Address.Text%&gt;"); var email = $("#&lt;%=txt_Email.Text%&gt;"); var phone = $("#&lt;%=txt_Phone.Text%&gt;"); var salary = $("#&lt;%=txt_Salary.Text%&gt;"); var dob = $("#&lt;%=txt_DOB.Text%&gt;"); var natinality = $("#&lt;%=txt_Nationality.Text%&gt;"); $('document').ready ( function () { $("#btn_Search").click ( function (e) { e.preventDefault(); $.ajax ( { type : 'POST', URL: pageurl, async: "true", //data: srch, //contentType: "application/json; charset=utf-8", //dataType: "json", success: function (x) { alert("Done Successfully with " + x.msg); }, error: function (e) { alert("The call got failed due to " + e.msg); } } ); $("#firstDivision").html("").append(data); } ); } ) //function dotask() //{ // employee_db.WebForm1.Search(); // return true; //} &lt;/script&gt; And this is the code for the functions am calling : [WebMethod] public static void Search() { //string search,string name,int empID,string address,string email,double phone,double salary,DateTime dob,string nationality string constr = ConfigurationManager.ConnectionStrings["myconnectionstring"].ConnectionString; SqlConnection myconnection = new SqlConnection(constr); myconnection.Open(); WebForm1 test = new WebForm1(); test.conc(myconnection); //conc(myconnection); myconnection.Close(); …
answer count: 3
has answer: http://stackoverflow.com/a/27322892
upvote count: 1
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/43090555
type: UnansweredQuestion
has title: How to call a function of webform through jquery with ajax?
has answer: http://stackoverflow.com/a/27315223
has answer: http://stackoverflow.com/a/27315444
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43090346
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/43241998

http://stackoverflow.com/q/27452982
answer count: 1
duplicate of: http://stackoverflow.com/q/5232295
favorite count: 0
type: UnansweredQuestion
downvote count: 6
linked to: http://stackoverflow.com/q/5232295
upvote count: 2
score: -4
has title: get all possible combinations of some characters javascript
type: Question
has body: So If a have A, B, C , I want to create some strings whith length 4 so the output will be AAAA AAAB AAAC AABA AABB AABC ABAB .... CCCC
tagged with: javascript
has comment: http://stackoverflow.com/comment/117299061
has answer: http://stackoverflow.com/a/27453074

http://stackoverflow.com/a/27479966
answers question: http://stackoverflow.com/q/27473679
type: Answer
score: 2
downvote count: 0
upvote count: 2
has body: The other answers have a bit of redundancy in them. Here is how I usually handle events that are related and have common variables: $('.button').on('click mouseup mouseleave', function(event) { var btn = $(this).data('button'); switch(event.type) { case 'click': { $(this).addClass(btn+'-activate'); break; } case 'mouseup': case 'mouseout': case 'mouseleave': { $(this).removeClass(btn+'-activate'); break; } } }); Listen to multiple events and use a switch statement to determine which event was called.

http://stackoverflow.com/comment/43293518
has text: @todd sorry, i didn't know i missed it. I added it above. by characters you mean ?
score: 0
comment on: http://stackoverflow.com/q/27425674
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27435295
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27432759
answers question: http://stackoverflow.com/q/27432759
upvote count: 1
type: AcceptedAnswer
has body: Bluebird lets you explicitly set the scheduler for these scenarios exactly. You need to tell bluebird how to execute a function directly: Promise.setScheduler(function(fn){ // fn is what to execute var timer = uv.new_timer.call({}); uv.timer_start(timer, 0, 0, fn); // add the function as a callback to the timer }); Do this above all your promise code - this will resolve the above error.
type: Answer
has comment: http://stackoverflow.com/comment/43761760

http://stackoverflow.com/comment/43165964
comment on: http://stackoverflow.com/a/27354707
score: 0
type: AnswerComment
has text: you can prevent conflict if you pass `$` to anonymous function like this: `(function($){ // code })(jQuery)`. By wrapping any jQuery using code in that construct you redefine $ to jQuery for the contained part without coming into conflict with other code in the page.
type: Comment

http://stackoverflow.com/q/27376681
downvote count: 0
tagged with: jsp
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27383854
has answer: http://stackoverflow.com/a/27385563
answer count: 2
has comment: http://stackoverflow.com/comment/43203247
has comment: http://stackoverflow.com/comment/43203788
has comment: http://stackoverflow.com/comment/43205575
score: 1
favorite count: 0
has body: <form:form action="approveAccount.html" method="GET"> Following Accounts are Pending to approve <c:forEach items="${accountIdList}" var="val"> ${val} </c:forEach> </form:form> val is the value that is fetched from database, I want to add a submit button and want to use this fetched value to do some stuffs, how many value get fetched is dynamically decided, how todo that.. here in this scenario, I am getting account id which admin needs to approv, so by adding textbox, admin can assign the role to the this account and then submit the to the database and this all happen with that clk of button
has title: Adding button and textbox dynamically in jsp page
has comment: http://stackoverflow.com/comment/43216278
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43203338
upvote count: 1
has comment: http://stackoverflow.com/comment/43203121
tagged with: java
type: Question

http://stackoverflow.com/comment/43354202
has text: do you think you can put one of the canvases inside a div with absolute position?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27458358
score: 0

http://stackoverflow.com/comment/43267473
score: 1
has text: I've got thru it. I've received that error due to the fact that i've included my script before jquery and bootstrap. Now it works flawlessly. thank you Chriss & Nacho
comment on: http://stackoverflow.com/q/27411287
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43187192
type: QuestionComment
has text: See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve).
type: Comment
comment on: http://stackoverflow.com/q/27367556
score: 0

http://stackoverflow.com/comment/43211736
score: 0
comment on: http://stackoverflow.com/q/27361268
type: Comment
type: QuestionComment
has text: The file is required to be portable to another computer and for ease of use it would be to cumbersome for the user if it isn't one big file.

http://stackoverflow.com/q/27387177
has answer: http://stackoverflow.com/a/27395115
has answer: http://stackoverflow.com/a/27387242
downvote count: 1
upvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27387242
type: AnsweredQuestion
has title: Why am I able to execute an $http function just by adding .success to it?
tagged with: angular-http
linked to: http://stackoverflow.com/q/27375710
favorite count: 0
score: -1
has body: I created a factory that returns an $http promise. loginRsrc.factory('loginSrvc', ['$http', function($http){ var http = $http({ method: 'POST', url: "http://myproj.herokuapp.com/api/signIn", data: $.param({email: "joe@gmail.com", password: "1234567"}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }); return http; I use this factory in a controller. But I'm getting funny behaviour. When I say loginSrvc() .success(function(res){ console.log("res:"); console.log(res); }) .error(function(res){ console.log("res"); console.log(res); }); I get an error that TypeError: object is not a function. But when I say (omitting parentheses) loginSrvc .success(function(res){ console.log("res:"); console.log(res); }) .error(function(res){ console.log("res"); console.log(res); }); it works great! The success prints to the console. I can't understand this weird behaviour. Just adding a success function calls the $http activity? This is my full controller: loginApp.controller('loginCtrl', ['$scope', '$state', 'loginSrvc', function($scope, $state, loginSrvc){ $scope.loginForm = {}; $scope.loginForm.email = ""; $scope.loginForm.password = ""; $scope.submit = function(){ loginSrvc .success(function(res){ console.log("res:"); console.log(res); }) .error(function(res){ console.log("res"); console.log(res); }); } }])
tagged with: angularjs
type: Question
answer count: 2
tagged with: angular-promise
possible better answer: http://stackoverflow.com/a/27395115

http://stackoverflow.com/q/27462408
tagged with: gulp
favorite count: 0
has body: Here's my gulpfile. var gulp = require('gulp'); var less = require('gulp-less'); var clean = require('gulp-clean'); var mincss = require('gulp-minify-css'); var gulpif = require('gulp-if'); var uglify = require('gulp-uglify'); var concat = require('gulp-concat'); var inject = require('gulp-inject'); var templateCache = require('gulp-angular-templatecache'); var angularFilesort = require('gulp-angular-filesort'); var env = 'development'; gulp.task('default', ['clean'], function() { gulp.start('static', 'html'); }); gulp.task('production', ['set-production', 'default']); gulp.task('development', ['default'], function() { gulp.watch('./src/less/**/*.less', ['styles']); gulp.watch('./src/js/**/*.js', ['scripts']); gulp.watch('./*.html', ['html']); }); gulp.task('static', function() { return gulp.src(['./src/static/*.*']) .pipe(gulp.dest('./dist/static')); }); gulp.task('clean', function() { return gulp.src('./dist', { read: false }) .pipe(clean()); }); gulp.task('html', ['styles', 'vendor-js', 'templateCache', 'scripts'], function() { return gulp.src('./*.html') .pipe(inject(gulp.src(['./dist/js/**/*.js']) .pipe(angularFilesort()), { 'ignorePath': 'dist/js', 'addRootSlash': false, 'addPrefix': 'scripts' })) .pipe(inject(gulp.src(['./dist/vendors/**/*.js', '!./dist/vendors/less/less.js'], { read: false }), { 'name': 'vendors', 'ignorePath': 'dist/vendors', 'addRootSlash': false, 'addPrefix': 'vendors' })) .pipe(inject(gulp.src(['./dist/css/*.css'], { read: false }), { 'ignorePath': 'dist/css', 'addRootSlash': false, 'addPrefix': 'styles' })) .pipe(gulp.dest('dist')); }); gulp.task('styles', function() { return gulp.src('./src/less/*.less') .pipe(less()) .pipe(gulpif(env === 'production', mincss())) .pipe(gulpif(env === 'production', concat('styles.css'))) .pipe(gulp.dest('dist/css')); }); gulp.task('scripts', function() { return gulp.src('./src/js/**/*.js') .pipe(gulpif(env === 'production', uglify())) .pipe(gulpif(env === 'production', concat('scripts.js'))) .pipe(gulp.…
has answer: http://stackoverflow.com/a/27463983
tagged with: node.js
score: 2
has title: gulp.watch going into endless loop
type: AnsweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43363438
tagged with: gulp-watch
upvote count: 2
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27463983

http://stackoverflow.com/q/27460534
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/43462265
tagged with: javascript
has title: Keep D3 objects size constant on Map while zoom in/out
answer count: 1
favorite count: 0
upvote count: 2
tagged with: d3.js
type: UnansweredQuestion
tagged with: topojson
has body: I am following the example from http://bl.ocks.org/d3noob/raw/5193723/ The cirles drawn in the example increases in size when zoomed-in. I am not able to figure out a way in which the circles' size can be kept same. Any ideas? Edit1: Any ideas on how to keep Pie arc constant in radii. I have figured out the the way to keep circles to constant radius as below: g1.append("circle") .attr("cx", 200) .attr("cy", 200) .attr("r", 10) .style("fill", "red"); var zoom = d3.behavior.zoom().on("zoom", function () { g1.selectAll("circle") .attr("transform", "translate(" + d3.event.translate.join(",") + ")scale(" + d3.event.scale + ")") .attr("r", function(d) { return 10/d3.event.scale; }); }); Similarly I have arcs of pie chart, the size of which I wish to maintain at zoom: var r = 4; var p = Math.PI * 2; var arc = d3.svg.arc() .innerRadius(r - 2) .outerRadius(r - 1) .startAngle(0) .endAngle(p * d.value1); var arc2 = d3.svg.arc() .innerRadius(r - 3) .outerRadius(r - 2) .startAngle(0) .endAngle(p * d.value2); var projection = d3.geo.mercator() .center([0, 5]) .scale(200) var translate = "translate(" + projection([77, 13])[0] + ", " + projection([77, 13])[1] + ")"; g.append("path") .attr("d", arc) .attr("fill", "maroon") .attr("transform", translate); g.append("path") .attr("d", arc2) .attr("fill", "green") .attr("transform", translate); Any suggestions on how to keep the arc type paths to maintain same size?
score: 2
has answer: http://stackoverflow.com/a/27465688

http://stackoverflow.com/q/27465850
has answer: http://stackoverflow.com/a/74860092
has comment: http://stackoverflow.com/comment/43367733
has comment: http://stackoverflow.com/comment/74859112
answer count: 18
has answer: http://stackoverflow.com/a/41192739
linked to: http://stackoverflow.com/q/13254549
has answer: http://stackoverflow.com/a/77298305
tagged with: node.js
has answer: http://stackoverflow.com/a/41598409
upvote count: 352
has answer: http://stackoverflow.com/a/62901071
has answer: http://stackoverflow.com/a/74698124
linked to: http://stackoverflow.com/q/38550979
has answer: http://stackoverflow.com/a/74265139
has comment: http://stackoverflow.com/comment/43368069
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43367848
tagged with: javascript
has comment: http://stackoverflow.com/comment/106032188
has answer: http://stackoverflow.com/a/70811320
has answer: http://stackoverflow.com/a/68265473
has answer: http://stackoverflow.com/a/50007721
tagged with: express
type: Question
has answer: http://stackoverflow.com/a/77784157
score: 351
has answer: http://stackoverflow.com/a/73313269
has comment: http://stackoverflow.com/comment/93248132
has answer: http://stackoverflow.com/a/28379965
has answer: http://stackoverflow.com/a/56875341
downvote count: 1
has answer: http://stackoverflow.com/a/51351786
has answer: http://stackoverflow.com/a/27466117
accepted answer: http://stackoverflow.com/a/27466117
has answer: http://stackoverflow.com/a/70285698
favorite count: 0
has answer: http://stackoverflow.com/a/64871464
has title: TypeError: Router.use() requires middleware function but got a Object
possible better answer: http://stackoverflow.com/a/28379965
has body: There have been some middleware changes on the new version of express and I have made some changes in my code around some of the other posts on this issue but I can't get anything to stick. We had it working before hand but I can't remember what the change was. throw new TypeError('Router.use() requires middleware function but got a ^ TypeError: Router.use() requires middleware function but got a Object node ./bin/www js-bson: Failed to load c++ bson extension, using pure JS version js-bson: Failed to load c++ bson extension, using pure JS version /Users/datis/Documents/bb-dashboard/node_modules/express/lib/router/index.js:438 throw new TypeError('Router.use() requires middleware function but got a ^ TypeError: Router.use() requires middleware function but got a Object at /Users/datis/Documents/bb-dashboard/node_modules/express/lib/router/index.js:438:13 at Array.forEach (native) at Function.use (/Users/datis/Documents/bb-dashboard/node_modules/express/lib/router/index.js:436:13) at /Users/datis/Documents/bb-dashboard/node_modules/express/lib/application.js:188:21 at Array.forEach (native) at Function.use (/Users/datis/Documents/bb-dashboard/node_modules/express/lib/application.js:185:7) at Object.&lt;anonymous&gt; (/Users/datis/Documents/bb-dashboard/app.js:46:5) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) app.js var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'); var session = require('express-session'); var MongoClient = require('mongodb').MongoClient; var routes = require('./routes/index'); var users = require('./routes/users'); var Users = require('./models/user'); var Items = require('./models/item'); var Store = require('./models/store'); var StoreItem = require('./models/storeite…

http://stackoverflow.com/comment/43339794
comment on: http://stackoverflow.com/a/27447098
type: AnswerComment
score: 0
type: Comment
has text: Yea, I was hoping there would be a way to have an update on the server (running the getTotal function when $$updated is run) trigger an event on $scope that would update that value. {{listWithTotal.getTotal}} would do that but that would constantly run that function from what I understand. Running it only when I complete a task would mean I would need to run it again when a task is moved to incomplete or if a task is deleted – it would create more edge cases I need to account for.

http://stackoverflow.com/comment/43223879
type: Comment
comment on: http://stackoverflow.com/a/27387897
has text: I was answering while he wrote that XD
type: AnswerComment
score: 0

http://stackoverflow.com/comment/130413336
score: 1
type: AnswerComment
has text: @YaaKouB I am not sure what you are trying to do but it can go into the .htaccess or the config files for apache for example. FYI https://tecadmin.net/configure-x-frame-options-apache/
type: Comment
comment on: http://stackoverflow.com/a/53526965

http://stackoverflow.com/comment/43237215
score: 0
type: Comment
has text: I want to turn off the auto chosen date when typing
type: AnswerComment
comment on: http://stackoverflow.com/a/27395281

http://stackoverflow.com/q/27319939
tagged with: css
accepted answer: http://stackoverflow.com/a/27319992
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27320000
has answer: http://stackoverflow.com/a/27320000
has title: jQuery's toggleClass and order of class names in .css file
tagged with: javascript
tagged with: jquery
has body: BACKGROUND: I have text with an arrow pointing to the right, clicking on the text/arrow reveals a div and substitutes the arrowRight with arrowDown. PROBLEM: The problem stems from the fact that my code works depending upon the order in the .css file and I don't know why that should matter w jQuery. CSS: .arrow{display:inline-block; width:15px; height:10px;background-repeat:no-repeat;} .arrowRight{background-image:url("../graphics/triangleRight.gif"); } .arrowDown{ background-image: url("../graphics/triangleDown.gif");} HTML: &lt;div id="showListOfBids" class="align-c"&gt; List of Bids &lt;div class="arrow arrowRight"&gt; &lt;/div&gt; jQUERY $("#showListOfBids").click(function(){ $(".bidList").toggleClass("show"); $(".arrowRight").toggleClass("arrowDown"); }); Developer Tool > Elements Toggling adds and removes arrowDown Toggle Off: &lt;div class="arrow arrowRight"&gt;&lt;/div&gt; Toggle On: &lt;div class="arrow arrowRight arrowDown"&gt;&lt;/div&gt; QUESTION: Why does the order of the class .arrowDown affect the display? AFAIK the css file isn't being reparsed when using jQuery. jQuery adds the class to the DOM and the parser just searches for that one element. COMMENT: I don't like toggling doubling up on the classes. Am I using it incorrectly? I was using removeClass and addClass and changed over to toggleClass
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27319992
has answer: http://stackoverflow.com/a/27320195
type: Question

http://stackoverflow.com/q/27389336
accepted answer: http://stackoverflow.com/a/27390541
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/51817995
has comment: http://stackoverflow.com/comment/43228244
has comment: http://stackoverflow.com/comment/43226609
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43261058
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27390541
has title: How to calculate the different between two datepickers
tagged with: datepicker
has body: im trying to calculate the date different for a two datepicker in JavaScript. I tried following other posts, but everytime i calculate the date diff * price, but i'm not getting a result. Can someone please direct me into the right direction in order to accomplish my goal in finding date differential between two datepickers. //input/saving data for the next form $(".next").click(function(){ start = $('#checkin').val(); ends = $('#checkout').val(); diff = (ends - start); days = diff/1000/60/60/24; //roomPrice = price inserted into selection type(Single = 65, Double = 100, Suite = 120) roomPrice = Rprices[selectType.value]; //preparing form5 fields = [$('#FirstName').val() + ' ' + $('#LastName').val(), $('#phone').val(), $('#email').val(), $('#StreetAddress').val(), $('#City').val(), $('#state').val(), $('#zip').val(), $('#checkin').val(), $('#checkout').val(), $('#RoomType').val(), $('#NumOfPeople').val(), document.getElementById("total").value = days * roomPrice];
has answer: http://stackoverflow.com/a/51817995
upvote count: 1

http://stackoverflow.com/q/27315064
has title: Events on html5 object tag
downvote count: 0
score: 7
type: Question
tagged with: javascript
tagged with: jquery-events
answer count: 2
has answer: http://stackoverflow.com/a/27317292
upvote count: 7
tagged with: jquery
favorite count: 0
has body: It seems that trigger/on jQuery events both standard and custom do not work on object tag. This does not work: var $test = $(" "); $test.on("test", function (){ console.log("jquery test handler"); }); $test.trigger("test"); While it works with other html tags (tried div, video, etc.). Vanilla js solution works: var test = document.createElement("object"); test.addEventListener("testV", function(e) { console.log("vanilla test handler"); }); var event = new CustomEvent("testV"); test.dispatchEvent(event); jQuery ver. 1.11.1 Tests: http://codepen.io/anon/pen/dPGoJg Questions: Am I only one who has this bug or am I doing something wrong? Is this a jQuery bug or is it expected behaviour? Any workarounds (especially for custom events besides using another element)?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27350287

http://stackoverflow.com/a/27394322
score: 0
has body: To execute the expression use eval function as below. eval(array[1] + array[2] + array[0]);
type: Answer
answers question: http://stackoverflow.com/q/27394240

http://stackoverflow.com/a/27373513
has body: Ok my setup was missing the jquery ui part See How to use jquery ui with bower? for how to solve it
accepted answer of: http://stackoverflow.com/q/27373128
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27373128
type: Answer

http://stackoverflow.com/q/27447728
tagged with: javascript
has comment: http://stackoverflow.com/comment/43335045
has comment: http://stackoverflow.com/comment/43335265
linked to: http://stackoverflow.com/q/14028959
score: 0
has body: var editor = { "test1": document.getElementById("a"), "test2": function() { return document.getElementById("a") }, "editCont": function() { console.log(editor.test1.id); // this returns 'cannot read property 'id' of null' console.log(editor.test2().id); // when removing the above console.log, this returns 'a' } } Click me! the console returns null for test1 and 'a' for the second. Can editor.test1 work without having to put it in a function like editor.test2? I understand that DOM element cannot be found if it doesn't exist however the second console.log works, whats the reason for the first console.log?
has comment: http://stackoverflow.com/comment/43334980
has comment: http://stackoverflow.com/comment/43334369
has comment: http://stackoverflow.com/comment/43335873
type: UnansweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/43335030
answer count: 0
type: Question
has title: Accessing DOM element as a JavaScript object property
duplicate of: http://stackoverflow.com/q/14028959
has comment: http://stackoverflow.com/comment/43334596
has comment: http://stackoverflow.com/comment/43334366

http://stackoverflow.com/q/27419413
tagged with: javascript
tagged with: extjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/188545
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27424949
favorite count: 0
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/43287080
has body: I'm trying to display some rich text in a component with a tpl in my extjs application. I get the rich text from my database and it looks like this: this is some example text \r\n\r\n with two line breaks At the moment extjs just displays the text but I want it to also make the line breaks. On the server-side I use PHP and the data then gets loaded into extjs via a direct layer. Are there any possibilities to do this? The best thing would be if you could somehow translate the rich text to HTML. Here is an example of my tpl: tpl:[ ' Some HTML Title ' '{RICH_TEXT}' ' Some more HTML Stuff ' ] Thanks in advance for your help. EDIT: I also encountered some cases where there is more than just some line breaks for example: {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\lang2055\b\f0\fs16 text text text\b0 , more text } How can I handle this? If there is no possibility, how can I get rid of that stuff and just display the clear text, because this is visible in extjs.
has comment: http://stackoverflow.com/comment/43288098
tagged with: php
answer count: 1
has title: Display rich text in ExtJS component
accepted answer: http://stackoverflow.com/a/27424949
tagged with: richtext
score: 2
downvote count: 0

http://stackoverflow.com/comment/43250712
comment on: http://stackoverflow.com/a/27386338
has text: Hi Carlos, I'm glad to hear it from you. I'll appreciate if you could accept my answer or give me an up vote. :) thanks
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43236587
comment on: http://stackoverflow.com/q/27394884
has text: Is this a prefix to infix form transformation by any chance?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43309347
score: 0
comment on: http://stackoverflow.com/q/27433215
type: Comment
type: QuestionComment
has text: You don't need to know why - but I'm preloading [webcomic](http://xkcd.com/688/) using AJAX in userscript. So in fact, I'm not loading exactly same URL. And yes, the attributes change. You didn't test anything and you doubt me?

http://stackoverflow.com/comment/43380173
has text: Sorry I don't really understand what to do... I thought I did append, by doing `.appendChild(script)`
comment on: http://stackoverflow.com/q/27472195
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27405694
has body: I think the button make an input submit by default. To prevent the post use the preventDefault like so : $('button.deleteHandheld').click(function (e) { e.preventDefault(); $("#hfDeviceId").val($(this).data('id')); $('#deleteConfirm').modal('show'); }); You can also replace you button with this : Delete
score: 3
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/27405547
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27405547
type: Answer

http://stackoverflow.com/comment/43586126
has text: Sorry, I meant that this is what I was currently doing in my code (you can see the code in the question) but it still doesn't work. This doesn't solve the problem.
type: Comment
comment on: http://stackoverflow.com/a/27559771
score: 1
type: AnswerComment

http://stackoverflow.com/comment/43293874
has text: but in console, I am seeing the id value is incrementing. But when I get that id, it is not incrementing
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27426005
score: 0

http://stackoverflow.com/comment/43275784
has text: You must set a flag in each of your actions (file upload etc) and then check for this flag in onbeforeunload event.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27415556

http://stackoverflow.com/comment/43283729
has text: @Grundy I've put in my template, hope that helps!
comment on: http://stackoverflow.com/q/27420341
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27354337
tagged with: web-services
tagged with: php
has comment: http://stackoverflow.com/comment/43161799
has answer: http://stackoverflow.com/a/27608026
tagged with: login-with-amazon
has body: So, I'm trying to integrate the Login and Pay with Amazon widget, and I'm encountering some problems. So, I have my seller account all set up on https://sellercentral.amazon.de/gp/ I have access to my API credentials, and I need to get a LWA client. So, I have registered on https://sellercentral.amazon.com/gp/homepage.htm in order to create an application. I have set up the application, on web settings I have completed the required URL's, and got my client ID. In the js for the Login and Pay with Amazon widget, I have replaced all the info needed: Client Id, merchant Id etc. But when I try to make a test login, I receive the following error : 400 Bad Request Unknown client_id The Pay With Amazon documentation is not very clear, and I can't seem to find anywhere a list with the error codes. If anybody has an idea, let me know. Thanks!
type: Question
has answer: http://stackoverflow.com/a/29478635
answer count: 2
has comment: http://stackoverflow.com/comment/43161968
tagged with: javascript
score: 0
has title: Login and pay with Amazon integration issue
tagged with: payment
type: UnansweredQuestion

http://stackoverflow.com/comment/43173120
type: AnswerComment
score: 0
type: Comment
has text: My described behaviour worked up to version 1.18.2 but changed in 1.19.0 (after merging https://github.com/mochajs/mocha/pull/1164/files). Now I'm thinking whether or how to make Mocha behave similarly as before.
comment on: http://stackoverflow.com/a/27358432

http://stackoverflow.com/a/27424907
score: 4
answers question: http://stackoverflow.com/q/27424777
has comment: http://stackoverflow.com/comment/43292751
has body: Your code is dependent on the IE event model, which creates a global window.event object for each event. It is deprecated in favour of the W3C event model (supported by Firefox and others), but still supported in IE for backward compatibility. You need to pass the event object to the function: Test then in the function: function test(event){ alert(event); } If you attach the listener using addEventListner, the event object is passed to the listener as the first argument by default: document.querySelector('#buttonID').addEventListener('click', test, false); You can also add listeners directly as properties: document.querySelector('#buttonID').onclick = test; which passes the event object as the first parameter in the W3C event model, but not in IE so the function must test and use window.event if event is undefined: function test(event){ event = event || window.event; console.log(event); } A very simple function to add a listener that works in all browser is: function addEvent(element, event, fn) { if (element.addEventListener) { element.addEventListener(event, fn, false); } else if (element.attachEvent) { element.attachEvent('on' + event, fn); } } Note that in IE, this will not be set to the element that called the event. If you need to fix that, then the following will do that: function addEvent(element, evt, fn) { if (element.addEventListener) { element.addEventListener(evt, fn, false); } else if (element.attachEvent) { element.attachEvent('on' + evt, function() { fn.call(element, event); }); } } And use it like: addEvent(document.getElementById('buttonID', 'click', test); There are more sophisticated versions, but the above should suffice. It creates unnecessary circular references though, you might want to avoid those. To do that, you need something like: function addEvent(element, evt, fn) { if (element.addEventListener) { element.addEventListener(evt, fn, false); } else if (element.attachEvent) { element.attachEvent('on' + evt, (function(fn, element) { return …
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/43293296
type: Answer

http://stackoverflow.com/comment/43344291
has text: No but undefined could be assigned to a truthy value
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27452887

http://stackoverflow.com/a/27472590
has comment: http://stackoverflow.com/comment/43389544
type: Answer
accepted answer of: http://stackoverflow.com/q/27471248
has body: According to the request readme, there are at least a few different ways to get debug information from request. The third solution in particular (using request-debug) seems to get you exactly what you're currently trying to do.
type: AcceptedAnswer
score: 0
answers question: http://stackoverflow.com/q/27471248

http://stackoverflow.com/comment/43104213
type: Comment
comment on: http://stackoverflow.com/q/27322250
type: QuestionComment
score: 0
has text: @BlaiseSwanwick: yes, the link you have provided has table attribute data-url="test.json" which loads the json file. But in my case I have to load the json objects(response) into table.

http://stackoverflow.com/comment/43124661
type: AnswerComment
has text: Thanks. Is there a particular reason you chose square-brace over dot syntax?
comment on: http://stackoverflow.com/a/27333500
score: 0
type: Comment

http://stackoverflow.com/a/27407755
has body: Ehh, just check them? if (userid == "" || password == "") { return false } //AJAX and so on.. script will jump out if either userid or password is empty
downvote count: 0
has comment: http://stackoverflow.com/comment/43260173
answers question: http://stackoverflow.com/q/27407717
has comment: http://stackoverflow.com/comment/43260209
upvote count: 2
has comment: http://stackoverflow.com/comment/43260018
type: Answer
score: 2

http://stackoverflow.com/q/27423582
type: Question
has comment: http://stackoverflow.com/comment/43289429
score: 0
has answer: http://stackoverflow.com/a/27424244
answer count: 3
has body: I have a plugin that hides a menubar. But i only want this to happen below 480px document size (aka, on phones, not on desktop computers). var wi; $(window).ready(function() { wi = $(window).width(); }); $(window).resize(function() { wi = $(window).width(); }); $(function() { if(wi&lt;480){ $('nav').scrollUpMenu({ waitTime: 200, transitionTime: 150, menuCss: { 'position': 'fixed', 'top': '0'} }); } }); The scrollUpMenu() code is from https://github.com/dvdsmpsn/Scroll-Up-Menu Now when I open the website it works. When I resize the window from desktop to phone size (&lt;480px), it will not hide the menu when scrolling. But if I refresh the page at that size, it will. And vice versa. I thought my $(window).resize function would take care of it, but I guess not. Anyone any ideas?
has answer: http://stackoverflow.com/a/27424004
has comment: http://stackoverflow.com/comment/43289528
has answer: http://stackoverflow.com/a/27423626
type: UnansweredQuestion
tagged with: javascript
has title: jQuery, Javascript: Responsive site - execute function below 480px
tagged with: jquery

http://stackoverflow.com/q/27405903
has comment: http://stackoverflow.com/comment/43258283
has answer: http://stackoverflow.com/a/27408890
has comment: http://stackoverflow.com/comment/43257971
has title: Passing more than one variable to Angular JS directive
has comment: http://stackoverflow.com/comment/43258504
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43257814
has comment: http://stackoverflow.com/comment/43258935
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/43258715
has body: I am new to writing directives. I have this snippet of code that works and I am trying to make it a directive: Some title ...content... So, my initial pass was app.directive('pbTogglePanel', function() { return { restrict: 'A', scope: { variableName: '@', panelTitle: '@' }, template: ' \n \n {{panelTitle}} \n \n \n\n \n \n...\n \n ', }; }); with the html This works, in the sense that the panel toggles as expected. I obviously did not try to use the variable "foobar" passed from the html attribute. When I try to use it, the code throws an error and the toggle does not work. I tried using the template: ' \n \n {{panelTitle}} \n \n \n\n \n \n...\n \n ' Although "foobar" shows up in all those places, the toggling fails and the console logs an angular error. So, what's the correct way to pull in more than one html attribute? Also, the goal would be to allow the contents of this DIV to replace ...content... placeholder in my template. Not sure how to pass that either. I feel if I can just get my head around how this data is passed, I'll be good from there out. TO HELP CLARIFY This works: http://codepen.io/smlombardi/pen/MYygpy But I wanted to pass the name of the variable for the toggler to use from an attribute too, and this does NOT work: http://codepen.io/smlombardi/pen/KwzPaw
score: 0
answer count: 1
tagged with: javascript
tagged with: angularjs

http://stackoverflow.com/a/27352235
type: Answer
upvote count: 1
has body: Try this HTML &lt;/div&gt; {% if username %} &lt;form action="#" method="post" id = "comment_form"&gt; {% csrf_token %} {{ form }} &lt;input type="text" name = "article" value="{{ article.id }}" id = "article_id"&gt; &lt;input type="text" name = "comment" value="comment goes here" id = "comment_text"&gt; &lt;input type="submit" class="button" value="???????? ???????????" id = "add_comment"&gt; &lt;/form&gt; {% endif %} &lt;/div&gt; jQuery $(document).ready(function(){ $("#add_comment").click(function(event){ event.preventDefault(); var article_id = $('#article_id').val(); $.ajax({ url: "http://127.0.0.1:8000/articles/addcomment/" + article_id + '/', type: "POST", /*i belive you are posting data to BE api*/ data:{'comment':"your comment goes here"}, /* use this get what given in input $("#comment_text").val()*/ success: function(result){ /*process data after success call*/ } }); }); });
score: 1
answers question: http://stackoverflow.com/q/27352013
downvote count: 0

http://stackoverflow.com/a/27322475
has comment: http://stackoverflow.com/comment/43104341
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/27322410
has body: You have to actually use the file upload middleware to get express to unpack that part of the request. From the multer docs: var express = require('express') var multer = require('multer') var app = express() app.use(multer({ dest: './uploads/'})); console.log(req.body) console.log(req.files)
score: -1
downvote count: 1

http://stackoverflow.com/q/27346563
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27346601
tagged with: quotes
has title: Havoc while escaping quotes in Javascript
tagged with: escaping
type: AnsweredQuestion
has body: I am trying to build a custom HTML/Javascript command using the following Javascript (for now, "dialogText" contains the name of a vegetable, but it may later contain HTML tags too): str = str + "&lt;span onClick=showDialog('"+dialogText+"')&gt;"; When dialogText is only one word long (i.e. "Basil"), this works correctly, giving the following result: &lt;span onclick="showDialog('Basil')"&gt; But when dialogText includes more than one word (i.e. "Beet root"), this fails. The result is syntactically invalid and generates a Javascript error: &lt;span onclick="showDialog('Beet" root')=""&gt; Why does this happen (where did the equals sign come from?)? And how can I change the code so that it works?
type: Question
has answer: http://stackoverflow.com/a/27346601
has comment: http://stackoverflow.com/comment/43148041
tagged with: javascript

http://stackoverflow.com/comment/43147828
type: QuestionComment
type: Comment
has text: Simple solutions if possible 1. You must call $('#zip-change-tooltip').parents('.qtip').css('height','200px'); after the content dynamically loaded (in success function of AJAX call) 2. You can pass the height to page eg: dynamic.php?height=200px and apply that height in the markup
comment on: http://stackoverflow.com/q/27339412
score: 0

http://stackoverflow.com/q/27361686
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27362091
favorite count: 0
has title: Droppable doesn't fire after changing divs
upvote count: 4
tagged with: css
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/27362506
accepted answer: http://stackoverflow.com/a/27362506
possible better answer: http://stackoverflow.com/a/27362057
has answer: http://stackoverflow.com/a/27362057
type: Question
has body: I'm trying to simulate an animate effect via jQuery that consists drag and drop as events to be fired. The code I use seems to be fine until the point when I have to swap divs by setting their display to none/block. Whenever I swap to the first div it perfectly executes the animation but when it gets on the 2nd div (after swapped) it doesn't fire the droppable event. I chose to have id selectors for the respective divs to instance the container of the droppable event hence to animate. I'm stuck and are out of any solution after searching numerous results so far. Thank you in advance. Here is my JS fiddle I prepared to easily understand my problem. Change http://jsfiddle.net/xoxxbr4t/6/
tagged with: javascript
tagged with: jquery
score: 4

http://stackoverflow.com/q/27439047
answer count: 1
tagged with: javascript
score: 0
has title: Nokia HERE Maps canvas drawing speed
type: UnansweredQuestion
type: Question
tagged with: performance
tagged with: here-api
linked to: http://stackoverflow.com/q/15799333
has answer: http://stackoverflow.com/a/27492566
tagged with: canvas
has body: I'm trying to draw a grid of rectangles on top of the map tiles using the Javascript API and highlight (switch fillColor for) whichever rectangle is currently under the mouse pointer. I would expect such a small change to be effective almost immediately. However the speed at which changes take place is unbearable for something like this, as changes seem to trigger with a delay of maybe 100ms or so. This applies even if I save a reference to one of the rectangles on a 2x2 grid and then change its color from the console. So this seems unlikely (but still possible) to be a performance issue but rather feels like the Maps simply won't refresh often enough. Is there maybe a way for me to tell the Maps to redraw a region immediately, or should I use some other way of drawing which would be more performant? I currently have a workaround of using a floating div as the highlight, but it feels a bit wrong and comes with other issues to hack around. rect = new nokia.maps.map.Rectangle(boundingBox, opts) ... // slow, but not a deal breaker map.objects.add(rect) ... // too slow to happen on every mouseenter/mouseleave event rect.set('fillColor', '000000') I'm using the 2.5 version of the Javascript API and I'm targeting mostly Chrome.

http://stackoverflow.com/a/27467057
has comment: http://stackoverflow.com/comment/43369947
has comment: http://stackoverflow.com/comment/43369977
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43369992
has comment: http://stackoverflow.com/comment/43370033
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27467029
has body: Define the mappings in an associative array: var carTypes = {}; carTypes["automatic"] = "automatic type"; carTypes["manual"] = "manual type"; Which you can then lookup : this.shout = function() { alert(carTypes[this.type]); }; Some validation will be required to ensure that the keys of the array are constrained.
answers question: http://stackoverflow.com/q/27467029

http://stackoverflow.com/comment/43349932
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27437683
has text: where are the posts saved ? and from where is the collection fetched ? Can you confirm that collection.fetch() is actually returning a non-empty collection ?

http://stackoverflow.com/q/27437197
answer count: 1
has answer: http://stackoverflow.com/a/27437313
has title: scoreboard will not update -- RPS game using javascript
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has body: I'm new to Javascript and I'm creating a RPS game. For some reason it is only recording points when I play the scissor button. I'm pretty sure I'm using something off that shouldn't be closed, but I can't find where. Any help would be appreciated. Here's my javascript code: var bot = 0; var you = 0; document.getElementById('rock').onclick = playRock; function playRock() { var humanChoice = 'rock'; var compChoice = cChoice(); console.log(compChoice); compare(humanChoice, computerChoice); }; function compare(humanChoice2, compChoice2) { if (humanChoice2 == compChoice2) { console.log("tie") } else if (humanChoice2 == "rock"){ if (compChoice2 == 'scissors') { you = you + 1; document.getElementById("humanScore").innerHTML = you; } else { bot = bot + 1; document.getElementById("computerScore").innerHTML = bot; } } } function cChoice() { computerChoice = Math.random(); if (computerChoice &lt;= .33) { computerChoice = 'rock'; } else if (computerChoice &lt;= .66) { computerChoice = 'paper'; } else { computerChoice = 'scissors'; } return computerChoice; } document.getElementById('paper').onclick = playPaper; function playPaper() { var humanChoice = 'paper'; var compChoice = cChoice(); console.log(compChoice); compare(humanChoice, computerChoice); }; function compare(humanChoice2, compChoice2) { if (humanChoice2 == compChoice2) { console.log("tie") } else if (humanChoice2 == "paper"){ if (compChoice2 == 'rock') { you = you + 1; document.getElementById("humanScore").innerHTML = you; } else { bot = bot + 1; document.getElementById("computerScore").innerHTML = bot; } } } function cChoice() { computerChoice = Math.random(); if (computerChoice &lt;= .33) { computerChoice = 'rock'; } else if (computerChoice &lt;= .66) { computerChoice = 'paper'; } else { computerChoice = 'scissors'; } return computerChoice; } document.getElementById('scissors').onclick = playScissors; function playScissors() { var humanChoice = 'scissors'; var compChoice = cChoice(); console.log(compChoice); compare…
type: Question
tagged with: javascript
favorite count: 0
score: 0

http://stackoverflow.com/q/27339107
tagged with: javascript
score: 0
tagged with: web-audio-api
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27339249
has body: I'm connecting the microphone input node, getUserMedia({audio:true}), to a createScriptProcessor node and the onaudioprocess event callback just stops happening and I cant figure out why. I print out the events for each callback. One in the middle looks like this: AudioProcessingEvent {outputBuffer: AudioBuffer, inputBuffer: AudioBuffer, playbackTime: 5.479909297052155, clipboardData: undefined, path: NodeList[0]…} bubbles: true cancelBubble: false cancelable: false clipboardData: undefined currentTarget: ScriptProcessorNode defaultPrevented: false eventPhase: 0 inputBuffer: AudioBuffer outputBuffer: AudioBuffer path: NodeList[0] playbackTime: 5.479909297052155 returnValue: true srcElement: ScriptProcessorNode target: ScriptProcessorNode timeStamp: 1417920765179 type: "audioprocess" __proto__: AudioProcessingEvent And the last one looks like this: AudioProcessingEvent {outputBuffer: AudioBuffer, inputBuffer: AudioBuffer, playbackTime: 5.944308390022676, clipboardData: undefined, path: NodeList[0]…} bubbles: true cancelBubble: false cancelable: false clipboardData: undefined currentTarget: ScriptProcessorNode defaultPrevented: false eventPhase: 0 inputBuffer: AudioBuffer outputBuffer: AudioBuffer path: NodeList[0] playbackTime: 5.944308390022676 returnValue: true srcElement: ScriptProcessorNode target: ScriptProcessorNode timeStamp: 1417920765643 type: "audioprocess" __proto__: AudioProcessingEvent Looks no different to me. I would've expected the event to contain some kind of notification. Or at least an error in the console. Is there a way to bind to some kind of error event or something? I'm not sure how to trouble shoot this further. Sometimes it stops after a millisecond. Sometimes after minutes. I cant seem to determine what the problem is.
type: Question
has title: AudioContext createScriptProcessor randomly stops with no error
answer count: 1

http://stackoverflow.com/comment/43178347
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27322474
has text: I'm thinking I'll just use a PHP session...I'll post to record how it went!

http://stackoverflow.com/comment/43342942
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27451963
has text: Why would you want to do that?

requestanimationframe
tags question: http://stackoverflow.com/q/27419663
type: Tag
tag name: requestanimationframe
tags question: http://stackoverflow.com/q/27356145
tags question: http://stackoverflow.com/q/27356936
tags question: http://stackoverflow.com/q/27432679

http://stackoverflow.com/q/27453617
linked to: http://stackoverflow.com/q/41309481
tagged with: javascript
upvote count: 39
tagged with: css-selectors
has answer: http://stackoverflow.com/a/27453618
tagged with: http://stackoverflow.com/tag/html
answer count: 7
has body: I have a project where I'm using the shadow DOM natively (not through a polyfill). I'd like to detect if a given element is contained within a shadow DOM or a light DOM. I've looked through all of the properties on the elements, but there don't seem to be any which vary based on the type of DOM an element is in. How can I determine if an element is part of a shadow DOM or a light DOM? Here is an example of what is considered "shadow DOM" and "light DOM" for the purpose of this question. (light root) • Document (light) • HTML (light) | • BODY (light) | • DIV (shadow root) | • ShadowRoot (shadow) | • DIV (shadow) | • IFRAME (light root) | • Document (light) | • HTML (light) | | • BODY (light) | | • DIV (shadow root) | | • ShadowRoot (shadow) | | • DIV (none) | • [Unattached DIV of second Document] (none) • [Unattached DIV of first Document] &lt;!doctype html&gt; &lt;title&gt; isInShadow() test document - can not run in Stack Exchange's sandbox &lt;/title&gt; &lt;iframe src="about:blank"&gt;&lt;/iframe&gt; &lt;script&gt; function isInShadow(element) { // TODO } function test() { // (light root) • Document // (light) • HTML var html = document.documentElement; console.assert(isInShadow(html) === false); // (light) | • BODY var body = document.body; console.assert(isInShadow(body) === false); // (light) | • DIV var div = document.createElement('div'); body.appendChild(div); console.assert(isInShadow(div) === false); // (shadow root) | • ShadowRoot var divShadow = div.createShadowRoot(); var shadowDiv = document.createElement('div'); divShadow.appendChild(shadowDiv); // (shadow) | • DIV console.assert(isInShadow(shadowDiv) === true); // (shadow) | • IFRAME var iframe = document.querySelector('iframe'); shadowDiv.appendChild(iframe); console.assert(isInShadow(iframe) === true); // (light root) | • Document var iframeDocument = iframe.contentWindow.document; // (light) | • HTML var iframeHtml = iframeDocument.documentElement; console.assert(isInShadow(iframeHtml) === false)…
has answer: http://stackoverflow.com/a/27524074
favorite count: 0
tagged with: shadow-dom
has comment: http://stackoverflow.com/comment/71044969
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27478691
downvote count: 2
linked to: http://stackoverflow.com/q/26248599
has answer: http://stackoverflow.com/a/73022243
has answer: http://stackoverflow.com/a/75217324
has answer: http://stackoverflow.com/a/27482101
has title: How can I tell if an element is in a shadow DOM?
type: Question
score: 37
has answer: http://stackoverflow.com/a/63225241

http://stackoverflow.com/a/27376859
answers question: http://stackoverflow.com/q/27376798
type: Answer
downvote count: 1
upvote count: 0
has body: this may help you $('textbox').val($(e.target).closest("tr").children().eq(4).text());
has comment: http://stackoverflow.com/comment/43206219
score: -1

http://stackoverflow.com/comment/43262478
score: 0
has text: where in the calendar.js.coffee file? I cant use erb in that file..
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27359692

http://stackoverflow.com/comment/43205280
comment on: http://stackoverflow.com/q/27377882
score: 0
type: Comment
has text: ans yes of course this code is inside $(document).ready()
type: QuestionComment

http://stackoverflow.com/a/27473866
upvote count: 2
score: 0
downvote count: 2
has body: There's no special advantage to using a variable. You can pass a function to .removeClass() and .addClass() thereby removing the need to use a variable: $(function() { $('.button').on('click', function() { $(this).addClass( function() { return $(this).data('button') + '-activate'; }); }).on('mouseup mouseleave', function() { $(this).removeClass( function() { return $(this).data('button') + '-activate'; }); }); }); $(function() { $('.button').on('click', function() { $(this).addClass( function() { return $(this).data('button') + '-activate'; }); }).on('mouseup mouseleave', function() { $(this).removeClass( function() { return $(this).data('button') + '-activate'; }); }); }); .one-activate { background-color:black; color:white; } .two-activate { background-color:black; color:yellow; } Man Woman BONUS: As you can see the functions passed to .removeClass() and .addClass() are exactly identical. We could write a jQuery custom method and use it in place of the functions as follows: $(function() { $('.button').on('click', function() { $(this).addClass( $(this).btnActivate() ); }) .on('mouseup mouseleave', function() { $(this).removeClass( $(this).btnActivate() ); }); }); $.fn.btnActivate = function() { return this.data('button') + '-activate'; }; $(function() { $('.button').on('click', function() { $(this).addClass( $(this).btnActivate() ); }) .on('mouseup mouseleave', function() { $(this).removeClass( $(this).btnActivate() ); }); }); $.fn.btnActivate = function() { return this.data('button') + '-activate'; }; .one-activate { background-color:black; color:white; } .two-activate { background-color:black; color:yellow; } Man Woman
answers question: http://stackoverflow.com/q/27473679
has comment: http://stackoverflow.com/comment/43383996
type: Answer
has comment: http://stackoverflow.com/comment/43384120
has comment: http://stackoverflow.com/comment/43384037

http://stackoverflow.com/comment/43229140
score: 0
type: Comment
type: QuestionComment
has text: @RiggsFolly ha, I didn't actually see that as I was staring at the console.log.
comment on: http://stackoverflow.com/q/27390479

http://stackoverflow.com/a/51410728
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/27352485
score: -1
upvote count: 0
has body: You can make this work by disabling the Cross-origin restrictions. On safari, open the Develop panel, and check disable cross-origin restrictions, or use a browser like Firefox.

http://stackoverflow.com/comment/43342622
score: 0
type: Comment
type: QuestionComment
has text: Apart from avoiding too many DOM queries: `$('.button')` does have the added benefit of matching any elements that were added later on to the DOM (AJAX responses and such)
comment on: http://stackoverflow.com/q/27451393

http://stackoverflow.com/a/27397822
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27397716
has body: Try using .removeAttr(). $('input[name="class"]').removeAttr('required')
type: Answer
downvote count: 0

http://stackoverflow.com/q/27383611
answer count: 2
has comment: http://stackoverflow.com/comment/43215920
has answer: http://stackoverflow.com/a/27383703
has answer: http://stackoverflow.com/a/27383728
upvote count: 3
possible better answer: http://stackoverflow.com/a/27383728
has comment: http://stackoverflow.com/comment/43215814
has comment: http://stackoverflow.com/comment/43216052
tagged with: arrays
tagged with: javascript
has body: I am trying to remove some elements from an array, and use the splice functionality where it also returns those values. See the javascript below: var blocksUsed = allNumbers.splice(0,3); When trying to run this line (in conjunction with the entire function), I get an error saying the following: Uncaught TypeError: undefined is not a function I have spent quite some time looking for typographical errors in the function, but there don't seem to be any. I also ready that JQuery is the common troublemaker here, but I am not using JQuery. The array is created by shuffling another array (the shuffle function isn't mine): function shuffle(o){ for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; }; Which I then use in the following manner: var allNumbers = shuffle(blocks); I tried logging the allNumbers, which works correctly. The array gets shuffled correctly. Trying to do a splice on this however gives a same error. Also note that I am doing the splicing inside a for-loop. Code below. for (var i = 0; i &lt; 4; i++){ // Get a block of 3 blocks. var blocksUsed = allNumbers.splice(0,3); // This line gives the error. // Determine the color used for these blocks and remove it so that it doesn't get drawn again. var colorIndex = randomIntFromInterval(0,i); var colorUsed = otherColors[colorIndex]; if(otherColors.indexOf(colorUsed) &gt; -1){ otherColors.splice(colorIndex, 1); } // For each block, set the color. for(var j = 0; j &lt; 3; j++){ blocksUsed[j].className = "block " + colorUsed; } } Why can I not use splice on this array? Note that I can provide the entire function, if desired. I have the entire function at this codepen for reference straight away. Because of the comment: allNumbers is a shuffled version of an array containing elements received in the following manner: var blocks = document.getElementsByClassName('block');
accepted answer: http://stackoverflow.com/a/27383703
has title: Undefined is not a function when using array.splice
type: AnsweredQuestion
score: 3
downvote count: 0
favorite count: 0
type: Question

http://stackoverflow.com/a/27443046
has body: The proReplace.replace(" ","-"); only works for the first occurrence of substring. Take a look at here Replace multiple characters in one replace call
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/27442858
score: -1
upvote count: 0

size
type: Tag
tags question: http://stackoverflow.com/q/27345608
tag name: size
tags question: http://stackoverflow.com/q/27321580

http://stackoverflow.com/comment/43327888
comment on: http://stackoverflow.com/a/27431711
score: 0
type: Comment
has text: As I am not that good at javascript, how would I then take the roomTypes variable and have it looped through for the dropdown menu as well as use the various parts of the array information stored within roomTypes?
type: AnswerComment

http://stackoverflow.com/q/27382814
tagged with: javascript
has comment: http://stackoverflow.com/comment/43214359
linked to: http://stackoverflow.com/q/5143464
downvote count: 0
tagged with: jquery
has body: Is there elegant way to determine if focusout focus is suppose to end up in element that is part of current window? Well I guess it would be enough to know id of element that was focused in, that caused focus out. $('body').on("focusout", ".control-container &gt; input", function () { var escapeContext = ??? if (escapeContext within currentWindow) { DoSomething(); } else { DoNothingAndStayInFocus(); } }); My goal is to make DOM non-reactive if user changes browser tab, just as if you switched to another window.
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
type: Question
has title: focusout focusin browser tab switch

clone
tags question: http://stackoverflow.com/q/27391478
tags question: http://stackoverflow.com/q/27384620
tags question: http://stackoverflow.com/q/27451377
tag name: clone
type: Tag

http://stackoverflow.com/comment/43307043
comment on: http://stackoverflow.com/a/27432815
has text: This is a much better use of jQuery
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43158351
comment on: http://stackoverflow.com/a/27352117
has text: Sorry,but I can't understand that which you have suggested is work for only browser and tab or anywhere in system even browser is minimize
score: 0
type: AnswerComment
type: Comment

android
tags question: http://stackoverflow.com/q/27330787
tags question: http://stackoverflow.com/q/27319258
tags question: http://stackoverflow.com/q/27426390
tags question: http://stackoverflow.com/q/27396617
tags question: http://stackoverflow.com/q/27469178
tags question: http://stackoverflow.com/q/27468070
tags question: http://stackoverflow.com/q/27417926
tags question: http://stackoverflow.com/q/27322208
tags question: http://stackoverflow.com/q/27470969
tags question: http://stackoverflow.com/q/27322916
tags question: http://stackoverflow.com/q/27385679
tags question: http://stackoverflow.com/q/27340447
tags question: http://stackoverflow.com/q/27386828
tags question: http://stackoverflow.com/q/27455884
tags question: http://stackoverflow.com/q/27468441
tags question: http://stackoverflow.com/q/27317963
tags question: http://stackoverflow.com/q/27379356
tags question: http://stackoverflow.com/q/27425573
tags question: http://stackoverflow.com/q/27346790
tags question: http://stackoverflow.com/q/27413838
tags question: http://stackoverflow.com/q/27320940
tags question: http://stackoverflow.com/q/27333570
tags question: http://stackoverflow.com/q/27435165
tags question: http://stackoverflow.com/q/27356447
tags question: http://stackoverflow.com/q/27471952
tags question: http://stackoverflow.com/q/27315070
tags question: http://stackoverflow.com/q/27433437
tags question: http://stackoverflow.com/q/27317110
tags question: http://stackoverflow.com/q/27467332
tags question: http://stackoverflow.com/q/27406450
tags question: http://stackoverflow.com/q/27448625
tags question: http://stackoverflow.com/q/27347403
tags question: http://stackoverflow.com/q/27351466
tags question: http://stackoverflow.com/q/27376694
tags question: http://stackoverflow.com/q/27314855
tags question: http://stackoverflow.com/q/27433511
tags question: http://stackoverflow.com/q/27439198
tags question: http://stackoverflow.com/q/27445634
tags question: http://stackoverflow.com/q/27323342
tags question: http://stackoverflow.com/q/27423776
tags question: http://stackoverflow.com/q/27343654
tags question: http://stackoverflow.com/q/27423530
tags question: http://stackoverflow.com/q/27333374
tags question: http://stackoverflow.com/q/27332951
tag name: android
tags question: http://stackoverflow.com/q/27331187
type: Tag
tags question: http://stackoverflow.com/q/27376005
tags question: http://stackoverflow.com/q/27448126

http://stackoverflow.com/a/27374936
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/27374517
upvote count: 3
answers question: http://stackoverflow.com/q/27374517
score: 3
has body: You need to stop the button from actually submitting the form. If you make sure that your Javascript function appears before your html and your button looks like this: Calculate Then it should work properly If you need to call the first calc() before the button is clicked, you need to do it when the document is ready: document.addEventListener("DOMContentLoaded", function(event) { calc(); }); Example
type: AcceptedAnswer

http://stackoverflow.com/q/27327691
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43114264
downvote count: 0
score: 1
tagged with: methods
type: Question
has title: Declaring new variables or using references in functions?
tagged with: performance
tagged with: javascript
upvote count: 1
tagged with: function
has comment: http://stackoverflow.com/comment/43114382
answer count: 1
has body: When defining methods for a class, is it better to use members themselves or does assigning them to a new variable make it faster? Imagine, for instance in JavaScript the following method: square: function() { var x = this.x; x *= x; return x; } or square: function() { this.x *= this.x; return this.x; }
has answer: http://stackoverflow.com/a/31434036

http://stackoverflow.com/comment/43245464
comment on: http://stackoverflow.com/a/27400129
type: Comment
has text: @MaxBumaye — No, it isn't. You can't make an Ajax request to a server that you can't reach. That is why you need to proxy. This is the same suggestion that Halayem Anis is making.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/68863869
score: 0
comment on: http://stackoverflow.com/a/28210364
type: Comment
has text: Great answer. Just be careful that while testing if an element is registered, `document.createElement(name).constructor` part actually creates the element if it is already registered, and you could find yourself searching for why ready event of your Polymer element is firing twice :)
type: AnswerComment

http://stackoverflow.com/comment/43170427
has text: @Jellezilla I think you can also target just the input fields you want. Instead of `$(window)` use `$("#theTargetScopeId input").keypress(...`
comment on: http://stackoverflow.com/a/27357422
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27342595
tagged with: disqus
tagged with: css
tagged with: iframe
has comment: http://stackoverflow.com/comment/43141361
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27343514
has title: Disqus comments overlapping my footer
has comment: http://stackoverflow.com/comment/43141893
has comment: http://stackoverflow.com/comment/43141453
type: Question
has comment: http://stackoverflow.com/comment/43141561
has comment: http://stackoverflow.com/comment/43142331
answer count: 1
tagged with: javascript
has body: Hi guys I've made a lot of progress on this project but now I seem to have run into a slight issue when integrating the disqus commenting system. I've looked at the other questions but it seems with html and css things can go sideways in so many different ways those questions didn't help too much. It's overlapping the footer at the bottom of the page. I'll post a link to a sample page, please help. Thanks. http://blubee.me/journal/ "disqus overlaps footer" here's a screenshot below css for the article section, the div article-footer which houses the disqus comment code doesn't have any styles applied to it. .article-header .title { text-transform: uppercase; font-weight: 500; font-size: 1.5em; padding: 0 0 10px 0; } .article-meta { text-align: left; margin-top: -10px; } .article-meta img { border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%; } .article-meta ul { margin: 0; padding: 0; list-style-type: none; } .article-meta ul li { display: inline-block; } .article-meta ul li a { text-decoration: none; } .article-meta ul li a:hover { color: #fff; } .journals h1, .journals h2, .journals h3, .journals h4, .journals h5, .content h1, .content h2, .content h3, .content h4, .content h5 { text-transform: uppercase; font-weight: bold; font-size: 1.5em; padding: 20px 0 15px 0; }
has comment: http://stackoverflow.com/comment/43141577
accepted answer: http://stackoverflow.com/a/27343514
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/43141692

http://stackoverflow.com/a/27386796
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43221944
has comment: http://stackoverflow.com/comment/43221899
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27385915
answers question: http://stackoverflow.com/q/27385915
has body: Here is a working http://plnkr.co/edit/5Ut80w4dhO6IQmSSlx6f?p=preview I would write it like this: app.directive('aview',['FruitService', function(FruitService){ return { templateUrl: 'a.html', restrict: 'C', link: function($scope){ $scope.resAVal = FruitService.resAVal; } } } ]); app.directive('bview',['FruitService', function(FruitService){ return { templateUrl: 'b.html', restrict: 'C', link: function($scope){ $scope.resAVal = FruitService.resAVal; } } } ]); app.directive('cview',['FruitService', function(FruitService){ return { templateUrl: 'c.html', restrict: 'C', link: function($scope){ $scope.resAVal = FruitService.resAVal; } } } ]); app.factory('FruitService', function(){ return { resAVal : 5 } }); And actually you dont even have to do $scope.resAVal = FruitService.resAVal; in every directive, you can do $scope.resAVal=yourvalue in the factory and just inject the factory in each directive
upvote count: 1

http://stackoverflow.com/q/27347132
has answer: http://stackoverflow.com/a/27347194
has comment: http://stackoverflow.com/comment/43149290
tagged with: javascript
has body: Why does the below code only work in the Codecademy.com editor and not in a real browser or jsfiddle? There seem to be no mistakes... HTML Zebras eat bananas That's nonsense With this javascript, #p2 should change automatically when the page has loaded. In the Codecademy editor that's what happens, but see it not work in Jsfiddle and also not when I make HTML/js files and run it in my browser. How can I fix this? Or did they teach me wrong? Javascript $(document).ready(function(){ $('#p2').html("Now it makes sense!"); })
has comment: http://stackoverflow.com/comment/43149065
has comment: http://stackoverflow.com/comment/43149112
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43149127
accepted answer: http://stackoverflow.com/a/27347194
has comment: http://stackoverflow.com/comment/43149235
type: AnsweredQuestion
has title: Simple code only works in certain editor but not anywhere else
type: Question

http://stackoverflow.com/comment/43302484
has text: value="<?php echo $r['id']; ?>" it is being set I've checked the source.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27430598

http://stackoverflow.com/comment/43155951
type: QuestionComment
type: Comment
has text: Are you against the URL not being the exact same? Like index.html and a new window opening could be index.html?q=1 and you can do a read in your javascript to find the value q=1 parse the 1 and change the title based on that.
score: 0
comment on: http://stackoverflow.com/q/27350817

http://stackoverflow.com/q/27410945
has comment: http://stackoverflow.com/comment/43266681
score: 0
has answer: http://stackoverflow.com/a/27433708
has comment: http://stackoverflow.com/comment/43266491
accepted answer: http://stackoverflow.com/a/27433708
tagged with: blogger
has answer: http://stackoverflow.com/a/27417408
type: AnsweredQuestion
has body: I'm trying to have a div appearing in a dialog using the jQuery-UI function. It will be a contact form in my blogspot site. However I keep getting the notorious 'Undefined is not a function' error. I searched a lot without eventually being able to address the issue and I have no idea about what's going on. Below is a fiddle EXACTLY as in the blogspot code (even same id names). You can see that in the fiddle the code functions perfectly. HTML: Click here! Blablabla JS: $(document).ready(function () { $("#emailform").click( function () { $("#contform").dialog(); }) }); http://jsfiddle.net/mukL3hq8/2/ Any help will be greatly appreciated. UPDATE: Changed the line #4 to a simple alert message and it worked. So I think that this narrowed the problem down to the jQuery UI library.
has title: Issue with jQuery UI in Blogspot
possible better answer: http://stackoverflow.com/a/27417408
has comment: http://stackoverflow.com/comment/43266449
type: Question
has comment: http://stackoverflow.com/comment/43307658
answer count: 2
has comment: http://stackoverflow.com/comment/43266345
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43266510
linked to: http://stackoverflow.com/q/7975093

http://stackoverflow.com/comment/43313930
type: QuestionComment
comment on: http://stackoverflow.com/q/27436396
score: 1
has text: AFAIK `toLocaleString` has nothing to do with the OS's local date format preference settings (although it knows abut the GMT offset on the computer it is running on).
type: Comment

http://stackoverflow.com/q/27406899
tagged with: meteor
type: Question
has title: Why is the document returning null even though I already subscribed to the collection (Meteor)?
answer count: 2
has body: I have a Books and Chapters collection. Self-explanatory: A book can have many chapters. subscriptions.js: Meteor.publish("singleChapter", function(id) { return Chapters.find(id); }); book_page.js: Template.bookPage.helpers({ chapters: function() { Chapters.find({ bookId: this._id }, { sort: { position: 1 } }); } }); book_page.html: {{#each chapters}} {{> chapterItem}} {{/each}} chapter_item.html: X Right now, I'm trying to get the current chapter item in chapter_item.js: Meteor.subscribe("singleChapter", this._id); // even tried this but didn't work Template.chapterItem.events({ "click .delete-current-chapter": function(e) { e.preventDefault(); var currentChapter = Chapters.find(this._id); } }); But when I do console.log(currentChapter); I get undefined. What am I doing wrong?
score: 0
has comment: http://stackoverflow.com/comment/43258670
has answer: http://stackoverflow.com/a/27409530
has answer: http://stackoverflow.com/a/27407516
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/27359101
downvote count: 1
type: Answer
upvote count: 0
has body: Did you called the method. I think no, you did created a method that append time options into the select tag but not called it. So, You have to call this method some where / at some event I am adding an example that load the dropdown at click event on an anchor tag. Example is given Here $(function(){ $('#trigger').click(function(){ populate('#select-custom-20'); }); function populate(selector) { var select = $(selector); var selectBox = $("&lt;select&gt;&lt;/select&gt;"); var hours, minutes, ampm ; for(var k = 700; k &lt;= 2300; k += 100){ var i=0; for(var j=0;j&lt;=45;j+=15){ i=k+j hours = Math.floor(i / 100); minutes = i % 100; if(minutes&gt;10){ minutes=minutes+""; }else{ minutes=0+""+minutes; } ampm = hours % 24 &lt; 12 ? 'AM' : 'PM'; hours = hours % 12; if (hours === 0){ hours = 12; } var valueString=hours + ':' + minutes + ' ' + ampm; select.append($('&lt;option&gt;&lt;/option&gt;') .attr('value', i) .text(valueString)); } } } }); Hope it helps.....
score: -1
answers question: http://stackoverflow.com/q/27358842

http://stackoverflow.com/comment/43101292
type: QuestionComment
has text: That didn't seem to do it. I also tried label, but I think that's for something else.
comment on: http://stackoverflow.com/q/27320871
type: Comment
score: 0

http://stackoverflow.com/q/27411752
has comment: http://stackoverflow.com/comment/43270310
has body: So, I have looked over the whole of stackoverflow to find an answer for my question and haven't found anything. I tried to rewrite the .htaaccess like everyone had suggested and it didn't work. I think the problem is that it is trying to read the web page as an image. All the other links on my site except for http://anarrayofstars.com/temp/portfolio/bar-isabel/ and http://anarrayofstars.com/temp/. Even my root level site anarrayofstars.com, works. Which is making me believe that it is something on one of these pages but I have looked over both of them many of times. The main error is: Resource interpreted as Image but transferred with MIME type text/html: "http://anarrayofstars.com/temp/portfolio/bar-isabel/". Then the sub errors are: (anonymous function)modernizr-2.6.2.min.js:4 y modernizr-2.6.2.min.js:4 s.touchmodernizr-2.6.2.min.js:4 (anonymous function)modernizr-2.6.2.min.js:4 (anonymous function)modernizr-2.6.2.min.js:4 I don't know if that will help, but those are the errors I am receiving when I use chrome inspector, and for the life of me I cannot figure out where to find these errors.
tagged with: javascript
type: Question
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
tagged with: php
tagged with: modernizr
answer count: 0
has comment: http://stackoverflow.com/comment/43270377
type: UnansweredQuestion
has title: Resource interpreted as Image but transferred with MIME type text/html in wordpress
tagged with: wordpress
upvote count: 1
has comment: http://stackoverflow.com/comment/43293482

http://stackoverflow.com/comment/43367976
comment on: http://stackoverflow.com/q/27465866
score: 0
type: QuestionComment
type: Comment
has text: cause those elements appended after load function is called, I didn't see the reason to write down 'load' function

http://stackoverflow.com/comment/43218139
type: Comment
comment on: http://stackoverflow.com/q/27384620
has text: So, Can you share the boilerplate HTML,CSS etc or a code snippet so that we don't have to spent our time on it..?
score: 0
type: QuestionComment

task
type: Tag
tag name: task
tags question: http://stackoverflow.com/q/27402965

http://stackoverflow.com/a/27415680
downvote count: 0
has comment: http://stackoverflow.com/comment/43275628
has body: So why do you have to beat your self up with a complex regex. Why not a number comparison? function validNum (num) { num = parserFloat(num); return num &gt; 0 &amp;&amp; num &lt; 100; } Want only two decimal places ? function validNum (num) { num = parseFloat((num + "").replace(/^(.*\.\d\d)\d*$/, '$1')); return num &gt; 0 &amp;&amp; num &lt; 100; } Test Here .5: true ..5 : false .005 : false 0.05 : true 99.99 : true 00.01 : true 00.00 : false 0.00 : false 00.0 : false 100.00 : false
score: 3
has comment: http://stackoverflow.com/comment/43275548
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/27415462

http://stackoverflow.com/comment/43146606
type: Comment
has text: Hmm, not that is not having any affect.
type: AnswerComment
comment on: http://stackoverflow.com/a/27345565
score: 0

http://stackoverflow.com/comment/43264288
score: 0
type: AnswerComment
has text: The OP already tried that and saw that it worked, he wanted to know what's actually happening.
type: Comment
comment on: http://stackoverflow.com/a/27409856

http://stackoverflow.com/q/27343604
has title: javascript function doesn't seem to be calling
has comment: http://stackoverflow.com/comment/43142599
has body: I am creating an AJAX dynamic search bar which returns results from a database. I find that when i open the debugger, the code isn't entering the function handleSuggest() which sets the inner html of the div where the results are shown. Here is my code. function getXmlHttpRequestObject(){ if(window.XMLHttpRequest){ return new XMLHttpRequest(); } else if (window.ActiveXObject){ return new ActiveXObject("Microsoft.XMLHTTP"); } else{ alert("Your browser does not support our dynamic search"); } } var search = getXmlHttpRequestObject(); function ajaxSearch(){ if (search.readyState == 4 || search.readyState == 0){ var str = escape(document.getElementById('searchBox').value); search.open("GET", 'searchSuggest.php?search=' + str, true); search.onreadystatechange.handleSearchSuggest(); search.send(null); } } function handleSearchSuggest(){ if(search.readyState == 4){ var ss = document.getElementById('ajaxSearch'); ss.innerHTML = ''; var str = search.responseText.split("\n"); for(i=0; i&lt;str.length-1; i++){ var suggestion = '&lt;div onmouseover="javascript:suggestOver(this);"'; suggestion += 'onmouseout="javascript.suggestOut(this);"'; suggestion += 'onclick="javascript:setSearch(this.innerHTML);"'; suggestion += 'class="suggestLink"&gt;' + str[i] + '&lt;div&gt;'; ss.innerHTML += suggestion; } } } function suggestOver(divValue){ divValue.className = "suggestLink"; } function suggestOut(divValue){ divValue.className = "suggestLink"; } function setSearch(x){ document.getElementById('searchBox').value = x; document.getElementById('ajaxSearch').innerHTML = ''; }
has answer: http://stackoverflow.com/a/27343669
accepted answer: http://stackoverflow.com/a/27343669
tagged with: dynamic
has comment: http://stackoverflow.com/comment/43142697
type: AnsweredQuestion
tagged with: search
type: Question
answer count: 1
tagged with: javascript
tagged with: ajax
score: 0

http://stackoverflow.com/comment/43372340
has text: @meagar: We don't know where the single `\ ` and `n` characters are coming from. Of course, if they were hardcoded it would not make much sense
comment on: http://stackoverflow.com/a/27468506
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/55124969
answers question: http://stackoverflow.com/q/27322432
type: Answer
score: 0
has body: Don't know if you were able to solve your issue. For me, I had forgotten to run: rake assets:precompile before deploying to production.

http://stackoverflow.com/comment/43356343
has text: @GRSEV .remove class got background-image
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27459706
type: Comment

http://stackoverflow.com/q/27391715
accepted answer: http://stackoverflow.com/a/27392913
score: 0
answer count: 1
tagged with: jquery
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/43270873
has comment: http://stackoverflow.com/comment/43231212
tagged with: css
has comment: http://stackoverflow.com/comment/43270966
tagged with: filepath
has title: V basic Bootstrap example: JS components not working, no collapsing functionality
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27392913
has body: I'm attempting a very basic Bootstrap tutorial example. None of the collapsing functionality (ie, all Bootstrap code referenced, I believe) is working. My file structure is correct, with index.html in the same folder as the bootstrap folders CSS, Fonts, and Javascript, where the min.xx files I am referencing are located. But, I believe the issue lies there, with referencing filepaths. Code: Bootstrap 101 Template <!--[if lt IE 9]> <![endif]--> Hello, world! Content Content
type: Question
tagged with: javascript

http://stackoverflow.com/q/27314663
has comment: http://stackoverflow.com/comment/43089584
type: Question
has comment: http://stackoverflow.com/comment/43089540
tagged with: c#
upvote count: 16
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/27315172
accepted answer: http://stackoverflow.com/a/27315172
has answer: http://stackoverflow.com/a/29101582
tagged with: asp.net
favorite count: 0
possible better answer: http://stackoverflow.com/a/27314930
has answer: http://stackoverflow.com/a/41983310
has body: Introduction: I have a WebMethod on my ASP.NET page which returns a Person object. One of the fields is Birthday which is a DateTime property. WebMethod [WebMethod] public static Person GetPerson() { Person p = new Person() { Id = 1, Name = "Test", Birthday = new DateTime(1988, 9, 13) }; return p; } If I make the call using $.ajax() I get the response of the server with the Person object. Ajax call // Class instance var Ajaxcalls = function () { } _$.extend(Ajaxcalls, { GetPerson: function (label) { var self = label instanceof _$ ? label : $(label); _$.ajax({ url: 'Default.aspx/GetPerson', type: "POST", dataType: "json", contentType: "application/json; charset=utf-8", success: function (data) { console.log(JSON.stringify(data.d)); self.html(new Date(Date.parse(data.d.Birthday))); } }); } }); Result: {"__type":"AjaxTest.Classes.Person","Id":1,"Name":"Test","Birthday":"/Date(590104800000)/"} Problem How do I parse the Birthday [/Date(590104800000)/] to a javascript/jQuery date? I tried new Date(Date.parse(data.d.Birthday)) but it gives me an Invalid date.
has comment: http://stackoverflow.com/comment/43089598
score: 16
has comment: http://stackoverflow.com/comment/43089824
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27314930
has title: ASP.NET Parse DateTime result from ajax call to javascript date
downvote count: 0

http://stackoverflow.com/q/27360901
has title: Polymer counting elements with certain attribute inside array
tagged with: arrays
downvote count: 0
has body: I am using Polymer on a project. For a certain element, I have an array that is the input. This array contains JSON objects that have for example a bool favorite. I want to display a certain message if none of the object is favorited. I know how to loop through the array inside a &lt;template&gt; and I know how to use the filters, but how to efficiently do this I don't know. Currently I have an extra object in my element that stores the number of favorited elements by looping through it, but this seems very inefficient. dataChanged: function(){ this.nrOfFavorites = 0; for(test in this.data){ if(test.favorite){ this.nrOfFavorites++; } } } Also, using this I'm having some issues that in other methods calling this.fire('dataChanged') is not calling the function, thus I cannot recount the number of favorite after (de)favoriting an item. What is the advised way to do this?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27369737
type: Question
score: 2
type: AnsweredQuestion
favorite count: 0
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/27369737
tagged with: polymer

http://stackoverflow.com/comment/66334681
type: AnswerComment
comment on: http://stackoverflow.com/a/35365041
type: Comment
has text: I must be using an out-dated version of JSHint, because only by using `"esnext": true` was I able to solve this. `"esversion": 6` had no effect.
score: 3

http://stackoverflow.com/a/27354707
has comment: http://stackoverflow.com/comment/43165964
downvote count: 0
score: 1
type: AcceptedAnswer
upvote count: 1
has body: it looks like you have bootstrap also included into your project. It got conflict with jQuery-UI. Do this: $(document).ready(function () { if ($.fn.button.noConflict) { $.fn.btn = $.fn.button.noConflict(); } });
type: Answer
accepted answer of: http://stackoverflow.com/q/27354625
answers question: http://stackoverflow.com/q/27354625
has comment: http://stackoverflow.com/comment/43162496

http://stackoverflow.com/a/27463308
has comment: http://stackoverflow.com/comment/43363217
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43362830
answers question: http://stackoverflow.com/q/27463043
has comment: http://stackoverflow.com/comment/43363211
has comment: http://stackoverflow.com/comment/43362795
has comment: http://stackoverflow.com/comment/43363190
has comment: http://stackoverflow.com/comment/43362779
has comment: http://stackoverflow.com/comment/43362916
has body: If I did understand well, and as you said: You only are meant to have ONE vote and can literally only "spend" it on one map; the choice of map is allowed to be changed at anytime. In this case, you should use a radio button. But, if you want to accumulate the votes done by all users, you should think about using e.g Ajax to retrieve and update the voting counts in the server. Please, correct me if I get it wrong. Hope it's useful!
has comment: http://stackoverflow.com/comment/43362896
has comment: http://stackoverflow.com/comment/43362868
has comment: http://stackoverflow.com/comment/43362861

http://stackoverflow.com/q/27458019
score: 3
has title: how to pull data from am XML file and show it on html table
tagged with: javascript
has answer: http://stackoverflow.com/a/27459658
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43353428
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27459658
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has body: here is my code(took from a old post). what I am doing wrong? 1.First one test.xml, a xml file to store data. <?xml version="1.0"?> 1/01/2001 milk <Quantity>10</Quantitty> 50 10 2/10/2007 milk <Quantity>20</Quantitty> 100 20 2.Second one is demo.html, to show the data stored in xml file. This html has an input tag as Text and a submit button. OnClick on the submit button, it should search for the input given and show the output. Product Name: I am getting an error on chrome as--- XMLHttpRequest cannot load file:///C:/Users/chandan/Desktop/demo/test/test.xml. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource. demoNew.html:28 Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/Users/chandan/Desktop/demo/test/test.xml'. However when I run this on firefox it's loading the xml file, but not showing the output, giving error on line 44 of Html.. how to fix?
upvote count: 3
type: Question

http://stackoverflow.com/q/27342546
has body: Try to get names of mathes in "Starting soon" section of this web-site: https://favbet.com/en/bets/ This is my code: var request = require('request'), cheerio = require('cheerio'); matches = []; request('https://favbet.com/en/bets/', function (err, resp, body) { if (!err &amp;&amp; resp.statusCode == 200) { var $ = cheerio.load(body); var content = $('#startsoon').find('li.col20').each(function() { var match = this.text(); matches.push(match); }); console.log(matches); } }); Console.log returns blank array. I'm not quite understand how the deep nesting works in this case.
upvote count: 4
tagged with: node.js
has comment: http://stackoverflow.com/comment/43200059
duplicate of: http://stackoverflow.com/q/28739098
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43142046
has title: Cheerio selector returns blank array
type: Question
has comment: http://stackoverflow.com/comment/43200058
linked to: http://stackoverflow.com/q/28739098
tagged with: cheerio
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/43200105
favorite count: 0
has comment: http://stackoverflow.com/comment/43198736

http://stackoverflow.com/a/27454014
type: Answer
has comment: http://stackoverflow.com/comment/43357068
has comment: http://stackoverflow.com/comment/43349977
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43346241
answers question: http://stackoverflow.com/q/27453974
has body: You can override another css attribute by using !important; as addition to your css attribute. So, without knowing the depth of bootstrap, you can try to add something like this to your stylesheet img { width: 100% !important; height: auto !important; } Or insert this between &lt;style&gt; and &lt;/style&gt; in your head-section. Hope this helps as a quick tipp. If you need other suggestions please let me know. UPDATE The other provided answere is the clean one. You should mark that answere as correct ;) Best regards, Marian.
downvote count: 0

http://stackoverflow.com/q/27396016
answer count: 3
has answer: http://stackoverflow.com/a/27396161
has answer: http://stackoverflow.com/a/27396189
has title: JavaScript / save variable values with callback
favorite count: 0
tagged with: angularjs
upvote count: 2
linked to: http://stackoverflow.com/q/750486
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27396189
type: Question
has answer: http://stackoverflow.com/a/27396186
has comment: http://stackoverflow.com/comment/43238396
downvote count: 0
tagged with: javascript
has body: I have the following code with Angular.js: $scope.createSSH = function(){ for (var j=0; j&lt;allGroupsArrays.length; j++){ for (var i=0; i&lt;$scope.appArray.length; i++){ allGroupsArrays[j][i][6] = Boolean(0); allGroupsArrays[j][i][7] = Boolean(0); // Some irrelvant code WClient.createSSHK(allGroupsArrays[j][i][2], allGroupsArrays[j][i][3], allGroupsArrays[j][i][4], i, allGroupsArrays[j], allGroupsArrays[j][i][7], j).then( function(data) { console.log("The j is: " + j) console.log("The i is: " + i) }, function(message) { console.log("Error") } When the callback is backed, I notice that j and i variables value were note save. Instead, It prints the following: The j is: 5 The i is: 3 These even when the callback was executed were i was 0 and j was 0. How can I save the variable's values context?
possible better answer: http://stackoverflow.com/a/27396161

http://stackoverflow.com/comment/43298008
score: 0
has text: Use the Attribute Selector ["tabindex"] to get all childelements of this form. Then simple save the values of this attribute in an array, sort it, last element = highest tabIndex
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27427793

http://stackoverflow.com/comment/43303867
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27429919
type: Comment
has text: I don't see that, I see it in a codeblock.

http://stackoverflow.com/a/27381556
has body: The problem is that you don't create angular app itself. just add an empty app: angular.module('myApp', ['ionic']) .controller('MapCtrl', function($scope) { }); http://codepen.io/anon/pen/ZYQqoe
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27379774
type: Answer
accepted answer of: http://stackoverflow.com/q/27379774
downvote count: 0

http://stackoverflow.com/comment/43311047
score: 0
type: Comment
type: QuestionComment
has text: sorry sleep(1) function can ignore..
comment on: http://stackoverflow.com/q/27434861

http://stackoverflow.com/a/27362097
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27318420
has comment: http://stackoverflow.com/comment/43213125
has body: Maybe your field name for the error message is not right. Cannot tell the exact reason why yours not work because you did not provide an example. However, when I tested, it works fine. This search field is required. http://plnkr.co/edit/56koY7YxPDVFe4S26x9N?p=preview
has comment: http://stackoverflow.com/comment/43200656
type: Answer
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/43213145
has comment: http://stackoverflow.com/comment/43211094
has comment: http://stackoverflow.com/comment/43213558
accepted answer of: http://stackoverflow.com/q/27318420

http://stackoverflow.com/comment/43258584
type: QuestionComment
comment on: http://stackoverflow.com/q/27406958
has text: Another option is to check the hour and set the setTimeout exactly after the hour shift
score: 0
type: Comment

http://stackoverflow.com/a/27340363
type: Answer
has body: http://jsfiddle.net/k0cfj48L/2/ I have fixed your fiddle. 1) JQuery was not included, so '$' in $(document).ready() was not defined. 2) I changed the JS to be included in the head so your check function is read as defined on execution of the page. 3) Your check function is not being instantiated directly within an event, so $(this) does nothing, rather is just a window reference. I incldued a proper selection of the textarea, but I'd consider using IDs or adding a jQuery event on the submit button and then finding a sibling: $(document).on('change','.chkView',function(){ var row = $(this).closest('tr'); if($(this).is(':checked')) { $(row).find('.chkEdit,.chkUpdate').prop("disabled",false); //var x = $(row).find('.chkEdit').val(); } else { $(row).find('.chkEdit,.chkUpdate').prop("disabled",true); } }); ///////////////////////////////////////////////////////// function check() { var x = $('.chkEdit').val(); alert(x); return ; }
has comment: http://stackoverflow.com/comment/43136936
has comment: http://stackoverflow.com/comment/43136978
answers question: http://stackoverflow.com/q/27340330
score: 0

http://stackoverflow.com/comment/43099448
comment on: http://stackoverflow.com/q/27320095
has text: Where are you going wrong? Are you getting an error?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/27330239
linked to: http://stackoverflow.com/q/21097820
answer count: 2
possible better answer: http://stackoverflow.com/a/27333580
upvote count: 1
has answer: http://stackoverflow.com/a/27333580
accepted answer: http://stackoverflow.com/a/27330270
favorite count: 0
has title: AngularJS UI-router unable to load second page view with dynamic reference
tagged with: angularjs
has answer: http://stackoverflow.com/a/27330270
has body: I have a main list page, when click on each post, it leads to a separate page with its own detail. That part of the UI-router works fine. I also have another page state whereby upon clicking a username (with link on main page as well as each detail page), it should bring user to a profile page of that user based on a userId. Whats wrong with the codes at the profile state? Ive tried many permutations and even blank '' states as per view@state structures but it always jumps back to the URL.otherwise url. I read up on the github states but and am clear on the rules but somehow I cant seem to figure this out. Does it mean I need 2 states for 2 different links leading to the same profile page view? html for link to user profile by Id ng-href="#/users/{{ user.profile.uid }} or ui-sref="tab.posts/users/{{ user.profile.uid }}". The app.js states file .state('tab', { url: '/tab', abstract: true, templateUrl: 'templates/tabs.html' }) .state('tab.posts', { url: '/posts', views: { 'tab-posts': { templateUrl: 'templates/tab-posts.html', controller: 'PostsCtrl' } } }) .state('tab.posts.view', { url: '/:postId', views: { 'tab-posts@tab':{ templateUrl: 'templates/tab-showpost.html', controller: 'PostViewCtrl' } } }) .state('tab.profile', { url: '/users/:userId', //tried url = '/:userId', doesnt work views: { 'tab-posts@tab': { // tried many permutations here too templateUrl: 'templates/profile.html', controller: 'ProfileCtrl' } } }); $urlRouterProvider.otherwise('auth'); });
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: angular-ui-router
tagged with: javascript

http://stackoverflow.com/comment/43361952
has text: @Wilmer: I don't get you. Which of the selector?
comment on: http://stackoverflow.com/q/27461803
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43360327
has text: what is the best way to avoid this... As I am unable to --allow-file-access?
comment on: http://stackoverflow.com/a/27459658
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27344038
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43143597
has body: I am learning angularJS, ng-app works ng-model works, but when I try ng-controller, it does not work, the fault is on my side but I am unable to figure out what it is, I am not even trying anything fancy, just trying make the ng-controller work, what is my mistake in the below code? HTML : &lt;div ng-app=""&gt; &lt;h1 ng-controller="HelloWorldCtrl"&gt;{{helloMessage}}&lt;/h1&gt; &lt;/div&gt;` and JS : function HelloWorldCtrl($scope){ $scope.helloMessage="Hello World"; } same problem when run in jsfiddle
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/26646941
has answer: http://stackoverflow.com/a/27344079
type: Question
has title: AngularJS simple ng-controller error
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/27344079

http://stackoverflow.com/comment/43366159
score: 0
type: Comment
has text: Thank you for the comments. I'll look for a good HTML validator; I wasn't aware such a thing existed. I'll also try giving the div an initial height. Haha, I can imagine that reading my code must be like pulling teeth for someone who really knows his way around web languages :P
comment on: http://stackoverflow.com/a/27464943
type: AnswerComment

http://stackoverflow.com/q/27372774
has answer: http://stackoverflow.com/a/27373300
has body: How will I add my checkbox value to the list of being added? If it is checked, it will be added to the total, if unchecked it will not be added. Or if it is already checked, then the customer unchecked it it will be deducted from the total. javascript function subtotal(){ $("#as").on('change',function(event){ var as = $(event.target).val(); var txt1 = $('#sff').val(); var txt2 = $('#osf').val(); var d = 0; if ($('#cbx3').is(":checked")) { d = parseFloat($("#cbx3").val(), 10); var a = parseFloat(as, 10); var b = parseFloat(txt1, 10); var c = parseFloat(txt2, 10); var total = parseFloat(a, 10) + parseFloat(b, 10) + parseFloat(c, 10) + d; $('#st').val(total.toFixed(2)); }); HTML //automatically shows value depending on a dropdownmenu /automatically shows value depending on a dropdownmenu //this is where the answers shows 10 20 30 the total should be equivalent to, textbox1 + textbox2 + dropdownmenu + checkbox I have managed to add the textboxes and dropdown, the concern now is the checkbox. thankyou...
has comment: http://stackoverflow.com/comment/43196721
has comment: http://stackoverflow.com/comment/43196499
answer count: 5
possible better answer: http://stackoverflow.com/a/27373173
has answer: http://stackoverflow.com/a/27373173
type: AnsweredQuestion
has title: Adding values in a checkbox, textbox and select using javascript
accepted answer: http://stackoverflow.com/a/27373193
has comment: http://stackoverflow.com/comment/43196547
has comment: http://stackoverflow.com/comment/43196548
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43197068
has answer: http://stackoverflow.com/a/27373305
score: 0
has answer: http://stackoverflow.com/a/27373179
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27373193

http://stackoverflow.com/comment/43295013
type: QuestionComment
comment on: http://stackoverflow.com/q/27426539
has text: @RuchirGupta Can you show.. what you mean by select becomes empty? and how does the items look like?
score: 0
type: Comment

http://stackoverflow.com/q/27440825
accepted answer: http://stackoverflow.com/a/27451413
tagged with: angular-filters
answer count: 1
has comment: http://stackoverflow.com/comment/43337319
has comment: http://stackoverflow.com/comment/43321680
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43328723
has answer: http://stackoverflow.com/a/27451413
has comment: http://stackoverflow.com/comment/43324515
type: AnsweredQuestion
has body: An update to angularjs 1.3.6 broke some of my filters. I tried to fix them and get to this solution. Hide the default option: Any Add an 'Any' option that won't filter the list. $scope.group = []; $scope.group[0] = {id:'',name:'Any'}; Does anyone have a better solution to do this ? Using this ng-show trick don't seems that good to me.
has comment: http://stackoverflow.com/comment/43324609
has comment: http://stackoverflow.com/comment/43338257
has title: Avoid filter on asynchronous ng-options default value
type: Question
tagged with: javascript
score: 0
tagged with: ng-options

http://stackoverflow.com/comment/43191461
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27368878
has text: THankyou sbking, your suggestions worked a treat! Thankyou, now I can sleep tonight!!! PS, thanks for the link, very useful indeed! Bookmarked! Steve
score: 0

http://stackoverflow.com/comment/43298732
score: 0
comment on: http://stackoverflow.com/q/27428051
has text: witch varables dont you understand?
type: QuestionComment
type: Comment

openlayers
tags question: http://stackoverflow.com/q/27334551
tags question: http://stackoverflow.com/q/27368537
type: Tag
tag name: openlayers
tags question: http://stackoverflow.com/q/27468739

http://stackoverflow.com/q/27433090
has title: Saving a google chart via php
tagged with: php
has body: I have PHP code that grabs some data from a server and then uses it to construct a PDF. As part of the PDF, I'd like to include a google chart. However, google chart is Javascript. Since I'm relatively new to web programming, can anyone provide suggestions on how I can incorporate google charts into a PHP script. Note, the data that the PHP script retrieves will be needed to construct the chart, so if it is a separate Javascript file or something, then it will need to somehow pass in data. Thanks in advance!
tagged with: charts
type: Question
has comment: http://stackoverflow.com/comment/43307354
tagged with: javascript
has comment: http://stackoverflow.com/comment/43307305
score: 0
has answer: http://stackoverflow.com/a/27433278
has comment: http://stackoverflow.com/comment/43313876
answer count: 1
has comment: http://stackoverflow.com/comment/43307371
tagged with: web
linked to: http://stackoverflow.com/q/14844629
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43307356
has comment: http://stackoverflow.com/comment/43314805

http://stackoverflow.com/comment/43108176
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27324321
has text: as i said, it´s untested. we don´t do the work for you on stackoverflow, we help you solve it on your own ;) if something is undefined, you need to start debugging. i only wrote this quickly in a minute in a text editor, just to show you the basics how it´s done in theory.

http://stackoverflow.com/comment/43377099
has text: This issue is for sure about the server setting. Check carefully the FAQ I gave you. If server is set properly, all will start to work. Here is [working example](http://stackoverflow.com/a/26009350/1679310)
comment on: http://stackoverflow.com/q/27469143
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43551145
comment on: http://stackoverflow.com/q/27420637
has text: @DelphiLynx could you, please, share your fiddle so that we can work with a base ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27371833
has body: It does as the article states? http://jsfiddle.net/txhu587b/ var myName = "Xavier"; function myName(){ console.log("Mi nombre es Javier"); } console.log(typeof myName); //prints string
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27371712
has comment: http://stackoverflow.com/comment/43195139
upvote count: 1
has comment: http://stackoverflow.com/comment/43195130
downvote count: 1

http://stackoverflow.com/q/27315087
has body: I am trying to upload a file on the server in my angularjs app. The file is upload in base64 string format. The things work fine when the file size is less than 30 MB but the browsers (both chrome and firefox) crash when he file size is more than 30 MB. The browsers crash before the post request is made. Here is the code of my controller for uploading the file: $scope.addMyFile = function(t,pid,id,week,day) { $("#upload"+t+pid+id).each(function() { var $input = $(this); var inputFiles = this.files; if(inputFiles == undefined || inputFiles.length == 0) return; var inputFile = inputFiles[0]; var inputFileSize = inputFile.size; var reader = new FileReader(); reader.onload = function(event) { var dataString = event.target.result; var firstPart = dataString.split(',')[0]; var secondPart = dataString.split(',')[1]; dataString = secondPart; var fileName = inputFile.name; var fileExtension = firstPart.split('/')[1].split(';')[0]; reader.readAsDataURL(inputFile); }); }; UploadMyFile Function: $scope.uploadFile = function(type,week,day,fileName,fileExtension,dataString) { $scope.loading = true; $scope.uploadBar = true; var fileUploadUrl = serverURL; var request = $http({ method: "POST", url: fileUploadUrl, headers: { 'Accept' :'application/json','Content-Type' :'application/json', authToken:userauthToken, 'Accept-Language': 'en'}, data: { name : fileName, documentString:dataString, extension: fileExtension} }); request.success( function(data) { $scope.uploadStatus = data.status; $scope.getWeekList(type); $scope.uploadBar = false; alert('The file has been successfully uploaded.'); }); $scope.loading = false; request.error( function(data, status) { console.log(status); $scope.uploadStatus = data.status || "Request failed"; alert('The file could not be uploaded. Please try again.'); }); };
has comment: http://stackoverflow.com/comment/43091029
score: 1
tagged with: file-upload
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43090141
upvote count: 1
tagged with: google-chrome
has title: Why does Chrome and Firefox crash while uploading a file larger than 30 MB?
has comment: http://stackoverflow.com/comment/43090431
type: UnansweredQuestion
tagged with: firefox
downvote count: 0
answer count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43091100
type: Question

http://stackoverflow.com/comment/43268749
type: QuestionComment
has text: The value of `GroupId` **is** the value of the selected option (`this.value`) - they are the same. What are you actually trying to do here? Note also `name = "ddlGroupName"` is pointless (check the html generated - and fortunately it does not work or you would lose all model binding) and why change the `id` from `GroupId` to `ddlGroupName`?
comment on: http://stackoverflow.com/q/27404012
score: 0
type: Comment

http://stackoverflow.com/q/27363331
tagged with: javascript
has body: I'm doing a basic chat app with node js and I'm trying to add commands to the chat. Example: A user can add a friend with this command /add name t = "/add Smith" var c = t.match(/^\s*([/](?:\S+\d+|add|send))\s+\S+/i); console.log(c[0]) // '/add Smith' But I can't get third word: t = "/send Smith 5000" var c = t.match(/^\s*([/](?:\S+\d+|add|send))\s+\S+/i); console.log(c) // '/send Smith' //third variable is missing It's still giving first two word in c[0], but I need third too. How can I solve this problem?
has answer: http://stackoverflow.com/a/27363407
has comment: http://stackoverflow.com/comment/43178652
tagged with: regex
favorite count: 0
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/27363407
type: AnsweredQuestion
has title: Regex check sentence for a word
type: Question
has comment: http://stackoverflow.com/comment/43178989
answer count: 1
downvote count: 0

remote-debugging
tag name: remote-debugging
type: Tag
tags question: http://stackoverflow.com/q/27379524

http://stackoverflow.com/comment/43347106
comment on: http://stackoverflow.com/q/27454529
score: 0
has text: The only thing you can do is override `publicMethod`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/31193724
has body: As an alternative, here's a jQuery-free solution: &lt;img src="image.png" onerror="this.src='image.png'; this.onerror = null" /&gt;
has comment: http://stackoverflow.com/comment/52353787
has comment: http://stackoverflow.com/comment/52354038
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/52353701
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/50392610
answers question: http://stackoverflow.com/q/27439693
has comment: http://stackoverflow.com/comment/52353629
has comment: http://stackoverflow.com/comment/52353429

http://stackoverflow.com/comment/43198643
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27373957
score: 0
has text: I am using the same loginController in the new template so that i dont need to create a new controller for this purpose. Hope this is fine @haxxxton

http://stackoverflow.com/a/45850314
score: 0
type: Answer
has body: Instead of editing the source code, you can do two things to fix it. Turn on enableSearch like following. $scope.enableSearch = function () { $scope.searchEnabled = true; }; Or check what @TDing mentioned or @Steve Ellis's answer on this post.
answers question: http://stackoverflow.com/q/27382766

http://stackoverflow.com/comment/43123933
has text: Btw, you should loop through all the value and check the equality manually when you receive the array. There's no quicker way than this but this way its only BigTheta(n) runtime.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27329274
type: Comment

http://stackoverflow.com/comment/43357730
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27460388
score: 1
has text: In that case you could have a look at the implementation of the SI unit format and adapt that to your needs.

http://stackoverflow.com/a/27362803
has body: The code works. To reset the alert setting I had to re-open the tab.
type: Answer
answers question: http://stackoverflow.com/q/27362556
score: 0

http://stackoverflow.com/comment/43207415
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27379000
type: Comment
has text: JS variables are local to every script, and when you move to another page you realoding the script and initialising the variable. If you want to display JS variables in another page try to use localstorage. http://diveintohtml5.info/storage.html

http://stackoverflow.com/q/27328324
tagged with: firebug
tagged with: javascript
has comment: http://stackoverflow.com/comment/43135549
has comment: http://stackoverflow.com/comment/43158951
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27328339
has answer: http://stackoverflow.com/a/27328357
has answer: http://stackoverflow.com/a/27499412
has body: I am playing around with a JavaScript code in Firebug and I would like changes to take effect in that page. Especially when there is code inside jQuery's $.ready() function. Some kind of refreshing the page without losing of what has been edited. Is there any way to do that?
type: Question
has comment: http://stackoverflow.com/comment/43129520
has comment: http://stackoverflow.com/comment/43115406
score: 0
has title: How to apply JavaScript changes in Firebug?
answer count: 3

http://stackoverflow.com/q/27439476
answer count: 2
has comment: http://stackoverflow.com/comment/43319106
has title: How to limit the number of characters and lines in the textbox using javascript?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43319019
has answer: http://stackoverflow.com/a/27439913
score: 0
type: Question
has body: &lt;script type="text/javascript"&gt; function checking(textarea, maxLines, maxChar) { var lines = textarea.value.replace(/\r/g, '').split('\n'), lines_removed, char_removed, i; if (maxLines &amp;&amp; lines.length &gt; maxLines) { lines = lines.slice(0, maxLines); lines_removed = 1 } if (maxChar) { i = lines.length; while (i-- &gt; 0) if (lines[i].length &gt; maxChar) { lines[i] = lines[i].slice(0, maxChar); char_removed = 1 } if (char_removed || lines_removed) { textarea.value = lines.join('\n') } } } &lt;/script&gt; This what I used based on few previous posts. But this code allows me to enter 'n' number of characters in 'm' number of lines. Could someone help me to write a code which takes only 30 characters and 2 lines? {suppose if the first line holds 10 characters then the next line should hold 20 characters but total number of characters should be 30 and lines to be 2.}
linked to: http://stackoverflow.com/q/556767
tagged with: javascript
has comment: http://stackoverflow.com/comment/43319465
has answer: http://stackoverflow.com/a/27439725

http://stackoverflow.com/a/27399575
score: 1
has body: Why not just pass the product id directly? &lt;select id="&lt;?php echo $jfeta7['product_id']; ?&gt;" name="aformats" onchange="showFormat(&lt;?php echo $jfeta7['product_id']; ?&gt;);"&gt; and your showFormat() function showFormat(dd) { alert(dd); };
upvote count: 1
answers question: http://stackoverflow.com/q/27399486
type: Answer
downvote count: 0

http://stackoverflow.com/comment/43132339
type: Comment
score: 0
type: AnswerComment
has text: My body is delete when I put 1 in the textbox
comment on: http://stackoverflow.com/a/27337164

http://stackoverflow.com/comment/50852238
comment on: http://stackoverflow.com/q/27434606
score: 1
has text: try this: chart.legend..width(100).height(50).margin({top: 10, right:30, left:80, bottom: 50}); it worked for me
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27414074
has answer: http://stackoverflow.com/a/27416275
has title: Make Backbone.js items within localStorage unique?
answer count: 1
downvote count: 0
favorite count: 0
tagged with: backbone.js
accepted answer: http://stackoverflow.com/a/27416275
tagged with: backbone-local-storage
type: AnsweredQuestion
has body: I have a dupe check within my collection, where I'm overriding the add function and it seems to work until a page refresh. Duplicates are blocked with an alert saying "You've already added this item to the todo list!" but it seems like when the page refreshes, the duplicate is added to localStorage either way. Would love a solution to this issue -- been scratching my head for the past few days on this issue. My collection below: app.TodoList = Backbone.Collection.extend({ model: app.Todo, localStorage: new Store("backbone-todo"), completed: function() { return this.filter(function(todo){ return todo.get('completed'); }); }, remaining: function(){ return this.without.apply(this, this.completed()); } }); app.TodoList.prototype.add = function(todo) { var isDupe = this.any(function(_todo){ return _todo.get('title').toLowerCase() === todo.get('title').toLowerCase(); }); return isDupe ? alert("You've already added this item to the todo list!") : Backbone.Collection.prototype.add.call(this, todo);} // instance of the Collection app.todoList = new app.TodoList(); Here is the model: app.Todo = Backbone.Model.extend({ defaults: { title: '', completed: false }, toggle: function(){ this.save({ completed: !this.get('completed')}); } }); The View: app.TodoView = Backbone.View.extend({ tagName: 'li', template: _.template($('#item-template').html()), render: function(){ this.$el.html(this.template(this.model.toJSON())); this.input = this.$('.edit'); return this; // enable chained calls }, initialize: function(){ this.model.on('change', this.render, this); this.model.on('destroy', this.remove, this); // remove: 'Convenience Backbone' }, events: { 'dblclick label' : 'edit', 'keypress .edit' : 'updateOnEnter', 'blur .edit' : 'close', 'click .toggle' : 'toggleCompleted', 'click .destroy' : 'destroy' }, edit: function(){ this.$el.addClass('editing'); this.input.focus(); }, close: function(){ var value = this.input.val().trim(); if(value) { this.model.save({ title: value }); } this.$el.r…
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/comment/43224808
comment on: http://stackoverflow.com/a/27369009
has text: hmmm. no i'm not sure what you mean. is there anything i can look at?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27464220
has body: Your code as written tries to insert into #Address# based on the a position found in the string cfhttp.filecontent. The 2 strings are (apparently) not the same - so a URL found in one would not be positionally relevant to the other. What you may be trying to do is modify the resultant contents of the HTML retrieved by the cfhttp call and replace thisurl with #address#. If that is the case you can simply replace it directly like so: &lt;cfset newHTML = replaceNocase(cfhttp.filecontent,'thisURL',Address)/&gt; Note - you don't need the quotes and pound signs inside the function. Keep it clean. Meanwhile, I'm not sure I'm clear on the end game here. The Javascript in the returned HTML will obviously not run on the server right? Why are you altering it again? Are you outputing the results to a page for a user?
answers question: http://stackoverflow.com/q/27463992
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/43364785
score: 2

http://stackoverflow.com/comment/43306386
has text: @Todd Just Equal Heights. I don't care about ratio because all that is handled by the CSS. But due to the nature of this template I can't rely on css to solve equal heights problem.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27432395
type: QuestionComment

http://stackoverflow.com/comment/43234195
comment on: http://stackoverflow.com/a/27378672
type: Comment
has text: here is an [example](http://jsfiddle.net/saikotju/NAs3V/210/) with jQuery and [jQuery UI](http://jqueryui.com/) Progress bar Customize it to solve your problem Thanks :)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/124013510
type: Comment
type: QuestionComment
score: 0
has text: Did the answer you accepted actually answer the question and solve your problem? Because my saved images have timing issues using the accepted answer.
comment on: http://stackoverflow.com/q/27318854

http://stackoverflow.com/comment/43326256
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27443563
has text: Why are you setting the css visibility first?

http://stackoverflow.com/q/27384145
score: 4
has comment: http://stackoverflow.com/comment/43218438
upvote count: 5
has comment: http://stackoverflow.com/comment/43216947
has title: The submit button not working AngularJS
downvote count: 1
has answer: http://stackoverflow.com/a/27384452
has comment: http://stackoverflow.com/comment/43217869
has comment: http://stackoverflow.com/comment/43220070
has comment: http://stackoverflow.com/comment/43217509
favorite count: 0
has comment: http://stackoverflow.com/comment/43217375
tagged with: angularjs
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/27384356
has comment: http://stackoverflow.com/comment/43220263
has comment: http://stackoverflow.com/comment/43217159
tagged with: angularjs-directive
type: AnsweredQuestion
has body: So basically wwhat I'm trying to do is take input of two numbers n1 and n2 and then print their sum all using angular. I have used bootstrap for styling. But i noticed nothing was happening so to check i added alert() function in the function to be called but still it's not getting accessed somehow. I dont know jQuery. PS: when I use text1+text2 it's concatinating the string instead of printing the sum This is my html: Trying Angular Enter n1 {{ text1}} Enter n2 <p >{{text2}} Your SUM of two numbers is ={{text1+text2}} This is my angular code: (function(){ var app=angular.module('store',[]); var n1=0; var n2=0; app.controller('formCtrl',function(){ this.submit=function(){alert("successful");}; // <----- alert() }); })();
tagged with: angularjs-scope
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/15648711
has answer: http://stackoverflow.com/a/27384356
accepted answer: http://stackoverflow.com/a/27384452
tagged with: javascript

http://stackoverflow.com/a/27413737
has comment: http://stackoverflow.com/comment/43272873
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43271875
has comment: http://stackoverflow.com/comment/43271722
type: Answer
answers question: http://stackoverflow.com/q/27413661
has body: You are still doing the drawing on your "cache" canvas so essentially you are doing the drawing + copy. I wouldn't be surprised if it takes more then just drawing directly. Especially if your canvases are large and you have to copy loads of pixels. Edit: Just to clarify: You do not need to implement double buffering for HTML canvas because browsers do not update canvas image on screen until your script is finished executing.
accepted answer of: http://stackoverflow.com/q/27413661

http://stackoverflow.com/q/27453683
answer count: 0
has comment: http://stackoverflow.com/comment/43346901
has comment: http://stackoverflow.com/comment/43346278
has comment: http://stackoverflow.com/comment/43346314
type: Question
tagged with: laravel-4
has body: I want to show a list of categories which i can do no problem but on selection of one category show children that has that parent id of the selection. So if JS/jQuery is the only or best option JS is not my strong point so I would like someone to give a good example so I understand more. I have this in my model: public function parent() { return $this-&gt;hasOne('Categories'); } public function children() { return $this-&gt;hasMany('Categories','parent'); } So just need a bit of help with the JS to show children on parent selection, please! Thanks in advance.
has comment: http://stackoverflow.com/comment/43346574
tagged with: javascript
tagged with: jquery
has title: Laravel showing categories then on change show children
score: 0
has comment: http://stackoverflow.com/comment/43346194
has comment: http://stackoverflow.com/comment/43346774
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43346646
has comment: http://stackoverflow.com/comment/43346714

http://stackoverflow.com/comment/51799130
has text: This is a great workaround especially if you're using TypeScript which promotes using classes with ControllerAs.
score: 0
comment on: http://stackoverflow.com/a/28803778
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27361648
tagged with: sharepoint-2013
has title: How to use SyntaxHighlighter on a sharepoint 2013 blog (Office365)?
tagged with: javascript
has answer: http://stackoverflow.com/a/27367650
upvote count: 4
tagged with: office365
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27367650
has answer: http://stackoverflow.com/a/27419823
downvote count: 0
favorite count: 0
type: Question
tagged with: events
score: 4
accepted answer: http://stackoverflow.com/a/27419823
answer count: 2
linked to: http://stackoverflow.com/q/2956966
has body: I'm trying to allow code highlighting using SyntaxHighlighter on a sharepoint 2013 blog site (office365 portal). Here is the code I have put in the head of the masterpage (js and css ressources are loaded before) : &lt;script type="text/javascript"&gt; function sh(){ SyntaxHighlighter.highlight(); }; // executed when SP load completes _spBodyOnLoadFunctionNames.push("sh"); &lt;/script&gt; The _spBodyOnLoadFunctionNames should provide a mechanism to run functions after the load page event, but it seems it's never executed. Running my sh function from the developper tool (console) is working as expected. Does anybody have a clue, am I using the right event ?
tagged with: syntax-highlighting

http://stackoverflow.com/comment/43198470
type: QuestionComment
has text: `sess_id` is defined in success callback of `$http` call, are you sure it was successful and you waited for end of call?
type: Comment
comment on: http://stackoverflow.com/q/27373957
score: 0

http://stackoverflow.com/comment/43287663
type: Comment
type: QuestionComment
has text: I have already tried using window.atob(base64) but not working for me.
score: 0
comment on: http://stackoverflow.com/q/27422575

http://stackoverflow.com/comment/75917317
has text: It does look as if this is the way you're supposed to do it.
type: Comment
comment on: http://stackoverflow.com/a/27463649
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43122412
comment on: http://stackoverflow.com/q/27332439
type: Comment
type: QuestionComment
score: 2
has text: Does your console report errors? For example, if your in chrome: CTRL+SHIFT+I and then the tab "Console". It could be the error lays somewhere else than the script inclusion

http://stackoverflow.com/comment/43297381
has text: Then you should start [here](http://api.jquery.com/category/selectors/).
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27427793

http://stackoverflow.com/comment/43320341
has text: In that case consider using websockets and/or socket.io to create a bi-directional connection.
type: Comment
comment on: http://stackoverflow.com/a/27439720
type: AnswerComment
score: 0

http://stackoverflow.com/a/27408301
has comment: http://stackoverflow.com/comment/43261170
score: 0
has comment: http://stackoverflow.com/comment/43261683
type: Answer
has comment: http://stackoverflow.com/comment/43262061
has body: Your code works, fiddle is talking: http://jsfiddle.net/m7beqvaf/ The {{hello}} token may not be replaced as soon as the page shows up loaded but that's all. Navigating to ang.htm can't be a problem. Note that I copy/pasted your ang.htm content in the fiddle: {{hello}}
answers question: http://stackoverflow.com/q/27408022

http://stackoverflow.com/q/27407267
has comment: http://stackoverflow.com/comment/43259215
has answer: http://stackoverflow.com/a/27407389
score: 0
has body: I just started learning JavaScript and have been stuck on an assignment for about a week now, I've tried several solutions but every time I add something I break something else. The assignment is to create a form (which I have completed). The form is to be used to enter data for a new favorite item, when each item is entered it should be displayed on the page and in the console log, as additional items are entered they are added to the list and all items are displayed - Ex - Favorites are: URL:http://oriellyschool.com, title: O'Reilly School, comment: help, tags: school, learning, URL: http://google.com, title: Google, comment: Use google to find info on JavaScript, tags: search, finding info faves:html:133 The specific instructions are to use objects for both all favorites and each new favorite item. The functionality to display the favorites (in console and on page) should be included in the methods for the objects. I am able to get the data from the form into a function and had the function to create the favorites working yesterday, not sure what happened this morning. If someone could please take a look at this and tell me if I am at least heading in the right direction I would appreciate it. I'm just going in circles now. (I have tons of console.log statements in the code so I could try to see what it was doing). Thanks! Code: // Function to create entries for favorite items from web form function FaveoriteEntry(url, title, comment, tags) { console.log("In Fave Function"); this.url = url; console.log(this.url); this.title = title; console.log(this.title); this.comment = comment; console.log(this.comment); this.tags = tags; console.log(this.tags); console.log("Have all items"); } //Function to retrieve data from web form and send to function to creat favorite //object. function addFavorite() { var myFavorites = []; console.log("In Function"); var furl = getFavorites.formURL.value; var ftitle = getFavorites.formTitle.value; var fcomment = getFavorites.formComment…
type: AnsweredQuestion
has title: New to JavaScript - Need help creating multiple objects with data from a form
accepted answer: http://stackoverflow.com/a/27407389
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43293593
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27423432
has text: You are adding a server side event?

http://stackoverflow.com/a/27439244
has comment: http://stackoverflow.com/comment/43320133
has body: First of all, I can't understand why you're not binding inputs using regular ng-model approach: &lt;!-- Example: --&gt; &lt;input type="text" ng-model="hour" /&gt; Once you've bound an input to some scope's property using ng-model, the so-called input and property will react to changes of both (this is two-way binding). In the other hand, you'll implement a hour and minute properties in your controller's $scope, and you won't access the DOM to get inputs' values, since Angular data-binding will set input values into these properties and viceversa when you set the properties. If you go this way, you can $watch property changes and once hours and minutes are current time, you can trigger a function: module.controller("X", ["$scope", function($scope) { $scope.hours = 0; $scope.minutes = 0; var onTimeChange = function() { // Eval $scope.hours and $scope.minutes // and trigger whatever function you want! }; $scope.$watch("hours", onTimeChange); $scope.$watch("minutes", onTimeChange); }); Let me give you an advise: AngularJS is about data-binding, separation of concerns and controllers, models or services shouldn't access the DOM directly - this is why data-binding exists -. Directives are the entity whithin Angular world that may access or modify the DOM using regular DOM or jQuery (or any other DOM manipulation library).
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27438408
type: Answer
answers question: http://stackoverflow.com/q/27438408
has comment: http://stackoverflow.com/comment/43325445
score: 1
upvote count: 1

http://stackoverflow.com/comment/43365660
type: QuestionComment
type: Comment
has text: How can I check this ?
comment on: http://stackoverflow.com/q/27464599
score: 0

http://stackoverflow.com/a/27376440
has body: Supposing you've an Object like this: var obj = {a: 1, b: 2, undefined: 1} You can do this var max = Math.max.apply(null,Object.keys(obj).map(function(x){ return obj[x] })); console.log(Object.keys(obj).filter(function(x){ return obj[x] == max; })[0]);
downvote count: 0
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/27376295
score: 8

http://stackoverflow.com/comment/43175575
type: QuestionComment
has text: its not a duplicate @omar but given answer worked for me.
comment on: http://stackoverflow.com/q/27358842
score: 0
type: Comment

http://stackoverflow.com/comment/43266713
type: Comment
has text: `"11"*1 + "1"*1` >> 12 now
comment on: http://stackoverflow.com/a/27409908
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43090715
has text: create a sample jsfiddle so people giving answer can test their answers
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27315235

http://stackoverflow.com/comment/43161298
score: 0
has text: What isn't working in your code? Here is a JSFiddle of your code snippet : http://jsfiddle.net/haroldcampbell/r45ffrea/. Also, there are better ways of writing this code, perhaps as an AngularJS directive. This would remove all of the JQuery that you have in your controller.
type: Comment
comment on: http://stackoverflow.com/q/27353525
type: QuestionComment

http://stackoverflow.com/a/27367732
accepted answer of: http://stackoverflow.com/q/27366950
has body: Here is how you can put unique titles in a table: function parseXml2(Xml) { var table = $('&lt;table/&gt;'), tbody = $('&lt;tbody/&gt;'), tr = $('&lt;tr/&gt;'), td = $('&lt;td/&gt;'), titles = []; $(Xml).find("programme").each(function() { var title = $(this).find("title").text(); if( titles.indexOf( title ) === -1 ) { tr.append( td.clone().html( title ) ); titles.push( title ); } }); $("#titl").append( table.html( tbody.html( tr ) ) ); } function parseXml2(Xml) { var table = $('&lt;table border="1" cellpadding="3" cellspacing="0"/&gt;'), tbody = $('&lt;tbody/&gt;'), tr = $('&lt;tr/&gt;'), td = $('&lt;td/&gt;'), titles = []; //this part create the table cells $(Xml).find("programme").each(function() { var title = $(this).find("title").text(); if( titles.indexOf( title ) === -1 ) { tbody.append( tr.clone().html( td.clone().html( title ) ) ); titles.push( title ); } }); //this part creates the table and puts the table cells in it and appends the //table to the #titl element $("#titl").append( table.html( tbody ) ); } //JUST FOR DEMO PURPOSES var xml = '&lt;?xml version="1.0" encoding="UTF-8"?&gt;\ &lt;channel id="sky_one" source="Sky" date="25/11/2014"&gt;\ &lt;programme&gt;\ &lt;desc&gt;Tony\'s motorcycle bursts into flames between his legs while town planner Liz is left in agony after her half-tonne horse bolts and lands on top of her. Also in HD&lt;/desc&gt;\ &lt;title&gt;The Real A &amp;amp; E&lt;/title&gt;\ &lt;end&gt;0630&lt;/end&gt;\ &lt;start&gt;0600&lt;/start&gt;\ &lt;/programme&gt;\ &lt;programme&gt;\ &lt;desc&gt;When Justin tries to detach a winch rope from a rock face during a charity event, a loose boulder falls on his pelvis. But with such rocky terrain, the Air Ambulance is unable to land. Also in HD&lt;/desc&gt;\ &lt;title&gt;The Real A &amp;amp; E&lt;/title&gt;\ &lt;end&gt;0700&lt;/end&gt;\ &lt;start&gt;0630&lt;/start&gt;\ &lt;/programme&gt;\ &lt;programme&gt;\ &lt;desc&gt;Temperatures rise as big boss Ken and legions of angry bakers take to the stree…
answers question: http://stackoverflow.com/q/27366950
score: 0
has comment: http://stackoverflow.com/comment/43213936
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43212408
type: Answer
has comment: http://stackoverflow.com/comment/43213274

http://stackoverflow.com/a/27340314
score: 1
accepted answer of: http://stackoverflow.com/q/27340297
answers question: http://stackoverflow.com/q/27340297
upvote count: 1
type: AcceptedAnswer
has body: var add = function(a){ return function(b){ return a+b; } } The add function return another function, so add(3) yield function(b){ return 3+b; } and then add(3)(2) yield 5 which is 3+2.
type: Answer
downvote count: 0

http://stackoverflow.com/q/27360787
tagged with: jqxgrid
has comment: http://stackoverflow.com/comment/43173809
type: UnansweredQuestion
upvote count: 1
tagged with: jqxwidgets
type: Question
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/27361787
score: 1
has body: I'm trying to enable custom keyboard navigation of a jqxGrid. I've got it working 99.9% of the way, but I can't get IE to select the highlighted/focused options in a select box. I wanted to see if there was a way to detect the option that's being focused on in order to manually set the select value when I hit the enter key. I've tried: var optVal = $select.find('option:selected').val(); $select.val(optVal); which just gets the previous val of the select element, and: var optVal = $select.find('option:focus').val(); $select.val(optVal); which gets nothing. EDIT: Also, I can't bind events directly to my controls.
has comment: http://stackoverflow.com/comment/43179227
has comment: http://stackoverflow.com/comment/43182362
has title: Is it possible to find out which select option has focus in IE before it is selected?
has comment: http://stackoverflow.com/comment/43192992
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/43311134
type: QuestionComment
type: Comment
has text: @Barmar: Yes, I guess I'm able to do that, although it's rather awkward because I have a whole array of data. So are you saying to parse it myself and then use the year, month, day constructor, as described at the end of my question?
score: 0
comment on: http://stackoverflow.com/q/27435021

http://stackoverflow.com/a/27351529
has body: This is commonly done server-side, where you have an endpoint that serves the image file to you as bytes... You can store the images in a private location on the server where IIS/&lt;your favourite web server&gt; doesn't have direct access to it, but only a web app, running on it, with the required privilege is authorized to do so. Alternatively people also "store" the images in the database itself and load it directly from there. In either case, the response which has to be sent back has to be a stream of bytes with the correct mime type. Edit: Here are a couple of links to get you started if you are into ASP.NET: http://www.codeproject.com/Articles/34084/Generic-Image-Handler-Using-IHttpHandler http://aspalliance.com/1322_Displaying_Images_in_ASPNET_Using_HttpHandlers.5 &lt;- this sample actually does it from a database. Don't let the choice of front-end framework (asp.net, php, django, etc) hinder you. Search for similar techniques in your framework of choice. Edit: Another way if you think html5 canvas is shown here: http://www.html5canvastutorials.com/tutorials/html5-canvas-images/ However you run into the same problem. Someone can view the image url if they can see the page source. You'll have to revert to the above approach eventually.
downvote count: 0
answers question: http://stackoverflow.com/q/27351444
upvote count: 1
has comment: http://stackoverflow.com/comment/43158261
type: Answer
score: 1

http://stackoverflow.com/q/27401714
tagged with: http://stackoverflow.com/tag/json
tagged with: forms
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/27402020
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has body: I have an ng-repeat select menu of countries of the world, their names and 2-letter abbreviations. I know from the Angular docs you can hard-code 1 option item before your ng-repeat in a select menu (https://code.angularjs.org/1.2.26/docs/api/ng/directive/select) So, as intended I used this for a null value "Choose..." menu item. The rest of the items come from a JSON source, alphabetized in my service by country code. Now my client wants to have the United States at the top of the menu, since it's chosen most often (and a British version with UK at top). How can I accomplish this, short of re-ordering my JSON file?
score: 2
type: AnsweredQuestion
has title: Angular JS Select menu from data, keep 1 item at top?
downvote count: 0
accepted answer: http://stackoverflow.com/a/27402020

http://stackoverflow.com/comment/43381003
comment on: http://stackoverflow.com/q/27473220
has text: What do you mean slides down? You could have a hidden div in each cell and a flag driven by ng-click to enable.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43401121
score: 0
comment on: http://stackoverflow.com/q/27456735
type: Comment
type: QuestionComment
has text: i tried 10 and it worked. Did you make sure that the window is not active while testing it ?

http://stackoverflow.com/a/27340457
has comment: http://stackoverflow.com/comment/43137103
answers question: http://stackoverflow.com/q/27339947
score: 0
has body: The matchMedia API has its uses: it's great for using addListener to let you know when your media queries switch. In my opinion it probably shouldn't be used here though. I notice that the body of the page has the following classes: "noTablet", "noMobile", so when I emulated an iphone, sure enough "noMobile" became "mobile." I was going to suggest implementing a 100% css fix using the body.noMobile selector, but it appears that you are using a ton of javascript to make the effect happen in the first place, which is setting inline styles, so... Looking at your javascript I am finding the following compressed code: s(".hover &gt; div").css("opacity", "0"), s(".hover").hover(function() { s(this).children("div").addClass("fadeUpIcon").animate({opacity: "1"}, 100) }, function() { s(this).children("div").css("opacity", "0").removeClass("fadeUpIcon") if you were to switch all of the selectors to prepend body.noMobile like: $('body.noMobile .hover &gt; div') You will likely eliminate the "overlay" for all mobile devices. Then you could use simple (albeit your selectors will likely have to be more specific) CSS like: body.mobile .hover { } To style it for mobile. This will probably work out for you, but I am of the strong opinion that you should try to budget time to remove the javascript controlling this and simply use the :hover pseudo selector along with transforms and transitions to achieve the same effect. If you really want to use media queries instead of whichever mobile detection you currently use, then those could easily go into the CSS as well.
type: Answer

http://stackoverflow.com/q/27409917
upvote count: 0
has answer: http://stackoverflow.com/a/27409967
type: UnansweredQuestion
has title: How to change a CSS property with logical operator with JQuery?
type: Question
has body: An element with the class ".has_padding" needs to be set to "display:none;" if it has no text content. The other elements with the class ".has_padding" must still be visible if they do have a text inside. In the following code I styled the elements a bit, so that you can easily understand my issue. (I want to get rid of the visible #DDD-colored padding, if the element is empty.) NOTE: JQuery is added, so that you can run it without big effort. Demo I have text. I have text too.
score: -2
linked to: http://stackoverflow.com/q/1455112
tagged with: javascript
answer count: 2
downvote count: 2
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43264286
has answer: http://stackoverflow.com/a/27409986
tagged with: css
duplicate of: http://stackoverflow.com/q/1455112

http://stackoverflow.com/q/27324105
tagged with: dom
type: Question
answer count: 1
downvote count: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/27324483
upvote count: 0
has body: With Javascript and a PHP back end I created a small website for personal use. It fetches all images from a specific tumblr. The Idea behind it is that I can quickly click on images I like to save them to my desktop. WHen the site has fetched everything I have a page-height of at least 120,000px and a huge dom. I noticed that the transitions that worked fine with just 4 images on the page do not work smoothly anymore. They stutter. How can I fix this? (i thought It has something to do with the page rendering) Im on Windows 8 using the newest version of Google Chrome
type: UnansweredQuestion
has title: How to make animations run smoothly on long pages?
tagged with: javascript
tagged with: render
score: -1

http://stackoverflow.com/comment/72477515
comment on: http://stackoverflow.com/a/27370415
has text: @Victor Nope, it's not. Look more carefully at his last client line.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43188855
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27367743
has text: Because itemCount isnt a thing, you need to pass that in.
type: AnswerComment

http://stackoverflow.com/comment/43212051
type: AnswerComment
comment on: http://stackoverflow.com/a/27379703
has text: @Hercal2020 you're way over the realms of this one question, please choose a right answer then move on to a new one...
score: 0
type: Comment

http://stackoverflow.com/a/27352354
downvote count: 0
has comment: http://stackoverflow.com/comment/43176486
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27349544
has comment: http://stackoverflow.com/comment/43177322
has body: You can choose between two approaches; caching data or caching promises. Here's two examples, both of which key on url, though any other key may be used, as appropriate - as long as it uniquely identifies each individual case. Cache data var dataCache = {}; function do_stuff_1(url) { if(dataCache[url] === undefined) { return $.ajax({ url: url }).then(function(data) { dataCache[url] = data; return data; }); } else { return $.when(dataCache[url]); } } Cache promises var promiseCache = {}; function do_stuff_2(url) { if(!promiseCache[url]) { promiseCache[url] = $.ajax({ url: url }); } return promiseCache[url]; } In both approaches, the function will (barring an uncaught error) return a promise, either by executing $.ajax() or by retrieving data/promise from the cache. In most applications, there's virtually nothing to distinguish one approach from the other. In an application where the cache is likely to grow to be large, then cache the data and avoid the overhead of caching promise wrappers. If necessary, the cache can be pre-loaded, thus avoiding the need to fetch known data : var dataCache = { '/path/to/data/a': 'A', '/path/to/data/b': 'B' } or var promiseCache = { '/path/to/data/a': $.when('A'), '/path/to/data/b': $.when('B') }
upvote count: 2

http://stackoverflow.com/comment/127215002
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27352691
has text: if anyone receives `throw new ERR_INVALID_CALLBACK();` error, use call back function for fs.close() as below `fs.close(file, (err) => { if (err) console.error('Failed to close file', err); else { console.log("\n> File Closed successfully"); } });`

http://stackoverflow.com/a/27454300
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27454052
type: Answer
accepted answer of: http://stackoverflow.com/q/27454052
has comment: http://stackoverflow.com/comment/43347560
has body: Add a slide class to each slide. Optionally, declare slider-content[x] as an id (don't forget to modify the CSS accordingly): &lt;div class="slide" id="slider-content3"&gt; Conduct analogical operation on the dots list: &lt;ul class="slider-dots"&gt; &lt;li class="dot active-dot"&gt;&amp;bull;&lt;/li&gt; &lt;li class="dot"&gt;&amp;bull;&lt;/li&gt; &lt;li class="dot"&gt;&amp;bull;&lt;/li&gt; &lt;/ul&gt; And change your javascript to: if(nextSlide.length === 0) { nextSlide = $('.slide').first(); nextDot = $('.dot').first(); } Check on Codepen if it's the desired behaviour.
has comment: http://stackoverflow.com/comment/43347470

http://stackoverflow.com/comment/43213788
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27382033
has text: thanks :) Class didn't work for me. So i needed the hack solution :)

http://stackoverflow.com/comment/43328372
type: Comment
has text: I've tried something similar. I dont really know (or understand), what to put as the value..! I do know that the access_token should be there..
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27444542

http://stackoverflow.com/comment/55700448
comment on: http://stackoverflow.com/a/27354917
score: 0
has text: you should change the content-type of file for read a pdf file
type: Comment
type: AnswerComment

http://stackoverflow.com/a/27366439
type: AcceptedAnswer
downvote count: 0
has body: try to replace return { label: item }; with return { label: item.Name }; you are returning an array of Objects not strings, so you will need to access the Name property on each in your success clause. i think you should ask the bookstrap typeahead question separately.
type: Answer
accepted answer of: http://stackoverflow.com/q/27366232
answers question: http://stackoverflow.com/q/27366232
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43184973

http://stackoverflow.com/q/27384796
has comment: http://stackoverflow.com/comment/43218509
tagged with: jquery
has title: Instantiate animated objects
has comment: http://stackoverflow.com/comment/43218970
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43218299
type: Question
has body: I'm new to javascript and jQuery mobile, I'm currently developing and app that needs to have several animations running independently, I found a really cool code for an animation that I need, it shows a pie timer countdown, the problem is with my lack of experience and knowledge of jQuery, I don't know how to instantiate new objects for this code. Here is the code: var methods = { init: function (options) { var state = { timer: null, timerSeconds: 60, callback: function () {}, timerCurrent: 0, showPercentage: false, fill: false, color: '#CCC' }; state = $.extend(state, options); return this.each(function () { var $this = $(this); var data = $this.data(globalForPieTimer); if (!data) { $this.addClass(globalForPieTimer); $this.css({ fontSize: $this.width() }); $this.data(globalForPieTimer, state); if (state.showPercentage) { $this.find('.percent').show(); } if (state.fill) { $this.addClass('fill'); } $this.pietimer('start'); } }); }, stopWatch: function () { var data = $(this).data(globalForPieTimer); if (data) { var seconds = (data.timerFinish - (new Date().getTime())) / 1000; if (seconds &lt;= 0) { clearInterval(data.timer); $(this).pietimer('drawTimer', 100); data.callback(); } else { var percent = 100 - ((seconds / (data.timerSeconds)) * 100); $(this).pietimer('drawTimer', percent); } } }, drawTimer: function (percent) { $this = $(this); var data = $this.data(globalForPieTimer); if (data) { $this.html('&lt;div class="percent"&gt;&lt;/div&gt;&lt;div class="slice' + (percent &gt; 50 ? ' gt50"' : '"') + '&gt;&lt;div class="pie"&gt;&lt;/div&gt;' + (percent &gt; 50 ? '&lt;div class="pie fill"&gt;&lt;/div&gt;' : '') + '&lt;/div&gt;'); var deg = 360 / 100 * percent; $this.find('.slice .pie').css({ '-moz-transform': 'rotate(' + deg + 'deg)', '-webkit-transform': 'rotate(' + deg + 'deg)', '-o-transform': 'rotate(' + deg + 'deg)', 'transform': 'rotate(' + deg + 'deg)' }); var secs = (data.timerSeconds) * ((100 - percent) / 100); /*NEW*/ $this.find('.percent').html(Math.round…
has comment: http://stackoverflow.com/comment/43219081
tagged with: javascript
score: 0

http://stackoverflow.com/comment/43326620
type: AnswerComment
comment on: http://stackoverflow.com/a/27443747
type: Comment
score: 1
has text: What if `maximumDisplayedItems` is larger than the amount of items in `models`?

http://stackoverflow.com/a/27390269
has comment: http://stackoverflow.com/comment/43415173
has comment: http://stackoverflow.com/comment/43413157
downvote count: 1
has comment: http://stackoverflow.com/comment/43256600
score: 1
has comment: http://stackoverflow.com/comment/43412556
answers question: http://stackoverflow.com/q/27385642
has comment: http://stackoverflow.com/comment/43409875
has body: To start, you should use a javascript library like jQuery to handle all the tough AJAX lifting. It will make your life sooo much easier. If you want to use regular javascript, you can return a comma-separated string and then parse each value separated by a comma but that can get messy. With that being said, you can use jQuery AJAX and return your data in a JSON encoded data object. .php <? include('conexion.php'); $conex=conex(); // get the q parameter from URL $q = isset($_REQUEST["q"]) ? $_REQUEST["q"] : ""; $descrip = ""; // lookup all hints from array if $q is different from "" if ($q !== "") { $sql = "SELECT * FROM SAPROV WHERE CodProv LIKE '$q'"; $stmt = sqlsrv_query($conex, $sql); $row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC); $descrip = $row['Descrip']; $telf = $row['Telef']; } $values = array(); // Output "no suggestion" if no hint was found or output correct values // NOTE: we're using the same "txtHint" here for the key as we do in the javascript function $values["txtHint"] = ($descrip === "") ? "no suggestion" : $descrip; // Set these to something useful $values["txtPhone"] = ""; $values["txtAddress"] = ""; // Output the json data print_r(json_encode($values)); ?> Now, for the jQuery implementation. The first thing you'll have to do is download the jQuery library from jQuery's website. I would recommend getting the most recent version (currently jQuery 2.x). .html The obvious change is the call to $.ajax() instead of using the XmlHttpRequest() object. It is in and of itself fairly self-explanatory. One thing I would like to mention is that since we set the "type" to "GET", the key-value pairs in "data" will be appended to the url as a querystring in the form: "url?key1=value1&key2=value2&etc...". So the resulting url, in our case, would be "../include/proveedores.php?q=[VALUE_OF_STR]" where [VALUE_OF_STR] is the value of the str variable. The other change worth noting is that jQuery has a very helpful way of selecting elements. If you want to get …
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27385642
has comment: http://stackoverflow.com/comment/43259390
has comment: http://stackoverflow.com/comment/43339408
has comment: http://stackoverflow.com/comment/43303401
type: Answer
has comment: http://stackoverflow.com/comment/43331328
has comment: http://stackoverflow.com/comment/43257024
has comment: http://stackoverflow.com/comment/43255966
upvote count: 2
has comment: http://stackoverflow.com/comment/43255749

http://stackoverflow.com/a/27365998
has body: You are talking about a form submission problem but we don't see anything related to the submission of the form in your code. But i can tell you this. If the form is submit with a regular postback, it's normal that you lost everything you added dynamically. I would suggest you to submit the form with an ajax call or validate the form on your own before submiting the form like so : $("myform").submit(function () { if(!$(this).validate()) { //if the form don't validate, don't submit it return false; } }); If you have validation on the server side. Make an ajax call to validate does thing. $("myform").submit(function () { $.ajax({ type: "POST", url: url, data: $(this).serialize(), // serializes the form's elements. success: function(data) { //do what's appropriate } return false; //we control the behavior of the submission }); Good luck
accepted answer of: http://stackoverflow.com/q/27365804
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27365804
score: 0
type: Answer

http://stackoverflow.com/q/27437125
has comment: http://stackoverflow.com/comment/43315124
has comment: http://stackoverflow.com/comment/43315169
type: Question
has comment: http://stackoverflow.com/comment/43314957
tagged with: javascript
has comment: http://stackoverflow.com/comment/43346773
score: 0
has answer: http://stackoverflow.com/a/27454354
answer count: 1
tagged with: upload
has body: I'm trying to pass files directly to an input type="filename" control element so I don't have to manually click [browse] and search for a file. I'm not trying to bypass any type of security or anything like that, i'm just trying to "imitate" the clicking of the browse putting and selecting an image without actually having to search for the file in the BROWSE FOR FILES dialog. I'm wanting to do this directly through javascript. Now some of you may be wondering "why the crap are you trying to do that?" well my employer has a website that he has to upload images of daily reports to and they use the standard &lt;input type="hidden" name="fileInput"&gt; He wanted me to try and make a program that just does it for him and will just auto upload the files for him and all he has to do is hit submit at the end. Is this possible? EDIT# I was thinking I needed to pass it the image in raw data:image/jpeg;base64 then pass it to the control somehow? EDIT#2 What about doing something like javascript:(function() { document.forms[0].file.value+='" + theFile + "';})() Edit#3 From what I been looking into I guess the only possible thing is to try and do a straight HTTP Post with a MultiPart Entity. I guess this is the only way to go about doing it and its impossible to do anything directly from Javascript itself. Would figure that since is considered a HTML object that javascript would be able to touch it. Kinda of weird that you can't.
has comment: http://stackoverflow.com/comment/43315434
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/27177661
has comment: http://stackoverflow.com/comment/43315158
tagged with: http://stackoverflow.com/tag/html
has title: Input/Pass an Image into an input type="filename" directly from Javascript
has comment: http://stackoverflow.com/comment/43314768

http://stackoverflow.com/comment/43300582
score: 1
comment on: http://stackoverflow.com/q/27429498
type: Comment
type: QuestionComment
has text: @GwiddleWorker There's no "better" case here, the usage is just different.

timezone
tags question: http://stackoverflow.com/q/27435021
tags question: http://stackoverflow.com/q/27412207
tags question: http://stackoverflow.com/q/27426037
type: Tag
tag name: timezone
tags question: http://stackoverflow.com/q/27407424

http://stackoverflow.com/a/35354966
type: Answer
has body: order matters here
upvote count: 9
score: 9
answers question: http://stackoverflow.com/q/27462602
downvote count: 0

http://stackoverflow.com/q/27382950
has comment: http://stackoverflow.com/comment/43215264
has comment: http://stackoverflow.com/comment/43214938
accepted answer: http://stackoverflow.com/a/27383421
tagged with: twitter-bootstrap
has body: How do I prevent buttons from staying focused after being clicked? HTML Left Middle Right CSS @import url('http://getbootstrap.com/dist/css/bootstrap.css'); body { margin: 10px; } Please see what I mean in this Fiddle. I know that I could get round this by applying the styling to anchors instead of buttons, but I can't do that because I have to keep the following original asp.net controls. <asp:Button ID="SearchResultsPDF" runat="server" Text="PDF Report" CssClass="btn btn-default" OnClick="PDFReport_Click" /> <asp:Button id="SearchResultsCSV" runat="server" Text="CSV Report" CssClass="btn btn-default" onClick="CSVReport_Click"></asp:Button> Also I have seen this solution with jQuery, which works fine, but it seems too specific. jQuery $(".btn").mouseup(function(){ $(this).blur(); }) I would like to know if there is a CSS only solution and I appreciate some directions on how to do that. Thanks.
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43214874
possible better answer: http://stackoverflow.com/a/41925330
has answer: http://stackoverflow.com/a/50163313
upvote count: 5
has answer: http://stackoverflow.com/a/27383609
linked to: http://stackoverflow.com/q/23443579
has answer: http://stackoverflow.com/a/41925330
type: Question
has title: Stop Bootstrap group buttons to stay focused
score: 5
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27383421
tagged with: css
favorite count: 0

http://stackoverflow.com/comment/43301517
comment on: http://stackoverflow.com/q/27413602
score: 0
has text: Yeah, I didn't post an answer because my information didn't constitute a complete answer. If you like, post the solution you came up with and accept your own answer :D
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/43382593
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27472191
has text: I have updated the code and still there is a problem with C#. Please check out the code and let me know how I can solve it. http://jsfiddle.net/n3d78so5/
score: 0

http://stackoverflow.com/q/27429174
tagged with: rest
type: UnansweredQuestion
has body: I want to implement paging/filtering on ember data asynchronously. This is my author model: export default DS.Model.extend({ user: DS.belongsTo('user'), articles: DS.hasMany('article', { async: true }), name: DS.attr('string'), email: DS.attr('string') }); route: export default Ember.Route.extend({ model: function(params) { return this.store.find('author', params.author_id); } }); controller: export default Ember.ObjectController.extend({ popularArticles: function() { return this.get('model.articles').filter({ tab: 'popular' }); }.property('model.articles') }); Note that model has an articles property with DS.hasMany('article', { async: true}) relationship. If I use this property this request is made authors/1/articles and its asynchronous. This is fine until I need to make request like authors/1/articles?page=2 or authors/1/articles?tab="hot". One possible approach is, as shown in the controller, I have a popularArticles property that filters the model.articles property, and will make the filtered request without loading all the articles. How can I pass query parameters to asynchronously loaded relationships in ember data?
has title: filter paginate pass parameters to asynchronous ember data relationship requests
tagged with: ember.js
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/43301481
type: Question
tagged with: ember-data
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/31566624
has answer: http://stackoverflow.com/a/27470631
upvote count: 4
answer count: 3
has answer: http://stackoverflow.com/a/32611402
has comment: http://stackoverflow.com/comment/43301355
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/43378210
type: Comment
comment on: http://stackoverflow.com/a/27471777
type: AnswerComment
has text: nice one, i'm on that path too but that doesn't match last repetition
score: 0

http://stackoverflow.com/comment/45705566
type: AnswerComment
comment on: http://stackoverflow.com/a/28705349
score: 0
type: Comment
has text: Also, wouldn't @Andy's solution be more efficient because it just sets up two variables, one integer and one function on the scope vs one integer and one watcher?

http://stackoverflow.com/q/27330722
tagged with: javascript
tagged with: asp.net
has body: I'M calling javascript function from button click StringBuilder bldr = new StringBuilder(); bldr.AppendFormat("var Timer = new myTimer({0},{1},'{2}','timerData');", this.timerStartValue, this.TimerInterval, this.txtResult.ClientID); bldr.Append("Timer.go()"); ClientScript.RegisterStartupScript(this.GetType(), "TimerScript", bldr.ToString(), true); ClientScript.RegisterHiddenField("timerData", timerStartValue.ToString()); Button code. &lt;asp:Button ID="Next" runat="server" OnClick="Button1_Click" Text="Next" Width="58px" /&gt; same code is calling from another button click. "myTimer" is my javascript function... js code... &lt;script type="text/javascript"&gt; function myTimer(startVal, interval, outputId, dataField) { this.value = startVal; this.OutputCntrl = document.getElementById(outputId); this.currentTimeOut = null; this.interval = interval; this.stopped = false; this.data = null; var formEls = document.documentElement; if (dataField) { for (var i = 0; i &lt; formEls.length - 1; i++) { if (formEls[i].name == dataField) { this.data = formEls[i]; i = formEls.length + 1; } } } myTimer.prototype.go = function () { if (this.value &gt; 0 &amp;&amp; this.stopped == false) { this.value = (this.value - this.interval); if (this.data) { this.data.value = this.value; } var current = this.value; this.OutputCntrl.innerHTML = this.Hours(current) + ':' + this.Minutes(current) + ':' + this.Seconds(current); this.currentTimeOut = setTimeout("Timer.go()", this.interval); } else { alert('Time Out!'); //window.location('Index.aspx'); } } myTimer.prototype.stop = function () { this.stopped = true; if (this.currentTimeOut != null) { clearTimeout(this.currentTimeout); } } myTimer.prototype.Hours = function (value) { return Math.floor(value / 3600000); } myTimer.prototype.Minutes = function (value) { return Math.floor((value - (this.Hours(value) * 3600000)) / 60000); } myTimer.prototype.Seconds = function (value) { var hoursMillSecs = (this.Hours(value) * 3600000) var minutesMillSecs …
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27330734
type: Question
tagged with: c#
has title: Javascript function is not calling from code behind button click
has comment: http://stackoverflow.com/comment/43119423
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43119397

http://stackoverflow.com/q/27415145
tagged with: javascript
linked to: http://stackoverflow.com/q/21692646
has comment: http://stackoverflow.com/comment/43274286
tagged with: facebook
has body: I was inspecting stuff, as you do, and came across this interesting thing on facebook. View Full Image I understand that is completely do-able with something similar to this: var cssRule = "color: rgb(249, 162, 34);" + "font-size: 60px;" + "font-weight: bold;" + "text-shadow: 1px 1px 5px rgb(249, 162, 34);" + "filter: dropshadow(color=rgb(249, 162, 34), offx=1, offy=1);"; console.log("%cHello World", cssRule); Source My main question is, How do they stop the showing of the file.js:line_numer that you always get on the right hand side in console? With the above code, you would see this: View Full Image Do you notice the red circle? But in facebooks example, they don't display that information. I've looked through the Web.Console API on Mozilla (Link), so does anybody possibly know how to exclude that specific peice of information?
favorite count: 0
score: 41
has answer: http://stackoverflow.com/a/27415188
upvote count: 41
possible better answer: http://stackoverflow.com/a/66483084
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/66483084
has comment: http://stackoverflow.com/comment/43274316
has title: How does Facebook log to console like this?
type: Question
accepted answer: http://stackoverflow.com/a/27415188
answer count: 2
downvote count: 0

http://stackoverflow.com/q/27369553
tagged with: node.js
type: AnsweredQuestion
score: 2
has body: I'm having the most odd problem trying to send data from a client browser to my node server using SocketIO. Sending from server to client works just fine, but the other way around I get an undefined error. Here's a quick bit of what it looks like, super simple. Node Server (app.js) io.on("connection", function(socket) { socket.on("pageReady", function(data) { console.log('pageReady called'); console.log(data); return socket.emit('newline', '###SOCKET STARTED###'); }); socket.on("disconnect", function() { return console.log('disconnected'); }); }); Browser (client.js) var socket; socket = io.connect("http://localhost:5678"); socket.on("newline", function(data) { return $('#socketData').append('&lt;li&gt;' + data + '&lt;/li&gt;'); }); socket.emit("pageReady", "test"); Super simple, right? Nothing special. When I emit from server, works fine, however when the client calls "pageReady". node responds with this. /Volumes/HOME/Users/user/git/sockettest/app.js:89 console.log(data); ^ ReferenceError: data is not defined Data should be returning "test", but isn't. What am I doing wrong?
downvote count: 0
tagged with: socket.io
type: Question
has comment: http://stackoverflow.com/comment/43190834
tagged with: javascript
has answer: http://stackoverflow.com/a/27370415
accepted answer: http://stackoverflow.com/a/27370415
upvote count: 2
answer count: 1
has title: SocketIO, can't send emit data from client
favorite count: 0
has comment: http://stackoverflow.com/comment/43190960

rsvp.js
type: Tag
tag name: rsvp.js
tags question: http://stackoverflow.com/q/27415023

http://stackoverflow.com/comment/43267007
comment on: http://stackoverflow.com/a/27384806
type: AnswerComment
type: Comment
has text: You're right, adding it like you described it solved the problem. But now the parser executes the JavaScript even if it is inside a string, e.g. `data += '<scrip'+'t type="text/javascript">console.log("Inline");<'+'/script>';`. "Inline" will appear in the console
score: 0

http://stackoverflow.com/comment/43266016
type: Comment
type: QuestionComment
has text: yes on page load. @caramba
comment on: http://stackoverflow.com/q/27410772
score: 0

http://stackoverflow.com/a/27430700
has body: Try something like this, *note the use of .attr("value") not .val(): &lt;a onclick="dialog();" id="deleteorderb" name="deleteorderb" value="&lt;?php echo $r['id']; ?&gt;" class="btn btn-danger btn-sm btn-icon icon-left"&gt; Cancel&lt;/a&gt; &lt;script&gt; $(document).ready(function() { $("#deleteorderb").click(function() { var a = $('#deleteorderb').attr("value"); var link = "/deleteorder.php?id=" + a; $("#deleteorder").attr("href", link); }); function dialog() { $('#modal-2').modal('show'); }; }); &lt;/script&gt;
type: Answer
answers question: http://stackoverflow.com/q/27430598
score: 0

http://stackoverflow.com/q/27406994
downvote count: 0
has comment: http://stackoverflow.com/comment/43258840
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/62014822
upvote count: 56
possible better answer: http://stackoverflow.com/a/62014822
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/50076352
score: 56
has body: I had a problem with CORS with node and angular and adding this option with true solved my problem. But I don't find info about what it is and what it is doing. Please can someone explain?
has title: Http requests withCredentials what is this and why using it?
has comment: http://stackoverflow.com/comment/43259176
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/27407440
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27407440
answer count: 2

http://stackoverflow.com/q/27418146
score: 0
type: UnansweredQuestion
tagged with: bower
type: Question
has body: I am using Grunt as part of an angular fullstack app (along with yeoman and bower). All is good in development land, but running a distribution results in horribly corrupt css (see image)(in development this all runs fine - in dist, the markup is littered with icon tags). I have found a number of posts that seem to suggest that fonts aren't being included etc, but in my case, my dist folder seems to have everything. Also, I am not getting ANY errors OR warnings, making debugging it more than tricky. Has anyone seen this before? Thanks
tagged with: gruntjs
has title: Grunt serve:dist (or build:dist) is creating broken css but no errors
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27433350
tagged with: yeoman

x-frame-options
tags question: http://stackoverflow.com/q/27358966
tag name: x-frame-options
type: Tag

http://stackoverflow.com/a/27378285
answers question: http://stackoverflow.com/q/27377308
type: Answer
accepted answer of: http://stackoverflow.com/q/27377308
type: AcceptedAnswer
has body: Problem solved: The Ghostery plugin was blocking freegeoip.net. What I learned from this experience: Always check if the Ghostery icon shows anything being blocked while working on your site!
score: 0

http://stackoverflow.com/comment/43116678
type: QuestionComment
has text: the simple answer is they are the same array. `emptySpaces = allCoords` creates a reference , not a copy
comment on: http://stackoverflow.com/q/27328556
score: 0
type: Comment

http://stackoverflow.com/q/27314086
has body: I have two angularjs models and I would like to use firstkey of firstcollection as index value in the anothercollention. Basically I want to iterate over anothercollention.firstkey using the key from the previous ng-repeat. Here is some code which I hope makes sense of what I'm trying to do. I've checked all the angularjs docs but none seems to provide an example for this scenario. All of them assume that you have the data in the same ng-repeat model. &lt;ul&gt; &lt;li ng-repeat="(firstkey, value) in firstcollection"&gt;&lt;/li&gt; &lt;ul&gt; &lt;li ng-repeat="(subkey, subvalue) in anothercollention.firstkey"&gt;&lt;/li&gt; &lt;ul&gt; &lt;/ul&gt; Example first collection {"fruits": "are the best", "veggies": "are the worst"} another collection {"fruits": [1, 2, 3 ], "veggies":[2,4,5]}, HTML page should look like this: fruits are the best 1, 2, 3 veggies are the worst 2,4,5
accepted answer: http://stackoverflow.com/a/27314301
has title: How to access 'foreign' fields in ng-repeat
tagged with: javascript
has comment: http://stackoverflow.com/comment/43088411
score: 0
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43088679
has answer: http://stackoverflow.com/a/27314301
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43088590
type: Question

internet-explorer-8
tags question: http://stackoverflow.com/q/27384301
tags question: http://stackoverflow.com/q/27324709
type: Tag
tag name: internet-explorer-8
tags question: http://stackoverflow.com/q/27435056
tags question: http://stackoverflow.com/q/27358081
tags question: http://stackoverflow.com/q/27411562
tags question: http://stackoverflow.com/q/27351786
tags question: http://stackoverflow.com/q/27358695
tags question: http://stackoverflow.com/q/27375360
tags question: http://stackoverflow.com/q/27449851
tags question: http://stackoverflow.com/q/27365474
tags question: http://stackoverflow.com/q/27323554
tags question: http://stackoverflow.com/q/27384272
tags question: http://stackoverflow.com/q/27317658

http://stackoverflow.com/q/27352407
has body: Is there a package manager for three.js extras? Things like FlyControls or EffectComposer, is there a way to easily pull and include these files? Right now i have to go into the examples for them and download the files from their source. I'd love to use bower or something to pull them in with a single command.
type: Question
has answer: http://stackoverflow.com/a/27354655
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: three.js
upvote count: 0
has title: How do you manage three.js libraries?

http://stackoverflow.com/comment/43434197
has text: I don't think that would work. Taking my example into account, the glob pattern you have above would match both the test files and the actual files, where the test files are not supposed to be included
comment on: http://stackoverflow.com/a/27499823
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27451377
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: pre
has title: clone div with jquery and show as code
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/27452638
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/4631646
has comment: http://stackoverflow.com/comment/43342539
upvote count: 2
answer count: 1
linked to: http://stackoverflow.com/q/412447
tagged with: clone
has comment: http://stackoverflow.com/comment/43341395
has answer: http://stackoverflow.com/a/27452638
has body: I need to show the code of some Divs in page. Div should be cloned into pre tag with proper spacing and identation and should work in ie8. I'm a starter so don't really know if i'm doing it correct way, so far i wrote this Html //create button after div $("&lt;div class='btn'&gt;click to show code&lt;/div&gt;").insertAfter(".content-wrapper"); //create pre wrapper after button $("&lt;pre&gt;&lt;/pre&gt;").insertAfter(".btn"); //hide the pre so can slidetoggle later $("pre").hide(); $(".btn").one("click", function() { var cloned = $(this).prev().clone(); var code = $(cloned).html().replace(/&lt;/g, "&amp;lt;").replace(/&gt;/g, "&amp;gt;"); $(this).next().append(code); }); $(".btn").click(function() { $(this).next().slideToggle("fast", function() { }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="wrapper-all"&gt; &lt;div class="content-wrapper"&gt; &lt;div class="example-div"&gt; &lt;span&gt;lorem ipsum first&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="wrapper-all"&gt; &lt;div class="content-wrapper"&gt; &lt;div class="example-div"&gt; &lt;span&gt;lorem ipsum second&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; jsfiddle It dynamically adds, button and pre after the .content-wrapper divs which can be slide toggled. ie8 completeley ignores whitespaces, and in chrome,firefox some unwanted whitespaces appearing, the outputed code should respect the identation of the original divs, but remove the spaces from left and code should start from zero whitespace to the left.
linked to: http://stackoverflow.com/q/4824207

http://stackoverflow.com/comment/43204815
has text: Sounds like an xy problem, why would you need to simulate mousedown event?FYI, this is the worst selector you can get `$('*')`, bind event to `document` instead and use `event.stopPropagation();`
type: Comment
comment on: http://stackoverflow.com/q/27377383
score: 0
type: QuestionComment

http://stackoverflow.com/q/27436513
tagged with: promise
upvote count: 1
answer count: 1
has title: Promise isn't running within process.exit
tagged with: bluebird
accepted answer: http://stackoverflow.com/a/27436537
downvote count: 0
tagged with: javascript
has body: Here's an example of some synchronous code that just logs hello world. function syncTest() { console.log("hello world"); } syncTest(); syncTest(); process.on('exit', function() { syncTest(); }); //hello world //hello world //hello world This is expected It runs syncTest() twice then on exit once again. I have the same code below, but with a promise in it instead. function existsAsync(path) { return new Promise(function(resolve) { fs.exists(path, resolve); }); } function promiseTest(projectDir) { var pkg = path.join(projectDir, "package.json"); existsAsync(pkg).then(function(exists) { console.log("hello world"); }).catch(function(e) { console.log(e.message); }); } var projectDir = process.cwd(); promiseTest(projectDir); promiseTest(projectDir); process.on('exit', function() { promiseTest(projectDir); }); //hello world //hello world This code with the promise only runs twice, it doesn't run inside the exit event for some strange reason. Is this a quirk of promises? What could be causing this? Am I not using promises the right way?
type: Question
type: AnsweredQuestion
tagged with: events
score: 1
has answer: http://stackoverflow.com/a/27436537
favorite count: 0

http://stackoverflow.com/comment/43341148
has text: You need write the function like a variable assignation. The original example dont work: http://jsfiddle.net/9g7v3urn/
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27451143
type: Comment

http://stackoverflow.com/comment/43367548
has text: No, I didn't know about the pseudo element parameter. Running `getComputedStyle($("#search input")[0], "::selection")["background-color"]` in the console to get the search field on this page, it returns `"rgba(0, 0, 0, 0)"`, which is transparent. Getting the `color` attribute returns `rgb(136, 136, 136)`, which seems to be the unfocused and unselected color. I tried adding `:focus` to the pseudo element param, but that didn't change anything.
comment on: http://stackoverflow.com/q/27454211
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/65775125
score: 6
has comment: http://stackoverflow.com/comment/117974302
has body: Dont save a Token in the Local Storage. Its not a good Style because you open up to attackers. I found this link on my search: https://medium.com/@benjamin.botto/secure-access-token-storage-with-single-page-applications-part-1-9536b0021321. This is a part from whats inside the page: “It’s recommended not to store any sensitive information in local storage.” -OWASP Cheat Sheet “Don’t store tokens in local storage.” -Auth0: Where to Store Tokens “You are safe from CSRF, but you have opened yourself up to a much greater attack vector… XSS.” Okta: JWTs Suck “Don’t store [JWTs] in local storage (or session storage).” LogRocket: JWT Authentication Best Practices “It is best to avoid letting the JavaScript code ever see the access token.” OAuth 2.0 for Browser-Based Apps: Best Current Practice
has comment: http://stackoverflow.com/comment/125900508
downvote count: 3
upvote count: 9
answers question: http://stackoverflow.com/q/27444403
type: Answer

http://stackoverflow.com/comment/43204635
type: Comment
score: 0
type: AnswerComment
has text: Hi souravb, Thank you very much for your reply and i have tried the same in my jsf2 appplication, but it does not worked for me.i there any configurations requied for this like the plugins to add. i wrote this in xhtml file and the jquery is place inbetween the script tags.
comment on: http://stackoverflow.com/a/27359995

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/27373198
tags question: http://stackoverflow.com/q/27444864
tags question: http://stackoverflow.com/q/27345520

http://stackoverflow.com/q/27405510
answer count: 2
downvote count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/43255766
score: -3
has title: How to download a file when load?
has comment: http://stackoverflow.com/comment/43255699
type: AnsweredQuestion
upvote count: 0
has body: I used below code for the create and download the file. But below the code only work when click the link. so how to download the file by default load. without click. &lt;script&gt; array=[{a:'1',b:'2'},{x:'3',y:'4'}]; function dl(array,filename){ var b=document.createElement('a'); b.download=filename; b.textContent=filename; b.href='data:application/json;base64,'+window.btoa(unescape(encodeURIComponent(JSON.stringify(array)))) return b } document.body.appendChild(dl(array,'my.json')); &lt;/script&gt;
linked to: http://stackoverflow.com/q/156686
accepted answer: http://stackoverflow.com/a/28583636
type: Question
possible better answer: http://stackoverflow.com/a/27405603
tagged with: javascript
has answer: http://stackoverflow.com/a/27405603
has answer: http://stackoverflow.com/a/28583636

http://stackoverflow.com/comment/43174347
has text: It's a call to an undefined attribute, not pointing to your callback function
type: Comment
comment on: http://stackoverflow.com/q/27361018
type: QuestionComment
score: 0

http://stackoverflow.com/a/27381332
type: Answer
score: 2
answers question: http://stackoverflow.com/q/27381248
upvote count: 2
has body: You need to add the height of the window too. $(window).scroll(function (event) { var scrollBottom = $(window).scrollTop() + $(window).height(); var div = $('#grid'); var bottom = ((div.offset().top + div.height()) - scrollBottom); $('.scroll').html(bottom); }); If bottom is negative by less than the window height, then the bottom of the #grid div is visible on the screen.
accepted answer of: http://stackoverflow.com/q/27381248
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27378375
answers question: http://stackoverflow.com/q/27378328
downvote count: 0
has body: $scope.persons.push(angular.copy($scope.person)); $scope.persons.push(angular.copy($scope.person)); you need a copy of a person object , you cant use new keyword with it in java, you can use class to create a object, after creating a object you can deal with it, but you cant create a new object from the object. like wise $scope.person is a object. you cant use new keyword with it.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27378328
score: 1
upvote count: 1

http://stackoverflow.com/a/27392882
accepted answer of: http://stackoverflow.com/q/27392786
answers question: http://stackoverflow.com/q/27392786
type: AcceptedAnswer
downvote count: 0
score: 1
has body: You should move picNum to the top, to declare it as global: var picNum = 0; var word; var wrongGuess = 0; var usedLetters = []; Because each time it goes to the CheckGuess() function it resets to zero, then if the user fails it will only increment to 1. That's why you are seeing the same image (first time)
type: Answer
upvote count: 1

http://stackoverflow.com/comment/43265514
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27410332
type: AnswerComment
has text: Yep - that'll work - altho that is the same as `this.setAttribute()`\

http://stackoverflow.com/q/27449242
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43340014
has comment: http://stackoverflow.com/comment/43339995
has answer: http://stackoverflow.com/a/27449297
has body: I have this code right now that works with mouse, but when I try to use it with my phone, it doesn't work. I think phones don't react on onClick. Is there a mobile version for this?
tagged with: onclick
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27450727
has title: onClick touch version
answer count: 2

http://stackoverflow.com/q/27380096
linked to: http://stackoverflow.com/q/16209584
answer count: 3
has answer: http://stackoverflow.com/a/34755713
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/44135187
upvote count: 5
has title: $_FILES returns empty when using HTML Form and Dropzone JS
tagged with: forms
has answer: http://stackoverflow.com/a/27866420
type: Question
linked to: http://stackoverflow.com/q/21047587
score: 5
has comment: http://stackoverflow.com/comment/44135223
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: dropzone.js
has body: I have spent way too much time on this and browsed various questions/answers here on stackoverflow. I am using dropzone.js to add a basic drag and drop upload feature to our HTML/PHP form. The drag and drop is working great however when the form is submitted or a file is uploaded the $_FILES returns empty and I cant figure it out. I checked a tutorial and no luck, also checked some Q & A's from stackoverflow before posting here but nothing has helped. Here is the form in its simplest form: <form action="<? echo BASE_URL; ?>/process-uploads.php" method="POST" class="form-signin" role="form" enctype="multipart/form-data"> Drag & drop file here or The JS is: And process-upload.php just checks to see if anything was sent, but returning empty: <?php if (!empty($_FILES)) { echo 'We have a file'; if($_FILES['ad']) { echo 'We grabbed the ad '; echo ' '; var_dump($_FILES); echo ' '; } } ?> Any help would be greatly appreciated. For reference I already checked enyo's tutorial for combining a form with dropzone and php
linked to: http://stackoverflow.com/q/21940099
has answer: http://stackoverflow.com/a/27380266

http://stackoverflow.com/q/27396471
accepted answer: http://stackoverflow.com/a/27396922
linked to: http://stackoverflow.com/q/19114586
type: AnsweredQuestion
has title: Datatables search functionality
tagged with: search
type: Question
tagged with: javascript
score: 0
has body: I use Datatables to build up a table and to make it searchable. $('#table').DataTable({ "paging" : true, "info" : true, "bFilter" : true, }); I have a column, which contains the values "security" and "non-security". If I search for "security"... it matches of cause to both. My Question is: How to use or how to configure datatables, that the search will filter out "non-security" items when searching for "security"?
tagged with: datatables
answer count: 1
has answer: http://stackoverflow.com/a/27396922

http://stackoverflow.com/q/27448827
has body: I want to display my drop down menu inside my text input field using bootstrap: One Two Three Four Five Six As you can see, I'm using Bootstrap-select and scrollYou for some of the functionality. But how can I get my select field (and options) to display inside the search box? Any help is much appreciated!
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/27449749
has comment: http://stackoverflow.com/comment/43336913
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/27449749
type: Question
has comment: http://stackoverflow.com/comment/43336836
tagged with: javascript
has comment: http://stackoverflow.com/comment/43336664
has title: Drop Down Menu Inside Text Field Bootstrap

http://stackoverflow.com/q/27371635
linked to: http://stackoverflow.com/q/23073216
has answer: http://stackoverflow.com/a/27371747
type: Question
possible better answer: http://stackoverflow.com/a/27371665
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/27371735
has comment: http://stackoverflow.com/comment/43194611
has answer: http://stackoverflow.com/a/27371665
has answer: http://stackoverflow.com/a/27371735
has body: When I use jquery find() to get elements, it will return a collection of objects. So, basically I run: $("#eventlist").find("span") Now if I run: $("#eventlist").find("span").html() It returns the html of just the first element in the object. When I try JSON.stringify($("#eventlist").find("span")) I get an error: DOMException: Failed to read the 'selectionDirection' property from 'HTMLInputElement': My question is, how could I get all elements in one big html string?
has title: Jquery find collection of objects and convert it to html string
has comment: http://stackoverflow.com/comment/43194628
type: AnsweredQuestion

http://stackoverflow.com/q/27428248
has comment: http://stackoverflow.com/comment/43298799
has comment: http://stackoverflow.com/comment/43297937
has answer: http://stackoverflow.com/a/27428476
has comment: http://stackoverflow.com/comment/43298400
has answer: http://stackoverflow.com/a/27428546
has answer: http://stackoverflow.com/a/27428314
type: Question
has comment: http://stackoverflow.com/comment/43298204
tagged with: javascript
has comment: http://stackoverflow.com/comment/43298919
has answer: http://stackoverflow.com/a/27428345
has comment: http://stackoverflow.com/comment/43298122
has comment: http://stackoverflow.com/comment/43298010
score: 0
has comment: http://stackoverflow.com/comment/43298096
has comment: http://stackoverflow.com/comment/43298271
answer count: 4
has body: I am trying to add text to my site based on the time. However, I cannot get it to work! HTML: About Me Products Contact FAQ JS: var timeAdd = function(){ var today = new Date(); var todayHour = today.getHours(); var message; switch(todayHour){ case(todayHour > 18): message = "Good Evening!"; break; case(todayHour > 12): message = "Good Afternoon!"; break; case(todayHour > 0): message = "Good Morning!"; break; default: message = "Welcome!"; break; } return message; }; var tag = document.getElementById("welcomeText"); tag.textContent(timeAdd()); I just want to be able to add the message to said div. When I try the page, nothing comes up. I have tried different ways, so, what am I missing?
linked to: http://stackoverflow.com/q/3463833
type: UnansweredQuestion
has title: My Date() JavaScript function is not working?

http://stackoverflow.com/comment/43370923
type: Comment
type: QuestionComment
has text: @dfsq - Then why does not document["a"](); work? or is there a different syntax.
comment on: http://stackoverflow.com/q/27467569
score: 0

http://stackoverflow.com/comment/43292111
score: 0
type: Comment
type: QuestionComment
has text: @PashaTurok.. +1.. your code now make the question clear.. but you need to understand this is only javascript. and javascript doesnt work exactly how java works. models can be defined on the scope of controllers within the controller itself..
comment on: http://stackoverflow.com/q/27423950

http://stackoverflow.com/comment/43305998
comment on: http://stackoverflow.com/q/27432271
type: QuestionComment
has text: thank you for the response, my code doesn't seem to work, the data is not changed at all and just remains empty. I'm new to AngularJS.
type: Comment
score: 0

http://stackoverflow.com/comment/43186080
comment on: http://stackoverflow.com/a/27357990
score: 0
type: AnswerComment
has text: Is there any possible way to track down object references without being passed on? My idea is a tool that lets you substitute your own preferred base layer on any Leaflet-based website. In order for it to work on any site, obviously it couldn't require the developer of that site to do anything special...
type: Comment

http://stackoverflow.com/comment/43192368
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27370076
has text: @Bill, as I said I'm fairly new to this, and I really still don't know what I'm looking at 100%. I've been stressing over this program all day. I know it's supposed to be a simple grade averaging system. But I just can't do it!
score: 0

http://stackoverflow.com/a/27432912
type: Answer
score: 2
has body: Missed a ; after -o-transition there FIDDLE
upvote count: 2
answers question: http://stackoverflow.com/q/27432836
has comment: http://stackoverflow.com/comment/43307015
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27432836

http://stackoverflow.com/comment/43244566
score: 0
comment on: http://stackoverflow.com/a/27399392
type: Comment
type: AnswerComment
has text: @user568458 Right, that's what my answers suggests; i.e. it will match the last occurrence of "HOHO" first :) performance may be impacted, but only a benchmark will give *some* assurance.

http://stackoverflow.com/comment/43293111
type: Comment
type: QuestionComment
has text: You could use native [HTMLTableElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement) interface.
comment on: http://stackoverflow.com/q/27425479
score: 0

http://stackoverflow.com/comment/43277799
score: 0
type: Comment
type: QuestionComment
has text: Have you thought about dropping Sencha Command usage? You can just include your scripts on web page or pack them with any other js minification tool.
comment on: http://stackoverflow.com/q/27370917

http://stackoverflow.com/q/27441502
type: Question
has answer: http://stackoverflow.com/a/48276682
has comment: http://stackoverflow.com/comment/43322882
has comment: http://stackoverflow.com/comment/43352566
upvote count: 2
tagged with: morris.js
tagged with: javascript
tagged with: jquery
has body: I am trying to animate morris bar chart, morris bar chart got displayed but I want animation and different colour for each bar. And my code is: success:function(response){ $('body').css('cursor', 'default'); if(response.status == 'success'){ var productValueCountList=response.productcountlist; $('#productCount-bar').empty(); if(productValueCountList=='') {vex.dialog.alert("No record found") return false; } Morris.Bar({ element: 'productCount-bar', data:productValueCountList, xkey: 'productName', ykeys: ['productCount'], labels: ['Number of Product'], barRatio: 0.3, barSizeRatio:0.3, xLabelAngle:25, //seriesColors:['#85802b', '#00749F', '#73C774', '#C7754C'], // barColors: ["#B21516", "#1531B2", "#1AB244", "#B29215"], hideHover: 'auto' }); In above code productcountlist is JSON array. Please help me or give me another solution.
has answer: http://stackoverflow.com/a/31974163
favorite count: 0
has answer: http://stackoverflow.com/a/28479517
answer count: 3
has title: how to animate morris bar chart?
score: 2
has comment: http://stackoverflow.com/comment/43326263
downvote count: 0
has comment: http://stackoverflow.com/comment/43322972
type: UnansweredQuestion

http://stackoverflow.com/a/27323876
accepted answer of: http://stackoverflow.com/q/27320331
type: Answer
answers question: http://stackoverflow.com/q/27320331
has comment: http://stackoverflow.com/comment/43125987
has body: Second attempt what about //assuming jquery you can modify for pure javascript, im just too lazy and I want to help not make your job :P var data = { name: 'John Doe', age: 35 } var arrTemplate = []; arrTemplate.push("&lt;form id='whateverID' action='' method=''"); for (var k in data){ if (data.hasOwnProperty(k)) { arrTemplate.push("&lt;input type='hidden' name='"+ k +"' value='"+ data[k] +"'&gt;"); } } arrTemplate.push("&lt;/form&gt;"); $(document).append(arrTemplate.join("")); $("#whateverID").submit(); //then you could remove the form if you want to. is this what you want???
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43166679

http://stackoverflow.com/q/27317558
has comment: http://stackoverflow.com/comment/43097228
has comment: http://stackoverflow.com/comment/43094805
score: -1
type: Question
has comment: http://stackoverflow.com/comment/43094955
has comment: http://stackoverflow.com/comment/43095744
has comment: http://stackoverflow.com/comment/43096839
has comment: http://stackoverflow.com/comment/43096998
tagged with: javascript
has comment: http://stackoverflow.com/comment/43096736
has comment: http://stackoverflow.com/comment/43094930
favorite count: 0
has comment: http://stackoverflow.com/comment/43096730
has comment: http://stackoverflow.com/comment/43094901
answer count: 1
has comment: http://stackoverflow.com/comment/43095229
has comment: http://stackoverflow.com/comment/43095169
has answer: http://stackoverflow.com/a/27317920
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43097823
type: UnansweredQuestion
downvote count: 2
has title: How do you write an if statement in an angular js function?
has comment: http://stackoverflow.com/comment/43094666
upvote count: 1
has body: I wrote a function in JS that ran and worked correctly to verify passwords. I then wrote an identical one in Angular JS and tried to refactor it so it would have the correct bindings and thus and it didn't work. Im assuming it is possible to do this in Angular, but when I try to google for answers it just takes me to StackOverflow ironically for answers. Thanks here is the current javascript if/else statement in the function: function passwordValidation(){ var pwf = document.getElementById("pword1").value; var pword = document.getElementById("cPassword").value; var matchCol = "#009900"; var noMatchCol = "#CC0000"; var noBg = "#FFFFFF"; var re = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[\\\+\=\.,\[\]_£|\`¬':\;\~{}&lt;&gt;()#?!\@$\%^&amp;*-]).{8,20}$/; if (pwf.length &lt; 1){ cPassword.style.backgroundColor = noBg; cPassword.style.borderColor = noBg; match = ""; }else{ if (pwf == pword){ match = "Match!"; cPassword.style.backgroundColor = matchCol; cPassword.style.borderColor = matchCol; }else if(pword.length &lt; 1){ cPassword.style.backgroundColor = noBg; cPassword.style.borderColor = noBg; match = ""; } else { match = "No Match!"; cPassword.style.backgroundColor = noMatchCol; cPassword.style.borderColor = noMatchCol; } document.getElementById("combination").innerHTML = match; } angular code attempted: no result returned function passwordValidation($scope){ $scope.password = "", $scope.confPassword = "", $scope.isThereAMatch = function(){ if ($scope.password == $scope.confPassword){ match = "There is a match!" ; } } }

http://stackoverflow.com/comment/43319371
score: 0
type: Comment
has text: Unfortunately, that didn't change anything. And in HTML, it worked fine if you called it as jQuery("map").googleMaps();
comment on: http://stackoverflow.com/a/27428084
type: AnswerComment

http://stackoverflow.com/a/27334810
score: 1
answers question: http://stackoverflow.com/q/27334690
has comment: http://stackoverflow.com/comment/43126718
has comment: http://stackoverflow.com/comment/43150111
has comment: http://stackoverflow.com/comment/43134214
downvote count: 0
has comment: http://stackoverflow.com/comment/43132624
has comment: http://stackoverflow.com/comment/43132966
has comment: http://stackoverflow.com/comment/43134376
has comment: http://stackoverflow.com/comment/43132671
type: Answer
upvote count: 1
has body: what about if you do this <?php $connect = mysql_connect("localhost","root","") or die ("Could not connect"); mysql_select_db ("login") or die ("Could not find database"); session_start(); function output_errors($errors){ return ' '.implode(' ', $errors) .' '; } $errors = array(); if(empty($_POST) === false) { $required_fields = array('username', 'password'); foreach ($_POST as $key=>$value) { if(empty($value) && in_array($key, $required_fields) === true){ $errors[] = 'user name and password is empty !'; break 1; } } $username = $_POST['username']; $password = $_POST['password']; if(strlen($_POST['password']) < 5){ $errors[] = 'Your password must be at least 5 Characters.'; } if ($username&&$password) { $query = mysql_query("SELECT * FROM users WHERE username ='$username'"); $numrows = mysql_num_rows($query); if ($numrows !=0) { while ($row =mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($dbusername&&$password != $dbpassword) { $errors[] = "password wrong"; } } } } if(empty($_POST) === false && empty($errors) === true && $username==$dbusername&&$password==$dbpassword){ echo header( 'Location: member.php' ) ; $_SESSION['username']=$dbusername; exit(); }else if(empty($errors) === false){ echo output_errors($errors); } ?> Username: Password: Register

http://stackoverflow.com/comment/43340027
has text: @Chen-TsuLin return string
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27450382
type: QuestionComment

tcp
type: Tag
tags question: http://stackoverflow.com/q/27454447
tags question: http://stackoverflow.com/q/27352032
tag name: tcp
tags question: http://stackoverflow.com/q/27352377

http://stackoverflow.com/comment/43327133
has text: Can you post any code that you have top this point?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27444062
score: 1

http://stackoverflow.com/a/27424371
score: 2
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has body: you have incorrect selector to target all input checkbox: if(!$('#checkableGrid').find("input:checkbox:checked").length){ alert("must check any item"); return false; };
accepted answer of: http://stackoverflow.com/q/27424335
type: Answer
answers question: http://stackoverflow.com/q/27424335
has comment: http://stackoverflow.com/comment/43291349

http://stackoverflow.com/comment/43201061
comment on: http://stackoverflow.com/q/27374757
score: 0
type: Comment
type: QuestionComment
has text: ah okay. Any suggestions on how I could amend my promise to get my desired result?

http://stackoverflow.com/a/27424274
has body: Just use a number &lt;input&gt; instead: function clearText(){ document.getElementById("myNumber").value = 1000; } &lt;input id="myNumber" type="number" step="1000" min="1000" max="1000000" value="1000"&gt; &lt;input type="button" value="Clear" onclick='clearText();'/&gt; This way, you can just use the step, min, and max attributes to specify the behavior of the input.
has comment: http://stackoverflow.com/comment/43291227
downvote count: 0
answers question: http://stackoverflow.com/q/27424108
has comment: http://stackoverflow.com/comment/43291697
has comment: http://stackoverflow.com/comment/43291317
has comment: http://stackoverflow.com/comment/43291579
score: 1
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/43291766
has comment: http://stackoverflow.com/comment/43290722

http://stackoverflow.com/q/27448903
tagged with: ajax
has body: Simple question, but I'm a little confused. In my application, when a user clicks an image's thumbnail, the thumbnail's ID is sent over to this controller action via AJAX: [HttpPost] public ActionResult GetHiResImage(string thumbnailID) { Guid id = new Guid(thumbnailID); try { using (var db = new ImagesDbContext()) { var image = db.Images.Where(x =&gt; x.ImageID == id).Select(x =&gt; x).Single(); return File(image.ImageData, image.ImageMimeType); } } catch (Exception e) { } return Json("An error occurred while trying to retrieve the image from the database."); } Using this code, the client appears to receive the image but nothing happens. I'd like to return the full-sized image to the client - without redirecting or refreshing the page - but I can't figure out how to do this. Ideally, I'd like the image to appear in a new window or tab, and I'm trying to figure out which type of FileResult (e.g. FileResult, FileStreamResult, or FileContentResult) would be used to do this. One of the bigger problems is that the image is that the image isn't saved in any directory on the server, so I can't simply return a FilePath to the client. I tried using return File and return FileContentResult to no avail. I also thought that I could maybe return a string containing a Base64String representation of the image back to the client and displaying it in a modal dialog, but this isn't ideal because the size of the image might exceed the length/width of the modal.
has title: Sending an image to client and opening in new window or tab using MVC 5
type: AnsweredQuestion
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/27449113
accepted answer: http://stackoverflow.com/a/27449113
tagged with: image
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/43162185
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27353346
score: 0
has text: I tried that that (edited my original post), but it still doesn't work. But what I dont get is - whats the correct way to do this with mongodb/node? Unfortunately I haven't found a working `gridFS` example either

http://stackoverflow.com/comment/43209773
type: Comment
type: QuestionComment
has text: @jsHero Der Vampyr attached image described the issue. In it, the scrollable area contains a lot of data, when I try to print the page, only the shown area printed and I can't get the other part of scrollable area that not scrolled as pages.
score: 0
comment on: http://stackoverflow.com/q/27379627

http://stackoverflow.com/q/27362224
tagged with: google-chrome-app
upvote count: 1
tagged with: whitelist
favorite count: 0
tagged with: blacklist
tagged with: kiosk-mode
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27383776
has title: Chrome Kiosk App Keeping user's within domain
score: 1
has answer: http://stackoverflow.com/a/27362367
type: Question
answer count: 2
has body: I'm creating a Chrome Kiosk App to allow user's to search our database for books so it's pretty much a library search system. It uses our homepage of our website where the universal search bar is. When you type in a title, it searches the database and displays results in Book format, Audio format, etc. However, I want to make sure that they stay within the domain name so they can't go to playboy.com or any other website for that matter. This is my HTML so far: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="browser.css"&gt; &lt;script src="jquery.min.js"&gt;&lt;/script&gt; &lt;script src="browser.js"&gt;&lt;/script&gt; &lt;body&gt; &lt;div id="controls"&gt; &lt;button id="back" title="Go Back"&gt;&amp;#9664;&lt;/button&gt; &lt;button id="forward" title="Go Forward"&gt;&amp;#9654;&lt;/button&gt; &lt;button id="home" title="Go Home"&gt;&amp;#8962;&lt;/button&gt; &lt;button id="reload" title="Reload"&gt;&amp;#10227;&lt;/button&gt; &lt;form id="location-form"&gt; &lt;div id="center-column"&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;webview src="https://thesmartstore.org/in-house-search" style="width:100%; height:100%"&gt;&lt;/webview&gt; &lt;div id="sad-webview"&gt; &lt;div id="sad-webview-icon"&gt;&amp;#9762;&lt;/div&gt; &lt;h2 id="crashed-label"&gt;Aw, Snap!&lt;/h2&gt; &lt;h2 id="killed-label"&gt;He's Dead, Jim!&lt;/h2&gt; &lt;p&gt;Something went wrong while displaying this webpage. To continue, reload or go to another page.&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; My Javascript is pretty heavy, but I was wondering if there was a way to whitelist just this domain or make sure they stay on https://thesmartstore.org/ domain. As long as the beginning of the url starts with this, they should be good, if not, I will redirect them to the homepage. Since the Javascript is quite large, I pasted it in pastebin: http://pastebin.com/UecgS4sQ Thank you for any help!
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/43240937
has text: THANK YOU SO MUCH! I didn't even think about that. It's getting late here
type: Comment
comment on: http://stackoverflow.com/a/27397439
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43161546
type: QuestionComment
has text: req.files is undefined. I looked at the GridFS doku, but I'm still not sure how I can save binary data into my mongodb
score: 0
comment on: http://stackoverflow.com/q/27353346
type: Comment

http://stackoverflow.com/q/27424687
linked to: http://stackoverflow.com/q/26564413
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: After a suggestion from this question Multiple forms in in a page - load error messages via ajax I am trying to work multiple forms in same page. I am trying to append error messages in to the respective input div classes. I don't want to have different form ids because i need to have single id in the jquery then. I have forms like and the jQuery part is $('.myform').on('submit', function(event) { postform = $(this); event.preventDefault(); $(this).ajaxSubmit({ url: 'process.php', type: 'post', dataType: 'json', success: function( response ){ $.each(response, function(index, element){ var msgdiv = postform.children('div.' + divclass).append(''+message+''); } } }); }); however the ajax part is working but the error messages do not load in the div tags as defined in the jQuery 'div.' + divclass. Any help would be appreciated
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27424897
favorite count: 0
has comment: http://stackoverflow.com/comment/43291874
upvote count: 1
tagged with: php
has title: Working with multiple ajax forms in same page
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43291610
type: Question
has answer: http://stackoverflow.com/a/27424897

http://stackoverflow.com/q/27471102
score: 0
tagged with: typeahead.js
has answer: http://stackoverflow.com/a/27524118
answer count: 1
has body: I'm following this link which is a great clear blog post about typeahead.js with Json. However, I'm having problems with it and can't figure out where I'm going wrong. Here is my js: &lt;script type="text/javascript"&gt; $('#Search').typeahead({ hint: true, highlight: true, minLength: 1 }, { name: 'states', displayKey: 'stateName', source: function (query, process) { states = []; map = {}; var data = [ { "stateCode": "CA", "stateName": "California" }, { "stateCode": "AZ", "stateName": "Arizona" }, { "stateCode": "NY", "stateName": "New York" }, { "stateCode": "NV", "stateName": "Nevada" }, { "stateCode": "OH", "stateName": "Ohio" } ]; $.each(data, function (i, state) { map[state.stateName] = state; states.push(state.stateName); }); process(states); }, updater: function (item) { selectedState = map[item].stateCode; return item; } }); &lt;/script&gt; When I type in the input control all the results come back as undefined. I think it's something to do with the displayKey and I've tried setting it to state.stateName but that results in the same problem. Maybe I'm looking in the wrong area? I've setup a plnkr.co demo here. Thanks for reading. Paul
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27524118
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/43462845
has title: Using typeahead.js with Json

http://stackoverflow.com/a/27359037
upvote count: 109
answers question: http://stackoverflow.com/q/27358966
type: Answer
has comment: http://stackoverflow.com/comment/98320347
has comment: http://stackoverflow.com/comment/117892872
score: 108
downvote count: 1
has body: X-Frame-Options is a header included in the response to the request to state if the domain requested will allow itself to be displayed within a frame. It has nothing to do with javascript or HTML, and cannot be changed by the originator of the request. This website has set this header to disallow it to be displayed in an iframe. There is nothing that can be done in a client-side web browser to stop this behaviour. Further reading on X-Frame-Options
has comment: http://stackoverflow.com/comment/98282409
has comment: http://stackoverflow.com/comment/125646099
has comment: http://stackoverflow.com/comment/123903211

http://stackoverflow.com/comment/43260350
type: QuestionComment
comment on: http://stackoverflow.com/q/27406763
score: 0
has text: I highly recommend you read a book on HTML and CSS. Class is very basic. In my opinion you should not really be using JavaScript if you don't know the basics of HTML. It will lead you to many many errors.
type: Comment

date
tags question: http://stackoverflow.com/q/27320920
tags question: http://stackoverflow.com/q/27444581
tag name: date
tags question: http://stackoverflow.com/q/27419364
tags question: http://stackoverflow.com/q/27456315
tags question: http://stackoverflow.com/q/27379243
tags question: http://stackoverflow.com/q/27400179
tags question: http://stackoverflow.com/q/27350405
tags question: http://stackoverflow.com/q/27451849
tags question: http://stackoverflow.com/q/27338161
tags question: http://stackoverflow.com/q/27331225
tags question: http://stackoverflow.com/q/27314530
tags question: http://stackoverflow.com/q/27449886
tags question: http://stackoverflow.com/q/27315593
tags question: http://stackoverflow.com/q/27423633
type: Tag
tags question: http://stackoverflow.com/q/27455060
tags question: http://stackoverflow.com/q/27343300
tags question: http://stackoverflow.com/q/27433086
tags question: http://stackoverflow.com/q/27333068
tags question: http://stackoverflow.com/q/27442370
tags question: http://stackoverflow.com/q/27450867
tags question: http://stackoverflow.com/q/27340620
tags question: http://stackoverflow.com/q/27403585
tags question: http://stackoverflow.com/q/27437097
tags question: http://stackoverflow.com/q/27435021
tags question: http://stackoverflow.com/q/27323791
tags question: http://stackoverflow.com/q/27358775
tags question: http://stackoverflow.com/q/27328816
tags question: http://stackoverflow.com/q/27328233
tags question: http://stackoverflow.com/q/27381115
tags question: http://stackoverflow.com/q/27470954
tags question: http://stackoverflow.com/q/27349492
tags question: http://stackoverflow.com/q/27435418
tags question: http://stackoverflow.com/q/27342164
tags question: http://stackoverflow.com/q/27326937

http://stackoverflow.com/comment/43317993
type: Comment
has text: Just found this: 06:26:03.476 PHP Warning: Unknown: POST Content-Length of 10612153 bytes exceeds the limit of 8388608 bytes in Unknown on line 0.... That's not a 32MB limit
type: QuestionComment
comment on: http://stackoverflow.com/q/27417184
score: 0

http://stackoverflow.com/a/27372707
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/27372680
answers question: http://stackoverflow.com/q/27372680
upvote count: 1
has body: should be This will style all the images which are under #footer #footer img { border-style: none; border-color: inherit; border-width: 0; height: 54px; width: 57px; }

http://stackoverflow.com/a/27459658
accepted answer of: http://stackoverflow.com/q/27458019
score: 2
has comment: http://stackoverflow.com/comment/43470676
answers question: http://stackoverflow.com/q/27458019
upvote count: 2
has comment: http://stackoverflow.com/comment/43443548
has body: you are trying to access a local file, and most browsers (recent Chrome for example) disable it by default. The clean and HTML5 friendly way to do it is via a dialog box and the FileAPI http://www.html5rocks.com/en/tutorials/file/dndfiles/ Here is one example to perform your task: a dialog box allows you to select the xml file and display the info as you wish. My main source is this one: https://github.com/MounirMesselmeni/html-fileapi Here is how to adapt the code &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;HTML5 File API&lt;/title&gt; &lt;/head&gt; &lt;body &gt; &lt;div&gt; &lt;form class="form-horizontal well"&gt; &lt;legend&gt; &lt;h3&gt; &lt;div id="title"&gt;HTML5 File API&lt;/div&gt; &lt;/h3&gt; &lt;/legend&gt; &lt;fieldset&gt; &lt;label for="xmlFileinput"&gt; &lt;strong&gt;XML File:&lt;/strong&gt; &lt;/label&gt; &lt;input type="file" id="xmlFileinput" onchange="handleFiles(this.files)" accept=".xml"&gt; &lt;/div&gt; &lt;/fieldset&gt; Product Name: &lt;input type="text" name="ProductName" id="input"&gt; &lt;/form&gt; &lt;div id="output"&gt; &lt;/div&gt; &lt;div id="results"&gt; &lt;/div&gt; &lt;/div&gt; &lt;br&gt; &lt;br&gt; &lt;footer&gt; &lt;center&gt; &lt;p&gt;&amp;copy; Gabriel Ter-Minassian + Mounir Messelmeni 2012&lt;/p&gt; &lt;/center&gt; &lt;/footer&gt; &lt;script type="text/javascript"&gt; function handleFiles(files) { // Check for the various File API support. if (window.FileReader) { // FileReader are supported. getAsText(files[0]); } else { alert('FileReader are not supported in this browser.'); } } function getAsText(fileToRead) { var reader = new FileReader(); // Handle errors load reader.onload = loadHandler; reader.onerror = errorHandler; // Read file into memory as UTF-8 reader.readAsText(fileToRead); } function loadHandler(event) { var xml = event.target.result; //alert(xml); doc=StringtoXML(xml); searchXML(doc); } function errorHandler(evt) { if(evt.target.error.name == …
has comment: http://stackoverflow.com/comment/43476591
has comment: http://stackoverflow.com/comment/43444391
has comment: http://stackoverflow.com/comment/43369528
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43360327
type: Answer

http://stackoverflow.com/comment/43127263
score: 0
type: AnswerComment
type: Comment
has text: newValues gives back `undefined`, and the data that being returned in the function: `Array [ Object ]`.
comment on: http://stackoverflow.com/a/27333921

http://stackoverflow.com/a/27379157
score: 1
has comment: http://stackoverflow.com/comment/43207867
type: Answer
upvote count: 1
has body: You can use a setTimeout within your custom jQuery function to handle the removal of the item after applying the color change. I've made an example here: http://jsfiddle.net/mkjj94m1/2/ I've renamed the function to deleteItem as remove is an existing jQuery function.
answers question: http://stackoverflow.com/q/27379050
downvote count: 0

http://stackoverflow.com/comment/43299843
type: QuestionComment
comment on: http://stackoverflow.com/q/27429180
score: 3
has text: Suggestion : remove it with css.
type: Comment

http://stackoverflow.com/comment/43500422
score: 0
type: Comment
type: AnswerComment
has text: You might be able to use a custom javascript function on the server http://rethinkdb.com/api/javascript/js/ You could possibly use js to convert the string and return a Date obj.
comment on: http://stackoverflow.com/a/27431999

http://stackoverflow.com/comment/43227671
comment on: http://stackoverflow.com/q/27389702
has text: Is there a reason you can't use `@Html.HiddenFor()`?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27454688
score: 1
possible better answer: http://stackoverflow.com/a/27454742
has answer: http://stackoverflow.com/a/27454830
has answer: http://stackoverflow.com/a/27454742
type: Question
answer count: 2
tagged with: grunt-contrib-concat
has title: using grunt to CONCATENATE FILES in sequence
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: gruntjs
has body: i'm new to grunt and i want to concatenate java script files to one file using grunt and i have 6 js files but they need to be in some sequence to run the code without errors like jquery should loaded in first but the result file which came from grunt not preserve this sequence i tried many things like arrange them in src or make more than one folder but it didn't work note - when i make manual concatenation in one file by copy and paste it works fine so is there any command to make grunt concatenate this files in the secuquence that i wrote them in src as example this is my gruntfile.js too module.exports = function(grunt) { // 1. All configuration goes here grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), // 1 - this is contecnate js files call them in one file only concat: { options: { separator: ';', }, dist: { src: ['src/public/js/jquery.min.js','src/public/js/bootstrap.js','public/js/modernizr.custom.77555.js', 'public/js/jquery.magnific-popup.js', 'public/js/jquery.mixitup.min.js','public/js/popup-box.js' ], dest: 'dist/1newbuilt.js', }, }, uglify: { build: { src: 'dist/1newbuilt.js', dest: 'dist/1newbuilt.min.js' } } }); // end 1 - this is contecnate js files call them in one file only // 3. Where we tell Grunt we plan to use this plug-in. grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); // 4. Where we tell Grunt what to do when we type "grunt" into the terminal. grunt.registerTask('default', ['concat', 'uglify']); }; i need the files to be concatenated in some orders like first add 1.js then add 2.js after it so i wrote the files in sequence but this way didn't work too –
accepted answer: http://stackoverflow.com/a/27454830
favorite count: 0
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/43266090
type: Comment
type: QuestionComment
has text: You could also use a more specific selector: `$(".change-this a:contains(Create an account)"`.
comment on: http://stackoverflow.com/q/27410772
score: 0

http://stackoverflow.com/a/27439117
has comment: http://stackoverflow.com/comment/43319299
downvote count: 1
has comment: http://stackoverflow.com/comment/43319559
type: Answer
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/27438313
has body: Example of batch insert in sqlite: Is it possible to insert multiple rows at a time in an SQLite database? It is faster to do a batch insert in a transaction than to run many requests. Imagine how much communication is reduced to a single batch request. If you have many rows you can cut them down to chunks. EDIT: Because of the fact that suggestion was not enough, let me give you a few more ideas. you need to loop all your data in each iteration add a (?, ?) to your query string in each iteration add the values to an associative array call your function by passing the query string an the values

http://stackoverflow.com/q/27412905
has body: I want to use SailsJS with OrientDB (using Oriento for NodeJS). What would be the right place to establish and define the database connection so that it is available in every model? I put the values for the connection in config/connections.js and the connection itself in /config/http.js as custom middleware. It works but I am absolutely not sure if that is correct module.exports.http = { middleware: { custom: true }, customMiddleware: function(app){ var Oriento = require('oriento'); var Oserver = Oriento({ host: sails.config.connections.orientDBServer.host, port: sails.config.connections.orientDBServer.port, username: sails.config.connections.orientDBServer.username, password: sails.config.connections.orientDBServer.password }); db = Oserver.use({ name: sails.config.connections.orientDBServer.dbname, username: sails.config.connections.orientDBServer.username, password: sails.config.connections.orientDBServer.password }); } }
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: oriento
has title: SailsJS: Where to define db connection to not supported db type (orientdb)? Custom Middleware?
has answer: http://stackoverflow.com/a/27426298
type: UnansweredQuestion
tagged with: orientdb
tagged with: node.js
tagged with: sails.js

http://stackoverflow.com/comment/43276685
comment on: http://stackoverflow.com/q/27415427
score: 0
type: Comment
type: QuestionComment
has text: Which version of jqGrid you use? Could you repeat the test with `jquery.jqGrid.src.js` instead of `jquery.jqGrid.min.js` and include the line number of `jquery.jqGrid.src.js` where the error take place?

http://stackoverflow.com/a/27443059
upvote count: 6
answers question: http://stackoverflow.com/q/27442858
has body: Your code isnt working because .replace() doesnt do the replacement globally inside the string. You need to set the g flag to make it work globally. Follow this simple algorithm for getting the string converted as you want: Make the whole string .toLowerCase() .replace() the % with -percent .replace() the space with a -, globally Working Code Snippet: var myString = 'Get Flat 50% off on Tees Purchase above Rs. 1200'; // apply the algorithm here: var outputString = myString.toLowerCase().replace('%', '-percent').replace(/ /g,"-"); alert(outputString); Readup: .replace() | MDN, .toLowerCase() | MDN
score: 6
accepted answer of: http://stackoverflow.com/q/27442858
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/27409356
type: Answer
has body: String wsdl1Path = request.getParameter("wsdl1path"); String wsdl2Path = request.getParameter("wsdl2path"); WsdlCompare com = new WsdlCompare(); String url = ""; if ( wsdl1Path != null &amp;&amp; wsdl2Path != null ) { url= com.compare(wsdl1Path,wsdl2Path); }else{ //Handle NPE } Try this... if wsdl1Path or wsdl2Path became null you will able to handle the exception. And also try passing your two parameters via GET or POST methods, if its GET load page with above two parameters. Eg: index.jsp?wsdl1Path=wsdl1_path&amp;wsdl2Path=wsdl2_path
score: 0
answers question: http://stackoverflow.com/q/27408906

http://stackoverflow.com/comment/43136503
comment on: http://stackoverflow.com/q/27340024
type: Comment
type: QuestionComment
has text: "How can I use the key in java script without allowing users to view the source?" You cannot. End of story.
score: 6

http://stackoverflow.com/comment/43290223
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27423950
has text: @PashaTurok Plalx only helped you for your question.
score: 0

http://stackoverflow.com/comment/43203648
has text: Your welcome! If you only want to use jQuery, you will have to loop trough each tr till you find the .blocked.end and highlight the .blocked divs while you are looping i suppose.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27376730

http://stackoverflow.com/q/27360875
tagged with: javascript
tagged with: asp.net
has answer: http://stackoverflow.com/a/27361451
accepted answer: http://stackoverflow.com/a/27361451
has body: I am working on an ASP.NET app. In my app, I need to upload 1 or more pictures. The pictures are associated with a product. The user enters the details of the product, uploads some pictures of the product, then clicks "Save". When the user clicks "Save", the product details get validated. I need to be able to upload 1 or more pictures and show their thumbnails while a user is still editing product details. Is there a way to do this with IE 9? I saw dropzone.js, however, it does not work with IE 9.
type: AnsweredQuestion
type: Question
score: 0
has title: Handling Picture Uploads in IE 9
answer count: 1

http://stackoverflow.com/comment/43381050
has text: Can't understand your issue exactly, can you please reframe? What I felt is that no matter how many words I am entering, it shows 1 word only.
comment on: http://stackoverflow.com/q/27473231
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43332703
comment on: http://stackoverflow.com/q/27446435
has text: Your backend script surely won't give you the data you expect, only "hello world" :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43367727
has text: Perhaps you're encountering a `box-sizing` issue? See http://getbootstrap.com/getting-started/#third-parties
comment on: http://stackoverflow.com/q/27456706
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27398648
has comment: http://stackoverflow.com/comment/43244223
has comment: http://stackoverflow.com/comment/43245138
has comment: http://stackoverflow.com/comment/43246442
type: Answer
has comment: http://stackoverflow.com/comment/43244216
has body: You can use delegated events: Instead of waiting for an element to be created/ready and then attaching an event handler, the handler is attached to a parent element, that exists early, such as the document object, since that always exists. Example: Instead of $('#mylink').on('click', function() { /* do something */ }); it's $(document).on('click', '#mylink', function() { /* do something */ }); This is normally used when elements are added dynamically, but it works just as well "while the page loads". EDIT: Short explanation: Basically DOM events "bubble": When an element is clicked, then the event isn't just sent to that element, but to all of its ancestors, one by one going up the DOM tree. The event contains information which element was originally clicked and you could filter/check for the element yourself: $(document).on('click', function(event) { if( $(event.target).is('#mylink') ) { alert('the link was clicked'); } }); Using the selector as the second argument in .on() jQuery does the filtering for you, and sets this to the link instead of the document. See also this example: http://jsfiddle.net/qhsktpcs/
has comment: http://stackoverflow.com/comment/43243874
has comment: http://stackoverflow.com/comment/43244595
has comment: http://stackoverflow.com/comment/43244411
upvote count: 2
has comment: http://stackoverflow.com/comment/43244627
has comment: http://stackoverflow.com/comment/43244909
has comment: http://stackoverflow.com/comment/43244367
has comment: http://stackoverflow.com/comment/43244498
has comment: http://stackoverflow.com/comment/43244324
has comment: http://stackoverflow.com/comment/43244632
score: 2
answers question: http://stackoverflow.com/q/27397529
has comment: http://stackoverflow.com/comment/43244984
has comment: http://stackoverflow.com/comment/43244741
has comment: http://stackoverflow.com/comment/43243716
has comment: http://stackoverflow.com/comment/43244275
accepted answer of: http://stackoverflow.com/q/27397529
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43244467

http://stackoverflow.com/comment/43337079
has text: I can confirm this happens to me as well.... wow that is weird. It happens to me after about 45 seconds of random clicking up and down.
comment on: http://stackoverflow.com/q/27448926
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43225528
has text: This code threw it off: margin-top: -150px; margin-left: -200px; but it work without it thanks so much
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27387240
type: AnswerComment

http://stackoverflow.com/comment/43299787
comment on: http://stackoverflow.com/a/27415047
type: AnswerComment
score: 0
type: Comment
has text: @impinball Yes because it doesn't need more work! It is obsolete and old yet better than a quick hack! I personally wouldn't use it but it works! and when I wrote this answer the title didn't say no jQuery.

http://stackoverflow.com/comment/81820366
comment on: http://stackoverflow.com/a/43389496
score: 2
type: AnswerComment
type: Comment
has text: Wouldn't `$date = new DateTime('2000-01-01'); $date->modify('+1 day');` be more readable?

http://stackoverflow.com/q/27451196
score: 0
tagged with: http-post
accepted answer: http://stackoverflow.com/a/27451236
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43344668
type: Question
has comment: http://stackoverflow.com/comment/43340943
has answer: http://stackoverflow.com/a/27451236
has body: I made a script but the big problem I found even I did it many times is the call back of jquery not respond: Here the HTML CODE Please Add Your Information project url callback add new project and here the jquery script code in the end of the page
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: callback
tagged with: ajax
has title: jquery call back not responding?

drupal
type: Tag
tags question: http://stackoverflow.com/q/27325254
tag name: drupal
tags question: http://stackoverflow.com/q/27327288

http://stackoverflow.com/comment/43107124
has text: Regional settings on the client are used to parse dates, usually. I'm pretty sure you can give Kendo a hint about the formats you want to accept.
type: Comment
score: 3
comment on: http://stackoverflow.com/q/27323987
type: QuestionComment

http://stackoverflow.com/a/27443473
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/27443185
score: 3
downvote count: 0
has body: To resolve this task you have to use closure - immediately invoke function witch be called on every iteration with i as param, and setTimeout inside this function. In this case param you passed will be stored in scope and could be used in timeout callback: for (var i=0; i&lt;8; i++) (function(t) { window.setTimeout(function() { //do anything with t }, t*2000) }(i)) UPD Also here is a shorten ES6 version. As let has block scope you can get rid os wrap function closure use for (let i=0; i&lt;8; i++){ setTimeout(() =&gt; { console.log(i) }, 2000 * i); }
has comment: http://stackoverflow.com/comment/87252297

http://stackoverflow.com/comment/43090555
type: QuestionComment
has text: Can u explain it in my case pls?
score: 0
comment on: http://stackoverflow.com/q/27315163
type: Comment

http://stackoverflow.com/q/27470969
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27518126
type: Question
tagged with: ios
tagged with: javascript
has body: so I'm working developing a fair bit of business logic in the beforeSave/afterSave/etc. type webhooks using Parse.com. As a Javacscript/Parse novice, I'm finding the flow slightly tedious and am wondering if I am approaching it correctly. On the iOS side I send a test PFObject This activates my beforeSave() function for that class I hit a syntax error Check the console logs/errors until I come up with a solution Fix the error in a text editor Save and run 'parse deploy' Repeat ad nauseam. Can I be using something like Rest Console/Postman to set up my JSON request? Can I be checking more syntax locally instead of having to run Parse Deploy every time I change an arbitrary piece of code? Is there any sort of improved debugging I could be using like XCode/etc? Thanks.
has title: What is your workflow for testing Cloud Code on Parse?
downvote count: 0
answer count: 1
favorite count: 0
tagged with: parse-platform
has answer: http://stackoverflow.com/a/27518126
tagged with: android
score: 11
tagged with: node.js
upvote count: 11

http://stackoverflow.com/comment/51346748
type: Comment
has text: Your javascript is really complicated for me ( a php programmer ).. it's well written i think? How do you call your written javascript in the file you linked? how do you like mingle it with your application. thanks!
comment on: http://stackoverflow.com/a/27391447
score: 0
type: AnswerComment

http://stackoverflow.com/a/27449243
type: Answer
accepted answer of: http://stackoverflow.com/q/27446435
has body: Your backend code should look something more like this (WebService.cs in my example, which is the CodeBehind for WebService.asmx ): using System; using System.Collections.Generic; using System.Web; using System.Web.Services; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class WebService : System.Web.Services.WebService { public class JsonResult { public string key, label, open; public List&lt;Children&gt; children; } public class Children { public string key, label; } [WebMethod] public List&lt;JsonResult&gt; test() { List&lt;Children&gt; child = new List&lt;Children&gt;(); child.Add(new Children { key = "211", label = "Burger" }); List&lt;JsonResult&gt; result = new List&lt;JsonResult&gt;(); result.Add(new JsonResult { key = "1", label = "Food", open = "false", children = child }); return result; } } This code sends the created list as JSON - which looks like this when jQuery receives it: {"d":[ { "__type":"WebService+JsonResult", "key":"1", "label":"Food", "open":"false", "children":[ { "key":"211", "label":"Burger" } ] } ]} Then, the jQuery AJAX is very simple, like so: $.ajax({ type: "POST", url: "/WebService.asmx/test", contentType: "application/json", success: function (response) { var jsonResponse = response.d; } }); Now you can access each element as native JavaScript objects, like I show here in the success callback when assigning each object to a variable. Now you can do anything you want to with the data. success: function (response) { var jsonResponse = response.d; for (var i = 0; i &lt; jsonResponse.length; i++) { var key = jsonResponse[i].key; var label = jsonResponse[i].label; var open = jsonResponse[i].open; var children = jsonResponse[i].children; for (var a = 0; a &lt; children.length; a++) { var key = children[a].key; var label = children[a].label; } } } This is 100% tested and working. Let me know if there's anything else I can help y…
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27446435

http://stackoverflow.com/q/27450311
linked to: http://stackoverflow.com/q/31722383
tagged with: chap-links-library
type: AnsweredQuestion
downvote count: 0
has title: Set Zoom Level in Vis.js
type: Question
score: 10
has body: I have a network that I'm building with vis.js, but it is too large width-wise to fit in the pages' container. The network runs left to right and contains steps about a specific process. As a person completes tasks, a server feeds new JSON records to update the colors. I can't change the container size due to the layout. When the network loads, it causes the font to be incredibly small and unreadable. Is there a way I could set the zoom level as an option so that only the current step in the process will show? function draw() { test = null; // create a network var testContainer = document.getElementById('testing'); // create some nodes var width = testing.clientWidth; var nodes = [ {id: 1, x: 0, y: 1, label: 'Start', color: 'green', shape: 'circle'}, {id: 2, label: 'Step 2', shape: 'square'}, {id: 3, label: 'Step 3', shape: 'square'}, {id: 4, label: 'Step 4', shape: 'square'}, {id: 5, label: 'Step 5', shape: 'square'}, {id: 6, label: 'Step 6', shape: 'square'}, {id: 7, label: 'Step 7', shape: 'square'}, {id: 8, label: 'Step 8', shape: 'square'}, {id: 9, label: 'Step 9', shape: 'square'}, {id: 10, label: 'Step 10', shape: 'square'}, {id: 11, label: 'Step 11', shape: 'square'}, {id: 12, x: width * 2, y: 1, label: 'Success!', shape: 'circle'} ]; // create some edges var edges = [ {from: 1, to: 2, style: 'arrow', color: 'red', width: 1, length: 200}, // individual length definition is possible {from: 2, to: 3, style: 'arrow', width: 1, length: 200}, {from: 3, to: 4, style: 'arrow', width: 1, length: 200}, {from: 4, to: 5, style: 'arrow', width: 1, length: 200}, {from: 5, to: 6, style: 'arrow', width: 1, length: 200}, {from: 6, to: 7, style: 'arrow', width: 1, length: 200}, {from: 7, to: 8, style: 'arrow', width: 1, length: 200}, {from: 8, to: 9, style: 'arrow', width: 1, length: 200}, {from: 9, to: 10, style: 'arrow', width: 1, length: 200}, {from: 10, to: 11, style: 'arrow', width: 1, length: 200}, {from: 11, to: 12, style: 'arrow', width: 1, length: 200} ]; var testDa…
tagged with: javascript
tagged with: vis.js-network
has answer: http://stackoverflow.com/a/27564080
accepted answer: http://stackoverflow.com/a/27564080
tagged with: visualization
answer count: 1
favorite count: 0
tagged with: vis.js
upvote count: 10

http://stackoverflow.com/q/27433491
has title: How to allow the country labels to auto-hide when using HTML?
type: AnsweredQuestion
tagged with: highmaps
has body: I have this map example here that I am running through Highmaps from Highcharts. You can observe that when we have this setting below, countries like Romania, Bulgaria, Serbia are not showing their label because the country is too small for that zoom level. If you zoom-in enough, those small countries will become bigger and their label is displayed. dataLabels: { enabled: true, useHTML: false, format: '{point.name}' } If I change to useHTML: true, all country labels will show all the time, no matter what the zoom level is or how small the country is which causes the labels to overlap really bad like this. Because of the project requirements, sticking with useHTML: true is a must, but is there anyway to achieve the auto-hiding of the labels in this situation?
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/27446989
accepted answer: http://stackoverflow.com/a/27446989
answer count: 1
tagged with: highcharts
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/2057682

http://stackoverflow.com/a/27398150
has comment: http://stackoverflow.com/comment/43245704
score: 0
answers question: http://stackoverflow.com/q/27397327
has comment: http://stackoverflow.com/comment/43243475
has comment: http://stackoverflow.com/comment/43274153
has comment: http://stackoverflow.com/comment/43248941
type: Answer
has body: You can display the content of your iFrame inside your TextArea like so document.getElementById('YourTextArea').innerHTML = frameContent; or using the Value attribute: document.getElementById('YourTextArea').value = frameContent; I have done a quick demo for you using the first method. This returns a string with any html tag in it. So for example if your iframe contains a list, the method returns an html list. Here's the code: Coffee Tea Click the button get the HTML content of the iframe. Try it
has comment: http://stackoverflow.com/comment/43245306
has comment: http://stackoverflow.com/comment/43273000

http://stackoverflow.com/a/27393535
score: 0
answers question: http://stackoverflow.com/q/27393358
has body: I think you miss reading the html. Because before the input field, that is a div with class of input-group-addon. Hence, your selector is incorrect. I changed your JS to : $(function () { function txtInput(elem) { var inputData = $(elem).val(); if (inputData != "") { return inputData; } else{ $(".input-group").addClass("err"); } } $("#btn-contact-rquest").on("click", function (e) { if (txtInput($('#name'))) { $("#result").html("No Error"); } else { $("#result").html("Error"); } }); }); http://jsfiddle.net/fjm63j56/3/
type: Answer

http://stackoverflow.com/comment/43206425
score: 0
type: QuestionComment
type: Comment
has text: @Tomalak Thank you very much for your comment, but you didn't give me a clue where to look to do it well...
comment on: http://stackoverflow.com/q/27377614

http://stackoverflow.com/a/27384294
type: Answer
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27384253
has body: Instead of messing with regex, you could use a combination of filter and map to get the properties of the elements in to an array as you require: var str = '&lt;rate val="xyz"&gt;&lt;/rate&gt; &lt;rate val="klm"&gt;&lt;/rate&gt; &lt;rate val="mnp"&gt;&lt;/rate&gt;'; var result = $(str).filter('rate').map(function() { return $(this).attr('val'); }).get(); console.log(result); Example fiddle
accepted answer of: http://stackoverflow.com/q/27384253

http://stackoverflow.com/a/27396330
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27396281
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/27396281
score: 3
has body: + repeats the previous token one or more times. &gt; "h....e l___l^^0".replace(/[\W_]+/g, "-") 'h-e-l-l-0' [\W_]+ matches non-word characters or _ one or more times.

http://stackoverflow.com/comment/43288770
has text: Have you tried? chart.setChartTitleText(mydesiredtitle)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27422950
type: QuestionComment

http://stackoverflow.com/a/27459547
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/27458542
has comment: http://stackoverflow.com/comment/105982895
has comment: http://stackoverflow.com/comment/105965335
has body: If you want to remove the whole previously drawn image please take a look at the other anwers. In the comments OP made it clear that this is not what he was trying to achieve. So instead I will answer the intended question: How do I un-stroke a path? A bitmap is not a vector graphic. You cannot simply remove or modify things you've drawn previously. By drawing on a canvas you modify the pixel color values of its image data. If you need to undo things you have to maintain a separate data structure with the relevant data yourself. For example you could create a copy of the image data before drawing something. Then you could return to this snapshot afterwards. HTMLCanvasElement#toDataURL returns the complete image as an url which you can use as the src of an image. Later you can draw this image on the canvas to revert all subsequent changes. HTMLCanvasElement#toBlob does about the same but it returns a blob. This might consume less memory but it's a little more inconvenient to use. The most convenient method is CanvasRenderingContext2D#getImageData. You can even use it to copy only a small part of the image. This is useful if you have a big canvas but only modify pixels in a small region. Another way to make modifications undoable is by maintaining a detailed list of your steps. For example whenever you draw an arc you store the exact parameters as one entry in the list. steps.push({type: 'stroke', style: 'rgb(0,0,0)', shapes: [{type: 'arc', x: 600, y: 500, radius: radius, from: 0.5 * Math.PI, to: 2 * Math.PI}]}) You can remove, rearrange or modify the elements in this list any way you like and have all necessary information to draw the resulting image from scratch. Basically you've implemented just another vector graphic library.
type: Answer
has comment: http://stackoverflow.com/comment/106020847
score: 2

http://stackoverflow.com/comment/43205491
score: 0
type: AnswerComment
type: Comment
has text: Sorry, I didn't notice that. Is this kind of thing worth a downvote? really?
comment on: http://stackoverflow.com/a/27376996

http://stackoverflow.com/comment/43242623
comment on: http://stackoverflow.com/q/27376931
score: 0
has text: @JK. this question is indeed fit for stackoverflow though a bit speculative. It still however is centered around an issue that I came across while deciding whether or not to port a large scale desktop program to a chrome web app. I would also point out that there already are helpful and useful answers present to my question. Finally since when is web design not fit for stackoverflow even if it does not contain source code? Now please note that I mean no offense to you in any way and would be more than happy to hear some suggestions on how to improve my question.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27314174
has answer: http://stackoverflow.com/a/27454306
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/43088765
has body: I have Rails app, where I'm able to select country from: = f.input :country, label: t("heading.country"), as: :string, input_html: { class: 'select2', data: { allowadd: true, depth: 0, id: @post.location.country.id, url: search_locations_path } } Select2 is attached to this element by: loadSelect2 = (selector = '.select2') -&gt; $(@).select2 ajax: data: (term, page) -&gt; search: term depth: $(@).data('depth') results: (data, page) -&gt; results: data url: $(@).data('url') createSearchChoice: (term, data) -&gt; if $(data).filter(-&gt; @title.localeCompare(term) is 0 ).length is 0 id: term title: term createSearchChoicePosition: 'bottom' formatResult: (item) -&gt; item.title formatSelection: (item) -&gt; item.title initSelection: (element, callback) -&gt; callback id: $(element).data('id') title: $(element).val() So, as you see, I'm able to select country or add one (if there is no country available). Also I'm loading initial value from input's val and id from data-id inside initSelection. When I select country and submit the form everything works: post_params['country'] is equal to selected country's id, but if I submit form without changing selected value (leaving the default one), then post_params['country'] helds value, instead of id. Where am I wrong and how to fix that?
type: Question
tagged with: select2-rails
tagged with: javascript
score: 4
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43089248
tagged with: jquery-select2
accepted answer: http://stackoverflow.com/a/27454306
has title: Select2 submitting value instead of id
upvote count: 4
has comment: http://stackoverflow.com/comment/43088599
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43089332

http://stackoverflow.com/a/27435260
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27431445
has body: It should be just a matter of toggling an observable to show and hide the loader. something like: var Vm = function() { var self = this; self.showLoader = ko.observable(false); self.showResults = ko.pureComputed(function() { return !self.showLoader(); }) self.getdata = function(stepNumber) { self.showLoader(true); return $.get("./api/data_count.php", { stepNumber: stepNumber }) .done(function(data) { self.dataCount($.parseJSON(data)); self.showLoader(false); }) .fail(function(textStatus, errorThrown) { console.error("Error ! Unable to get step " + number + " count." + "Error: " + errorThrown + ", Status: " + textStatus); self.showLoader(false); }); } return self; } &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;span data-bind="text: dataCount, visible: showResults"&gt;&lt;img src='path/to/loader' data-bind="visible: showLoader" /&gt;&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43394263
has text: **var downloadLink = document.createElement('a'); downloadLink.href = "fileLink"; downloadLink.download = "fileName";** I believe the link has to be on the document so: **document.body.appendChild(downloadLink); downloadLink.click();**
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/27477853

http://stackoverflow.com/q/27471409
has title: Kendo UI grid can't be initialized from jquery when angular is present - throws "undefined is not a function"
type: Question
has body: This one is fun... I'm trying to use Kendo UI grid inside my angular app. I have tried using the grid directive but I'll need to manipulate the grid once it's created so I prefer using the jquery+custom directive method. The issue is simple to recreate. Once the html has ng-app, calling $("thegrid").kendoGrid(options) will fail with "undefined is not a function". You can see it live here: http://jsfiddle.net/L3ps7hn2/7/ just remove the ng-app attribute from the parent &lt;div&gt; and it all works properly. I assume this is a bug in the kendo ui code but I was wondering if anyone can think of a workaround for now so I can continue working. Thanks!
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
score: 0
has comment: http://stackoverflow.com/comment/43394906
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43389816
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27481084

http://stackoverflow.com/comment/43175799
type: Comment
comment on: http://stackoverflow.com/a/27361601
has text: I know, but there is multiple versions of jQuery. I think it would be great to know the percentage of user having a jquery cached, and what version(s) of jQuery are cached
type: AnswerComment
score: 1

http://stackoverflow.com/a/57060265
answers question: http://stackoverflow.com/q/27376522
score: 0
type: Answer
has body: I had the same problem, it happened because I was sending 3 objects with the emit I solved it by sending only one object

http://stackoverflow.com/q/27463653
accepted answer: http://stackoverflow.com/a/27463688
has comment: http://stackoverflow.com/comment/43363678
has comment: http://stackoverflow.com/comment/43363518
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43363765
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43363688
has comment: http://stackoverflow.com/comment/43363540
score: 0
has title: Calling a nested object function with a string in jQuery
has answer: http://stackoverflow.com/a/27463688
favorite count: 0
has comment: http://stackoverflow.com/comment/43363500
has comment: http://stackoverflow.com/comment/43363578
possible better answer: http://stackoverflow.com/a/27463697
upvote count: 1
has answer: http://stackoverflow.com/a/27463697
has body: I have this code that works perfectly well on its own : var Person = { getName: function() { alert("Johnny"); } }; var myContext = "Person"; var theCodeToExecute = myContext + ".getName()"; var theFunctionItself = new Function(theCodeToExecute); theFunctionItself(); But when I put it inside jQuery, it stops working. $(document).ready(function() { //Where the code should be. }); I'm aware that very similar questions have been answered, but none of them fixed that precise problem. EDIT : Thanks everyone for the answers. I guess I narrowed down my problem so much that I made my intentions very unclear. Here's a clearer version of what i'm trying to achieve : var Road = { House: function(color, size, neighbor){ this.color = color; this.size = size; this.neighbor = neighbor; } }; Road.House.prototype.getSize = function() { alert(this.size); }; Road.House.prototype.getNeighborSize = function() { var theNeighbor = this.neighbor; var codeToExecute = theNeighbor + ".getSize()"; var tmpFunc = new Function(codeToExecute); tmpFunc(); //this only works when outside of jQuery. }; var house1 = new Road.House("blue", "small", "house2"); var house2 = new Road.House("red", "huge", "house3"); house1.getNeighborSize(); //this successfully returns "huge" when outside of jQuery. Again, this works perfectly well on its own but doesn't work within jQuery, and I need it to work within jQuery because the final version of my functions will use a lot of jQuery code. Thanks again! LAST EDIT : Thanks Felix for your excellent help. There seems to be one final problem. I can only get the size of a neighbor if the neighbor is declared BEFORE the house I'm querying. var house1 = new Road.House("red", "big", house2); var house2 = new Road.House("blue", "huge", house3); var house4 = new Road.House("blue", "small", house4); var house3 = new Road.House("blue", "little", house1); house1.getNeighborSize(); //this doesn't work. house3.getNeighborSize(); //this works Thanks again!!
type: AnsweredQuestion
tagged with: object

session
tags question: http://stackoverflow.com/q/27345202
tags question: http://stackoverflow.com/q/27397372
tags question: http://stackoverflow.com/q/27353541
tags question: http://stackoverflow.com/q/27400635
type: Tag
tag name: session

http://stackoverflow.com/comment/43129224
type: Comment
comment on: http://stackoverflow.com/q/27336071
score: 0
has text: are you creating modal window elements using ajax..
type: QuestionComment

http://stackoverflow.com/a/27470811
answers question: http://stackoverflow.com/q/27465490
type: Answer
has body: The solution was moving my code up after my 4th or 5th input. A problem with Div's maybe?
score: 0

http://stackoverflow.com/a/27429206
answers question: http://stackoverflow.com/q/27429005
has body: as @epascarello said, if you are using jquery, you should use it properly. anyway, here's a pure javascript answer: function getValue() { var value = document.getElementById('tagInput').value; var newValues = document.getElementsByClassName('clickable'); for(var i=0; i &lt; newValues.length; i++) { document.getElementById('tagInput').setAttribute("src","newValues[i].innerHTML"); } } Related Docs
score: 0
type: Answer

http://stackoverflow.com/comment/43274014
has text: "How can I change this script to show the image (classname.png) of any elements with classname, but show nothing if there no image classname.png" in my example if pathToImage is null, I don't show the image. like you ask in your question, doesn't you?
comment on: http://stackoverflow.com/a/27414304
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/27355739
type: Answer
answers question: http://stackoverflow.com/q/27355703
accepted answer of: http://stackoverflow.com/q/27355703
upvote count: 1
has comment: http://stackoverflow.com/comment/43164325
has comment: http://stackoverflow.com/comment/43164240
type: AcceptedAnswer
downvote count: 0
score: 1
has body: length is a property and not a method. Just drop the (): for( i=0; i&lt;eu.length;i++) { alert( eu[i].Country ); } Furthermore, you have an Array of objects, so eu[0][0] does not exists. To output the country, eg., use eu[0].Country or eu[0]['Country']. Besides, your second Array element is null, so you should check for that (or receive an error): for( i=0; i&lt;eu.length;i++) { if( 'Country' in eu[i] ) { alert( eu[i].Country ); } }

http://stackoverflow.com/a/27394864
score: 0
has body: I think the problem is that you are trying to use document.writeln after the document has finished loading. You should only use document.writeln on an open document, once the document becomes closed document.writeln will cause the contents to be erased. This is what is erasing your style sheet. To modify the page after it has loaded, you should do something like this: var div = document.createElement('div'); div.innerHTML = "Some new text here"; Or precreate your elements in your index page and then use them to set the innerHtml: Then in your code: var section = document.getElementById("section"); section.innerHTML = "Some new text goes here";
answers question: http://stackoverflow.com/q/27394701
type: Answer
has comment: http://stackoverflow.com/comment/43333341

http://stackoverflow.com/a/27429348
type: Answer
answers question: http://stackoverflow.com/q/27429150
has comment: http://stackoverflow.com/comment/43300185
score: 0
has body: Try: var imgs = []; var fruits = ["fruit1.png", "fruit2.png", "fruit3.png", "fruit4.png"]; var monsterReady1 = false; for (var i = 0; i &lt; fruits.length; i++) { imgs[i] = new Image(); imgs[i].onload = function() { monsterReady1 = true; }; imgs[i].src = fruits[i]; } var draw = function() { if (monsterReady1) { for (var i = 0; i &lt; fruits.length; i++) { monster1.x = (Math.random() * (canvas.width - 100)); monster1.y = (Math.random() * (canvas.height - 100)); ctx.drawImage(imgs[i], monster1.x, monster1.y); } } } var main = function() { draw(); requestAnimationFrame(main); } main(); I moved the monster.x and monster.y inside the loop.

http://stackoverflow.com/a/27363885
answers question: http://stackoverflow.com/q/27363379
has comment: http://stackoverflow.com/comment/43179743
has body: Before validating your search results, convert the input to upper case letters and then, when comparing it to the rowData, make it upper case as well. // JavaScript Document function doSearch() { //Get the input value as lower case var searchText = document.getElementById('searchTerm').value.toUpperCase(); var targetTable = document.getElementById('dataTable'); var targetTableColCount; //Loop through table rows for (var rowIndex = 0; rowIndex &lt; targetTable.rows.length; rowIndex++) { var rowData = ''; //Get column count from header row if (rowIndex == 0) { targetTableColCount = targetTable.rows.item(rowIndex).cells.length; continue; //do not execute further code for header row. } //Process data rows. (rowIndex &gt;= 1) for (var colIndex = 0; colIndex &lt; targetTableColCount; colIndex++) { rowData += targetTable.rows.item(rowIndex).cells.item(colIndex).textContent; } //If search term (upper case) is not found in row data //then hide the row, else show if (rowData.toUpperCase().indexOf(searchText) == -1) targetTable.rows.item(rowIndex).style.display = 'none'; else targetTable.rows.item(rowIndex).style.display = 'table-row'; } } EDIT: As pointed out in the comments by Jakar, you are better off converting all text to upper case instead of lower case (which I initially recommended) The problem is that some characters might not be converted correctly. Source: http://msdn.microsoft.com/en-us/library/bb386042.aspx
score: 0
type: Answer

http://stackoverflow.com/q/27469551
type: Question
accepted answer: http://stackoverflow.com/a/27469609
tagged with: firefox
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27469635
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27469609
has body: I think it very stupid question, but after hours of google it - i have no idea or solution. Point is that i need reload page after handling "click" event on my web-site. In chrome\opera it's works without problems. But in firefox i have some bug. My JS code with comments: $('#project_create').click(function() { var projectname = $("#project_name").val(); var projectdescription = $("#project_description").val(); $.post("projects/add_project.php", { project_name: projectname, project_description: projectdescription }); $("#create_project_form").hide("slow"); $("#project_list").show("slow"); //return false; - if it uncomment, all work, but next page reloader doesn't work. window.location.reload(); //but if it's work, FireFox doesn't send $.post-query }); I need to work booth methods, because after click - script put in $_SESSION['my_var'] some variable, and it variable is avaliable after reload page only. Maybe there are other ways to do it? As I understand the problem here in features with firefox and preventDefault(); Thanks!
tagged with: php
possible better answer: http://stackoverflow.com/a/27469590
linked to: http://stackoverflow.com/q/4479216
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27469590
has title: Firefox return false; (preventDefault();) and window.location.reload(); together

http://stackoverflow.com/comment/43207127
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27378385
score: 0
has text: I take it that as a general principle for deciphering JSLint message that when you get an unexpected 'something' message you should look *backwards* from that point for potential issues.

http://stackoverflow.com/q/27442994
answer count: 2
has title: Javascript Object watch
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/27443338
accepted answer: http://stackoverflow.com/a/27443437
possible better answer: http://stackoverflow.com/a/27443338
type: AnsweredQuestion
has body: I use the next code for watch changes in javascript object: https://gist.github.com/eligrey/384583 I have a next code for check updates: var Obj = { prop: 0, inc: function() { this.prop ++; } }; Obj.watch('prop', function(prop, oldv, newv) { console.log(prop); console.log(oldv); console.log(newv); }); // on button click i increment prop: $("#btn").on('click', function() { Obj.inc(); }); When i run this code, and click button i get in console: prop 0 1 It's correctly. But, when i click the next time, i get: z undefined NaN Online demo: http://jsbin.com/jenarapufo/2/edit?html,js,console,output Why?
has comment: http://stackoverflow.com/comment/43325617
has answer: http://stackoverflow.com/a/27443437
type: Question

http://stackoverflow.com/comment/43241593
type: Comment
comment on: http://stackoverflow.com/a/27396693
has text: @KashamaShinn you forgot to add jquery to that fiddle (from the dropdown on the left), here's the updated one http://jsfiddle.net/k40rcpbf/3/ note you have the same image there for 1 and 3 so there is a sort of flash between the changes
score: 0
type: AnswerComment

http://stackoverflow.com/a/27449529
upvote count: 1
has comment: http://stackoverflow.com/comment/43337799
score: 1
answers question: http://stackoverflow.com/q/27449360
accepted answer of: http://stackoverflow.com/q/27449360
has body: You have a typo: it should be "userSpaceOnUse" instead of "userSpaceOnUser": .attr("patternUnits", "userSpaceOnUse") // &lt;---- delete last "r" See updated fiddle here. Note that the image you are using for your pattern is only 112 by 63 pixels, and you are stretching it to 300 by 200 pixels. As a result, it will still look slightly blurry. If you shrink it back to 112 by 63 pixels, it will be crystal clear.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43094183
has text: It's a date object, as described in the text
comment on: http://stackoverflow.com/q/27314530
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27405872
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43256664
has comment: http://stackoverflow.com/comment/43256774
type: Answer
has comment: http://stackoverflow.com/comment/43257298
has body: You could use a global variable as a state indicator, like so: JavaScript var isExpanded = false; function myBurger() { document.getElementById("burger").style.height = isExpanded ? "10px" : "200px"; document.getElementById("burger").style.width = isExpanded ? "10px" : "300px"; isExpanded = !isExpanded; } JSFiddle Link demonstrating this, here. I changed a few variables (and the method that it's called) via the JSFiddle, but it's the exact same concept. The line isExpanded = !isExpanded is a bit flip, where we set the isExpanded token to its inverse.
answers question: http://stackoverflow.com/q/27405259
has comment: http://stackoverflow.com/comment/43257406
score: 0
accepted answer of: http://stackoverflow.com/q/27405259

http://stackoverflow.com/q/27466212
score: 0
answer count: 1
tagged with: security
accepted answer: http://stackoverflow.com/a/27466709
type: AnsweredQuestion
has body: Is it possible for a web site that uses either Java or Javascript to accomplish the installation (meaning: not just forced download) of an executable on a client Windows system (Windows 7 or newer) when user clicks on only one link on the website? So in this scenario, the user clicks on a link (e.g. some click-bait link) that is supposed to display some article or a video, on a website. Can this sole single click lead to both a forced download and actual installation of an executable on the users machine? I do not need, nor am I looking for, explicit detail on how this is done. I am more curious of whether this is even possible with the current Windows OS. In this case the user would be using a recent version of one of the following browsers: IE, FF, Chrome, or Opera.
has comment: http://stackoverflow.com/comment/43368462
has title: About a website installing an executable by using Java or JavaScript
type: Question
tagged with: java
has answer: http://stackoverflow.com/a/27466709
tagged with: javascript
tagged with: browser

http://stackoverflow.com/comment/43285146
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27421236
has text: @Barmar, yes i want to reload whole page, or at least to redirect to the same page with another `header`. Changing only `midSection` would be trivial as i already implemented functions to do so =/
type: Comment

http://stackoverflow.com/comment/43297394
type: Comment
type: QuestionComment
has text: On the ng-change I have it also making a calculation with the result shown to the user that I want updated in real time
comment on: http://stackoverflow.com/q/27427807
score: 0

http://stackoverflow.com/comment/43355833
has text: Sorry, but how are you expecting it to work? Your code will not send the actual value of the search field, only the one that exists on window load (probably empty).
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27457426

http://stackoverflow.com/comment/43136428
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27337026
has text: Crossfilter can help aggregate the data, though. Most charting libraries will have about the same performance characteristics because the limiting factor is the number of DOM elements. (The only exception is if you can use canvas rendering, but that's pretty difficult.) You want to find some way to summarize the data, and crossfilter can do it, although it's by no means the only way.

http://stackoverflow.com/comment/43280203
type: AnswerComment
has text: glad it helps kevin. :) You should check console for errors in such situations.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27418460

http://stackoverflow.com/comment/43300497
has text: http://stackoverflow.com/questions/3730159/changing-iframe-src-with-javascript
comment on: http://stackoverflow.com/q/27429479
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27411785
has comment: http://stackoverflow.com/comment/43268069
score: 1
has comment: http://stackoverflow.com/comment/43268137
type: AcceptedAnswer
downvote count: 0
has body: .form_settings option { ... width: 10px; ... } is your culprit. Chrome and IE don't honor most option styling (dag blast them), so it renders as the browser intends it to, but Firefox (it would seem) lets you mess it up all you want. And you have definitely messed it up with the width: 10px;. I would just recommend losing all of your option styles, but that's just my opinion.
answers question: http://stackoverflow.com/q/27397295
has comment: http://stackoverflow.com/comment/43268207
type: Answer
accepted answer of: http://stackoverflow.com/q/27397295
upvote count: 1

http://stackoverflow.com/comment/43131978
type: AnswerComment
type: Comment
has text: Thank you. However now there is a problem with the height. For whatever reason it's about 200px. Also the scroll bar is on the side. Would you happen to know how to fix these problems?
comment on: http://stackoverflow.com/a/27337328
score: 0

http://stackoverflow.com/a/78068791
score: 0
answers question: http://stackoverflow.com/q/27358966
type: Answer
has body: You can set it to an invalid value. In PHP header("X-Frame-Options: ALLOWALL"); this will default to X-Frame-Options not set https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

http://stackoverflow.com/q/27318336
has comment: http://stackoverflow.com/comment/43100282
tagged with: java
has body: I have a dialog box from where I have given a option to upload a file but its not working. I mean request in not going to controller. my code is shown below: My JSP Div content: Content of dialog Box is : Please select a file to upload : Java Script function: Now how i have to use form data to send this request to controller and again i should get a string response in success like uploaded succesfully. I have tried like this but its not working: Because i am not sure what should be the controller code as i got it from a site. if i use what i have mention here i am getting error like incorrect syntax i mean the data send by ajax call to controller is not correct syntactically to accept the form data i.e. so problem with what ajax call is sending and what controller code is expecting. Pls let me know what should be the correct way to implement how to send a file request in ajax call so the controller should get proper data. As saving file code is working fine if i will not use this ajax call files are getting saved properly. Now my controller code: private static final String KDC_FILE_UPLOAD_LOCATION_FOLDER = "/root/Desktop/Upload_Files/"; @RequestMapping(value= "/fileUploadForm",method = RequestMethod.POST) public String handleFileUpload(HttpServletRequest request, @RequestParam CommonsMultipartFile[] fileUpload) throws Exception { System.out.println("finally in controller "); if (fileUpload != null && fileUpload.length > 0) { for (CommonsMultipartFile aFile : fileUpload){ System.out.println("Saving file: " + aFile.getOriginalFilename()); if (!aFile.getOriginalFilename().equals("")) { aFile.transferTo(new File(FILE_UPLOAD_LOCATION_FOLDER + aFile.getOriginalFilename())); } } } // returns to the view "Result" return "File has been Uploaded Successfully"; } Changes in my spring Dispatcher servlet xml file is: i have added below line only as to use multipart Please let me know what is wrong in my code and if we can achieve the same results using some other approach. Spri…
type: Question
answer count: 1
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/27322141
score: 0
has comment: http://stackoverflow.com/comment/43101047
has comment: http://stackoverflow.com/comment/43100500
has title: how to upload any file and save it to a specfic folder in spring mvc
has comment: http://stackoverflow.com/comment/43101754
has comment: http://stackoverflow.com/comment/43098958
has comment: http://stackoverflow.com/comment/43100326
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43101730
tagged with: spring
tagged with: spring-mvc

http://stackoverflow.com/q/27347331
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/16591787
has title: Backbone routes doesn't work with Laravel
type: Question
accepted answer: http://stackoverflow.com/a/27349380
tagged with: javascript
score: 0
answer count: 1
has body: I dont't know exactly where the error/s is/are. I'm doing a Single Page App, this is the context: I have a resource controller in Laravel that watch this route "domain.dev/v1/" Laravel serves the first page/view "/public/views/layouts/application.blade.php" Mustache views are stored under "public/views/" and they are loaded synchronously when they are called by the Backbone Router (I've modified the "app/config/view.php" file to serve the views from bakcbone) In backbone, the Router controls every URI change, even pushstate and the respective Mustache views. Everything seems to work fine, but if you type the direct URI for a user o list or users...you only see JSON returned by the server, not the corresponding Backbone View, in other words, I dont know Which is not doing the correct work, the Laravel Router or the Backbone Router. Or is it a Laravel configuration? This is my code so far: // app/routes.php Route::group(['prefix' =&gt; 'v1'],function (){ Route::resource('users','V1\UsersController'); Route::get('/', function() { return View::make('layouts.application')-&gt;nest('content', 'app'); }); }); // app/controllers/V1/UsersController.php namespace V1; //import classes that are not in this new namespace use BaseController; use User; use View; use Input; use Request; class UsersController extends \BaseController { public function index() { return $users = User::all(['id','email','name']) ; } public function show($id) { $user = User::find($id,['id','email','name']); if(is_null($user)){ return array( 'id' =&gt; 0, 'email' =&gt; 'fake email' ); } return $user; } // public/js/namespaces.js (function(){ window.App = { Models : {}, Collections : {}, Views : {}, Router : {} }; window.Templator = function (mustacheView){ return $.ajax({ url: '/views/'+mustacheView, async : false, type: 'GET', }).responseText; }; window.Vent = _.extend({},Backbone.Events); })(); // public/js/backbone/router.js App.Router = Backbone.Router.extend({ routes : { '' : 'home', 'users' : 'showA…
has comment: http://stackoverflow.com/comment/43154210
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/43150472
has answer: http://stackoverflow.com/a/27349380
tagged with: php
tagged with: laravel

http://stackoverflow.com/q/27472397
has comment: http://stackoverflow.com/comment/43379524
has comment: http://stackoverflow.com/comment/43379332
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43379458
has title: IE 7 Set MaxLength For TextArea Error
has comment: http://stackoverflow.com/comment/43379376
answer count: 0
linked to: http://stackoverflow.com/q/5292235
type: Question
has body: I have HTML and javascript code : My question is : Why this code : $("#test").attr("maxlength", "15"); give me an error : Member not found File: jquery.js, Line: 2582, Column: 4 But this code : $("#test").attr("xxx", "15"); doesn't throw an error. I am using IE 7
tagged with: textarea
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43379438
score: 0
has comment: http://stackoverflow.com/comment/43379633

http://stackoverflow.com/comment/43307565
comment on: http://stackoverflow.com/q/27433075
score: 1
type: Comment
type: QuestionComment
has text: @RocketHazmat Alerting the array would give a list of commas (in FF at least, though I think in other browsers as well). Interestingly `console.log` gave `Array [ <10 empty slots> ]`.

http://stackoverflow.com/comment/43120552
comment on: http://stackoverflow.com/q/27331370
type: Comment
type: QuestionComment
has text: what do you mean by delete?
score: 5

http://stackoverflow.com/q/27422885
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27423029
upvote count: 1
type: Question
tagged with: javascript
has title: HTML Javascript - How to change image dependent on the number
has body: I am making a dice game as an assignment for school and i need some help with it. So i want to change the image to a dice with 1 or 2 points with javascript depending on the number i get back from Math.random does anyone know how to do this here is my code. dice Roll Dice
tagged with: dice
has comment: http://stackoverflow.com/comment/43287889
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/43105251
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27323033
score: 0
has text: check this out: http://www.openjs.com/scripts/strings/setcharat_function.php

http://stackoverflow.com/a/27321035
has comment: http://stackoverflow.com/comment/43101587
has comment: http://stackoverflow.com/comment/43101853
type: Answer
has comment: http://stackoverflow.com/comment/43102004
has comment: http://stackoverflow.com/comment/47482529
has comment: http://stackoverflow.com/comment/43101978
has body: [assuming {{Departure_Date}} is a string, like '04032003'] Almost there. Try [ddmmyyyy].replace(/^(\d{2})(\d{2})(\d{4})$/, '$3-$2-$1'). Alternatively, you can slice up the ddmmyyyy string (see snippet) var res = document.querySelector('#result'); res.innerHTML = 'input: 20052014, output: ' + '20052015'.replace(/^(\d{2})(\d{2})(\d{4})$/, '$3-$2-$1'); // Alternative: var inp = '18072013'; res.innerHTML += '&lt;br&gt;input: 18072013, output: ' + [inp.slice(4), inp.slice(2,4), inp.slice(0,2)].join('-'); &lt;div id="result"&gt;&lt;div&gt;
has comment: http://stackoverflow.com/comment/43101816
answers question: http://stackoverflow.com/q/27320920
score: 0

http://stackoverflow.com/comment/43358727
comment on: http://stackoverflow.com/q/27461172
has text: @vp_arth As mentionned, I already tried `transform-origin` (with `e.clientX`, `e.clientY`) but it did not change anything.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43158091
comment on: http://stackoverflow.com/a/27351928
has text: i have already use class name in querySelector but at run time error occurs: Uncaught TypeError: Cannot read property 'addEventListener' of null
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43122210
type: Comment
score: 0
type: AnswerComment
has text: I want to open files in browser but as `http://localhost/folder/file.php` not as `file:///C:/xampp/htdocs/folder/file.php`
comment on: http://stackoverflow.com/a/27332169

http://stackoverflow.com/q/27464071
duplicate of: http://stackoverflow.com/q/17392857
favorite count: 0
downvote count: 0
has answer: http://stackoverflow.com/a/27469011
linked to: http://stackoverflow.com/q/17392857
has body: I have two chunks of code and they seem to work the same. The only difference between the two is one has Object.create() and the other does not. Am I missing some potential consequence of not using it? First Chunk, does not use Object.create: function Rectangle(width, height) { this.height = height; this.width = width; } Rectangle.prototype.area = function() { return this.width * this.height; }; function Square(side) { Rectangle.call(this, side, side); } Square.prototype = Rectangle.prototype; Square.prototype.constructor = Square; var sq = new Square(5); console.log(sq.area()) Second Chunk, uses Object.create: function Rectangle(width, height) { this.height = height; this.width = width; } Rectangle.prototype.area = function() { return this.width * this.height; }; function Square(side) { Rectangle.call(this, side, side); } Square.prototype = Object.create(Rectangle.prototype); Square.prototype.constructor = Square; var sq = new Square(5); console.log(sq.area())
has title: Relationship between object.create and prototype
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/43364447
has answer: http://stackoverflow.com/a/27464131
tagged with: prototype
accepted answer: http://stackoverflow.com/a/27464131
type: Question
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/27469011
tagged with: javascript

http://stackoverflow.com/comment/43242436
has text: Component doesn't have a `setText` method.
comment on: http://stackoverflow.com/a/27395800
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/27327261
upvote count: 1
type: AnsweredQuestion
score: 1
has body: i have question how to use ng-switch inside ng-repeat and use scope for switch-on ? example : {{item.name}} $scope.submenu : $scope.submenu =[{ name:'Glasba', filter:'music', sub:[{ name:'Koncerti', filter:'Concerts' },{ name:'Klasika', filter:'Clasic' },{ name:'Elektronika', filter:'Elektro' },{ name:'Indy', filter:'Indy' },{ name:'Teater', filter:'Theater' }] }] so the problem is on ng-switch-when = "{{item.filter}}" <-- does not recognize. the output is the same as code ng-swith-when="{{item.filter}}" insted of music. What can i do ? thx for anwsers ! exmaple picture <--upper is menu and udner 50px height is submenu with no content now ...
accepted answer: http://stackoverflow.com/a/27327453
type: Question
tagged with: javascript
tagged with: ng-switch
has title: ng-switch inside ng-repeat Angularjs
answer count: 1
downvote count: 0
tagged with: angularjs-ng-repeat
favorite count: 0
has answer: http://stackoverflow.com/a/27327453
tagged with: angularjs

http://stackoverflow.com/q/27398204
has body: I have a simple if statement below: function calculateTotal() { if (tanksize != 1 || tanksize != 2) { var setupPrice = basicPrice + StatPrice() + DigiStatPrice() + IRPrice() + UVPrice() + cagePrice(); var setupPrice2 = toFixed(setupPrice, 2); } else { var setupPrice = basicPrice; var setupPrice2 = toFixed(setupPrice, 2); } //display the result at the top of page var divobj = document.getElementById('totalPrice'); divobj.innerHTML = "£" + setupPrice2; //display the result at the bottom of page var divobj = document.getElementById('totalPrice2'); divobj.innerHTML = "£" + setupPrice2; } But when the tanksize variable is set to 1 or 2, the setupPrice variable is still calculated by adding the basicPrice + StatPrice...etc.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27398264
accepted answer: http://stackoverflow.com/a/27398246
downvote count: 2
has comment: http://stackoverflow.com/comment/43242202
upvote count: 1
type: Question
tagged with: boolean-operations
tagged with: if-statement
has comment: http://stackoverflow.com/comment/43242225
score: -1
has answer: http://stackoverflow.com/a/27398390
has answer: http://stackoverflow.com/a/27398255
has answer: http://stackoverflow.com/a/27398246
tagged with: javascript
answer count: 6
has title: JavaScript if else statement ignored
favorite count: 0
has comment: http://stackoverflow.com/comment/43243000
has answer: http://stackoverflow.com/a/27398433
has answer: http://stackoverflow.com/a/27398431
has answer: http://stackoverflow.com/a/27398264

http://stackoverflow.com/comment/43260038
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27407575
has text: @PatrickLC I'm using Version 39.0.2171.71 m

http://stackoverflow.com/comment/43259971
has text: it prints foo. and when i pass on it in debug i get this error: `XMLHttpRequest cannot load http://127.0.0.1:1337?mydata=content. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource.VM154:1 E.extend.ajaxMessageScript.js:7 (anonymous function)VM154:1 (anonymous function)VM154:1 (anonymous function)VM154:1 E.extend.eachVM154:1 E.extend.ready` Maybe the problem is in the server side?
comment on: http://stackoverflow.com/q/27405344
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43229131
type: QuestionComment
comment on: http://stackoverflow.com/q/27390374
score: 0
has text: I've got maybe 10 items, maybe 15, maybe 20 etc. I figured if I use margin properties (or iow basic css) there's no way of telling if a particular item is touching a border. Any item touching the bottom or right border needs to have the corresponding property 0px, and when it's potentially 50 items in a grid that's a lot of items that need special treatment. I just figured there's a simpler way that more experienced coders could tell me about.
type: Comment

http://stackoverflow.com/a/27343388
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27343345
answers question: http://stackoverflow.com/q/27343345
type: Answer
has comment: http://stackoverflow.com/comment/43440376
has body: Looks like you're trying to access a string like an array. Your data variable contains a string, thus when you call data[4], you get the 5th character in your string. There's the parseFloat method for parsing your string into a float, if you want it like that.
upvote count: 1
has comment: http://stackoverflow.com/comment/43142242

http://stackoverflow.com/comment/43247907
comment on: http://stackoverflow.com/q/27401535
score: 0
type: Comment
type: QuestionComment
has text: I love this SO-driven development :) Can we see what wrong with your `xhtml` page?

http://stackoverflow.com/q/27411826
favorite count: 0
possible better answer: http://stackoverflow.com/a/27411881
tagged with: angularjs
has answer: http://stackoverflow.com/a/27411893
has title: Detect if checkbox is checked or unchecked in Angular.js ng-change event
has body: I want to detect if a checkbox has been checked or unchecked when a click is happening on the checkbox. This is what I have: &lt;input type="checkbox" ng-model="answers[item.questID]" ng-change="stateChanged()" /&gt; And then in the controller I have: $scope.stateChanged = function () { alert('test'); } I'm able to fire the alert when I do check/uncheck but how can I detect the state of the checkbox? I did research a bit to find a similar issue but I wasn't able to get what I need.
tagged with: checkbox
type: AnsweredQuestion
downvote count: 1
accepted answer: http://stackoverflow.com/a/27411893
type: Question
upvote count: 46
tagged with: javascript
tagged with: angularjs-scope
answer count: 2
score: 45
has answer: http://stackoverflow.com/a/27411881
tagged with: jquery

http://stackoverflow.com/q/27342517
has title: jQuery width returns 0 for even when window is loaded
type: Question
tagged with: width
has body: I am having an issue with a jQuery css('width') value inside a $(window).load function in Chrome and Safari. Normal behaviour: The page loads, visitor hovers an element of the menu, the sub menu appears with correct column widths. Actual bug occurs when: The user accesses the website, doesn't wait until the page is fully loaded to hover a menu item... after a few seconds the sub menu's columns collapse. You can see it live on http://www.pharmagooddeal.fr/beta678/ (use Chrome or Safari). Here is a screenshot: Basically what happens is a JS file kicks in to resize different menu elements on window load. Here is the script's content (I didn't code it myself) : $(window).load(function(){ resizeWidth(); (function($,sr){ // debouncing function from John Hann // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ var debounce = function (func, threshold, execAsap) { var timeout; return function debounced () { var obj = this, args = arguments; function delayed () { if (!execAsap) func.apply(obj, args); timeout = null; }; if (timeout) clearTimeout(timeout); else if (execAsap) func.apply(obj, args); timeout = setTimeout(delayed, threshold || 100); }; } // smartresize jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; })(jQuery,'smartresize'); var TO = false; $(window).resize(function(){ if(TO !== false) clearTimeout(TO); TO = setTimeout(resizeWidth, 400); //400 is time in miliseconds }); function resizeWidth() { var number1=123.15; var number=Math.round(number1).toFixed(2); var menuWidth = 1180; var numColumn = 5; var currentWidth = $("#menu").width()-2; if (currentWidth &lt; menuWidth) { new_width_column = currentWidth / numColumn; $('#menu div.options_list').each(function(index, element) { var options_list = $(this).next(); var span_options_list = options_list.attr('styleWidth'); console.log('Span options list: ' + span_options_list); $(this).width(parseFloat(span_options_list)/menuWidth*numColumn * new…
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43140780
tagged with: jquery
has comment: http://stackoverflow.com/comment/43140672
type: UnansweredQuestion
tagged with: css
answer count: 0
tagged with: google-chrome

http://stackoverflow.com/q/27415462
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27415494
accepted answer: http://stackoverflow.com/a/27415482
has body: I am trying to enter value greater than 0 and less than 100 and i am using the following regex: /^(0+)?(99(\.99?)?|(\.99?)?|\.[0-9]+|0?[0-9](\.[0-9]{0,2})?|(0+)?[0-9][0-9](\.[0-9][0-9]?)?)$/ this regex does not complain about zero but 0.01 is a valid value. Basically, I am trying to get the value in a 00.00 format and it is also acceptable to have values like 0.01, 00.01, ... 99.99 but strictly numbers and dot only. I am using javascript and html
possible better answer: http://stackoverflow.com/a/27415680
type: Question
answer count: 3
has answer: http://stackoverflow.com/a/27415680
has title: Regex to allow decimal numbers greater than 0 and less than 100
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43274925
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
has answer: http://stackoverflow.com/a/27415482
has comment: http://stackoverflow.com/comment/43274947
score: 2
upvote count: 3
downvote count: 1

http://stackoverflow.com/comment/43348491
has text: Sorry, that was a typo, there is a semicolon after, but I am unable to access any functions or variables that are not inherited from the callback data
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27455354
score: 0

http://stackoverflow.com/comment/43157483
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27351466
type: QuestionComment
has text: the video is probably encoded in a format that html5 can't play, only flash or an app...

http://stackoverflow.com/q/27451849
has title: How do I set a countdown's target time to be in a set time zone?
type: Question
tagged with: javascript
tagged with: date
has body: I'm working on a countdown webpage for a huge update on a game that will be a big thing and whatnot. That countdown is working currently with this code getting the times of the computer, the target end time and the time difference: var christmas = new Date("December 25, 2014 00:01:00"); var now = new Date(); var timeDiff = christmas.getTime() - now.getTime(); I need a way to get the christmas target time to be in the same timezone no matter what your computer's timezone is set to.
score: 0
answer count: 2
tagged with: countdown
has answer: http://stackoverflow.com/a/27451950
possible better answer: http://stackoverflow.com/a/27452120
tagged with: time
has answer: http://stackoverflow.com/a/27452120
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27451950

http://stackoverflow.com/q/27319099
downvote count: 0
favorite count: 0
has title: d3.js Sankey Node with a tall image
tagged with: sankey-diagram
has comment: http://stackoverflow.com/comment/43454030
tagged with: d3.js
type: UnansweredQuestion
score: 2
answer count: 0
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/43494418
tagged with: javascript
has body: I am able to append images to a Node; however I am unable to set the height of the image? Any help would be much appreciated. node.append("image") .attr("xlink:href", function(d) { if ( d.id.lastIndexOf("gp_", 0) === 0 ) return "raceflag.jpg"; else if (d.id === "ct_ferrari") return "ferrari.jpg"; else if (d.id === "ct_red_bull") return "redbull.jpg"; else if (d.id === "ct_williams") return "williams.jpg"; else if (d.id === "ct_force_india") return "forceindia.jpg"; else if (d.id === "ct_mclaren") return "mclaren.jpg"; else if (d.id === "ct_mercedes") return "mercedes.jpg"; /* else if (d.id === "dr_nico_rosberg" || d.id === "dr_sebastian_vettel") return "german.jpg"; */ }) .attr("x", 1) .attr("y", 1) .attr("width", sankey.nodeWidth() - 1) .attr("height", 200); //this only positions the image within the node

http://stackoverflow.com/q/27404299
type: Question
has body: Well I have a small piece of JScript code that responsible to download data from a server (binary data as well): var HttpObj = new ActiveXObject("Microsoft.XMLHTTP"); HttpObj.open("GET", serverUrl, false); HttpObj.send(); var responseText = HttpObj.responseText; This code work fine, However, initializing HttpObj as: var HttpObj = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); also works. As I see it, there are quite a few ActiveXObject object that provide HTTP requests API. Question Which ActiveXObject to use? which one is the "best" / latest / most robust / fits most cases? How do I even begin evaluating that?
tagged with: activexobject
tagged with: javascript
tagged with: httprequest
score: 0
has comment: http://stackoverflow.com/comment/43278262
tagged with: jscript
type: UnansweredQuestion
has title: JScript (WSH) get data from server. which ActiveXObject to use
has comment: http://stackoverflow.com/comment/43278416
answer count: 0
linked to: http://stackoverflow.com/q/1163045

http://stackoverflow.com/a/27457268
has comment: http://stackoverflow.com/comment/43351822
has comment: http://stackoverflow.com/comment/43351772
answers question: http://stackoverflow.com/q/27457202
score: 0
has comment: http://stackoverflow.com/comment/43351896
has comment: http://stackoverflow.com/comment/43351708
has comment: http://stackoverflow.com/comment/43351905
type: Answer
has comment: http://stackoverflow.com/comment/43351666
has body: You can see my DEMO CODE You should change function checkUncheckFields: Select User ABC DEF Income / Expense Donations Annual Fees Members Password

http://stackoverflow.com/comment/43292862
has text: i appreciate your help but its not working :( have you and other solutions please ??
type: AnswerComment
comment on: http://stackoverflow.com/a/27425235
score: 0
type: Comment

http://stackoverflow.com/a/55044587
upvote count: 28
type: Answer
has comment: http://stackoverflow.com/comment/111994527
has comment: http://stackoverflow.com/comment/111994152
has comment: http://stackoverflow.com/comment/126410369
has body: This works great for me: const { spawn } = require('child_process') const shell = spawn('sh',[], { stdio: 'inherit' }) shell.on('close',(code)=&gt;{console.log('[shell] terminated :',code)})
answers question: http://stackoverflow.com/q/27458502
score: 28
has comment: http://stackoverflow.com/comment/110048157
downvote count: 0

http://stackoverflow.com/comment/43494418
comment on: http://stackoverflow.com/q/27319099
has text: @VividD I would like to stretch the image to fit the height of the node if possible.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43260450
has text: besides this, *it would give any non-technical user a false idea that the page is still loading*.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27407575

http://stackoverflow.com/comment/43191730
has text: Why do you think it should work?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27369982

http://stackoverflow.com/comment/43271368
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27411878
has text: JK - By any reason I try to shout, even when I am asking my for help.
score: 0

http://stackoverflow.com/comment/43149288
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27341248
has text: @Bonatoc, yes, I parse and concatenate, because it gives me what I need. See my immediate previous comment. The parsing and concatenation works; open the second link in the original post and then look at the source code. This is an asynchronous processing issue. Given that information, do either of you have any suggestions?
score: 0

http://stackoverflow.com/comment/43150738
comment on: http://stackoverflow.com/q/27345520
type: QuestionComment
score: 4
has text: The normal user doesn't typically dig through the source code, and people who would think to dig through the source code to exploit you somehow won't be particularly deterred by obfuscation.
type: Comment

http://stackoverflow.com/a/27431285
type: Answer
answers question: http://stackoverflow.com/q/27413135
score: 0
has body: You can't directly. You'll have to MacGyver some solution. The first problem you'll run into is that you cannot connect directly to a SHOUTcast stream from most browsers. While SHOUTcast is essentially HTTP, there is one small difference that breaks compatibility, especially with more modern clients. A normal HTTP server returns a status line in its response like this: HTTP/1.1 200 OK SHOUTcast servers return this: ICY 200 OK The only way around this (assuming you need to still use SHOUTcast) is to proxy the data server-side while rewriting the response status line. The next problem is that SHOUTcast/Icecast streams use a codec, usually MP3 or AAC in ADTS, to compress the audio into bandwidth suitable for internet streaming. The Web Audio API deals with floating point PCM samples. You will have to decode the audio stream. While this can often be done in-browser, it depends on the codec you're using. Otherwise, you'll have to do it server-side at which point you might as well do the spectrum analysis server side and stream frequency band values. I think that the best way to handle this is to get your stream playing in an audio element or object and use that as a Web Audio API node which is then connected to your analyser node to get the spectrum. You'll want to use Icecast for your server, and you will have to transcode your streams to a couple codecs to get broader browser support.

http://stackoverflow.com/q/27460721
type: Question
tagged with: turbolinks
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I'm using Director.js in our application along with Turbolinks. It works perfectly fine when changing the hash, but when using the browser back button (which should just change the hash back to the previous hash, and trigger the relevant Director.js route), Turbolinks takes over and replaces the body causing everything to break. Is there any way to opt out of Turbolinks when changing the window hash with window.location.hash? EDIT: After more Googling, I've found Turbolinks causes issues with other JS routers as well (eg. Backbones's router). I've not found a working solution yet. My JS looks as follows: var new_item_js = function(){ if (signup_routes_defined == false) { var step1 = function() { console.log('step one functions go here.'); }; var step2 = function() { console.log('step two functions go here.'); }; var routes = { 'new_item_step_1': step1, 'new_item_step_2': step2 }; var signup_router = Router(routes); signup_router.init(); signup_routes_defined = true; } $(document).on('page:load ready', new_item_js);
answer count: 1
tagged with: hash
has answer: http://stackoverflow.com/a/27506532
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
score: 1
has title: Director.js and Turbolinks - changing the window hash and using then back

http://stackoverflow.com/a/27320214
accepted answer of: http://stackoverflow.com/q/27318516
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43203929
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43100067
score: 1
has body: I think you don't really need to store entries in the array in order to get incremental ids, just use the element index relative to the current selection. Also, I made a few cosmetic improvements and added a callback to your loadVideo function, so the image is hidden just after the video is loaded. var videoData = [{ 'player_id':'video1', 'url':'http://vimeo.com/87701971', 'width':'1000' }, { 'player_id':'video2', 'url':'http://vimeo.com/73893277', 'width':'1000' }]; function loadVideo($target, ix, next){ return function() { var video = videoData[ix]; var path = 'http://www.vimeo.com/api/oembed.json?'+ Object.keys(video).map(function(key){ return key + '=' + video[key]; }).join('&amp;')+ 'api=1&amp;byline=0&amp;color=ffffff&amp;title=0&amp;callback=?'; $.getJSON(path, function(data){ $target.find('.video-container').html(data.html); $target.closest('iframe').load(function(){ $f(player).addEvent('ready', function(id){ var vimeoVideo = $f(videoid); next(); }); }); }); }; } $(function(){ $('.video-container').each(function(ix){ var $cont = $(this), $par = $cont.parent(); var attr = $cont.attr('data-video'); if (typeof attr !== typeof undefined &amp;&amp; attr !== false) { $par.one('click', loadVideo($par, ix, function(){ $container.find('.b-studio__image').hide(); })); } }); });
answers question: http://stackoverflow.com/q/27318516

http://stackoverflow.com/a/27408882
has comment: http://stackoverflow.com/comment/43264412
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27407474
downvote count: 0
answers question: http://stackoverflow.com/q/27407474
has body: Don't use with: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with Access your div by id. http://jsfiddle.net/ymeejLzb/
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/43170481
has text: I'd considered to change the data to an array of numbers, though you can convert the string you have to a such as well.
comment on: http://stackoverflow.com/q/27358923
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27384356
has comment: http://stackoverflow.com/comment/43217936
has comment: http://stackoverflow.com/comment/43217863
has comment: http://stackoverflow.com/comment/43218031
downvote count: 1
has comment: http://stackoverflow.com/comment/43217645
has comment: http://stackoverflow.com/comment/43217556
has comment: http://stackoverflow.com/comment/43217722
has comment: http://stackoverflow.com/comment/43217461
score: 1
upvote count: 2
answers question: http://stackoverflow.com/q/27384145
has comment: http://stackoverflow.com/comment/43217675
has comment: http://stackoverflow.com/comment/43217308
has comment: http://stackoverflow.com/comment/43217568
has body: It would be better to add your submit code inside a function: app.controller('formCtrl',[$scope, function('$scope'){ $scope.submit = function() { alert('submit'); }; }]); then in your ng-submit directive use submit() as per documentation you can also use ng-change and ng-click directives to update the models then do whatever with the models. Further to the comments about accessing the data from the inputs: When you add the ng-model attribute to an input you are saying I would like data from this input to be stored in ng-models name. Adding this to an input: ng-model="inputvalue.input1" would enable you to store data kind of like the following: inputvalue = { input1 : "Input value would go here" } note the names are the same for a reason. You can then set up those objects to be stored/accessed inside the controller using $scope look at the docs on AngularJS website - take your time and get to know what's going on.
type: Answer
has comment: http://stackoverflow.com/comment/43218089

http://stackoverflow.com/comment/43286421
comment on: http://stackoverflow.com/q/27420567
has text: so your problem is solved?
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27439105
score: 0
type: Answer
answers question: http://stackoverflow.com/q/27371446
has body: you can make some millisecond operations function getNewDate(start,num_of_days){ var newTime = num_of_days * 24 * 60 * 60 * 1000 + start.getTime(); undefined var newDate = new Date(newTime); return newDate; } endDate.setDate(getNewDate(booking_from,days)); or $('.duration').change(function(){ var days = $(this).val(); var booking_from= $( "#datetimepicker1" ).datepicker( "getDate" ); var endDate = new Date(Date.now() + days * 24 * 60 * 60 * 1000); $('#datetimepicker2').datepicker('setDate', endDate); });

http://stackoverflow.com/q/27386034
type: Question
tagged with: javascript
tagged with: jquery
has title: IE: First list item smaller than rest
has answer: http://stackoverflow.com/a/27386204
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/43220370
has answer: http://stackoverflow.com/a/27386457
has body: Any thoughts? The first list item is being squished, but only by IE. All of the other browsers are happy. http://dev.torontofamilytherapist.com/services/
favorite count: 0
has comment: http://stackoverflow.com/comment/43220342
tagged with: css
accepted answer: http://stackoverflow.com/a/27386204
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27386357
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/27386357
tagged with: wordpress
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/27380763
has comment: http://stackoverflow.com/comment/43211302
type: AnsweredQuestion
has title: Insert canvas context to html string in new dynamically created window html
accepted answer: http://stackoverflow.com/a/27478550
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/27478550
tagged with: javascript
tagged with: jquery
score: 0
tagged with: canvas
tagged with: google-chrome-extension
has body: I have created a chrome extention to take full page screen shot. It is working fine while openening Image element in new window. But I need to display image in Canvas element to allow editing in canvas. Here is the code for event listener of chrome.tabs.CaptureTab : background.js chrome.runtime.onMessage.addListener( function(request,sender,sendResponse) { if(Array.isArray(request.image)) { var canvas = document.createElement('canvas'), context = canvas.getContext('2d'), image, done = 0; canvas.width = request.width; canvas.height = request.height; for(var i = 0; i < request.image.length; i++) { (function(i) { image = new Image(); image.onload = function() { context.drawImage(this, 0, request.image[i].position, this.width, this.height); if(++done == request.image.length) { screenshot = canvas.toDataURL('image/png'); var htmlCode = " Image here: End Image "; var url = "data:text/html," + encodeURIComponent(htmlCode); chrome.tabs.create({url: url}); } } image.src = request.image[i].image; })(i); } } else { var htmlCode = " Image here: End Image "; var url = "data:text/html," + encodeURIComponent(htmlCode); chrome.tabs.create({url: url}); return; } }); Now, I tried : var htmlCode = " Image here: End Image " + canvas + " "; It Gives : [object HTMLCanvasELement] I need to embed this canvas element while creating the chrome tab
answer count: 1

http://stackoverflow.com/comment/43294825
type: AnswerComment
has text: Another thing... is it possible to speed up the animation of each question opening/closing to the same speed as the 'open/close all'?
type: Comment
comment on: http://stackoverflow.com/a/27383743
score: 0

http://stackoverflow.com/a/27328680
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27328293
answers question: http://stackoverflow.com/q/27328293
type: Answer
downvote count: 0
has body: OK, first multiple commands can be used, separated by semicolons; However, it is generally not recommended ... you might try creating a master function or a series of them so that only one function has to be mentioned in the HTML code. Then, you don't need to create the variables ... try this Some item ... then, the executeFunction would be like this ... function executeFunction(item) { document.getElementById("div1").style.display='none'; document.getElementById("div2").style.display='none'; document.getElementById("div3").style.display='none'; document.getElementById("div4").style.display='none'; switch(item){ case "item1": document.getElementById("div1").style.display='block'; break; case "item2": document.getElementById("div2").style.display='block'; break; case "item3": document.getElementById("div3").style.display='block'; break; case "item4": document.getElementById("div4").style.display='block'; break; } }
score: 1
upvote count: 1

http://stackoverflow.com/q/27426368
type: Question
has answer: http://stackoverflow.com/a/27426516
has body: I have some tabs that I'm using as navigation and it's working fine apart from one bit of functionality, The tabs are closed by default and only open once clicked, what I want is to be able to click on the tab again to close the panel with the content. I know this will probably be really easy but I'm not a jQuery developer so I'm struggling a bit. Here is the Javascript: $(document).ready(function () { $('ul.tabs li').click(function () { var tab_id = jQuery(this).attr('data-tab'); $('ul.tabs li').removeClass('current'); $('.tab-content').removeClass('current'); $(this).addClass('current'); $("#" + tab_id).addClass('current'); }) }) you can see the full working tabs JSFiddle
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27426516
has answer: http://stackoverflow.com/a/27426433
accepted answer: http://stackoverflow.com/a/27426433
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: jQuery click tab to open and close
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/27405172
has comment: http://stackoverflow.com/comment/43255324
score: 0
has comment: http://stackoverflow.com/comment/43255411
accepted answer: http://stackoverflow.com/a/27405411
has comment: http://stackoverflow.com/comment/43255302
type: Question
has comment: http://stackoverflow.com/comment/43255113
has comment: http://stackoverflow.com/comment/43255363
has comment: http://stackoverflow.com/comment/43255405
has comment: http://stackoverflow.com/comment/43255277
has comment: http://stackoverflow.com/comment/43255235
linked to: http://stackoverflow.com/q/1470488
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43255106
has comment: http://stackoverflow.com/comment/43255457
has body: If I remove "var", the browser(Chrome) complains : "someVar is not defined" var someVar = someVar || {}; From what I know, it should complain only if I am not initializing the variable.
has comment: http://stackoverflow.com/comment/43255225
has title: Why does a conditional variable initialization need "var"?
has comment: http://stackoverflow.com/comment/43255020
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27405411
has comment: http://stackoverflow.com/comment/43255168

http://stackoverflow.com/q/27460723
upvote count: 1
type: Question
tagged with: google-visualization
accepted answer: http://stackoverflow.com/a/27461524
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
favorite count: 0
has body: i try to get image of a three axial google chart but don't display any line chart , like below : http://chart.googleapis.com/chart?chxt=x,y,r&amp;chxr=1,734238,882088|2,993,1431&amp;cht=lc&amp;chd=t:850751,852364,828412,801830,772874,734238,768322,804502,844117,882088,839063,832920|&amp;1364,1431,1380,1263,1168,1093,993,1099,1285,1261,1330,1261,1175&amp;chco=76A4FB&amp;chls=2.0&amp;chs=200x125 we have three axial and different range numbers and want to show this two data series in one google line chart image
has title: draw a google line chart with three axial
has answer: http://stackoverflow.com/a/27461524
type: AnsweredQuestion

http://stackoverflow.com/q/27388413
linked to: http://stackoverflow.com/q/2490825
has answer: http://stackoverflow.com/a/27390402
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43224753
upvote count: 2
has comment: http://stackoverflow.com/comment/43224979
has comment: http://stackoverflow.com/comment/43225852
type: Question
has comment: http://stackoverflow.com/comment/43225030
score: -2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27390402
linked to: http://stackoverflow.com/q/8838648
has comment: http://stackoverflow.com/comment/43224813
answer count: 2
downvote count: 4
has answer: http://stackoverflow.com/a/27388456
tagged with: jquery
has title: jQuery to pure JS conversion does not work
favorite count: 0
has comment: http://stackoverflow.com/comment/43225032
possible better answer: http://stackoverflow.com/a/27388456
has body: Lately, I've been trying to use pure JavaScript instead of jQuery. As I've read more and more about pure JS, I didn't think it was that hard, or that much of a difference in the actual code, and of course it's a little bit faster. This was until today, when I converted a whole 70-line script from jQuery to JavaScript, and although I've checked my new code for errors on jslint.com, it won't work. Before posting the code, and the difference, what I essentially did was to convert .on("change" with .addEventListener("change" along with replacing other jQuery functions and selectors. Part of the working jQuery code: jQuery("form.abo input").change(function() { if(jQuery("#likerdudanse input[value='ja']").is(":checked") || jQuery("form input[value='Tilknyttet en danseklubb']").is(":checked")) { jQuery("#jeglikerdanse").removeAttr("style"); if(jQuery("form input[value='Tilknyttet en danseklubb']").is(":checked")) { jQuery("#likerdudanse").hide(); } else { jQuery("#likerdudanse").removeAttr("style"); } } else { jQuery("#jeglikerdanse").hide(); jQuery("#likerdudanse").removeAttr("style"); } if(jQuery("form fieldset:first-child input[value='bestille et abonnement']").is(":checked")) { jQuery("#hardukode").removeAttr("style"); jQuery("#tskjorte").removeAttr("style"); if(jQuery("#hardukode input[value='ja']").is(":checked")) { jQuery("#hardukode label:last-of-type, #hardukode br, #hardukode &gt; input:last-of-type").removeAttr("style"); jQuery("#tskjorte").hide(); } else { jQuery("#hardukode label:last-of-type, #hardukode br, #hardukode &gt; input:last-of-type").hide(); jQuery("#tskjorte").removeAttr("style"); } if(jQuery("#tskjorte input[value='ja']").is(":checked")) { jQuery("#tskjorte #i, #tskjorte #j, #tskjorte label[for='i'], #tskjorte label[for='j'], #tskjorte br").removeAttr("style"); } else { jQuery("#tskjorte #i, #tskjorte #j, #tskjorte label[for='i'], #tskjorte label[for='j'], #tskjorte br").hide(); } } else { jQuery("#hardukode").hide(); jQuery("#tskjorte").hide(); }…

http://stackoverflow.com/q/27366010
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27366515
favorite count: 0
possible better answer: http://stackoverflow.com/a/32404242
has answer: http://stackoverflow.com/a/32404242
score: 2
upvote count: 2
has body: I'm struggling with the "Great-great-great-great-..." example from the Higher Order Functions chapter in Eloquent JS. I don't understand how one of the functions creates a value from an object only containing ancestry data. Here are the functions: function reduceAncestors(person, f, defaultValue) { function valueFor(person) { if (person == null) return defaultValue; else return f(person, valueFor(byName[person.mother]), valueFor(byName[person.father])); } return valueFor(person); } and function sharedDNA(person, fromMother, fromFather) { if (person.name == "Pauwels van Haverbeke") return 1; else return (fromMother + fromFather) / 2; } I don't understand how valueFor(byName[person.mother]) generates a numerical value from an object like this: "Carolus Haverbeke" : { "name": "Carolus Haverbeke", "sex": "m", "born": 1832, "died": 1905, "father": "Carel Haverbeke", "mother": "Maria van Brussel"}
has answer: http://stackoverflow.com/a/27366515
type: Question
type: AnsweredQuestion
answer count: 2
has title: Great-great-great-great-... Example - Eloquent JS
downvote count: 0

http://stackoverflow.com/q/27408612
has comment: http://stackoverflow.com/comment/59377288
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/60649902
favorite count: 0
tagged with: hammer.js
tagged with: angularjs
has body: In using the ryan mullins fork of angular-hammer, I'm not clear on how to wire up several recognizers with requireFailure via the hmRecognizerOptions attribute... if it's even possible. My perusal of the source left me with the impression it could be done, but I'm having a problem with sequencing the creation of the recognizers on a given element. To see the problem firsthand, take the existing default demo, and add the following hm-recognizer-options attribute, &lt;div id="target" ng-controller="hmCtrl" hm-pan="onHammer" hm-pinch="onHammer" hm-press="onHammer" hm-rotate="onHammer" hm-swipe="onHammer" hm-tap="onHammer" hm-doubletap="onHammer" hm-recognizer-options='[ {"type":"pan","requireFailure":"swipe"} ]'&gt; {{eventType}} &lt;/div&gt; (Also, see this plunker: http://embed.plnkr.co/3sJFrC/preview and the resulting error in the console) My hope was this would cause pan to be recognized only after swipe fails. However, stepping through the code reveals that the swipe recognizer has not been instantiated when pan is trying to reference it during the requireFailure call. It's also not clear how this would ever work since it appears requireFailure (in HammerJS) automatically creates the reverse reference as well, via the otherRecognizer.requireFailure(this) line near the end of the method, /** * recognizer can only run when an other is failing * @param {Recognizer} otherRecognizer * @returns {Recognizer} this */ requireFailure: function(otherRecognizer) { if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) { return this; } var requireFail = this.requireFail; otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); if (inArray(requireFail, otherRecognizer) === -1) { requireFail.push(otherRecognizer); otherRecognizer.requireFailure(this); } return this; } In short, it appears both recognizers have to be instantiated before calling requireFailure, but angular.hammer.js treats the hm-recognizer-options on creation of each recognizer. Am i missing a…
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
type: Question
has title: Can angular-hammer (ryan mullins fork) wire up recognizers with `requireFailure`?

http://stackoverflow.com/comment/43307546
type: QuestionComment
has text: Please read [the documentation](https://developers.google.com/maps/documentation/javascript/reference#Map). google.maps.Map.setCenter takes a [google.maps.LatLng](https://developers.google.com/maps/documentation/javascript/reference#LatLng) or a [LatLngLiteral](https://developers.google.com/maps/documentation/javascript/reference#LatLngLiteral) as an argument.
comment on: http://stackoverflow.com/q/27432919
score: 0
type: Comment

http://stackoverflow.com/a/47515234
upvote count: 2
answers question: http://stackoverflow.com/q/27316888
score: 2
downvote count: 0
has body: This likely means you have recursivety somewhere in your code. Since V8 removed support for TCO (Tail Call Optimization) the call size will grow until it explodes. Using --stack_size would seem like a natural solution, but it doesn't actually increase the stack size, it is tells V8 to assume there is a bigger stack size when in reality this is controlled by the OS. Sources: https://github.com/nodejs/node-v0.x-archive/issues/5669 https://github.com/nodejs/node/issues/6360 Node.js tail-call optimization: possible or not? So for now ( with Node.js 8.x ) the best solution is simple to stop using recursive functions.
type: Answer

http://stackoverflow.com/comment/43295580
score: 0
comment on: http://stackoverflow.com/q/27411927
type: Comment
type: QuestionComment
has text: cross looking at the code of emirplicanic.com, you should change the frame element from rect to path and draw it with the expected arrow, something like: "M25,15 q 0,-5 5,-5 l 90,0 q 5,0 5,5 l 0,30 q 0,5 -5,5 l -90,0 q -5,0 -5,-5 l 0,-5 -14.1,-10 14.1,-10z" (this is relative to the rectangle)

http://stackoverflow.com/a/27341094
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43138408
upvote count: 2
answers question: http://stackoverflow.com/q/27340910
has body: Strings, Booleans and Numbers are passed by value in javascript. You could however wrap targetVariable in an object which would be passed by reference. ctx.target = JSON.parse(data); actually just sets a value for the key target in the ctx object, which would be the window object in your case. It has nothing to do with the parameter target that you pass in as a parameter to your function. Also your assignDataTo() function runs asynchronously, so calling valueOf(targetVariable) is not going to work, since the Promise is probably not going to be resolved yet ie. the result of the XHR has not arrived yet. A better solution would be something like this. function assignDataTo(url) { // Return a Promise return getJSON(url) .then(function(data) { //resolve the Promise with this value return JSON.parse(data); }, function(error) { console.log(error); } ); } var targetVariable; //wait for the Promise to be resolved and then assign the variable and do whatever with it assignDataTo(url).then(function(result) { targetVariable = result; valueOf(targetVariable); });

http://stackoverflow.com/comment/43254658
type: QuestionComment
comment on: http://stackoverflow.com/q/27403426
has text: so implement `compatibleTypes` as [_filter_](https://docs.angularjs.org/guide/filter)
score: 0
type: Comment

http://stackoverflow.com/comment/43367682
type: QuestionComment
type: Comment
has text: See, only name1 is there, Do you think that is there anything with parent div and this kinda of #$%$? Cause I saw on other thread that the generated field weren't even inside the . See http://pastebin.com/VpWq0x43
comment on: http://stackoverflow.com/q/27465490
score: 0

http://stackoverflow.com/comment/43184449
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27364805
has text: You could do it with a pub/sub pattern. Fire an event with the response comes back from a post/put/del request, and have listeners in the services wait for them then do GET request.
score: 0

http://stackoverflow.com/comment/43097858
comment on: http://stackoverflow.com/q/27319245
type: Comment
score: 0
has text: @enhzflep Believe me that I did, but each time that I've tried to implement it, the image got messed up
type: QuestionComment

http://stackoverflow.com/comment/43186605
comment on: http://stackoverflow.com/q/27365369
has text: Do you have to change the color for each letter, or for each word?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27391546
has comment: http://stackoverflow.com/comment/43231964
type: Answer
has body: Since you're sending a request as post, its important to add this on your XMLHttpRequest object: xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); And just combine them inside, no need to separate some parts. It would look something like this: Here's what it would look like Obligatory Note: Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial. Ref: https://stackoverflow.com/a/12860140/3859027 You should consider also (if you're using PHP 5.5 or greater) to use PHP's native password hashing and replace that md5() instead. If you're below v5.5 then you could use the its compatibility pack
accepted answer of: http://stackoverflow.com/q/27391404
score: 0
answers question: http://stackoverflow.com/q/27391404
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43232162

http://stackoverflow.com/a/27339339
has comment: http://stackoverflow.com/comment/43149663
has comment: http://stackoverflow.com/comment/43135432
downvote count: 0
has comment: http://stackoverflow.com/comment/43154972
score: 1
has comment: http://stackoverflow.com/comment/43135411
accepted answer of: http://stackoverflow.com/q/27337953
has body: Just tested your code and it works fine. I think you might be missing your url parameter. It should be http://localhost:3000/1 - or whatever ID you're trying to retrieve. Try it out. Also, you should pass the extended option to your bodyParser.urlencode method: express throws error as `body-parser deprecated undefined extended` Edit: To specifically answer your question about defining request parameters. You don't have to do anything to define request parameters other than make sure that you're passing in the correct URL. Express takes care of parsing the URL and defining the request parameters for you. So, if you go to the URL http://localhost/jimbob on your server then the value passed in for the id parameter will be available as req.params.id. See this link on request parameters for more info. Edit 2: You could try debugging your app to see what you get. Here's a link on how to enable debugging in Express and how to use node-inspector for debugging. I saw that your running this on Ubuntu. So, there may be something weird there that I'm not aware of. (I'm running it on a Mac.) I would also check the version of Node that you're running on the computer(s) that the app works on and check the version of Node on your Ubuntu environment (or whatever computers the app doesn't work on).
answers question: http://stackoverflow.com/q/27337953
has comment: http://stackoverflow.com/comment/43172475
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/70959658
type: Answer

http://stackoverflow.com/comment/43108343
has text: possible duplicate of [Interpolation in JavaScript](http://stackoverflow.com/questions/6644618/interpolation-in-javascript)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27324603
type: QuestionComment

http://stackoverflow.com/comment/46014061
has text: Still no news about that?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27444179

http://stackoverflow.com/q/27346387
upvote count: 2
has comment: http://stackoverflow.com/comment/43148171
has body: It's not recommended to send a lot of bytes between processes in Node, proven here: https://stackoverflow.com/a/27327402/2440515 Node first JSON.stringify the object. How can I actually measure a size of a string to avoid transferring to much data? Is length equal to bytes?
tagged with: node.js
has answer: http://stackoverflow.com/a/27346777
type: AnsweredQuestion
has title: How can I measure a size of javascript string?
linked to: http://stackoverflow.com/q/5515869
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43148404
accepted answer: http://stackoverflow.com/a/27346777
linked to: http://stackoverflow.com/q/27321392
score: 2
has comment: http://stackoverflow.com/comment/43147923
favorite count: 0

http://stackoverflow.com/q/27339132
linked to: http://stackoverflow.com/q/2904131
has answer: http://stackoverflow.com/a/27339150
tagged with: javascript
has answer: http://stackoverflow.com/a/27339239
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27339150
has answer: http://stackoverflow.com/a/27339149
tagged with: arrays
has body: So I am trying to create a variable that grabs the type_name from an array. Here is my array. var customIcons = { ItemI: { icon: 'http://...' type_name: 'East' }, ItemII: { icon: 'http://...' type_name: 'West' }, ItemIII: { icon: 'https:...' type_name: 'North' }, question: { icon: 'https:...' type_name: 'South' } } Here is the variable I am trying to create. I know the php is passing in correctly, but I do not know why it is not grabbing the appropriate type_name from the array: var buttonText= customIcons[&lt;?php echo $type; ?&gt;].type_name; I am getting a cannot read property 'type_name' of undefined when I try to use the variable. Sincere thanks for any help! It is greatly appreciated.
has comment: http://stackoverflow.com/comment/43136315
has title: Grabbing from Javascript array
type: Question
accepted answer: http://stackoverflow.com/a/27339149
has comment: http://stackoverflow.com/comment/43134818
has comment: http://stackoverflow.com/comment/43136191
has comment: http://stackoverflow.com/comment/43134793
has comment: http://stackoverflow.com/comment/43142574
has comment: http://stackoverflow.com/comment/43134904
score: 0
answer count: 3

http://stackoverflow.com/q/27427819
tagged with: http://stackoverflow.com/tag/html
has title: MVC4: Sending checkbox values as HtmlAttributes when button is clicked
tagged with: asp.net-mvc-4
type: AnsweredQuestion
type: Question
has body: I've got an a list of checkboxes on my MVC4 webpage that are generated like this: @Html.Label("Type de service") @foreach (var serviceType in Model.ServiceTypeList) { @Html.CheckBox(serviceType.ServiceTypeId.ToString(CultureInfo.InvariantCulture)) @serviceType.Description } @Html.Label("Type d'application") @foreach (var appType in Model.ApplicationTypeList) { @Html.CheckBox(appType.ApplicationId.ToString()) @appType.ApplicationName } What I want to do now is to send a dictionary for each one of the two lists of checkboxes back to the server when a button is clicked, containing a key/value pair with the ID of the checkbox and a boolean as it's value: @using (Html.BeginForm("Filter", "Customer", FormMethod.Post, new Dictionary<string, bool> {})) { } What is the best way to obtain dynamically the values of both of the lists and send them to the server ?
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43313535
has answer: http://stackoverflow.com/a/27428158
accepted answer: http://stackoverflow.com/a/27428158

three.js
tags question: http://stackoverflow.com/q/27331935
tag name: three.js
tags question: http://stackoverflow.com/q/27375795
tags question: http://stackoverflow.com/q/27414701
tags question: http://stackoverflow.com/q/27321774
tags question: http://stackoverflow.com/q/27368184
tags question: http://stackoverflow.com/q/27316157
tags question: http://stackoverflow.com/q/27348635
tags question: http://stackoverflow.com/q/27353745
tags question: http://stackoverflow.com/q/27365814
tags question: http://stackoverflow.com/q/27433121
type: Tag
tags question: http://stackoverflow.com/q/27330789
tags question: http://stackoverflow.com/q/27422549
tags question: http://stackoverflow.com/q/27318854
tags question: http://stackoverflow.com/q/27335186
tags question: http://stackoverflow.com/q/27403515
tags question: http://stackoverflow.com/q/27322720
tags question: http://stackoverflow.com/q/27383979
tags question: http://stackoverflow.com/q/27424250
tags question: http://stackoverflow.com/q/27410475
tags question: http://stackoverflow.com/q/27409074
tags question: http://stackoverflow.com/q/27389801
tags question: http://stackoverflow.com/q/27352407
tags question: http://stackoverflow.com/q/27467494

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/27374616
tag name: sequelize.js

http://stackoverflow.com/a/27450512
has comment: http://stackoverflow.com/comment/43341316
has comment: http://stackoverflow.com/comment/43348251
has comment: http://stackoverflow.com/comment/43341376
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43339625
has comment: http://stackoverflow.com/comment/43340672
has comment: http://stackoverflow.com/comment/43341229
answers question: http://stackoverflow.com/q/27450442
has body: I think it would be better to select by class and add that class to the image .backImage { background-image: url("img/level1.jpg"); background-repeat: repeat-y; } Javascript Code: var obstcar = $("&lt;image&gt;").addClass('backImage') Though thinking about it, Im not quite sure why an &lt;img&gt; element would have a background image? Maybe var obstcar = $("&lt;div&gt;").addClass('backImage') would be better Edit following your comment: To create an the canvas you need an image object with the source attribute as the image so lets make a temporary element and assign the css class to it var tmp= $("&lt;div&gt;").addClass('backImage') Then get the image source: var src = tmp.css('background-image'); Create the image element var obstcar = new Image(); obstcar.src = src Get the context var canvas=$("#myCanvas"); var ctx=canavas.getContext("2d"); Paint the canvas ctx.drawImage(obstcar, -(obstcar.width / 2), -(obstcar.height / 2));
type: Answer
has comment: http://stackoverflow.com/comment/43340843
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27450442

http://stackoverflow.com/a/27316755
type: Answer
downvote count: 0
score: 1
has body: Instead of looping through all divs, you can assign a class lets say hovered to the div when hovering and when you hover to another div then find previosly hovered div using class=hovered and remove class with animation. And add class=hovered to currently hovering elemnt. See below code - $(".partenaires-aside").mouseover(function () { //find previosly hovered div using $(".hovered") $(".hovered").each(function () { $(this).delay( 800 ).animate({'width':'24%'}, 500); $(this).animate({'margin-left':'0%'}, 500); $(this).find("p").hide("slow"); //remove hovered class $(this).removeClass('hovered'); }); $(this).animate({'margin-left':'30%'}, 500); $(this).animate({'width':'60%'}, 500); $(this).find("p").show("slow"); //add hovered class $(this).addClass('hovered'); });
upvote count: 1
has comment: http://stackoverflow.com/comment/43094277
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27316625
answers question: http://stackoverflow.com/q/27316625
has comment: http://stackoverflow.com/comment/43095280

text-indent
tag name: text-indent
tags question: http://stackoverflow.com/q/27446141
type: Tag

http://stackoverflow.com/comment/43331908
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27446139
has text: @HifzurRahman happy to help. :) If this helped, please mark the answer as Accepted if and when you get the chance. Thanks!

http://stackoverflow.com/q/27408668
tagged with: visual-studio
has body: I'm an ASP.NET developer and I haven't tried debugging JavaScript in a while and thought I'd try it out again. In general, it's a pretty nice experience, it's nice having the "go to definition" like in C#. However, I'm trying to figure out where a variable is getting set in my call stack. I go up a couple levels in my call stack and I get to a big ugly chunk of minified JavaScript. I don't see anyway to pretty print this like I can do with the IE Developer tools so I can figure out where I am. Is there anyway to do this in Visual Studio 2013? Thanks, Eric
score: 3
has title: Pretty print JavaScript code in Visual Studio 2012 while debugging
answer count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/43295719
type: Question
tagged with: javascript
downvote count: 0
tagged with: asp.net
favorite count: 0
tagged with: visual-studio-2013
type: UnansweredQuestion

http://stackoverflow.com/q/27365628
has body: Is it possible to use ngChecked on a checkbox that you want to have deselect all other checked checkboxes. Below is an example of what I'd like to do except that the functionality selects all I want to deselect all http://plnkr.co/edit/iseIU1OIjocW4nXTN6ru?p=preview Example - example-example54-production Check me to select all:
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27366391
has comment: http://stackoverflow.com/comment/43183336
score: 0
answer count: 1
tagged with: angularjs
tagged with: checkbox
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27366391
has comment: http://stackoverflow.com/comment/43184150
has title: ngChecked to deselect checkboxes
type: Question
has comment: http://stackoverflow.com/comment/43184045

http://stackoverflow.com/comment/43126342
comment on: http://stackoverflow.com/a/27327948
score: 0
type: AnswerComment
type: Comment
has text: Okay sorry I'm having trouble understanding? So it works well in your plunkr but not the actually code?

http://stackoverflow.com/a/27354421
score: 0
answers question: http://stackoverflow.com/q/27354373
type: Answer
has body: Why not cancel its event by using off? $('*').on('keyup',function(e){ if(e.keyCode == 13){ $(this).trigger('click'); } }).find(".ui-buttons").off('keyup'); // this unbinds the event so it won't trigger

http://stackoverflow.com/a/27345746
answers question: http://stackoverflow.com/q/27345716
type: AcceptedAnswer
has body: "([^"]+) Try this.Grab the captures or groups. or var re4='((?:[a-z\/]+))';
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27345716
upvote count: 2

http://stackoverflow.com/a/46651562
downvote count: 0
has body: As far as I understand, you can change the date format(without year) for specific languages using MomentJS properties https://momentjs.com/docs/#/customization/long-date-formats/ Example: moment.updateLocale('en', { longDateFormat: { LLL: "MMMM Do, LT", // Oct 6th, 4:27 PM } }); moment.updateLocale('ru', { longDateFormat: { LLL : 'D MMMM, HH:mm', // 6 окт., 16:27 } });
upvote count: 7
answers question: http://stackoverflow.com/q/27360102
type: Answer
score: 7

http://stackoverflow.com/q/27386588
has title: Executing javascript in Splinter
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a python script that uses Splinter to interact with a webpage. There's a form on the page that I want to submit, but there's no button element to submit it. Instead, there's a piece of javascript that runs when the button is clicked. I tried to run the javascript in my python program using browser.execute_script, but it says the function is undefined. Here's the tag that the button is in: Continue So I tried browser.execute_script("submitAction_win0(document.win0, 'DERIVED_SSS_SCT_SSR_PB_GO');") but it said submitAction was undefined. I found the function defined a bit further up in the html in the head. How can I execute the javascript? Btw the form name is win0. Thanks
answer count: 1
has answer: http://stackoverflow.com/a/27408056
tagged with: splinter
type: UnansweredQuestion
tagged with: python
tagged with: forms

http://stackoverflow.com/comment/43330365
has text: looks like a few options are available, let me try a couple
comment on: http://stackoverflow.com/q/27445586
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27353690
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27353753
tagged with: jquery
tagged with: parallax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a page www.redpeppermedia.in/tc24_beta/ it works fine over 980px resolution but as you bring it down to 768px, the CSS and media queries change the layout of it, but once you are in the 768px and you refresh the page, everything becomes as I want, the layouts fix itself. And now if you try to resize it to more than 768px you need to refresh again so as the layout fixes.. I mean is there a better way to do it... or can anyone help me with this refreshing and reloading thing.. Thank You so much though :)
has answer: http://stackoverflow.com/a/27355794
type: Question
has title: How to trigger a refresh/reload when a page crosses a certain resolution back and forth only once

http://stackoverflow.com/a/27366175
type: AcceptedAnswer
downvote count: 0
has body: with the help of Patrick, i was able to solve it. i changed my controller to app.controller('SearchController', ['$scope', '$http', '$interpolate', function($scope, $http, $interpolate) { $scope.searchString = ''; $scope.searchType = 'Artist'; $scope.updateHtml = function() { $http.get('/search', { params: { searchString: $scope.searchString, searchType: $scope.searchType } }).success(function(data) { $scope.html = $interpolate(data)($scope); // &lt;&lt;-- difference here }).error(function(err){ $scope.html = err; }); }; $scope.updateHtml(); }]); and now my html is interpolated based on the passed-in scope. thank you! edit: $interpolate is only for rendering the DOM and parsing it through the scope. it simply returns plain html. if you need to actually retrieve a full working html template, with angular code in it, use $compile. i found this answer extremely helpful in sorting out the differences between $interpolate, $compile and $parse.
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27365352
score: 2
answers question: http://stackoverflow.com/q/27365352

http://stackoverflow.com/comment/43345638
comment on: http://stackoverflow.com/q/27449067
type: Comment
type: QuestionComment
score: 1
has text: You could rotate the datalables. http://jsfiddle.net/w7cc8krc/

http://stackoverflow.com/q/27418672
tagged with: blob
tagged with: canvas
has body: I'm creating a PNG file from a canvas, but before I want to display the canvas as an img element, using a blob as the src of the img. What I tried so far: canvas = document.getElementById("canvas"); //Get data from canvas img_b64 = canvas.toDataURL('image/png'); //Create PNG png = img_b64.split(',')[1]; //Create new img img = document.createElement("img"); img.src = img_b64; //Append img to document //Save png This works, but instead of img_b64 I want a blob to be the src of the img, like this: //Create blob from new PNG blob = new Blob([window.atob(png)], { type: 'image/png', encoding: 'utf-8' }); //Create new img with blob as src img = document.createElement("img"); img.src = URL.createObjectURL(blob); //Append img to document //Save png The above code only shows me an empty img. Is there a way to do this or do I have to create the png file first and afterwards create a blob for it?
accepted answer: http://stackoverflow.com/a/27419542
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43280580
favorite count: 0
score: 6
possible better answer: http://stackoverflow.com/a/62366400
has answer: http://stackoverflow.com/a/27419542
tagged with: http://stackoverflow.com/tag/png
upvote count: 6
has answer: http://stackoverflow.com/a/62366400
linked to: http://stackoverflow.com/q/4998908
type: AnsweredQuestion
has title: Canvas to img with src blob
type: Question
answer count: 2

http://stackoverflow.com/comment/43116713
has text: @rajeshkakawat you should use `xmlHttp.readyState` and `xmlHttp.status` and not `xmlhttp.readyState` or `xmlhttp.status`. You can give any valid name but it has to be consistent like OP did.
score: 0
comment on: http://stackoverflow.com/a/27328855
type: Comment
type: AnswerComment

http://stackoverflow.com/q/27342671
possible better answer: http://stackoverflow.com/a/27342788
has comment: http://stackoverflow.com/comment/43141070
has comment: http://stackoverflow.com/comment/43141056
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/27342738
has body: I need to create a row with ajax in a javascript function, but i'm having a lot of trouble finding the correct syntax. This is the HTML final result i want to get: And this is the JS code that needs to be modified: Finally this is the HTML i obtain using js i have written before: Thanks in advance!
has comment: http://stackoverflow.com/comment/43141057
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
accepted answer: http://stackoverflow.com/a/27342738
favorite count: 0
has comment: http://stackoverflow.com/comment/43141080
has title: Javascript ajax syntax to create html row
type: AnsweredQuestion
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/27342788
has comment: http://stackoverflow.com/comment/43141521
has answer: http://stackoverflow.com/a/27342820
type: Question

http://stackoverflow.com/q/27417938
has answer: http://stackoverflow.com/a/27418049
has title: Javascript - Insert element at script position
linked to: http://stackoverflow.com/q/38947554
possible better answer: http://stackoverflow.com/a/27418383
has answer: http://stackoverflow.com/a/27418383
has body: How do I insert element at script location (not to rely on div's id or class), for example where addDivSayHello.js will insert div child hello , result example: hello I tried searching inside Stackoverflow but found nothing.
favorite count: 0
has answer: http://stackoverflow.com/a/27418085
answer count: 5
linked to: http://stackoverflow.com/q/1533568
has comment: http://stackoverflow.com/comment/43279300
accepted answer: http://stackoverflow.com/a/27418049
downvote count: 1
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27418020
has answer: http://stackoverflow.com/a/73375567
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/43279196
has comment: http://stackoverflow.com/comment/101163923
tagged with: javascript
has comment: http://stackoverflow.com/comment/43279259

http://stackoverflow.com/comment/43103730
has text: We're going to have a hard time programmatically finding those numbers too, if the programming language isn't tagged.
comment on: http://stackoverflow.com/q/27322267
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/27484533
has comment: http://stackoverflow.com/comment/43430479
has comment: http://stackoverflow.com/comment/43430284
has comment: http://stackoverflow.com/comment/43430523
score: 0
has comment: http://stackoverflow.com/comment/43430580
has comment: http://stackoverflow.com/comment/43409744
has comment: http://stackoverflow.com/comment/43430396
has comment: http://stackoverflow.com/comment/43424530
answers question: http://stackoverflow.com/q/27431196
type: Answer
has body: I'd advise against the use of eval. However, you can follow the following model. First in your myFunctions.js, wrap all your code into a single function. (function(_, $, graphie) { // declare all your functions here which makes use of the paramters }) // we will be calling this anonymous function later with parameters Then after getting the script you could do $.get( 'url/to/myfunctions', function(fn){ var el = document.createElement('script'); el.type = 'text/javascript'; el.text = fn + '(_, jQuery, Graphie);'; document.head.appendChild(el); }); Note that, I've put Graphie as the parameter, but I'm not sure of it. So put your correct graphie variable there.
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/27335477
score: 2
type: AnsweredQuestion
downvote count: 0
has title: does array.shift() delete the array?
tagged with: shift
type: Question
upvote count: 2
tagged with: arrays
answer count: 1
has body: i have an array that has one element and i want to use proarray.shift(); var proarray=[]; proarray[0]=1; //... proarray.shift(); //... proarray[i]=5; but when i do, it stops the program. does it delete the array? if it does, what should i do to prevent that? cuz i need that array for later. and also i tried to use var proarray=[]; proarray[0]=1; //... array.splice(0,1); //... proarray[i]=5; but it didn't work. what should i do?
tagged with: javascript
has answer: http://stackoverflow.com/a/27335532
accepted answer: http://stackoverflow.com/a/27335532
favorite count: 0

http://stackoverflow.com/a/27416365
answers question: http://stackoverflow.com/q/27416315
score: 1
has body: You can use limitTo: &lt;li ng-repeat="element in listArray | limitTo:limit"&gt;
has comment: http://stackoverflow.com/comment/43276823
has comment: http://stackoverflow.com/comment/43276492
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/43276437
accepted answer of: http://stackoverflow.com/q/27416315
downvote count: 0

http://stackoverflow.com/a/27331445
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/43120805
answers question: http://stackoverflow.com/q/27331370
downvote count: 0
has comment: http://stackoverflow.com/comment/43120745
has body: Just assign the animals array to a value undefined and the array data will be dereferenced and garbage collected. Donot try to call delete operator that is explicit removal. animals = undefined OR animals = void 0 Thanks
type: Answer

http://stackoverflow.com/a/27472546
downvote count: 0
answers question: http://stackoverflow.com/q/27472476
type: Answer
upvote count: 3
has body: In order to apply your code inside the function, you must run (call) the function: var i = document.getElementById("inp").value; var m=i-1; var s=59; function func() { document.getElementById("display").innerHTML = m +":"+s; } func(); See this JSFiddle for a live example.
score: 3

http://stackoverflow.com/comment/43214104
type: Comment
type: QuestionComment
has text: I believe when you do `Json(new { a = 1, b = 1})`, the javascript function handler should be `function(data) { var a = data.a; var b = data.b}`. I.e., the js handler should only have one parameter. try doing a `console.log(result_success);` in your handler to see what you're really getting back
comment on: http://stackoverflow.com/q/27382709
score: 0

http://stackoverflow.com/comment/43480885
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27515410
has text: Well that's another question. The best would be to add [the computeDistanceBetween method provided by the google api](https://developers.google.com/maps/documentation/javascript/reference#spherical).This is going to calculate a straight line between two latitudes and longitudes: `google.maps.geometry.spherical.computeDistanceBetween( a, b );` or you can check out [the distance matrix service](https://developers.google.com/maps/documentation/javascript/distancematrix) but this is more a travel distance calculator.

http://stackoverflow.com/comment/43223727
comment on: http://stackoverflow.com/q/27387737
type: QuestionComment
has text: The image hasn't been uploaded yet...how would it be able to show the image?
score: 0
type: Comment

http://stackoverflow.com/comment/43229618
type: Comment
has text: @Katcha I can't reproduce your problem. I've inserted a code snippet into the answer and it works just fine.
comment on: http://stackoverflow.com/a/27390830
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43185970
type: Comment
type: QuestionComment
has text: Seems reasonable except that your links won't function at all until the jQuery is ready. That might be an unpleasant UX scenario.
score: 0
comment on: http://stackoverflow.com/q/27366954

http://stackoverflow.com/comment/43328144
type: Comment
comment on: http://stackoverflow.com/q/27444581
type: QuestionComment
score: 1
has text: forget `Date.parse` - `var d = new Date(); d.setTime(Date.parse("11/28/2014 11:00 am"));` What format u need ?

http://stackoverflow.com/q/27326937
has answer: http://stackoverflow.com/a/73450674
score: 104
has comment: http://stackoverflow.com/comment/43112870
has answer: http://stackoverflow.com/a/38712945
favorite count: 0
answer count: 5
has comment: http://stackoverflow.com/comment/86616517
has title: How to do a greater than or equal to with moments (moment.js) in javascript?
has comment: http://stackoverflow.com/comment/86568219
has comment: http://stackoverflow.com/comment/86572605
tagged with: datetime
has answer: http://stackoverflow.com/a/27327083
has body: Basically, I want to do a myMoment &gt;= yourMoment. There is no myMoment.isSameOrAfter and writing that out combining isSame and .isAfter is a bit lengthy. What's the alternative? Convert moment to js date and use &gt;= to compare?
accepted answer: http://stackoverflow.com/a/27327083
tagged with: momentjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/22600856
downvote count: 0
has comment: http://stackoverflow.com/comment/51612341
upvote count: 104
possible better answer: http://stackoverflow.com/a/38712945
has answer: http://stackoverflow.com/a/52111079
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/74393458
tagged with: date
has comment: http://stackoverflow.com/comment/43113104

http://stackoverflow.com/a/27441710
has comment: http://stackoverflow.com/comment/43332837
type: Answer
has comment: http://stackoverflow.com/comment/43332948
upvote count: 3
accepted answer of: http://stackoverflow.com/q/27437396
answers question: http://stackoverflow.com/q/27437396
has comment: http://stackoverflow.com/comment/43332918
has body: Specflow is cucumber for .net, so it won't be able to run javascript tests using jasmine. However there are a couple of cucumber frameworks for javascript (see this and the answers in this question which also shows how jasmine expects the tests to be written BDD style.) which will give you natural language syntax used in SpecFlow for you javascript tests.
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/27343505
favorite count: 0
has title: Arrange two unequal length arrays based on id in javascript
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/27344672
downvote count: 1
has comment: http://stackoverflow.com/comment/43142500
has body: Array 1: [{Id:1,Name:'abc'},{Id:5,Name:'bcd'},{Id:3,Name:'xyz'}] Array 2: [{Id:3,Name:'Ajay3'},{Id:5,Name:'Ajay5'},{Id:1,Name:'Ajay1'},{Id:2,Name:'Ajay2'},{Id:4,Name:'Ajay4'] On re-arranging the two arrays the output should be like: Array 1: [{Id:1,Name:'abc'},{Id:3,Name:'xyz'},{Id:5,Name:'bcd'}] Array 2: [{Id:1,Name:'Ajay1'},{Id:3,Name:'Ajay3'},{Id:5,Name:'Ajay5'},{Id:2,Name:'Ajay2'},{Id:4,Name:'Ajay4'}] OR [{Id:1,Name:'Ajay1'},{Id:3,Name:'Ajay3'},{Id:5,Name:'Ajay5'},{Id:4,Name:'Ajay4'},{Id:2,Name:'Ajay2'}] Let me know the best way for above. The existing IDs in both array should be in same order and the extra Ids in one of the array should be in the last.
has comment: http://stackoverflow.com/comment/43142586
has comment: http://stackoverflow.com/comment/43142678
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/43142759
has comment: http://stackoverflow.com/comment/43142783
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43142483
has comment: http://stackoverflow.com/comment/43147103
score: 0
has answer: http://stackoverflow.com/a/27343612
has comment: http://stackoverflow.com/comment/43144154

http://stackoverflow.com/q/27407448
has title: How to make input field to show real time markups
score: 0
answer count: 2
tagged with: textbox
has answer: http://stackoverflow.com/a/27410523
linked to: http://stackoverflow.com/q/8956567
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27407884
accepted answer: http://stackoverflow.com/a/27407884
has body: I want to know how to make a input text field like the one in facebook or twitter where text smiles are converted into graphics and the ability to add extra markup. I have gone through other stackoverflow questions like How do I make an editable DIV look like a text field? So I know how to make an editable div using contenteditable, thats not what I wanted to know. I have inspected facebook comment box via chrome and it shows they use an Invisible input box and a div to show the output I have removed facebook classes and added some my own styles to see the input box So what i want to know is How the input can be hidden and the things that user enters shows up in the div How to make the hidden input field to be selected when the user focus on div I want to know how to implement this technique with an input[type=text] and div In General It would be much helpful if adding a hash tag method is explained. Thanks!
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27410523
type: Question
tagged with: javascript

http://stackoverflow.com/comment/117273186
score: 1
has text: I think if you send your data this way, you will need to take care of `csrf` token also.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/27346402

http://stackoverflow.com/a/27462423
answers question: http://stackoverflow.com/q/27462392
has comment: http://stackoverflow.com/comment/43363053
has comment: http://stackoverflow.com/comment/43361633
has body: Yes, inner function variables can access outer function variables, BUT NOT THE OTHER WAY AROUND. Very good clarifying question. Below is a simple example of a function accessing a variable in an encompassing scope. var name = 'John'; var Person = function(){ this.name = name; } var guy = new Person(); guy.name //John function a(){ var x=10; console.log(x); return function b(){ var y=20; console.log(x,y); } } var x = a(); console.log('x defined') x(); Try running this to see the sequence of interpretation in javascript
score: 0
type: Answer

http://stackoverflow.com/q/27366699
has answer: http://stackoverflow.com/a/27367297
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/27366849
accepted answer: http://stackoverflow.com/a/27366849
type: Question
has comment: http://stackoverflow.com/comment/43185868
has comment: http://stackoverflow.com/comment/43186141
has title: jQuery selector for target event?
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27367297
has comment: http://stackoverflow.com/comment/43185950
has body: I have the following CSS and HTML: a { padding: 20px; } div { background: yellow; margin: 600px 0; } link 1 link 2 link 3 link 4 link 5 I'm the target 1! I'm the target 2! I'm the target 3! I'm the target 4! I'm the target 5! I want to perform certain jquery operations when divs with class "target_class" are targeted. I know this can be achieved by adding a common class to these a tags (say, "link") and then binding a click event handler with that class like this: $(".link").click(function(){ //code }); What I needed to know was: Is there a jQuery handler for target event for a particular class/id? Something like: $(".target_class").target(function(){ //code }); If not, are there any alternatives to achieve this?
tagged with: jquery
has comment: http://stackoverflow.com/comment/43185368
has comment: http://stackoverflow.com/comment/43185733
favorite count: 0
has comment: http://stackoverflow.com/comment/43185957
has comment: http://stackoverflow.com/comment/43185746
has comment: http://stackoverflow.com/comment/43185631
has comment: http://stackoverflow.com/comment/43185766
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43185479
tagged with: css
has comment: http://stackoverflow.com/comment/43185681
has comment: http://stackoverflow.com/comment/43185797
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43185465
has comment: http://stackoverflow.com/comment/43186081

http://stackoverflow.com/comment/43271010
comment on: http://stackoverflow.com/q/27413364
has text: Just one advice, put your JavaScript code in a separate `.js` file.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27374905
downvote count: 0
answers question: http://stackoverflow.com/q/27374850
has comment: http://stackoverflow.com/comment/43201106
has comment: http://stackoverflow.com/comment/43201176
has comment: http://stackoverflow.com/comment/43200016
has comment: http://stackoverflow.com/comment/43238807
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: You cannot pass parameter from javascript to server side at inline code. You should use jquery ajax for that. var message = "value"; $.get( url: "/yoururl/GetScreenMessage", data: {message : message}, success: function(data){ alert(data); });
score: 2
accepted answer of: http://stackoverflow.com/q/27374850

http://stackoverflow.com/q/27426664
has comment: http://stackoverflow.com/comment/43294999
has comment: http://stackoverflow.com/comment/43295173
type: Question
tagged with: javascript
tagged with: jquery
has title: HTML5 Fullscreen Image ASP.Net
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: asp.net
has body: Got a very simple question and I am overwhelmed with :( ! My requirement is that, ASP.Net is used server side to generate HTML5 document and sent to client side. The HTML5 document contains a single Img element with src set on server side. I want the browser to show the Image in full screen, once the page has been loaded. Is that possible, if yes, how do I do it? Came across some Fullscreen info here: http://www.sitepoint.com/use-html5-full-screen-api/ Thanks!
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/139768625
has text: This question is similar to: [How do I return the response from an asynchronous call?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call). If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27377614
type: Comment

http://stackoverflow.com/q/27369955
has body: Question: How can I get var trapfocus() inside ParentCtrl to console.log(el) from the approrate element properly ? HTML &lt;div ng-controller="ParentCtrl"&gt; &lt;div ng-repeat="tab in tabs" modaltab="trapfocus($event)"&gt;&lt;/div&gt; &lt;/div&gt; JS: .directive('modaltab', function() { return function(scope, element, attrs) { element.bind("keydown keypress", function(event) { if(event.which === 9) { scope.$apply(function(){ scope.$eval(attrs.modaltab, {'event': event}); }); }); }; }) Parent Ctrl .controller('ParentCtrl', function(){ var trapfocus = function(evt, el){console.log(el)}; $scope.tabs = [1,2,3,4]; });
type: Question
tagged with: angularjs-directive
tagged with: angularjs-scope
score: 0
has title: In Angular how do I $eval() a function and pass the element to parent function?
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27370065
accepted answer: http://stackoverflow.com/a/27370065
tagged with: angularjs
tagged with: eval
type: AnsweredQuestion

http://stackoverflow.com/comment/43168988
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27358020
has text: What I mean: why you don't get the current page number using `var currentPage = $('#tblCompletedPriceList').jqGrid('getGridParam', 'page');` inside of `refreshGrid` function. It's the page number which you want to hold. You can use `[{current: true, page: currentPage}]` option of `reloadGrid` to preserve selected rows and to preserve the page number which you get just before. See [the old answer](http://stackoverflow.com/a/3808014/315935) for more information.

http://stackoverflow.com/a/27323418
type: Answer
answers question: http://stackoverflow.com/q/27323363
upvote count: 1
score: 1
downvote count: 0
has body: You're comparing the myarray[0] value to a string value of undefined. What you need is this: if (typeof(myarray[0]) !== 'undefined') Hope this helps!

http://stackoverflow.com/a/27457026
has body: Books could be declared as a property(see get and set in TypeScript) and in its getter you can start an ajax call. The only issue is that you cannot know when the ajax call will return and you don't want to block the code execution while value for Books is loading. You can use promise to solve your problem. The following code is using JQuery Deferred Object which is returned by $.ajax call (since 1.5 version). One change - HasLoaded and DeferredURI. They should reside in "loader class" i.e. Library because in my example Library class is responsible for data retrieval. export class Library { private _loadedBooks: Book[]; public get Books(): any { var result: any = null; // Check first if we've already loaded values from remote source and immediately resolve deferred object with a cached value as a result if(this.HasLoaded) { result = $.Deferred(); result.resolve(this._loadedBooks); } else { // Initiate ajax call and when it is finished cache the value in a private field result = $.ajax(this.DeferredURI) .done((values) =&gt; { this.HasLoaded = true; this._loadedBooks = values; }); } return result; } } Then code consumer would use Books as following: var library = new Library(); library.Books.done((books: Book[]) =&gt; { // do whatever you need with books collection }); For me this design is counter intuitive and user of this code would not expect the Books field/property to return a deferred object. So I would suggest to change it to method, something like loadBooksAsync(). This name would indicate that the code inside this method is asynchronous and hinting that return value is a deferred object which value would be available somewhere later.
accepted answer of: http://stackoverflow.com/q/27456580
answers question: http://stackoverflow.com/q/27456580
type: Answer
upvote count: 6
downvote count: 1
score: 5
type: AcceptedAnswer

http://stackoverflow.com/a/27321713
has comment: http://stackoverflow.com/comment/43102950
score: 1
has comment: http://stackoverflow.com/comment/43103020
upvote count: 1
has body: How about: ^(\S+:.+?)\s(\S+:.+)$ Code:Name is in group 1 and Another-code:Another name in group 2. \S+ means one or more character that is not a space.
answers question: http://stackoverflow.com/q/27321679
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43321695
type: QuestionComment
has text: http://jsfiddle.net/4ux95g0o/
comment on: http://stackoverflow.com/q/27440004
score: 0
type: Comment

http://stackoverflow.com/comment/43144599
type: Comment
type: QuestionComment
has text: @charlietfl how? sorry but please give me example. Thanks
comment on: http://stackoverflow.com/q/27344454
score: 0

http://stackoverflow.com/comment/43317977
has text: Okie. Thanks for the pointers.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27438795
type: Comment

http://stackoverflow.com/comment/43138969
score: 0
type: AnswerComment
has text: ya i corrected fucntion and swapped the script still not opening in my browsers :(
comment on: http://stackoverflow.com/a/27341542
type: Comment

http://stackoverflow.com/a/27462614
answers question: http://stackoverflow.com/q/27462576
type: Answer
has body: You just use this like this: collide(node)(quad, x1, y1, x2, y2);
score: 0

http://stackoverflow.com/q/27323168
has comment: http://stackoverflow.com/comment/43105625
downvote count: 0
has body: I have a piece of code which accepts fn as the argument and stores it in an object property. var obj = {}; function anotherFn(fn){ obj["name"] = fn.apply(fn, []); } function google(){ console.log("hello"); } anotherFn(google); console.log(obj.name); What i am not understanding is the fn.apply(fn,[]) code and its purpose. Normally we use call and apply method when we want to execute a fn in a different this/context. But what does the fn.apply(fn, []) do here?. The confusion is why can't i just do obj["name"] = fn();
accepted answer: http://stackoverflow.com/a/27323214
favorite count: 0
has title: what does fn.apply(fn, []) do?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43106488
type: Question
has answer: http://stackoverflow.com/a/27323214
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/27323299
upvote count: 4
has answer: http://stackoverflow.com/a/27323299
answer count: 2

http://stackoverflow.com/comment/43201265
comment on: http://stackoverflow.com/q/27375635
score: 0
type: QuestionComment
type: Comment
has text: tip! use `<>` instead of `~=` and do you require to add or trim `%` ?

http://stackoverflow.com/comment/43112284
comment on: http://stackoverflow.com/a/27326433
score: 0
type: AnswerComment
has text: Yes, I'm running this from a folder on my desktop. I'll try running it from MAMP?
type: Comment

handlebars.js
tags question: http://stackoverflow.com/q/27450443
tags question: http://stackoverflow.com/q/27389867
tags question: http://stackoverflow.com/q/27317658
tags question: http://stackoverflow.com/q/27422408
tags question: http://stackoverflow.com/q/27373654
type: Tag
tag name: handlebars.js
tags question: http://stackoverflow.com/q/27432045
tags question: http://stackoverflow.com/q/27351927
tags question: http://stackoverflow.com/q/27326367
tags question: http://stackoverflow.com/q/27424901
tags question: http://stackoverflow.com/q/27387886
tags question: http://stackoverflow.com/q/27456675

http://stackoverflow.com/comment/43125003
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27332689
score: 0
has text: @mason , my answer reflect the same

http://stackoverflow.com/comment/43166639
type: Comment
comment on: http://stackoverflow.com/a/27356863
has text: What I want to know is that, if I add files to asset folder. How do I add them to specific location inside the webpage that is loaded in webview. Since the file order matters.
score: 0
type: AnswerComment

http://stackoverflow.com/q/27436274
has answer: http://stackoverflow.com/a/27436455
has answer: http://stackoverflow.com/a/27436969
tagged with: ajax
has comment: http://stackoverflow.com/comment/43314385
tagged with: django
type: AnsweredQuestion
has body: I am having trouble displaying the contents of a $.getJSON call. I have this code which retrieves some JSON data from a page. var loadItems = function() { if (hasNextPage === false) { return false } pageNum = pageNum + 1; var url = baseUrl + "json/" + pageNum + '/'; var jqxhr = $.getJSON(url, function (data) { var a = []; $.each(data.itemList, function (item) { a.push("&lt;li&gt;" + item.title + "&lt;/li&gt;"); }); $("&lt;ul/&gt;", {html: a.join(" ")}).appendTo("#anchor"); }); jqxhr.complete(function () { alert('done!'); $(window).bind('scroll', loadOnScroll); }); }; The idea is just to load a page dynamically based on scroll position, and get the JSON contents of that page (for an infinite scroll effect). The JSON structure is something like this: { "key1": val1, "key2": val2, "itemList": [ {"title": "title", "author": "author", "id": 100, "slug": slug, }, ... ] } The important values are in itemList, where I have to retrieve data that will get plugged into my django template, which in turn will get some data from the view. Everything seems to work just fine, except that I can't access the data in itemList. Nothing seems to get pushed into the array. because nothing gets displayed on the page (namely, the &lt;li&gt; that should be created). This seems to be a simple implementation of a basic ajax move, but its not working. EDIT: I've done some bug tracking and have found that the code never executes the $.each loop. Not sure how to resolve this though.
has comment: http://stackoverflow.com/comment/43314283
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43314354
accepted answer: http://stackoverflow.com/a/27436969
has comment: http://stackoverflow.com/comment/43314131
has title: Trouble getting getJSON to display values from array
type: Question
possible better answer: http://stackoverflow.com/a/27436450
has answer: http://stackoverflow.com/a/27436450
tagged with: javascript
tagged with: jquery
answer count: 3

http://stackoverflow.com/comment/43260202
comment on: http://stackoverflow.com/q/27407645
score: 0
has text: [selectionEnd](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement).
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27344897
score: -4
has comment: http://stackoverflow.com/comment/43145123
downvote count: 4
upvote count: 0
has title: in HTML, how do I make a dropdown with pictures when its in a list?
type: Question
has answer: http://stackoverflow.com/a/27344957
has comment: http://stackoverflow.com/comment/43145127
tagged with: javascript
has body: thank you for trying to help me! Here is my current line &lt;li&gt;&lt;a href="#Language"&gt;*LanguageHERE*&lt;/a&gt;&lt;/li&gt; I want it to be a dropdown menu when I hover/press it where it is flags for all languages avaible, but I don't know how to create a dropdown menu with images? could someone help me?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/27444222
tagged with: asp.net
has comment: http://stackoverflow.com/comment/43327828
has body: I have a problem in my project using Angularjs. Here is my code: Controller // GET: api/CustomerLists/5 [ResponseType(typeof(CustomerList))] public IHttpActionResult GetCustomerList(int id) { var data = (from cust in db.CustomerLists join call24 in db.CallingList4 on cust.CustID equals call24.CustID where cust.CustID == id select new CustomerVM { CustID = cust.CustID, Customer = cust.Customer, Call4ID = call24.Call4ID, Wk1WebID = call24.Wk1WebID, Wk1OrdID = call24.Wk1OrdID }).First(); return Ok(data); } // PUT: api/CustomerLists/5 [ResponseType(typeof(void))] public IHttpActionResult PutCustomerList(CustomerVM vm) { if (ModelState.IsValid) { var cust = db.CustomerLists.Find(vm.CustID); var call4 = db.CallingList4.Find(vm.Call4ID); cust.Customer = vm.Customer; cust.ContactName = vm.ContactName; call4.Wk1OrdID = vm.Wk1OrdID; call4.Wk1WebID = vm.Wk1WebID; db.CustomerLists.Attach(cust); db.Entry(cust).State = EntityState.Modified; db.CallingList4.Attach(call4); db.Entry(call4).State = EntityState.Modified; db.SaveChanges(); } return StatusCode(HttpStatusCode.NoContent); } JS var EditCtrl = function ($scope, $routeParams, $location, data, $http) { var id = $routeParams.editId; $scope.lis = data.get({ id: id }); $scope.selectTest = null; $scope.testTest = []; $http({ method: 'GET', url: '/api/OrderStatus/', data: { OrderStatID: 1 } }).success(function(result) { $scope.testTest = result; }); $scope.selectTest1 = null; $scope.testTest1 = []; $http({ method: 'GET', url: '/api/WebStatus/', data: { WebStatID: 1 } }).success(function (result1) { $scope.testTest1 = result1; }); $scope.save = function () { data.update({ id: id }, $scope.lis, function () { $location.path('/'); }); }; Template &lt;select class="form-control" ng-model="selectTest" ng-model="lis.OrderStatID"&gt; &lt;option ng-repeat="s in testTest" value="{{s.OrderStatID}}"&gt;{{s.OrderStatus}}&lt;/option&gt; &lt;/select&gt; View Model public class CustomerVM { public int CustID { get; set; } public string Customer {…
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43327761
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/43327843
tagged with: javascript
has title: How to Save an id for a dropdownlist using angular js?
has answer: http://stackoverflow.com/a/27455144
score: 0
tagged with: api
answer count: 1

http://stackoverflow.com/q/27428875
tagged with: jasmine
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43300013
type: Question
has body: In the Factory I have a function: factory.save = function(preference) { ... MyService.create(createCmd, onSuccess, onError); ... } Where, in the same factory: var onSuccess = function(data) { console.log("123") } var onError = function(data) { console.log("123") } I want to test that factory invokes the create method it invokes the onSuccess - so then I could extend my test, testing whatever onSuccess does But for now I do not see the message "123" in output while running my test, which looks like this: it('should call Create() on save', function() { // given factory = $injector.get('MyFactory'); service = $injector.get('MyService'); spyOn(service, 'create').and.callThrough(); // spying on service // when factory.save("{'some':'some-value'}"); // then expect(service.create).toHaveBeenCalled(); }) The test is green . The question is: How to make onSuccess or onError to be invoked ? To print "123" In reality it invokes onSeccess or onError - so the code is working itself. UPDATE: My Factory code (short version): angular.module('factories').factory('MyFactory', ['MyService', function MyFactory(MyService) { 'use strict'; var factory = this; factory.userPreferenceId = -1; factory.save = function(preference) { MyService.create(preference, onSuccess, onError); }; var onSuccess = function(data) { console.log("123"); factory.userPreferenceId = data.preferenceID; }; var onError = function(data) { console.log("123"); }; return factory; }]); Service code (if one asks for it): angular.module('services').factory('MyService', ['$resource', function ($resource) { return $resource('/api/userpreference/:id/:action', {id: "@id"}, //parameters default { create: { method: "POST", params: {action : "create"}}, }); }]);
has comment: http://stackoverflow.com/comment/43300975
tagged with: javascript
has title: Jasmine 2 - Testing Angular Factory that calls Service onSuccess case
has answer: http://stackoverflow.com/a/27432004
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27431512

http://stackoverflow.com/q/27370104
has comment: http://stackoverflow.com/comment/43193504
accepted answer: http://stackoverflow.com/a/27372004
has comment: http://stackoverflow.com/comment/43192074
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/27370272
has answer: http://stackoverflow.com/a/27370272
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have: A navbar (div > ul > li) with a few navigational links in it. A border added on hover .my-nav &gt; li:hover { border-bottom: 0.2em solid white; } An AngularJS directive which applies the below class to whichever is the active page (using routes) .active-tab { border-bottom: 0.2em solid white; font-weight: bold; } My issues are: If I'm on active-tab "A" and hover onto active tab "B", I want all styling removed from "A" but I have no idea how to approach. If I hover on the active page (which already has active-tab applied to it, it doubles the thickness of the border.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27371879
type: Question
has answer: http://stackoverflow.com/a/27372004
tagged with: javascript
has comment: http://stackoverflow.com/comment/43192025
has title: CSS nav link styling: remove styling of other element & remove double border when hovered on selected
has comment: http://stackoverflow.com/comment/43193535
score: 0
answer count: 3

http://stackoverflow.com/comment/122695537
type: Comment
comment on: http://stackoverflow.com/a/30654451
type: AnswerComment
has text: "Keep in mind that all other execution within your node app is paused until GC completes" -- what other execution are you referring to (apart from worker threads)? Do you simply mean this method is blocking (and takes a while to return) and as-such, the event loop won't be processing other callbacks until it completes?
score: 0

http://stackoverflow.com/comment/43232502
score: 0
type: AnswerComment
type: Comment
has text: Thank you for this. Im going with your answer over dandavis because I am not in control of the function/callback/workflow originally being executed. With your solution, I am seeing the setInterval being called by 3rd party, along with multiple other calls, and see the a[1] changing where needed. I can see the disadvantages of this and will probably keep this in the 'for fun' bucket.
comment on: http://stackoverflow.com/a/27391978

http://stackoverflow.com/comment/43189511
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27368863
type: AnswerComment
has text: @Hey: You'll want to read the last paragraph of the [algorithm conventions](http://es5.github.io/#x5.2) :-)

http://stackoverflow.com/comment/43290848
type: QuestionComment
has text: Thanks! I tried looking into it, but I was unable to get it to work and without any guidance I don't know if I will be able to figure it out. It seems like very complicated code and I'm not that familiar with JS on this level. Thanks again.
score: 0
comment on: http://stackoverflow.com/q/27411927
type: Comment

http://stackoverflow.com/comment/43360459
has text: it helps, but with in the case ` h ello` ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27435903
type: Comment

http://stackoverflow.com/comment/44105417
type: QuestionComment
has text: You never answered: why `--force`
type: Comment
comment on: http://stackoverflow.com/q/27352291
score: 0

http://stackoverflow.com/a/27389568
has body: here is how you should do it. var myApp = (function() { var stuff = []; //private return { //exposed to public myfunc: function(values) { alert('You said: ' + values); } } }()); myApp.myfunc('Test Me');
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27389374
has comment: http://stackoverflow.com/comment/43229093
downvote count: 0
type: Answer

http://stackoverflow.com/a/27452060
has comment: http://stackoverflow.com/comment/43342893
score: 2
answers question: http://stackoverflow.com/q/27451978
has comment: http://stackoverflow.com/comment/43342658
has body: You have most of it, just drop the str.toLowerCase(); function properCase(str) { return str.replace(/(\b)([a-z\WA-Z\W])/g,function (firstLetter) { return firstLetter.toUpperCase(); }); } running properCase('mcCormick') returns McCormick Edit: Taking a look at the regex, I think you probably don't need that whole expression (though it depends on your use case, as all things do) function properCase(str) { return str.replace(/(?:^|\s)([a-z])/,function (firstLetter) { return firstLetter.toUpperCase(); }); } This will uppercase the beginning of any word that starts with a letter. Ex properCase('mcCormick is *an excellent duelist') returns "McCormick Is *an Excellent Duelist"
has comment: http://stackoverflow.com/comment/43342629
accepted answer of: http://stackoverflow.com/q/27451978
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43342624
has comment: http://stackoverflow.com/comment/43343289
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/43342719

http://stackoverflow.com/q/27350786
favorite count: 0
upvote count: 1
tagged with: charts
has title: How to add more multiTooltipTemplate in Chartjs?
tagged with: chart.js
has body: I make analytic for some payment. And I want to add total payment per day for each data. This is my onload for the line chart: window.onload = function(){ var ctx = document.getElementById("lineChart").getContext("2d"); new Chart(ctx).Line(data, { multiTooltipTemplate: "&lt;%= datasetLabel + ' - IDR ' + addDot(value) %&gt;", }); legend(document.getElementById("lineLegend"), data); } I use datasetLabel to show the label name and addDot to make the value separate by dot. But I want to add total so when I hover the total also showing there.
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
score: 1

angularjs-directive
tags question: http://stackoverflow.com/q/27444569
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/27393759
tags question: http://stackoverflow.com/q/27315224
tags question: http://stackoverflow.com/q/27322008
tags question: http://stackoverflow.com/q/27369955
tags question: http://stackoverflow.com/q/27421619
tags question: http://stackoverflow.com/q/27413391
tags question: http://stackoverflow.com/q/27420504
tags question: http://stackoverflow.com/q/27365352
tags question: http://stackoverflow.com/q/27448005
tags question: http://stackoverflow.com/q/27354139
tags question: http://stackoverflow.com/q/27364761
tags question: http://stackoverflow.com/q/27472390
tags question: http://stackoverflow.com/q/27319228
tags question: http://stackoverflow.com/q/27384145
tags question: http://stackoverflow.com/q/27353967
tags question: http://stackoverflow.com/q/27427484
tags question: http://stackoverflow.com/q/27392925
tags question: http://stackoverflow.com/q/27473474
tags question: http://stackoverflow.com/q/27473323
tags question: http://stackoverflow.com/q/27393436
tags question: http://stackoverflow.com/q/27324144
tags question: http://stackoverflow.com/q/27316686
tags question: http://stackoverflow.com/q/27396586
tags question: http://stackoverflow.com/q/27327944
type: Tag
tags question: http://stackoverflow.com/q/27314510
tags question: http://stackoverflow.com/q/27395926
tags question: http://stackoverflow.com/q/27376112
tags question: http://stackoverflow.com/q/27381714
tags question: http://stackoverflow.com/q/27471314
tags question: http://stackoverflow.com/q/27354013
tags question: http://stackoverflow.com/q/27405903
tags question: http://stackoverflow.com/q/27352980
tags question: http://stackoverflow.com/q/27329914
tags question: http://stackoverflow.com/q/27448789

http://stackoverflow.com/q/27382439
upvote count: 1
has title: Is there a good way to allow setting of assert.expect(n) in multiple places?
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
has body: I'm writing tests for a non-trivial API and many things need to be repeated for different tests. I've split out common stuff in separate functions, but Unfortunately, this makes it a huge pain to use assert.expect(n) in any meaningful way. Is there any way that I can improve this? I've been looking for something that will let me do expects for the current function only: function x(assert) { assert.expect(2); y(assert); // 2 asserts. assert.testExpects(); } function y(assert) { assert.expect(1); // Assert. assert.testExpects(); } Or some way to increment the expected number of asserts. Something like this: function x(assert) { assert.expect(assert.expected + 2); y(assert); // 2 asserts. } function y(assert) { assert.expect(assert.expected + 1); // Assert. }
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27382625
tagged with: qunit
score: 1

http://stackoverflow.com/a/27343376
answers question: http://stackoverflow.com/q/27343278
type: Answer
has comment: http://stackoverflow.com/comment/43241933
has body: One more example of CSS animation which probably better option then javascript: .circle { background: coral; height: 100px; width: 100px; border-radius: 50%; -webkit-animation: pulse 1s ease infinite alternate; animation: pulse 1s ease infinite alternate; } @-webkit-keyframes pulse { from { -webkit-transform: scale(1); } to { -webkit-transform: scale(.2); } } &lt;div class="circle"&gt;&lt;/div&gt; For Firefox you will need to add prefixless rule @keyframes pulse { from { transform: scale(1); } to { transform: scale(.2); } }
downvote count: 0
score: 1
upvote count: 1

ios
tags question: http://stackoverflow.com/q/27378965
tags question: http://stackoverflow.com/q/27362217
type: Tag
tags question: http://stackoverflow.com/q/27445442
tags question: http://stackoverflow.com/q/27397805
tags question: http://stackoverflow.com/q/27448625
tags question: http://stackoverflow.com/q/27317978
tags question: http://stackoverflow.com/q/27371484
tags question: http://stackoverflow.com/q/27343099
tags question: http://stackoverflow.com/q/27400818
tags question: http://stackoverflow.com/q/27470652
tags question: http://stackoverflow.com/q/27381195
tags question: http://stackoverflow.com/q/27448331
tags question: http://stackoverflow.com/q/27396158
tags question: http://stackoverflow.com/q/27407015
tag name: ios
tags question: http://stackoverflow.com/q/27368972
tags question: http://stackoverflow.com/q/27335320
tags question: http://stackoverflow.com/q/27443350
tags question: http://stackoverflow.com/q/27410605
tags question: http://stackoverflow.com/q/27441278
tags question: http://stackoverflow.com/q/27470969
tags question: http://stackoverflow.com/q/27409755
tags question: http://stackoverflow.com/q/27415998
tags question: http://stackoverflow.com/q/27416549
tags question: http://stackoverflow.com/q/27368476
tags question: http://stackoverflow.com/q/27391962

http://stackoverflow.com/comment/43099439
score: 0
comment on: http://stackoverflow.com/a/27320070
type: AnswerComment
has text: Please explain how to add jQuery also
type: Comment

http://stackoverflow.com/comment/43357582
has text: Huh, that seems to work. From the way the documentation read I assumed that was called when dragging finished, and wouldn't after the revert happens. You should put that in a real answer so I can except it.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27460560
type: Comment

http://stackoverflow.com/q/27375470
has title: Moving caret position within text field
upvote count: 3
tagged with: firefox
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27420119
downvote count: 0
favorite count: 0
tagged with: webdriver
type: Question
has body: I'm attempting to write browser tests for a customised input field (it's an Angular directive, though I don't think that's relevant), and I'm having trouble with moving the cursor within the field. The situation that was found that if a user types a value into the field, then hits home and enters another value, that was appearing at the end rather than the start of the field. The code has been fixed, but now I'm trying to add tests to cover it. A simplified version of the code I'm using is as follows: driver.sendKeys('555'); driver.sendKeys(webdriver.Key.HOME); driver.sendKeys('1'); assert.equal(getFieldValue(), '1555'); Unfortunately, sending the Home key appears to do nothing. It's not a timing issue between the Home key and the rest, as if I look at the browser while it's in flight, I can see that the cursor has not moved. Any suggestions gratefully appreciated.
score: 3
tagged with: javascript

http://stackoverflow.com/comment/43158108
has text: use map.get(key), map.has(key), or map.forEach() for all keys
score: 2
comment on: http://stackoverflow.com/q/27352088
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43353428
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27458019
type: Comment
has text: please make a fiddle so that other can help here http://jsfiddle.net/

http://stackoverflow.com/q/27382928
has comment: http://stackoverflow.com/comment/43215245
type: UnansweredQuestion
tagged with: css
has body: The website I'm working on has an accessibility toggle. When high contrast mode is on it adds various outlines and/or borders to buttons, links and input elements. Currently their color (of the borders and outlines) is set to #000, but it won't matter - they always appear black. I'm testing this in Firefox on a Mac, by checking off the Preferences -&gt; Content -&gt; Colors -&gt; Allow pages to choose their own colors, instead of my selections above checkbox. It looks good when the Background option is set to white. But once it's set to black, I see no borders, because they are black as well. So - how do I detect light/dark high contrast themes (-ms-high-contrast is no good for me) and/or how do I set a white border when background is black?
type: Question
answer count: 2
has title: How to set border color in High Contrast mode?
has answer: http://stackoverflow.com/a/68034350
tagged with: javascript
tagged with: accessibility
has comment: http://stackoverflow.com/comment/43214767
score: 0
has comment: http://stackoverflow.com/comment/43214638
has answer: http://stackoverflow.com/a/27383587
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43214955

http://stackoverflow.com/a/27440712
accepted answer of: http://stackoverflow.com/q/27401241
has body: I haven't tested it, but it should work like this. var used = { inset : [], outset : [] } $("#mark").click(function(){ var marking=$("#x").val()+$("#y").val()+$("#blur").val()+$("#spread").val(); if (marking==0) { // make sure to remove this before publishing the app console.log("No code changed"); } else{ var x=$("#x").val()+"px "; var y=$("#y").val()+"px "; var b=$("#blur").val()+"px "; var s=$("#spread").val()+"px "; $r=$("#red").val(); $g=$("#green").val(); $b=$("#blue").val(); $color=" rgb("+$r+","+$g+","+$b+")"; var finalCode=0; if($("#blur").val()==0 && $("#spread").val()==0){ finalCode=x+y; } else if ($("#blur").val() != 0 && $("#spread").val()==0) { finalCode=x+y+b; } if ($("#inset").val()==0) { if (used.inset.indexOf((finalCode+$color)) != -1){ alert("That combination has been used"); } else{ $("#saved ul").append(" box-shadow:"+finalCode+$color+"; "); used.inset.push(finalCode+$color); } } else { if (used.outset.indexOf((finalCode+$color)) != -1){ alert("That combination has been used"); } else{ $("#saved ul").append(" box-shadow:inset "+finalCode+$color+"; "); used.outset.push(finalCode+$color); } } } }); If you prefer you could use to vars for inset and outset var usedInset = []; var usedOutset = new Array(); // what ever you prefere [...] if ($("#inset").val()==0) { if (usedInset.indexOf((finalCode+$color)) != -1){ alert("That combination has been used"); } else{ $("#saved ul").append(" box-shadow:"+finalCode+$color+"; "); usedInset.push(finalCode+$color); } } else { if (usedOutset.indexOf((finalCode+$color)) != -1){ alert("That combination has been used"); } else{ $("#saved ul").append(" box-shadow:inset "+finalCode+$color+"; "); usedOutset.push(finalCode+$color); } } Hope this helps (:
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27401241
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/27417699
has answer: http://stackoverflow.com/a/27417844
type: Question
has title: Jquery usage of setTimeout in loop
tagged with: javascript
answer count: 6
accepted answer: http://stackoverflow.com/a/27417761
possible better answer: http://stackoverflow.com/a/27417766
score: 0
has answer: http://stackoverflow.com/a/27417944
has body: I want to change value of p from 10 to 1 with delay 10 seconds. for (var i=0;i&lt;9;i++) { setTimeout(function(){$('#timer').text(10-i)}, 1000); } It takes value 1 for 1 second, I want it to become 10 then 9 then 8 etc. Here is fiddle. What's my mistake?
tagged with: jquery
has answer: http://stackoverflow.com/a/27417761
tagged with: timer
has comment: http://stackoverflow.com/comment/43278860
has answer: http://stackoverflow.com/a/27418125
has answer: http://stackoverflow.com/a/27419895
has answer: http://stackoverflow.com/a/27417766
type: AnsweredQuestion

http://stackoverflow.com/q/27473780
has title: Pushing data into an array model in mongoose
answer count: 1
has body: Well, i have a conceptual problem and a real error... i'm working on an inventory module concept, is simple, it consist on two models: Inventory Item The Inventory model just contains a "items" field, and that field is just a reference (to populete) to the real item object models, you know items: [type: String, ref: 'Item']. The Item object is the real data container, it have all data (name, itemCode, description, disponibility, existence... and so on). The problem in the concept is confusing for me. When an item is created, it need to be pushed into the array "items" of Inventory model document, i coded this snippet, but it retrieve me an error: var inventario = new Inventario(); //The inventory document instance var inventarios = router.route('/inventarios'); inventarios.post(function(req, res) { // itamdata object var nuevoItem = { _id: req.body._id, descripcion: req.body.descripcion, costo: req.body.costo, precioMin: req.body.precioMin, precioMax: req.body.precioMax, existencia: req.body.existencia, disponible:req.body.disponible }; // Create a new item Item.Create(nuevoItem, function(err, item) { if(err) { res.status(500).json({ msg: 'Problema interno con la base de datos', error: err }); } // call push from push method of documents array inventario.items.push({ _id: nuevoItem._id }); res.status(200).json({msg: 'Item Creado', token: item}); }); // fin Item.Create }); //fin inventarios.post The error is: /home/nano/Dev/JS/OMI/node_modules/express/lib/router/index.js:482 this.stack.push(layer); ^ TypeError: Cannot call method 'push' of undefined My concept is really simple, and i tested the requires and exports of models, all looks fine, so, anyone have some idea to solution the problem?
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/29160724
has comment: http://stackoverflow.com/comment/43450803
tagged with: node.js
linked to: http://stackoverflow.com/q/7042340
has comment: http://stackoverflow.com/comment/43450371
score: 0
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/43450645
tagged with: mongodb

http://stackoverflow.com/comment/43157858
has text: @323go ok but is there any plugin so that it may help me to play it in-line in my app itself without prompting me to play it in youtube app
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27351466

http://stackoverflow.com/q/27409812
has comment: http://stackoverflow.com/comment/43264057
tagged with: variables
favorite count: 0
has comment: http://stackoverflow.com/comment/43264063
has title: How to make javascript remember a variable?
has body: function name(){ var name = prompt("Vul hier uw naam in."); if (name != null){ document.getElementById("p1").innerHTML = "Hallo " + name + ", welkom op onze website. Op deze website kunt u informatie vinden over het vak informatica."; document.cookie="name";}} I'm trying to find a way to make my web page remember the name variable so that users don't have to tell their name each time the open the web page. it's also supposed to use the same variable at other pages. For example: when you open the web page, you get a prompt to fill in your name. after that, you get a personalized welcome message. then, when you navigate to the next page, your name will still be used. I'm very new to javascripts so please answer as simple as possible. Also, if you have some spare time, please explain to me how te code works. it will help me to understand javascripts better. thanks for your time.
possible better answer: http://stackoverflow.com/a/27410546
has comment: http://stackoverflow.com/comment/43264263
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: cookies
type: Question
has answer: http://stackoverflow.com/a/27410546
accepted answer: http://stackoverflow.com/a/27410414
has comment: http://stackoverflow.com/comment/43263882
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/43263960
answer count: 2
has answer: http://stackoverflow.com/a/27410414

http://stackoverflow.com/a/27436771
upvote count: 3
answers question: http://stackoverflow.com/q/27436749
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43389342
score: 3
type: AcceptedAnswer
has body: The not (!) operator in javascript on a boolean toggles the state between the bool values true and false, so: state = !state; has the effect that if state was true, it is now false, and vice versa. To answer your first question: var state = true; Means that initial state starts off at true. Javascript variables like state are mutable, and the value of state will be changed as per the above toggle, which is triggered by each click of a button. To put it all together, with comments: // Set the initial visual state var state = true; // jQuery handler for each button click $( "#button" ).click(function() { if ( state ) { // Visual effects when state is true } else { // Visual effects when state is false } // Now change the visual state, (which will be applied in the next click) state = !state; }); Interestingly, the state is changed only after the new visual status is applied, meaning that the display update lags the state.
accepted answer of: http://stackoverflow.com/q/27436749

http://stackoverflow.com/comment/43108870
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27324716
has text: @BrianShamblen this is a different question than that one. In that question, they have the name of a function they want to call.
score: 0

http://stackoverflow.com/comment/43244903
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27399709
has text: @RoryMcCrossan i have just posted the div not the form .on the server side i want the same structure as i posted in the question.I haven't done this in jquery i need help to do this

http://stackoverflow.com/comment/43293824
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27425774
has text: @KarlenKishmiryan Where the word `function` there is a closure. Always :)
score: 0

http://stackoverflow.com/q/27366384
has title: Send image and additional informtion with AJAX to Servlet
upvote count: 3
type: Question
tagged with: java
tagged with: servlets
has body: Bonjour, I need to send an Image from a &lt;input type="file"&gt; element to a servlet. currently using ajax var files; $("input[type='file']").on("change",function(e) { files = e.target.files; $("#Submit-Button").prop({"disabled":false}); }); $("#Submit-Button").on("click", function(){ var data = new FormData(); $.each(files, function(key, value){ data.append(key, value); }); $.ajax({ url: "UploadServlet", type : "POST", data: data, cache: false, dataType: JSON, processData : false, contentType: false, success: function(data, textStatus, jqXHR){ //SUCCESS }, error: function(jqXHR, textStatus, errorThrown){ //ERROR } }); }) }); This is working and my servlet is receiving the file. However i want to send some additional information to the servlet. I tried (in the js ajax method) data : {data: data, userID : userID, username: username}, and (in the java servlet) String Filename = request.getParameter("uid") + request.getParameter("username")+".png"; Collection&lt;Part&gt; Parts = request.getParts(); which is obviously not working. And now I can't think of anything that would solve my problem.
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
score: 3
has answer: http://stackoverflow.com/a/27367243

http://stackoverflow.com/comment/43092977
type: QuestionComment
comment on: http://stackoverflow.com/q/27316562
has text: but you should know how to eat it @Abhinabyte :)
score: 0
type: Comment

http://stackoverflow.com/a/27389681
answers question: http://stackoverflow.com/q/27370837
has body: Ok so after reviewing the demos of famo.us Angular I ran across an example that properly scrolls. Documentation How to think about scrolling is different in famo.us than typical html. For what I think is a few reason [memory management, engine loop, etc] there is a directive called fa-scroll-view which will create a scroll event. The task doesnt end there. one must append that event to an element using pipes.
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27370837

import
type: Tag
tag name: import
tags question: http://stackoverflow.com/q/27338448

http://stackoverflow.com/comment/43322882
score: 0
type: QuestionComment
type: Comment
has text: You should explain better your question.
comment on: http://stackoverflow.com/q/27441502

http://stackoverflow.com/q/27386625
favorite count: 0
tagged with: angularjs
has body: I am attempting to one-time bind a parameter within an ng-click method. The HTML is being generated in the controller as part of a qTip tooltip. I have tried placing '::' before the method and the parameter, but I still end up with persistent data binding. This result is that when $scope.data.selectedEvent is updated, these methods no longer reference the original event. Any help would be most appreciated! eventRender: function(event,element,view) { // bind selected event to scope so it can be referenced in button methods $scope.data.selectedEvent = event // render qTip with buttons element.qtip({ content: $compile( ' ' + ' Confirm ' + ' Cancel ' + ' ' )($scope), })
type: UnansweredQuestion
upvote count: 4
answer count: 0
type: Question
has title: One-time binding of method parameter
tagged with: javascript
score: 4
downvote count: 0
tagged with: qtip2
has comment: http://stackoverflow.com/comment/43226564

http://stackoverflow.com/comment/43306853
score: 0
type: Comment
type: QuestionComment
has text: `content = "\n" + content;`
comment on: http://stackoverflow.com/q/27432777

http://stackoverflow.com/q/27384754
type: AnsweredQuestion
has title: mongoose / MEAN.js - model.find() returns empty array if filtered
linked to: http://stackoverflow.com/q/27464146
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/43230043
tagged with: mean-stack
has comment: http://stackoverflow.com/comment/43219976
tagged with: mongoose
tagged with: javascript
has comment: http://stackoverflow.com/comment/43220939
has answer: http://stackoverflow.com/a/27392104
score: 0
has body: im new to mean.js so it could be just wrong syntax, but when i use model.find() with a query inside (option.find({poll_id:1}) it returns an empty array. poll.server.model.js 'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Poll Schema */ var PollSchema = new Schema({ poll_id: {type:Number}, user_id: {type:Number}, poll_question: {type:String}, poll_language: {type:String}, poll_description: {type:String}, poll_description_raw: {type:String}, poll_weight_additional: {type:Number}, poll_flag_active:{type:Number,default:1}, poll_flag_18plus:{type:Number,default:0}, poll_flag_expire:{type:Number,default:0}, poll_flag_deleted:{type:Number,default:0}, poll_flag_moderated:{type:Number,default:0}, poll_flag_favourised:{type:Number,default:0}, poll_date_expiration:{type:Date}, poll_date_inserted:{type:Date,default:Date.now()}, poll_flag_updated:{type:Date}, show_thumbs:{type:Number}, comments:{ type: Schema.ObjectId, ref: 'User' } }); mongoose.model('Poll', PollSchema); option.server.model.js 'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Option Schema */ var OptionSchema = new Schema({ option_id:{type:Number}, poll_id:{type:Number}, option:{type:Number} }); mongoose.model('Option', OptionSchema); polls.server.controller.js /** * Module dependencies. */ var mongoose = require('mongoose'), errorHandler = require('./errors.server.controller'), Poll = mongoose.model('Poll'), Option = mongoose.model('Option'), _ = require('lodash'); /** * List of Polls */ exports.list = function(req, res) { Poll.find().limit(10).sort('_id')/*.populate('user', 'displayName')*/.exec(function(err, polls) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { for (var i=0; i &lt; polls.length; i++) { // this works, returns an array with 10 items Option.find().exec(function(err,docs){ console.log(docs); }); // this doesnt! although…
answer count: 1
accepted answer: http://stackoverflow.com/a/27392104
has comment: http://stackoverflow.com/comment/43221040
tagged with: node.js

http://stackoverflow.com/q/27455157
has answer: http://stackoverflow.com/a/27455235
has answer: http://stackoverflow.com/a/27455273
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43349854
tagged with: php
has comment: http://stackoverflow.com/comment/43348214
has title: How to store the order of added inputs in php?
type: Question
tagged with: javascript
has body: I have a form: Add file Add text I add inputs to the form by javascript: var form; window.onload=function(){ form=document.getElementById("myForm"); } function addFile(){ var input=document.createElement("input"); input.type="file"; input.name="files[]"; form.appendChild(input); } function addText(){ var input=document.createElement("input"); input.type="text"; input.name="texts[]"; form.appendChild(input); } I'd like to store the order in which the inputs were added. so in php i could do something like this: foreach($_POST["texts"] as $text){ $db -> insert("table", $text, $index); } foreach($_POST["file_paths"] as $path){ $db -> insert("table", $path, $index); } So in the database I could have something like this: 0 "text1" 1 "data/uploads/image.jpg" 2 "text2" I tried adding all the contents to an array in $_POST, then array_search() to get the index, but it's not going to work when two input's content is the same, and it seems sloppy. So how would you go about with such a task?
has comment: http://stackoverflow.com/comment/43348172
score: 0
answer count: 2

http://stackoverflow.com/comment/43221040
type: QuestionComment
has text: 1) Never apologize for asking questions — its assumed you're asking a question on SO because you're learning. Anyone on this forum that admonishes you for asking questions is missing the point. 2) Could you maybe write, in plain english, the query you are attempting to achieve? You've got a couple "problem areas" in your controller and before I can lend a hand, it would be good to know your objective
comment on: http://stackoverflow.com/q/27384754
score: 0
type: Comment

http://stackoverflow.com/comment/43238665
comment on: http://stackoverflow.com/a/27393312
score: 0
type: AnswerComment
has text: Thank you for your prompt response. Yes I don't have much experience in Javascript too. As a side question, don't you think if we rewrite these two function in one, it would be easier to understand?
type: Comment

http://stackoverflow.com/comment/43236996
has text: hmmmm if I get it correct I would need to create the file there with a PUT -File command and then checkin for teh file to be availbel?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27381989
score: 0

http://stackoverflow.com/comment/43281358
type: Comment
has text: Can you please write a code . That will help me thanks.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27418167

http://stackoverflow.com/a/27432574
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43307081
has comment: http://stackoverflow.com/comment/43307185
has body: Taken from the angular $watch source code comments: When objectEquality == true, inequality of the watchExpression is determined according to the {@link angular.equals} function. We can see that from the angular.equals documentation: During a property comparison, properties of function type and properties with names that begin with $ are ignored. So that explains why the $ properties are ignored for $watch comparisons. The $watchCollection function actually does it's own comparison to check to see if the objects are the same, whether or not they're arrays and if they're arrays it checks to see if the values are the same. Taken straight from the source code: if (oldLength !== newLength) { // if lengths do not match we need to trigger change notification changeDetected++; oldValue.length = oldLength = newLength; } // copy the items to oldValue and look for changes. for (var i = 0; i &lt; newLength; i++) { oldItem = oldValue[i]; newItem = newValue[i]; bothNaN = (oldItem !== oldItem) &amp;&amp; (newItem !== newItem); if (!bothNaN &amp;&amp; (oldItem !== newItem)) { changeDetected++; oldValue[i] = newItem; } } I can't speak to whether or not they implemented it that way on purpose, but that's certainly how it worked out =D
upvote count: 1
answers question: http://stackoverflow.com/q/27432193
type: Answer

http://stackoverflow.com/q/27376416
tagged with: node.js
tagged with: parallel-processing
score: 1
tagged with: concurrency
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
has body: I have a huge array of numbers. I want to compute a sum of all of the numbers using JavaScript / Node.js. (For the purposes of this question it's a simple sum; in reality I have a much more complex and lengthy mathematical operation to perform). In a single-threaded world, computing the sum takes a long time. To crunch the result quicker, I've been trying to delegate the work to multiple child processes running in parallel. Each child process determines the sum of a sub-array, and everything is totalled in the parent process. My two scripts are below: index.js function computeSum(data) { var start = new Date(); var sum = data.reduce(function(a, b) { return a + b; }); console.log("Sum = %s, Time = %s ms", sum, new Date().getTime() - start.getTime()); } function computeSumConcurrent(data) { var child_process = require("child_process"); var os = require("os"); var cpuCount = os.cpus().length; var subArraySize = data.length / cpuCount; var childProcessesFinished = 0; var start = new Date(); var sum = 0; for (var i = 0; i &lt; cpuCount; i++) { var childProcess = child_process.fork("child.js"); childProcess.on("message", function(message) { sum += message.sum; childProcessesFinished++; if (childProcessesFinished == cpuCount) { console.log("Sum = %s, Time = %s ms", sum, new Date().getTime() - start.getTime()); process.exit(); } }); childProcess.send({ subArray: data.slice(subArraySize * i, subArraySize * (i + 1)) }); } } console.log("Populating array..."); var data = [] for (var i = 0; i &lt; 50000000; i++) { data.push(Math.random()); } console.log("Computing sum without using child processes..."); computeSum(data); console.log("Computing sum using child processes..."); computeSumConcurrent(data); child.js process.on("message", function(message) { var sum = message.subArray.reduce(function(a, b) { return a + b; }); process.send({ sum: sum }); process.exit(); }); If you run index.js, you'll observe that the parallel sum is extremely slow. I think it may be due to childProce…
favorite count: 0
has answer: http://stackoverflow.com/a/27379224
tagged with: child-process
downvote count: 0
has title: How to use parallel child processes to perform "work" on a large array?
type: UnansweredQuestion

http://stackoverflow.com/comment/43109596
comment on: http://stackoverflow.com/q/27324802
score: 0
has text: @JuanMendes furthermore according to this http://stackoverflow.com/questions/27032656/does-it-make-sense-to-load-scripts-concurrently-in-java-8-nashorn-javascript-eng Nashorn is not thread-safe so it shouldn't create different globals (like Object constructor) for different threads.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43126299
has text: The ngClass is failing in the fiddle or in your code? If it's yours can you make a fiddle?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27327948

http://stackoverflow.com/q/27448433
has comment: http://stackoverflow.com/comment/43335769
has answer: http://stackoverflow.com/a/27448902
tagged with: javascript
has answer: http://stackoverflow.com/a/27448520
type: AnsweredQuestion
has title: Javascript print is displaying hidden elements
type: Question
accepted answer: http://stackoverflow.com/a/27448520
has body: I am trying to built a billing system using php and javascript. For that I need to print some content in a new tab. I am using the following code for this purpose. Where the variable divElements contains the inner html of my table that needs to be print. var print_body = ' '+ divElements +' '; //Print Page newWin= window.open(""); newWin.document.write(print_body); newWin.print(); using the class dop I am trying to hide the unwanted elements. In the print preview the the design displaying correctly but when taking printout, the hidden elements are printing in the paper. I think the problem is print function is running before the style loads. Please help me to solve the issue. thanku
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/27448682
has answer: http://stackoverflow.com/a/27448682

http://stackoverflow.com/comment/43297527
comment on: http://stackoverflow.com/q/27427963
score: 0
type: Comment
type: QuestionComment
has text: try get elementbytagname("body")[0].style.backround = whatever

http://stackoverflow.com/q/27359993
tagged with: jquery-ui
tagged with: pickadate
has answer: http://stackoverflow.com/a/27360327
has answer: http://stackoverflow.com/a/69701374
possible better answer: http://stackoverflow.com/a/27360327
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27361174
tagged with: jquery
has body: If you open a time picker in a jQuery dialog using the classic theme and try to use the time picker scroll bar to move down the time list, the time list disappears. You can see the issue here: http://jsfiddle.net/7c2z840a/7/ jQuery("#tmStart").pickatime({ editable: true, format: 'h:i A', formatSubmit: 'HH:i', //hiddenSuffix: '_FORMATTED', interval: 15, min: [7,0], max: [21,0] }); The problem appears in both Chrome and Firefox, but not in IE. Anyone have any ideas as to why this is happening and how to fix it?
favorite count: 0
tagged with: jquery-ui-dialog
score: 0
answer count: 4
upvote count: 1
downvote count: 1
has title: Pickadate Time Selector Disappears on Click on JQuery UI Dialog
has comment: http://stackoverflow.com/comment/43173913
has answer: http://stackoverflow.com/a/27361174
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27361265

http://stackoverflow.com/q/27471474
type: UnansweredQuestion
tagged with: ecmascript-6
score: 2
has body: Please can someone confirm my understanding of ES modules? In javascripts/bar.js: var foo = 2; export function Bar() {} In index.html &lt;script&gt; import { Bar } from 'javascripts/bar'; var b = new Bar(); // Instantiates an instance of Bar. &lt;/script&gt; Under the hood the ES6 engine will load bar.js when it evaluates import { Bar } from 'javascripts/bar';, and block upon return of that module over HTTP? Or is bar.js downloaded prior to evaluation of the script in index.html? Because bar.js is loaded using the import keyword, the globals in bar.js are scoped to that module and are not visible globally? Now if I want to concatenate modules, I will continue to need to wrap my modules in IIFEs, so that their scopes remain distinct (or at least use a build step that does this under the hood)?
tagged with: javascript
has comment: http://stackoverflow.com/comment/49151815
type: Question
has title: Understanding ES6 modules
tagged with: module
favorite count: 0
upvote count: 3
answer count: 1
has answer: http://stackoverflow.com/a/30560672
downvote count: 1

http://stackoverflow.com/comment/44198391
comment on: http://stackoverflow.com/a/27373949
type: Comment
has text: It is confirmed by Google as being a "feature": https://code.google.com/p/chromium/issues/detail?id=446060
score: 1
type: AnswerComment

http://stackoverflow.com/q/27386968
has answer: http://stackoverflow.com/a/27387072
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I am trying to get base64 string representation of an image giving its URL. HTML: &lt;input type="text" value="" id="urlFileUpload"/&gt; &lt;input type="button" id="btn" value="GO" /&gt; JS: $('#btn').click(function() { var img = new Image(); img.src = $('#urlFileUpload').val(); img.onload = function () { var canvas = document.createElement("canvas"); canvas.width = this.width; canvas.height = this.height; var ctx = canvas.getContext("2d"); ctx.drawImage(this, 0, 0); console.log(canvas.toDataURL("image/png")); } }); I get this error: Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. Here is a JSFiddle.
score: 1
duplicate of: http://stackoverflow.com/q/22710627
upvote count: 1
type: Question
has title: Get Base64 string from image URL
tagged with: javascript
tagged with: base64
tagged with: image
linked to: http://stackoverflow.com/q/22710627
answer count: 1
downvote count: 0

cryptography
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/27318857

http://stackoverflow.com/comment/43270959
type: QuestionComment
score: 0
has text: we are implemnting in Spring MVC
comment on: http://stackoverflow.com/q/27395493
type: Comment

http://stackoverflow.com/comment/43373407
has text: Love down voters who are too lazy to explain their vote.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27466656

http://stackoverflow.com/comment/43143012
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27342428
has text: Well it sounds like a common use case to me as well, which is why I suggested raising a feature request.. :)

http://stackoverflow.com/comment/43233818
type: Comment
comment on: http://stackoverflow.com/a/27372393
has text: Ok @Reinmar why don't you show us right approach with Example.
type: AnswerComment
score: 0

http-redirect
tags question: http://stackoverflow.com/q/27335921
tags question: http://stackoverflow.com/q/27423403
type: Tag
tags question: http://stackoverflow.com/q/27338924
tags question: http://stackoverflow.com/q/27453830
tags question: http://stackoverflow.com/q/27442576
tags question: http://stackoverflow.com/q/27379903
tags question: http://stackoverflow.com/q/27454205
tag name: http-redirect
tags question: http://stackoverflow.com/q/27349252

http://stackoverflow.com/comment/43144652
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27339810
type: Comment
has text: Thanks for the info. Makes sense. But it looks like you fiddle is in the same spot that we started with. The route isn't showing.

http://stackoverflow.com/q/27395792
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27395881
has answer: http://stackoverflow.com/a/27397081
has comment: http://stackoverflow.com/comment/43237996
has title: Javascript: how nested functions get variables from parent function
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27395881
score: 0
has comment: http://stackoverflow.com/comment/43238023
has answer: http://stackoverflow.com/a/27395914
has body: I've read everything about js closures but can't understand the following code: function main(condition){ var a; if (condition){ a="aaa"; } else { a="bbb"; return; } button.addEventListener("click", function(){ alert(a);}); } main(true); main(false); After that click button. The result is:"aaa". Doest this mean that for nested function doesn't keep the reference to variables but copy them? Please explain.
possible better answer: http://stackoverflow.com/a/27396993
has answer: http://stackoverflow.com/a/27396993
answer count: 4

http://stackoverflow.com/q/27351816
has comment: http://stackoverflow.com/comment/43157702
type: Question
has comment: http://stackoverflow.com/comment/43157793
tagged with: php
has body: The console ends up writing back Uncaught ReferenceError: provhtml is not defined Also, when I change up my Javascript to be the code right below, the console ends up just writing " &lt;?= $provhtml ?&gt;" var provnum = "&lt;?= $provhtml ?&gt;"; console.log(provnum); I'm not exactly sure what the problem is. I want $provhtml to be written inside the console when a user clicks a button named otherlistbut (I'm also not sure if there needs to be the d.preventDefault(); Here is my prov.php &lt;?php $phonenum = $_POST["phonenum"]; $provhtml = file_get_contents('http://api.data24-7.com/v/2.0?user=USERNAME&amp;pass=PASSWORD&amp;api=C&amp;p1=1' . $phonenum); ?&gt; Here are my scripts in my index.html $('button[name="otherlistbut"]').click(function(d) { lookupProvider(d); }); }); /************ FUNCTIONS ******************/ function lookupProvider(d) { d.preventDefault(); var phonenum = $('input[name="phonenum"]').val(); $.ajax({ type: 'POST', data: { phonenum: phonenum }, url: 'prov.php', success: function(data) { var provnum = $(provhtml); console.log(provnum); }, error: function(xhr, err) { console.log("readyState: " + xhr.readyState + "\nstatus: " + xhr.status); console.log("responseText: " + xhr.responseText); } }); }
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27351917
tagged with: javascript
has title: Passing variable from Javascript to PHP and back
has comment: http://stackoverflow.com/comment/43157728
type: AnsweredQuestion
tagged with: variables
tagged with: jquery
has comment: http://stackoverflow.com/comment/43157624
accepted answer: http://stackoverflow.com/a/27351917

http://stackoverflow.com/comment/43185337
type: QuestionComment
has text: for some reason this is not working for me either. this.animate is not a function: this.myinterval = setInterval(function() {this.animate(this.endpointx,this.endpointy);}, 10);
comment on: http://stackoverflow.com/q/27366481
score: 0
type: Comment

http://stackoverflow.com/comment/43268991
has text: This does not work since the function is executed as soon as the controller is created.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27412068
type: AnswerComment

http://stackoverflow.com/a/27358840
score: 2
upvote count: 3
has body: Move the % inside of the quotes. ng-style="{'width' : '{{ progress }}%' }"&gt;
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27358784

http://stackoverflow.com/comment/43126256
comment on: http://stackoverflow.com/a/27333356
score: 0
type: AnswerComment
type: Comment
has text: @SaB Time to learn, as you'll have a faster, more efficient, and easier to maintain site.

http://stackoverflow.com/comment/43264486
score: 0
comment on: http://stackoverflow.com/q/27409950
type: QuestionComment
type: Comment
has text: cport I don't mean exactly to go to that url, I have just used it as an example.. it all depends what the user inputs. so whatever the user inputs and he/she clicks submit, I want it to go http://sites.com/driver/userinput

http://stackoverflow.com/q/27450443
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27450542
tagged with: http://stackoverflow.com/tag/html
has body: In HandleBars JS I can easily iterate over key values. var context = { "object" : { "numbers" : [{data : 1}, {data : 2}, {data : 3}, {data : 4}, {data : 5}], "letters" : [{data : 'a'}, {data : 'b'}, {data : 'c'}], "people" : [{data : 'Linus'}, {data : 'Larry'}, {data : 'Dennis'}, {data : 'Steve'}] } }; {{#each object}} &lt;span&gt;{{@key}}&lt;/span&gt; {{#each this}} /* LOOP THROUGH EACH ARRAY HERE HOW DO I ACCESS THE 'data' KEY? */ {{/each}} {{/each}} Is there anyway to loop through all the array members using the keys or by another method without registering a Handlebars helper? I would want my output to look something like numbers 1 2 3 4 5 letters a b c people Linus Larry Dennis Steve
type: AnsweredQuestion
tagged with: handlebars.js
has title: Iterate over arrays of objects in object keys
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/27450542
type: Question
has comment: http://stackoverflow.com/comment/43339456
has comment: http://stackoverflow.com/comment/43339422
has comment: http://stackoverflow.com/comment/43339390
score: 0

http://stackoverflow.com/a/27446917
score: 1
has comment: http://stackoverflow.com/comment/43335166
accepted answer of: http://stackoverflow.com/q/27446752
has body: Two things: Your code is relying on the automatic global that browsers create for elements that have ids on them, by using version as a global variable without declaring or initializing it. Perhaps for some reason, the automatic global isn't working on browsers other than IE. I don't like to rely on them anyway, it's too easy to shadow them, so I suggest getting the element on purpose by adding this near the top of your script: var version = document.getElementById("version"); But your comment on the question suggests that it's not this, but #2 below: You may need vesrion.contentDocument rather than version.document in your currVersion = version.document.getElementById("version").value; and similar lines; perhaps JavaScript's curiously-powerful || operator: var versionDoc = version.document || version.contentDocument; // ...and then currVersion = versionDoc.getElementById("version").value; // ...and so on Side note: Just to keep yourself and whoever has to maintain the code after you sane, I'd also suggest different id values for the version frame and the version input inside it.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27446752
has comment: http://stackoverflow.com/comment/43334683
type: Answer
has comment: http://stackoverflow.com/comment/43333203
has comment: http://stackoverflow.com/comment/43333899
upvote count: 1
has comment: http://stackoverflow.com/comment/43334381
has comment: http://stackoverflow.com/comment/43335850

http://stackoverflow.com/comment/43249304
type: Comment
has text: 'document.styleSheets' returns [object StyleSheetList]. I don't know how to get the various attributes of the Stylesheets from it.
score: 0
comment on: http://stackoverflow.com/q/27395573
type: QuestionComment

http://stackoverflow.com/q/27412603
has title: how to change the position of the legend-nvd3 graphs
type: Question
has comment: http://stackoverflow.com/comment/43269817
has answer: http://stackoverflow.com/a/27414211
answer count: 2
possible better answer: http://stackoverflow.com/a/36509214
has answer: http://stackoverflow.com/a/36509214
tagged with: javascript
tagged with: legend
has body: How can I change the position of the legend, where the legend being on the right most side, I can make it move to the left most side? I tried to do some changes in the nvd3.js code, but that hasn't worked for me at all!. I'm sure how and where can i add attributes to change the position? Just for info, here is the legend (Key Usage', 'block Usage','other usage') whose position im trying to change: Any ideasss? Thanks!
accepted answer: http://stackoverflow.com/a/27414211
type: AnsweredQuestion
tagged with: nvd3.js
score: 0

http://stackoverflow.com/q/27352980
has body: Basically, I have a directive which is used by two forms. On page load, each loads the default properties set by the directive. The problem is, both forms need to have a checkbox option to be able to apply the same properties to the other form. I have two separate html templates and controllers for each form. return function row(ModelService) { return { restrict: 'E', templateUrl: function(elem, attr) { return elem.templateUrl; }, scope: { formTitle: '@', type: '@' }, link: function(scope, elem) { scope.setDefault = function() { . . scope settings defined here . . . } scope.close = function (action) { . . if(checked) { . some code needed to apply the settings to the other form . } . . . } }; }); &lt;div ng-controller="app.FirstCtrl"&gt; &lt;propFilter form title="someTitle" template-url="someUrl"&gt;&lt;/propFilter&gt; . . multiple div elements with ng-model . . . &lt;input id="applyToOther" type="checkbox"&gt; &lt;/div&gt; &lt;div ng-controller="app.secondCtrl"&gt; &lt;propFilter form title="someTitle" template-url="someUrl"&gt;&lt;/propFilter&gt; . . multiple div elements with ng-model . . . &lt;input id="applyToOther" type="checkbox"&gt; &lt;/div&gt; What I want to know is how to copy the properties of a scope to the other scope using the same directive if possible. Any help would be very much appreciated. Thank you!
tagged with: angularjs-scope
type: Question
has comment: http://stackoverflow.com/comment/43159737
has answer: http://stackoverflow.com/a/27357486
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Copy scope property from another isolated scope using one directive
answer count: 1
tagged with: angular-ui
accepted answer: http://stackoverflow.com/a/27357486
tagged with: angularjs
upvote count: 1
has comment: http://stackoverflow.com/comment/43159591
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1

http://stackoverflow.com/a/27329952
downvote count: 0
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27329869
has body: You need to compose an query object with the key being the value in the nameparameter and value being the value in the parameter value. function findStud(name,value){ var query = {}; query[name] = value; return db.graduates.find(query); } By default when you don't do this, name is considered to be a String literal and the query gets executed as db.graduates.find({"name":value}); which searches for a key named name with the specified value, causing the query to fail. See Also: Mongodb doesn&#39;t not update when I use like this
answers question: http://stackoverflow.com/q/27329869
type: AcceptedAnswer

http://stackoverflow.com/a/27428889
score: 1
has body: Here's my attempt, just for the challenge: ^(?!\d*?(\d+?)\1)\d{6,15}$ Demo The (?!\d*?(\d+?)\1) part will make sure there are no groups of repeated digits by matching a group of digits and trying to match the same digits immediately after. If it finds one, the match fails. If you want to allow two same consecutive digits, replace (?!\d*?(\d+?)\1) with (?!\d*?(\d{2,}?)\1)(?!(\d)\2*(\d)(?:\2|\3)*$). This will then make sure there are more than 2 different digits by matching a series of one digit, then a different digit followed by a series of a combination of both digits. If it reaches the end of the string it forces the match to fail. But it'll be probably more maintainable to just do it the conventional way, without regex.
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/27428720
has comment: http://stackoverflow.com/comment/43308255
downvote count: 0
has comment: http://stackoverflow.com/comment/43309627
has comment: http://stackoverflow.com/comment/43308153

http://stackoverflow.com/comment/43344451
type: Comment
score: 0
has text: @Madbreaks can you please have a quick join.me session with me, because I'm really running out of ideas, if you're very good with JS you'll help me in 2-3 mins. Thanks
comment on: http://stackoverflow.com/q/27452887
type: QuestionComment

http://stackoverflow.com/comment/43401091
comment on: http://stackoverflow.com/q/27380018
score: 0
type: Comment
type: QuestionComment
has text: @Mephiztopheles - The problem is only with the CMD key (`event.metaKey` courtesy jQuery).

http://stackoverflow.com/comment/43372841
type: QuestionComment
comment on: http://stackoverflow.com/q/27468714
has text: Do you want to color the labels or the axis itself?
score: 0
type: Comment

http://stackoverflow.com/q/27429634
tagged with: javascript
has comment: http://stackoverflow.com/comment/43340803
score: 0
linked to: http://stackoverflow.com/q/21138388
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43302064
has title: Angular bootstrap lifecycle: Run code after full load
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43300647
has comment: http://stackoverflow.com/comment/43302013
has body: Angular defines a run() block for an application module. This runs after config() and before any controllers and directives are loaded. Is there a step in the lifecycle to run something after all controllers, directives, services, etc are loaded? I need this in order to broadcast a message in my authorization pubsub service, and I want to ensure that everything is loaded before I publish the message. While I can check authentication in the run block (basically, just checking localstorage for a JWT via my authentication service), if I publish in the run() block I can't be sure if everything has loaded. I'm wondering if Angular exposes anything like this or whether I need to find a different solution. Thanks!
has comment: http://stackoverflow.com/comment/43300749
has answer: http://stackoverflow.com/a/31159330
type: Question

http://stackoverflow.com/a/27382809
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: Try this. When you pass it as a parameter, pass as string, not the variable. var one = 100; var change = function(name, value) { window[name] = value; }; change('one', 300); console.log(one);
accepted answer of: http://stackoverflow.com/q/27382701
answers question: http://stackoverflow.com/q/27382701

http://stackoverflow.com/comment/43186848
type: AnswerComment
has text: How about over-riding the data attribute value.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27367383

graphael
tag name: graphael
tags question: http://stackoverflow.com/q/27426971
type: Tag

http://stackoverflow.com/comment/64478585
type: QuestionComment
type: Comment
has text: @apsillers This question has been extremely helpful! (+1). I'm wondering though how I might set the CORS response header on my own web server. I've built my own webserver with Ubuntu Mate 14.04 and LAMP with Apache2 and I've been banging the wall for many hours trying to figure this out. Any suggestions? Thank you :)
comment on: http://stackoverflow.com/q/27429123
score: 0

http://stackoverflow.com/a/27974869
type: Answer
has body: Use the cleanup function to remove watchers: function cleanup(element) { element.off().removeData(); var injector = currentSpec.$injector; element.$injector = null; // clean up jquery's fragment cache angular.forEach(angular.element.fragments, function(val, key) { delete angular.element.fragments[key]; }); angular.forEach(angular.callbacks, function(val, key) { delete angular.callbacks[key]; }); angular.callbacks.counter = 0; } Use a self-destructing service as a simple bind once: function onetime() { /*...*/ onetime = Function; } angular.module('myApp').constant('bindonce', onetime); angular.module('myApp').controller('foo', function($bindonce){ this.$inject = '$bindonce'; $scope.mybind = $bindonce(); } Use the migration guide for reference to find breaking changes: References testabilityPatch.js angular-mocks.js AngularJS Developer Guide: Migration from Previous Versions
downvote count: 1
answers question: http://stackoverflow.com/q/27400422
has comment: http://stackoverflow.com/comment/44348398
score: -1
upvote count: 0

http://stackoverflow.com/comment/43310916
type: Comment
score: 1
has text: Exactly what I would have suggested.
comment on: http://stackoverflow.com/a/27435008
type: AnswerComment

http://stackoverflow.com/q/27449305
answer count: 0
has comment: http://stackoverflow.com/comment/43405697
has title: Activex object making site as untrusted for ie
type: Question
score: 0
tagged with: activex
has comment: http://stackoverflow.com/comment/43337307
has comment: http://stackoverflow.com/comment/43369130
tagged with: internet-explorer
tagged with: trusted-sites
tagged with: javascript
type: UnansweredQuestion
has body: I am testing one plugin availabilty using ActiveX object (new ActiveXObject("Microsoft.LWAPlugin15.8.InProcComponentFx") in javascript. But in IE browser it is not giving correct result. if i add my site (localhost or ip) as a trusted site then it is giving correct result. But client don't know this settings. Now my question is How to make my site as a trusted site for IE?

http://stackoverflow.com/comment/43297586
has text: At a glance it looks good, but you probably want [codereview](http://codereview.stackexchange.com/) and not SO.
comment on: http://stackoverflow.com/q/27427953
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/27415427
has comment: http://stackoverflow.com/comment/43277106
type: Question
has comment: http://stackoverflow.com/comment/43281482
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Uncaught TypeError: Cannot read property '0' of undefined - in jqGrid Spring MVC
favorite count: 0
has comment: http://stackoverflow.com/comment/43277924
has body: I got the message : Uncaught TypeError: Cannot read property '0' of undefined in jqGrid.min.js . When I submit to update data from grid. my script: $('#list-student').jqGrid({ url: 'GetAllStudent', datatype: 'json', colNames:['ID','Student', 'Birth day', 'Is Male ?','Province'], colModel:[ {name:'id',index:'id', editable:false,width:100, align:'center'}, {name:'name',index:'name',editable:true, width:240}, { name:'birth', index:'birth', editable:true, width:200, align:'center', editoptions:{ size:12, dataInit:function(el){ $(el).datepicker({dateFormat:'yy-mm-dd', beforeShow: function(){ $('.ui-datepicker').css({'font-size': 11, 'line-height': 1.2}) } }); } }, editrules:{required:true} }, {name:'male',index:'male', editable:true, formatter:'checkbox',width:100, align:'center',edittype:'checkbox',editoptions:{value:'true:false'}}, {name:'homeTown.nameProvince',editable:true, index:'province', align:'center',edittype:'select',editoptions:{dataUrl:'GetAllProvinceHTML'}} ], jsonReader : {repeatitems:false}, rowNum: 10, rowList:[10,20,30], pager: '#pager', sortname: 'id', viewrecords: true, height: 'auto', width: 'auto', sortorder: 'asc', loadonce: true, caption:'List Students', editurl: 'EditStudent' }); $('#list-student').jqGrid( 'navGrid', '#pager', {view:true}, { reloadAfterSubmit:false, closeOnEscape:true, jqModal:true, afterSubmit:function(response, post_data){ console.log(response.responseText); }, closeAfterEdit: true }, // edit options {reloadAfterSubmit:false,jqModal:true, closeOnEscape:true,bottominfo:'Fields marked with (*) are required', closeAfterAdd: true}, // add options {reloadAfterSubmit:false,jqModal:true, closeOnEscape:true}, // del options {closeOnEscape:true}, // search options {jqModal:true,closeOnEscape:true} // view options ); in Spring Controller package controller; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import model.Province; import model.Pro…
has answer: http://stackoverflow.com/a/46956861
has comment: http://stackoverflow.com/comment/43284236
upvote count: 3
has comment: http://stackoverflow.com/comment/43276685
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43278797
tagged with: spring
has comment: http://stackoverflow.com/comment/43281827
tagged with: spring-mvc
score: 3
has comment: http://stackoverflow.com/comment/43276865
tagged with: jqgrid

http://stackoverflow.com/a/27437471
score: 0
has body: You need to add .html() in your final code . i have updated your coded with this link
type: Answer
answers question: http://stackoverflow.com/q/27437358

http://stackoverflow.com/comment/43237803
has text: @Bergi: ..what kind of xss problems? function getMealByCategory(category, mealNr){ var meals = getMealsByCategory(category); /* another js function, calls to php function with jquery ajax, works fine */ var meal = meals[mealNr]; return meal; }
score: 0
comment on: http://stackoverflow.com/a/27382069
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43216052
type: Comment
type: QuestionComment
has text: `for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);` is the nastiest line of code I've seen in a while.
comment on: http://stackoverflow.com/q/27383611
score: 0

http://stackoverflow.com/a/27424430
accepted answer of: http://stackoverflow.com/q/27423978
answers question: http://stackoverflow.com/q/27423978
type: Answer
has body: Please see working demo var app = angular.module('app', []); app.controller('ArduinoCtrl', function($scope, $http) { $scope.response = {}; $scope.progress = false; $scope.setServo = function(setting) { $scope.progress = true; var url = "http://192.168.1.79/arduino/" + setting $http.get(url).then(sucess, error).then(function() { $scope.progress = false; }); function sucess(response) { angular.copy(response, $scope.response) } function error(response) { angular.copy(response, $scope.response) } } }); 3 Seconds(Food) 9 Seconds(Food) Please wait Response
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/27439487
answers question: http://stackoverflow.com/q/27393572
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43360973
upvote count: 1
type: AcceptedAnswer
has body: term.open() does a focus for the terminal at the end of the function. Simply comment it out and it won't scroll down to the terminal. At line 801: setTimeout(function() { self.element.focus(); }, 100); I made a JSFiddle to demonstrate it. As an alternative to modifying the code you could put the terminal into an iframe. load the terminal dynamically on a user event (button click).
accepted answer of: http://stackoverflow.com/q/27393572

polymer
tags question: http://stackoverflow.com/q/27434442
tags question: http://stackoverflow.com/q/27366617
tags question: http://stackoverflow.com/q/27316935
tags question: http://stackoverflow.com/q/27333261
tags question: http://stackoverflow.com/q/27445341
tag name: polymer
tags question: http://stackoverflow.com/q/27324235
tags question: http://stackoverflow.com/q/27473783
tags question: http://stackoverflow.com/q/27471381
tags question: http://stackoverflow.com/q/27456519
tags question: http://stackoverflow.com/q/27365819
tags question: http://stackoverflow.com/q/27469726
tags question: http://stackoverflow.com/q/27360901
tags question: http://stackoverflow.com/q/27429836
tags question: http://stackoverflow.com/q/27407709
tags question: http://stackoverflow.com/q/27456554
type: Tag
tags question: http://stackoverflow.com/q/27357014
tags question: http://stackoverflow.com/q/27473437

http://stackoverflow.com/a/41983310
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27314663
type: Answer
upvote count: 1
has body: Another way of tackling this problem is to make a new element in your person class and then use that. Example public class Person { public int Id {get;set;} public string Name {get;set;} public DateTime Birthday {get;set;} public string BirthdayFormat { get { return Birthday.toString("dd/MM/YYYY") }} } I would have thought this would be the best way as then all the formating is in one place and where possible you can use. [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/YYYY}")] Above the Birthday element, so that displayFor will use the correct formatting.

http://stackoverflow.com/comment/43306065
has text: Collision detection requires knowing the shape of the objects, and all relevant dimensions and requires comparisons in at least two dimensions to detect intersection. I only see you comparing height, nothing else.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27432262

http://stackoverflow.com/comment/43286948
type: QuestionComment
has text: P.S. I've read that it would not be a good idea to use eval(), so I did not even try it. Maybe there is a way without using this?
type: Comment
comment on: http://stackoverflow.com/q/27422352
score: 0

http://stackoverflow.com/q/27447343
has answer: http://stackoverflow.com/a/27447418
score: 0
answer count: 1
has title: Grunt Task default not found
accepted answer: http://stackoverflow.com/a/27447418
has body: When I run the command grunt I receive the error: Warning: Task "default" not found. Use --force to continue. My Gruntfile.js : module.export = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: { dist: { files: { 'dist/flatify.css':'sass/style.scss' } } }, autoprefixer: { dist: { files: { 'dist/dist/flatify.css':'dist/flatify.css' } } }, cssmin: { css: { scr: 'dist/flatify.css', dest: 'dist/flatify.min.css' } }, watch: { css:{ files: '**/*.scss', tasks: ['sass','autoprefixer','cssmin:css'] } } }); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-autoprefixer'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', ['sass','autoprefixer', 'cssmin']); } My package.json: { "name": "Flatify", "version": "0.0.1", "description": "An beautiful CSS framework", "repository": { "type": "git", "url": "https://github.com/1ClickComputing/Flatify.git" }, "keywords": [ "CSS" ], "author": "", "license": "MIT", "bugs": { "url": "https://github.com/1ClickComputing/Flatify/issues" }, "homepage": "https://github.com/1ClickComputing/Flatify", "devDependencies": { "grunt": "^0.4.5", "grunt-autoprefixer": "^2.0.0", "grunt-contrib-cssmin": "^0.10.0", "grunt-contrib-sass": "^0.8.1", "grunt-contrib-uglify": "^0.6.0", "grunt-contrib-watch": "^0.6.1" } }
type: AnsweredQuestion
tagged with: javascript
tagged with: gruntjs
type: Question

http://stackoverflow.com/q/27431912
upvote count: 1
accepted answer: http://stackoverflow.com/a/27432011
type: Question
has title: Javascript .getAttribute() works but .attr() does not
tagged with: javascript
downvote count: 4
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/43305418
favorite count: 0
has comment: http://stackoverflow.com/comment/43305040
has answer: http://stackoverflow.com/a/27432011
has comment: http://stackoverflow.com/comment/43305041
possible better answer: http://stackoverflow.com/a/27432073
score: -3
has answer: http://stackoverflow.com/a/27432073
has body: Try to understand why .getAttribute("id") can get the value but .attr("id") cannot. I wrote a Jquery plugin function and try to get the selector or id from the one that uses the plugin function. In my HTML, the plugin function call is - &lt;script&gt; $(document).ready(function() { var langObj = {"lang" : "en"}; var curMap = {"testMap" : "tttt"}; $("#test_id").testProduct({ 'error_msg' : 'ERROR NOT LOAD.' }).load(langObj, curMap); }); &lt;/script&gt; In my JQuery plugin function - (function($){ var pluginName = "testProduct", defaults = {}; $.test.testProduct = function(element, options) { this.apiLoadType = { 'ERROR' : 'error' } this.options = $.extend({}, defaults, options); this.element = element; return this; }; $.test.testProduct.prototype = { _load: function(langObj, curMap) { console.log(this); //Chrome console log #1 console.log(this.element) //Chrome console log #2 this.element.getAttribute("id"); //show the id this.element.attr("id"); //not show the id }, //PUBLIC load: function(langObj, curMap) { var self = this; this._load(langObj, curMap); return this; } } $.fn[pluginName]= function(options) { var el = null; this.each(function () { el = new $.test[pluginName]( this, options ); }); return el; }; })(jQuery); Chrome console log #1 - $.testFn.testProduct {apiLoadType: Object, options: Object, element: div#test_id.test_id2, errorElement: null} apiLoadType: Object element: div#test_id.test_id2 accessKey: "" align: "" baseURI: null attributes: NamedNodeMap 0: id ... className:"test_id2" id:"test_id" outerHTML: "&lt;div id="test_id" class="test_id2"&gt;&lt;/div&gt;" outerText: "" ... options: Object __proto__: Object Chrome console log #2 - &lt;div id="test_id" class="test_id2"&gt;&lt;/div&gt; Why this.element.getAttribute("id"); can show the element id? Which Jquery method should I use to get the selector or element id from my element is this case?
type: AnsweredQuestion

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/27359155
tags question: http://stackoverflow.com/q/27379648
tags question: http://stackoverflow.com/q/27402217
type: Tag

http://stackoverflow.com/q/27315270
possible better answer: http://stackoverflow.com/a/27315326
type: AnsweredQuestion
has body: I am writing a simple game to help learn javascript. What I want to happen is if game.playerTurn is true, then this extra method is added to my buttons. Conversely, if game.PlayerTurn is false, I don't want this method to execute. .bind seems to add the method forever (so if statements don't really work). and binding and unbinding seems a bit heavy handed as something to do each round (there are 12 buttons). Can an expert out there point me in the right direction? What would be the normal way to do this? Further info: when it is the computer's turn, I am using a .trigger function to push the buttons and store their values in an array called game.computer. That all works. if(game.playerTurn){ $( "#one" ).bind( "click", function() { game.player.push(1); }); $( "#two" ).bind( "click", function() { game.player.push(2); }); }
type: Question
has answer: http://stackoverflow.com/a/27315326
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/27315344
accepted answer: http://stackoverflow.com/a/27315344
has title: What is a simple way to add and subtract a method to a button, based on a boolean var?

http://stackoverflow.com/a/27362268
has comment: http://stackoverflow.com/comment/43177525
downvote count: 0
has body: intData = ({ A: 1, B: 2, C: 3})[strData] For example (transcript from Chrome debugger console): &gt; (function() { var strData = "C"; return ({ A: 1, B: 2, C: 3})[strData]; })() &lt;- 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27362099
answers question: http://stackoverflow.com/q/27362099
has comment: http://stackoverflow.com/comment/43200033
type: Answer
has comment: http://stackoverflow.com/comment/43213405
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/43186485

http://stackoverflow.com/a/27457484
type: AcceptedAnswer
downvote count: 0
score: 10
has body: The error is clear. There are two directives on the same element that is trying to use transclusion: 1. ng-if 2. ng-include An element can only apply one transclusion. To fix, try this instead:
type: Answer
answers question: http://stackoverflow.com/q/27456294
accepted answer of: http://stackoverflow.com/q/27456294
upvote count: 10

http://stackoverflow.com/comment/43346109
has text: I removed cleanNode and added the "with" binding along with the other changes you had but it's not working for me. When I click the link to open the modal, I'm getting an error like this: Uncaught ReferenceError: Unable to process binding "value: function (){return Foo } (Foo is not defined). It was working before the "with" bind.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27453338
type: Comment

http://stackoverflow.com/q/27346346
has answer: http://stackoverflow.com/a/27346516
linked to: http://stackoverflow.com/q/6339790
upvote count: 2
type: AnsweredQuestion
has body: I would like to ask what is the purpose of such a response when making XHR or when a push notification is made by a server to the browser: for(;;);[{"syncId": 2, "changes" : [["change",{"pid":"7"},["10",{"id":"7"}]]], "state":{"5":{"childData":{"7":{"alignmentBitmask":48,"expandRatio":0}}},"7":{"caption":"This is the real UI","text":""}}, "types":{"5":"1","7":"10"}, "hierarchy":{"5":["7"],"7":[]}, "rpc" : [], "meta" : {"async":true}, "resources" : {}, "typeMappings" : { "com.vaadin.ui.AbstractField" : 11 , "com.vaadin.ui.AbstractTextField" : 12 , "com.vaadin.ui.TextArea" : 10 }, "typeInheritanceMap" : { "11" : 6 , "12" : 11 , "4" : 9 , "6" : 5 , "10" : 12 , "8" : 4 , "9" : 6 , "1" : 8 }, "timings":[185, 6]}] I mean, I know it is a JSON (or at least, it should be), but what about the for(;;); at the beginning of the response? What is it for?
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/27346431
has title: What is the purpose of a JSON starting with an empty for(;;); in Javascript when making XHR or receiving Push notifications?
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27346516
tagged with: push-notification
tagged with: xmlhttprequest
favorite count: 0
possible better answer: http://stackoverflow.com/a/27346431
score: 2

http://stackoverflow.com/comment/43140461
type: Comment
comment on: http://stackoverflow.com/a/27341288
has text: Then you have to change the time values used in the timeout function at each iteration. I changed the code. Check if it works now..
type: AnswerComment
score: 0

http://stackoverflow.com/a/27424737
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/27424250
has body: You're overwriting variables. In the beginning you declare a variable body, and then you say body = new CANNON.Body... and after that you use the same sentence for the second sphere, so the first one gets overwritten. You should have a variable body2, a variable mesh2 to avoid this. This approach would work ok if you only need two bodies, but if you're planning to have more you need a different approach: Arrays. In an Array you can store all your bodies and then loop through it and handle each one singularly. Example: Here we create 10 bodies: var bodies= []; //create the array for (var i = 0; i &lt; 10; i++) { bodies.push({ //insert into the array an object that contains the information for each body/mesh body: new CANNON.Body({mass:0.2}), mesh = new THREE.Mesh(geometry,material) }) }; And then we use them: for (var i=0, l=bodies.length; i &lt; l; i++) { //we loop through each body var body = bodies[i]; //this will be the current body //MOVE THE BODY AND UPDATE THE MESH HERE } This would be a better approach. It's more maintainable and you can have as many bodies as the browser can handle. If you only need two, your fastest fix would to add a second variable for the second body and handle it separately. EDIT: Watch this: https://www.youtube.com/watch?v=tW6pmzd34Hc he stores the circles into an array as well. I hope it makes it a little bit clearer.
answers question: http://stackoverflow.com/q/27424250

http://stackoverflow.com/comment/43265335
comment on: http://stackoverflow.com/q/27396253
has text: Yes, you are right. But after it when click on image, thrn image loads in new tab.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43214934
type: QuestionComment
comment on: http://stackoverflow.com/q/27382162
score: 0
has text: @MZeinstra it's sites.js
type: Comment

http://stackoverflow.com/comment/43310951
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27435013
has text: The API provides several position options for you to select from and implement. http://api.jqueryui.com/dialog/#option-position
score: 0

http://stackoverflow.com/comment/43269799
score: 1
has text: What do you want the final value to be?
comment on: http://stackoverflow.com/q/27412680
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27433383
has title: JSONP request gives Unexpected token (:) but not on partner's computer
tagged with: javascript
has comment: http://stackoverflow.com/comment/43307981
score: 0
tagged with: rest
has body: I'm working on an Arduino project with another student. We are working with an Arduino Yùn module and a website powered by Angular.js. When we wanna do a get request for the contents of the data store we do the following things: var promise = $http.jsonp("http://192.168.0.234/data/get?callback=JSON_CALLBACK"); promise.then( function(arduinoData) { console.log(arduinoData.data.value); } ); On my partner's computer (Windows) this works perfectly and he can work on with the data. When I do the request on my laptop (Mac) I get an error in the JavaScript console: Uncaught SyntaxError: Unexpected token :. I'm absolutely puzzled what the problem could be. I'm using the exact same code with the same Angular.js version and such. It seems to me like a platform-dependent problem, but that would be extremely weird since it's basic HTTP requests and JavaScript handling... Somehow the JSON_CALLBACK isn't recognised or something. To be honest I don't have an idea what the JSON_CALLBACK does, but on my partner's PC it works like a charm... Whoever gives me some advice on what could be the problem gets a huge thank you and 100 internet points.
has comment: http://stackoverflow.com/comment/43308800
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43308932
has comment: http://stackoverflow.com/comment/43308073
answer count: 0
tagged with: arduino
tagged with: http
type: Question

http://stackoverflow.com/q/27398992
has answer: http://stackoverflow.com/a/27399334
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27399797
has body: So I've got this code to create a rectangular div every 800ms which falls down the screen. Now I'd like to be able to remove a div once it reaches a certain top value, otherwise it'll get too cluttered with div's. Now I have no idea how to exactly do that, considering the id's I've given them. I'd also like to know how I could end up removing every single one of those div's once it's game over. This is what I have so far all together: http://student.howest.be/pieter-jan.vandenb1/crossdodger/Game.html. I'm pretty new at javascript so thanks in advance! var idNumber = 0; SpawnBlock(); function SpawnBlock() { UpdateBlock(); setTimeout(SpawnBlock, 800); } function UpdateBlock() { var block = document.createElement("div"); block.style.width = "25px"; block.style.height = "25px"; block.style.background = "lightgrey" block.style.top = "-25px"; block.style.left = Math.random() * 455 + "px"; block.style.position = "absolute"; block.id = "block" + ++idNumber; //block.speed = 0.5; sym.$("Stage").append(block); sym.$("#block"+idNumber).transition({top:"800px"},8000,"linear"); } It's made in Adobe Edge, hence the "sym." namespace.
tagged with: adobe-edge
score: 0
has title: Remove div's with almost the same id once a certain top value is reached
answer count: 2

http://stackoverflow.com/comment/43150937
comment on: http://stackoverflow.com/q/27347889
score: 0
type: QuestionComment
type: Comment
has text: All I can suggest is to verify that the element you are looking at actually has that css id?

http://stackoverflow.com/comment/43311913
type: Comment
type: QuestionComment
has text: Not only there's no transition, but also, if you actually wanted a transition (i.e. ` `s literally animating to their new positions), it would take a whole lot of work to achieve that. In fact, you wouldn't use a table in that case; you'd have to absolutely position every row at some position, which you'd have to calculate yourself.
score: 1
comment on: http://stackoverflow.com/q/27429632

http://stackoverflow.com/comment/43338095
type: Comment
type: QuestionComment
has text: I guess all of the trolls come out to SO after lunch, offering nothing of value. You seriously can't remember being stumped on something simple? I can think of one: deducing a question from a clearly stated, specific problem. One with included code, at that.
score: 1
comment on: http://stackoverflow.com/q/27449349

testing
tags question: http://stackoverflow.com/q/27388435
tags question: http://stackoverflow.com/q/27422295
tag name: testing
tags question: http://stackoverflow.com/q/27435004
tags question: http://stackoverflow.com/q/27413932
tags question: http://stackoverflow.com/q/27320059
tags question: http://stackoverflow.com/q/27465602
type: Tag
tags question: http://stackoverflow.com/q/27346687
tags question: http://stackoverflow.com/q/27437396
tags question: http://stackoverflow.com/q/27337786
tags question: http://stackoverflow.com/q/27367920

http://stackoverflow.com/a/27419755
type: Answer
answers question: http://stackoverflow.com/q/27380545
has body: right here is my solution to my question you load the first image as in the demo page , and than put your javascript that does the swap image, basically change the source of the image, destroy it and than call the function again var swap_img = $(this).find('img').attr('src'); //get the src of the image of the thumbnail $("#sample_picture").attr('src',swap_img); //set it , swap it picture.guillotine('remove'); //remove the current instance guillotine_function(); //and call it again. and everything should work as it should be
score: 0

http://stackoverflow.com/q/27468188
type: Question
answer count: 2
tagged with: formidable
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has comment: http://stackoverflow.com/comment/87337587
downvote count: 0
has comment: http://stackoverflow.com/comment/43380307
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/27469072
upvote count: 2
type: UnansweredQuestion
has title: promise with loop and file read in nodejs
has body: I looked at lot of example but couldn't achieve it..so need help.. Problem.. the content from loop should be passed to execute one by one. each loop iteration contains a file read and database save operation along with few other object properties that need to be assigned. I have created example here.. http://runnable.com/VI1efZDJvlQ75mlW/api-promise-loop-for-node-js-and-hello-world how to run: Api: http://web-91b5a8f5-67af-4ffd-9a32-54a50b10fce3.runnable.com/api/upload method : POST content-type : multipart/form-data upload more than one file with name. .. the final expected promise is files.name = "name of file" files.content files.content-type files.size - saved to db. currently i am getting different content from file..but other files content are not filled and is undefined. Regards Moyeen
tagged with: node.js
score: 2
has comment: http://stackoverflow.com/comment/43372281
has answer: http://stackoverflow.com/a/27471605
has comment: http://stackoverflow.com/comment/43378276

http://stackoverflow.com/q/27371798
score: 0
has body: I have a situation here. I am having a object like this. var x ={ "startTime":"10:05Am", "endTime":"12:05Pm" } So my requirement is i want a function which will return a variable with respective time function getTime(x){ //do something return timewitHrs; } timewitHrs should can be something like this [{"10am-11pm":55,"11pm-12pm":60,"12pm-1pm":5}] Is there any way to sort this out Thanks.
answer count: 1
has comment: http://stackoverflow.com/comment/43194962
tagged with: time
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43194899
has answer: http://stackoverflow.com/a/27372913
has comment: http://stackoverflow.com/comment/43195602
has comment: http://stackoverflow.com/comment/43194928
type: Question
has comment: http://stackoverflow.com/comment/43195168
has comment: http://stackoverflow.com/comment/43195066
tagged with: javascript
tagged with: jquery
has title: Get Time According to hours

http://stackoverflow.com/a/27400820
type: Answer
has body: The responsible of your 'bug' is the following instructions: window.setInterval(function(){ fazeClick(mntDew); }, 1000); Your counter start to increment because the onclick of 'Buy Mountain Dew' button increment the value of `mntDew var', before of that the set interval call fazeClick(0); I am really sorry, but I'm not able to understand what you want to achieve
accepted answer of: http://stackoverflow.com/q/27400507
answers question: http://stackoverflow.com/q/27400507
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/27450120
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27450284
score: 0
has title: JQuery radio input on click form submit
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have a form that I want to submit when a radio button is selected. I already tried some methods to make it work, but it doesn't. My form is something like this (just one radio option for ilustration, but the original one has 20 options): &lt;form action="http://spartanas.com.br/novo/wp-comments-post.php" method="post" id="votoscommentform" class="comment-form"&gt; &lt;div class="anuncio vitrine"&gt; &lt;a href="http://spartanas.com.br/novo/ninasalvattori/"&gt; &lt;div style="position: absolute; width: 172px; height: 285px;" class="fphover"&gt;&amp;nbsp;&lt;/div&gt; &lt;img src="http://spartanas.com.br/novo/wp-content/plugins/nextcellent-gallery-nextgen-legacy/nggshow.php?pid=982" style="width:172px;height:285px"&gt; &lt;/a&gt; &lt;div class="infos"&gt;Nina Salvattori&lt;br&gt;Hotéis e Motéis&lt;/div&gt; &lt;div style="text-align:center"&gt;&lt;strong&gt;1 Voto&lt;/strong&gt;&lt;br&gt; &lt;p&gt;&lt;input onchange="this.form.submit();" value="6019" id="6019" name="comment" type="radio"&gt;&lt;label for="6019"&gt;Votar&lt;/label&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;p class="form-submit"&gt; &lt;input name="submit" id="votarcomentform" value="Votar" type="submit"&gt; &lt;input name="comment_post_ID" value="6183" id="comment_post_ID" type="hidden"&gt; &lt;input name="comment_parent" id="comment_parent" value="0" type="hidden"&gt; &lt;/p&gt; &lt;input id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment" value="f33d177e03" type="hidden"&gt;&lt;script&gt;(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();&lt;/script&gt; &lt;/form&gt; As you can see this version I tried to submit it with onchange event, but I've tried with JQuery too: &lt;script&gt; jQuery(document).ready(function($) { $('input[type="radio"][name="comment"]').click(function() { $(this).closest("form").submit(); }); }); &lt;/script&gt; What am I doing wrong?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43338856
tagged with: wordpress
tagged with: forms
has comment: http://stackoverflow.com/comment/43339973
type: Question
has comment: http://stackoverflow.com/comment/43338990
has comment: http://stackoverflow.com/comment/43340415

http://stackoverflow.com/q/27334617
favorite count: 0
score: 0
has title: How to add element to JSON object with Javascript
linked to: http://stackoverflow.com/q/736590
accepted answer: http://stackoverflow.com/a/27334635
has answer: http://stackoverflow.com/a/27334643
has body: So say I have a JSON object like this: {"name":"asdf","quantity":"3","_id":"v4njTN7V2X10FbRI"} And I can't modify it when it is created. But I want to make it look like this: {"name":"asdf","quantity":"3","_id":"v4njTN7V2X10FbRI", checked: true} So how would I do that with javascript?
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/27334643
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43126274
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43126328
has answer: http://stackoverflow.com/a/27334635
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/43236683
type: Comment
type: QuestionComment
score: 0
has text: @Sruti No, it's to MongoDb... but it doesn't really matter!
comment on: http://stackoverflow.com/q/27394884

http://stackoverflow.com/comment/43106713
has text: You could filter this data to get only distinct `x` values, but there's no way to get just the different "levels" with the current implementation.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27322849

http://stackoverflow.com/comment/43187037
has text: http://jsfiddle.net/wnqj0uta/55/ see this i comment out the line 4 and now white boxes are resizble but red are not resized @Michael
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27367458

http://stackoverflow.com/a/27383695
type: Answer
has comment: http://stackoverflow.com/comment/43244284
upvote count: 1
has comment: http://stackoverflow.com/comment/43244320
score: 1
has body: I work for New Relic, yes it is possible to monitor this application with our Node agent. Give it a go and let us know if you need any help.
downvote count: 0
answers question: http://stackoverflow.com/q/27381323

http://stackoverflow.com/q/27460831
has comment: http://stackoverflow.com/comment/43362161
has comment: http://stackoverflow.com/comment/43360795
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43358221
upvote count: 2
type: UnansweredQuestion
has title: JAVASCRIPT 2D Platformer objects do not appear on screen
has comment: http://stackoverflow.com/comment/49456415
score: 2
tagged with: 2d
answer count: 0
has body: I have been coding with javascript for about 3 months now and I decided to start working on a 2D Platform game for my Advanced Higher project. I found a very helpful tutorial online which showed each step of the creation process and even supplied the source code. The problem is that whenever I run the source code, the game does not load properly. At this stage I am faced with a totally blank screen but a sized canvas. I deconstructed the tutorial and followed it step by step but still nothing. Anyone have an ideas? I apologise if it is not a lot to go by, however I do know that the problem most likely lies in the update function I coded this using Sublime Text 2 For Mac function update() { // controls if (keys[38] || keys[32]) { // up arrow or space if(!player.jumping &amp;&amp; player.grounded) { player.jumping = true; player.grounded = false; player.velY = -player.speed*2; } } if (keys[39]) { // right arrow if (player.velX &lt; player.speed) { player.velX++; } } if (keys[37]) { // left arrow if (player.velX &gt; -player.speed) { player.velX--; } } player.velX *= friction; player.velY += gravity; ctx.clearRect(0, 0, width, height); ctx.fillStyle = "black"; ctx.beginPath(); player.grounded = false; for (var i = 0; i &lt; boxes.length; i++) { ctx.rect(boxes[i].x, boxes[i].y, boxes[i].width, boxes[i].height); var dir = colCheck(player, boxes[i]); if (dir === "l" || dir === "r") { player.velX = 0; player.jumping = false; } else if (dir === "b") { player.grounded = true; player.jumping = false; } else if (dir === "t") { player.velY *= 0; } } if(player.grounded) { player.velY = 0; player.x += player.velX; player.y += player.VelY; ctx.fill(); ctx.fillStyle = "red"; ctx.fillRect(player.x, player.y, player.width, player.height); requestAnimationFrame(update); } function colCheck(shapeA, shapeB) { // get the vectors to check against var vX = (shapeA.x + (shapeA.width / 2)) - (shapeB.x + (shapeB.width / 2)), vY = (shapeA.y + (shapeA.height / 2)) - (shapeB.y + (shapeB.height /…
tagged with: collision-detection
type: Question
has comment: http://stackoverflow.com/comment/43358411
has comment: http://stackoverflow.com/comment/43358073
tagged with: javascript

http://stackoverflow.com/q/27417064
has comment: http://stackoverflow.com/comment/43277684
type: AnsweredQuestion
upvote count: 2
tagged with: shopping-cart
has answer: http://stackoverflow.com/a/27417204
has comment: http://stackoverflow.com/comment/43277647
type: Question
has comment: http://stackoverflow.com/comment/43277718
downvote count: 5
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43277681
answer count: 2
has title: can anyone help me with this simple (javascript) script
possible better answer: http://stackoverflow.com/a/27417204
has body: I want to upgrade this simple script by javascript. It's just simple script that calculates the total from check-boxed services menu. But right now it's just calculating and bring the total price and iI want to upgrade it so he can type the services that has been cheeked. http://jsfiddle.net/tL5hdf64/1/ And the JS code: $('input[type="checkbox"]').change(function(){ var totalprice = 0; $('input[type="checkbox"]:checked').each(function(){ totalprice= totalprice + parseInt($(this).val()); }); $('#price').val(totalprice); });
has comment: http://stackoverflow.com/comment/43277670
has comment: http://stackoverflow.com/comment/43277671
favorite count: 0
has answer: http://stackoverflow.com/a/27417142
accepted answer: http://stackoverflow.com/a/27417142
has comment: http://stackoverflow.com/comment/43277645
score: -3

http://stackoverflow.com/comment/43191400
score: 0
has text: @enhzflep thanks for checking it out. Yes, the canvas the game is drawn on is 800x500 pixels exactly. However that size stays the same regardless of window size. I checked the difference in frame rates with the built-in fps display. The game runs at around 33 fps when the window is big, and 56 fps when the window is small. If the size of the canvas never changes, why would the size of the window matter? There is nothing else on the page.
comment on: http://stackoverflow.com/q/27367448
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/138720802
has text: is it possible to create a new variable and also assign to an existing one within the same destructing? Something like `({a, b, let c} = obj)` - where `c` is being created?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27386370

http://stackoverflow.com/a/27336427
downvote count: 1
score: 1
has body: Use JavaScript's textContent method. This will extract ONLY the text, and no checkbox. alert(document.getElementById('lblID').textContent); some text here
answers question: http://stackoverflow.com/q/27336408
upvote count: 2
type: Answer

http://stackoverflow.com/comment/43242790
type: Comment
score: 0
comment on: http://stackoverflow.com/q/27382437
type: QuestionComment
has text: this is not desired, at least by me. Also re-setting the source for editable is also not desirable.

http://stackoverflow.com/comment/43107962
type: Comment
has text: Ok that helped, but I'm looking for a simpler way to do this. I've added the question marks to places I know code goes but I can't figure out what.
comment on: http://stackoverflow.com/a/27323401
type: AnswerComment
score: 0

http://stackoverflow.com/q/27393328
tagged with: iframe
type: Question
has answer: http://stackoverflow.com/a/27394194
tagged with: javascript
has body: I am trying to load an external page inside my angular template. However i need to pass the sess_id value along with the url for the authentication purpose. I have added a iframe inside my div and called the url along with the sess_id value. the sess_id value is retrieved properly inside my modal. but i could not load the page inside Iframe. My url structure to be retrieved should be like "urlhere?ss_id=bfc443c761de8b2ba18c82fecc50fd77" {{sess_id}} // i can retrive the value here Any Help will be highly appresiated.
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Retrieving the data binding value inside Iframe in Angular JS
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43235301
score: 2
upvote count: 2

http://stackoverflow.com/comment/43276470
comment on: http://stackoverflow.com/a/27416303
score: 0
has text: What I did is to change all the tags that had the <> , and this was my result : http://codepen.io/anon/pen/jEqPKW
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/43293388
comment on: http://stackoverflow.com/q/27425774
score: 0
type: QuestionComment
type: Comment
has text: You have to use JavaScript Closures: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Closures

http://stackoverflow.com/a/73022243
has body: This can check if node or element is in shadow dom, and works for iframes /** * @param {!Node} node * @return {!boolean} */ function isInShadowRoot(node) { return node.getRootNode().constructor.name === "ShadowRoot"; } Or using instanceof const inShadow = node.getRootNode() instanceof node.ownerDocument.defaultView.ShadowRoot
answers question: http://stackoverflow.com/q/27453617
downvote count: 0
score: 1
type: Answer
upvote count: 1

http://stackoverflow.com/q/27323213
downvote count: 0
has comment: http://stackoverflow.com/comment/61611697
tagged with: javascript
tagged with: jquery
has title: Kendo window.refresh not successfully grabbing partial view
favorite count: 0
has comment: http://stackoverflow.com/comment/43213317
tagged with: kendo-ui
tagged with: model-view-controller
score: 2
has comment: http://stackoverflow.com/comment/43185690
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: kendo-window
has body: all. Thank you in advance. I have a window which much refresh every time a dropdown selection is changed (or button is pressed). The controller is being called upon refresh, but the view is not being called/refreshed, for some reason. Am I missing something fundamental? Window: @(Html.Kendo().Window() .Name("EditWindow") .Title("Edit Contact") .LoadContentFrom("_ContactEdit", "Contacts", new { selectedContact = Model.ContactId }) .Content("Loading...") .Visible(false) .Draggable() .Resizable() .Width(400) .Modal(true) .Actions(actions => actions.Pin().Minimize().Maximize().Close()) ) Refresh code (in javascript): var combobox = $("#ContactId").data("kendoComboBox"); var ContactId = combobox.value(); var window = $("#EditWindow").data("kendoWindow"); window.refresh({ url: "../../Contacts/_ContactEdit", data: { selectedContact: ContactId } //url: "/Contacts/_ContactEdit/?selectedContact=ContactId" }); Controller: [HttpGet] public ActionResult _ContactEdit(int selectedContact) { var entities = from r in dbContext.Contacts where r.ContactId == selectedContact select r; if (entities.Any()) { return PartialView(entities.First()); } else { return HttpNotFound("Contact does not exist."); } } I know that the partial view is working correctly because it's called and populates upon the initial window load. Why in the world can't I get it to refresh? edit: Here's my partial view (window contents): @model PNC.CM.MBS.BizServiceTier.IIDB.Contact @using Kendo.Mvc.Extensions @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) Hello, world. @Html.HiddenFor(model => model.ContactId, new { id = "EditWindowId" }) Contact Name @Html.TextBoxFor(model => model.FullName, new { type = "text", id = "EditWindowName", @class = "k-textbox form-control", style = "width: 200px; cursor:default" }) }
has comment: http://stackoverflow.com/comment/43108068
has comment: http://stackoverflow.com/comment/43212473
has comment: http://stackoverflow.com/comment/43109944
has comment: http://stackoverflow.com/comment/43108284
has comment: http://stackoverflow.com/comment/43226515
type: Question

http://stackoverflow.com/a/27367819
has comment: http://stackoverflow.com/comment/43188045
has comment: http://stackoverflow.com/comment/43188170
answers question: http://stackoverflow.com/q/27367731
has body: To get the selected option's text, use: function changelivrare(objDropDown) { document.getElementById("liv").value = objDropDown.options[objDropDown.selectedIndex].innerHTML; } objDropDown.value is the value of the selected option, not its text. objDropDown.options is a collection of the options, and objDropDown.selectedIndex is the position of the selected option. I also suggest you combine the two function into one: function textToHiddenInput(objDropDown, inputID) { document.getElementById(inputID).value = objDropDown.options[objDropDown.selectedIndex].innerHTML; } Then you change the HTML to: &lt;select name="locridicare" id="locridicare" onchange="textToHiddenInput(this, 'liv')"&gt; ... &lt;select name="locreturnare" id="locreturnare" onchange="textToHiddenInput(this, 'ret')" &gt;
score: 0
type: Answer

http://stackoverflow.com/comment/43337307
comment on: http://stackoverflow.com/q/27449305
score: 0
type: Comment
type: QuestionComment
has text: You can't, user decides which page to trust, not an author of any web page.

http://stackoverflow.com/comment/43170929
has text: can you please help me how do i clear output if user add images second time
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27359339

http://stackoverflow.com/comment/43290323
has text: for me it still goes to the servlet and displays HTTP 500 Internal server error
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27423353

http://stackoverflow.com/comment/43202411
comment on: http://stackoverflow.com/q/27376286
has text: It looks like a timezone issue to me. Are you in the Central American timezone by any chance?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43324247
score: 0
has text: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
comment on: http://stackoverflow.com/q/27442178
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27326897
has comment: http://stackoverflow.com/comment/43112795
type: AnsweredQuestion
has title: returning multiple values from functions
has comment: http://stackoverflow.com/comment/43112811
type: Question
has answer: http://stackoverflow.com/a/27326940
accepted answer: http://stackoverflow.com/a/27326940
has answer: http://stackoverflow.com/a/27326962
tagged with: javascript
score: 0
answer count: 2
has body: I have a js file (below) where each function returns 2 results (Step1 and Step2). I need to put these results into a format like... "Mix " + (Step1 productType) + " with " + (Step1 peroxide) + ". " + (Step1 timing) Using a " + (Step2 productType) + " , mix " + (Step2 toneCalc) + ", with " + (Step2 peroxide) + ". " + (Step2 timing) What is the best way to get these results into the formats above? I know how to do a single value, but not quite sure on multiple functions wrapped in a function. Thanks function doubleprocess(type) { function productType() { var step1; var step2; if (type == "light") { step1 = "lightner"; step2 = "demi-color"; } else { step1 = "demi-color"; step2 = "demi-color"; } return step1, step2; } function toneCalc() { var step1; var step2; if (type == "light") { step1 = "light gold"; } else if (type == "dark") { step1 = "80% gold with 20% red" } else { step1 = "another tone"; } step2 = "neutral"; return step1, step2; } function peroxide() { var step1; var step2; if (type == "light") { step1 == "20V/6% peroxide"; } else if (type == "dark") { step1 = "something else"; } else { step1 = "Do something."; } step2 = "Do something else."; return step1, step2; } function level() { var step1 = ""; var step2; if (type == "dark") { step1 = "Do something."; } else { step1 = "Do Nothing."; }; step2 = "Do something."; return step1, step2; } function timing() { var step1; var step2; if (type == "light") { step1 == "Do something."; step2 = "Do something."; } else if (type == "dark") { step1 = "Do something."; step2 = "Do something."; } else { step1 = "Do something."; step2 = "Do something."; } return step1, step2; } }
tagged with: arrays
tagged with: jquery
possible better answer: http://stackoverflow.com/a/27326962

http://stackoverflow.com/q/27369805
score: 0
has answer: http://stackoverflow.com/a/27369832
answer count: 1
has comment: http://stackoverflow.com/comment/43191358
duplicate of: http://stackoverflow.com/q/6967297
accepted answer: http://stackoverflow.com/a/27369832
tagged with: javascript
has comment: http://stackoverflow.com/comment/43191365
tagged with: html-table
linked to: http://stackoverflow.com/q/22727403
tagged with: getelementsbytagname
type: AnsweredQuestion
has body: Just testing this out, trying to insert a table into the body tag but I can only do it with getElementById. I also tried inserting the script code at the bottom, but that doesn't work either. Exam Test Trial
duplicate of: http://stackoverflow.com/q/22727403
type: Question
linked to: http://stackoverflow.com/q/6967297
has title: Why doesn't getElementsByTagName work in this logic?

http://stackoverflow.com/q/27446499
linked to: http://stackoverflow.com/q/11634747
has body: All I found for headless browser using C# where these packages: Headless browsers Stackoverflow In the comments often someone is angry about the kit isn't headless. Is there any alternativ which is headless being able to be used by importing an assemblie and supporting Javascript on clientside? WatiN isn't headless, I tried this first.
upvote count: 1
has title: headless browser supporting JS for .Net
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27446816
score: 1
type: Question
tagged with: c#
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/43332304
has answer: http://stackoverflow.com/a/27446816
answer count: 1
linked to: http://stackoverflow.com/q/142184
tagged with: headless-browser
favorite count: 0
linked to: http://stackoverflow.com/q/10161413

http://stackoverflow.com/a/27376778
answers question: http://stackoverflow.com/q/27375670
type: Answer
has body: It's not conceptually different from you being logged on to multiple PCs, or having an app which say syncs between a web app and multiple devices. The quota issue isn't well defined, so it's a bit of a guess whether or not you'll hit the Per User Quota, or even the undocumented bucket quota. The former can be increased by request, the latter can't. If you do hit limits, you have two levels of workaround:- Create multiple apps within your project, and somehow allocate or round-robin access tokens from multiple stored refresh tokens Go a step further and create multiple projects. This of course creates a possible permission/sharing issue so you would either need to have Drive scope (a bad idea if this is a general purpose Drive account), or make sure that each user was always bound to the same refresh token. btw, you understand the potential security issues with multiple users being able to use the access token to access each others' files?
score: 0

http://stackoverflow.com/a/27322635
answers question: http://stackoverflow.com/q/27322564
has comment: http://stackoverflow.com/comment/43104463
score: 0
has comment: http://stackoverflow.com/comment/43104563
type: Answer
has body: You can test and declare of not already declared using the OR operator || foo = foo || 1; So if foo exists, foo will be foo. If foo does not exist, foo will be 1.

http://stackoverflow.com/a/27468472
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has body: In the create, you are creating a new object with the help of a constructor function (new F()). So, the prototype chain is established, between proto object and the object constructed with the constructor function. In create2, you are creating an Object and creating a property on it with the name prototype. In this case, the prototype chain is not established. That is why the object created by create2, couldn't go up the prototype chain to find status. Note: In the second case, you can still do document.writeln(c2.prototype.status);
accepted answer of: http://stackoverflow.com/q/27468449
type: Answer
answers question: http://stackoverflow.com/q/27468449
score: 4

http://stackoverflow.com/a/27347439
type: Answer
has body: It's not clear what you need to do. I'm pretty sure you've got a real mess on your hands beyond your main problem, and using Angular is only making it worse. If your goal is to console.log the state of the array at each step of the selectionSort outer loop, then you need to run console.log at the bottom of each loop. The first thing that looks fishy suspicious is: $scope.array2.push(temp2); If you run console.log(array2) at each step of the loop as I suggested, you need this line to be instead: $scope.array2 = temp2; That way, you overwrite array2, which holds the state of the array at each iteration of the for loop. Then you log it. Appending each state to a larger array, and then running console.log on each item in that array is not the best way to do this. But, I'm not sure that's what your problem is.
answers question: http://stackoverflow.com/q/27347095
score: 0
has comment: http://stackoverflow.com/comment/43150179

http://stackoverflow.com/a/30380901
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27406464
has body: I have described one solution using webpack here : http://blog.netgusto.com/asynchronous-reactjs-component-loading-with-webpack/ In essence : use require.ensure([], cbk) to define code chunks; in the cbk, load your packages synchronously using require() in your host component, load your asynchronous component in componentWillMount(), and set in in the host component state. use it in the host component render, when defined on the state
upvote count: 1
score: 1

http://stackoverflow.com/comment/43233412
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27392845
has text: Are you trying the example of jsfiddle on this link (http://jsfiddle.net/94nx8sgu/)? Desktop or mobile version of Chrome?

http://stackoverflow.com/a/27347221
has comment: http://stackoverflow.com/comment/43149236
has body: Use .map().join() instead of .forEach(). iDiv = $(' ' + event.map(function (eve) { return ' '+eve+' ' }).join("") +' '); The .map() method creates a new Array that contains the values you returned from the function, and then .join(""), joins the content of that array as a single string. You could also write it like this, which doesn't require .map() at all: iDiv = $(' ' + event.join(" ") +' '); And since option tags aren't required to be closed in order to be valid, you could shorten it a bit more. iDiv = $(' ' + event.join(" ") + ' ');
score: 0
has comment: http://stackoverflow.com/comment/43151303
has comment: http://stackoverflow.com/comment/43149220
has comment: http://stackoverflow.com/comment/43149471
has comment: http://stackoverflow.com/comment/43151185
type: Answer
has comment: http://stackoverflow.com/comment/43149376
has comment: http://stackoverflow.com/comment/43149408
answers question: http://stackoverflow.com/q/27347193
has comment: http://stackoverflow.com/comment/43152329
has comment: http://stackoverflow.com/comment/43151612

http://stackoverflow.com/a/27497948
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27439198
upvote count: 2
type: Answer
score: 2
has body: For mobile testing, here are some resources might help. Personally I prefer the Samsung emulator and Adobe Edge Inspect(will charge). Adobe Edge Inspect Samsung Emulators Chrome - Device Mode &amp; Mobile Emulation (recommended only for testing responsiveness) Keynote (might charge fee) Because the limit of the content length, Please click the links and see the detailed documentation. Hope it will help to speed up the testing and debug on mobile devices.
answers question: http://stackoverflow.com/q/27439198

http://stackoverflow.com/comment/43696541
type: Comment
comment on: http://stackoverflow.com/q/27425131
score: 0
has text: @KeenanLidral-Porter the gulp file is for building a static website. as i tried to show the main template files need to be preprocessed for front matter, then have their templates evaluated, producing output. the template files also depend on data files (e.g. includes) for context. these data files also need to be preprocessed for front matter and have templates evaluated, and it is not possible to know the data file(s) associated with a template file until the template is processed. thus, i am trying to reuse the preprocess subpipeline for both file types, but w/in the same main pipeline. thx
type: QuestionComment

http://stackoverflow.com/a/27325479
answers question: http://stackoverflow.com/q/27324958
has body: you can place your javascript/php mix like this
score: 0
type: Answer

http://stackoverflow.com/a/27401011
has comment: http://stackoverflow.com/comment/43247374
has comment: http://stackoverflow.com/comment/43249789
downvote count: 0
has comment: http://stackoverflow.com/comment/43291399
has comment: http://stackoverflow.com/comment/43247857
has comment: http://stackoverflow.com/comment/43290353
has body: Here are the fixes for the ajax code not displaying the invalid login message. First i removed the function call for the hello2 function and placed in a javascript event at within a script tag at the bottom of the page. This made it easier for me to conduct tests. You will have to add the id submit-button to your button html. The previous echo in your index php file will look like this now. echo "&lt;form action='login_parse.php' method='post' style='display: inline-block'&gt; Username: &lt;input type='text' name='username' id='username' /&gt; Password: &lt;input type='password' name='password' id='password' /&gt; &lt;input id='submit-button' type = 'button' value='login' id='submit' /&gt;"; Here is the javascript that will before the closing body tag of your index.php file: &lt;script src="ajax.js"&gt;&lt;/script&gt; &lt;script&gt; //return XMLHTTP request and store it var HTTP = loadXMLDoc(); //on click event for #submit-button var submitEvent = document.getElementById("submit-button").onclick = function(){ hello2(HTTP); }; &lt;/script&gt; This is were I found the main problem. I made the variable xmlhttp have global scope by placing it at the top your ajax.js code. I found this problem initially by changed the following line of code: document.getElementById("ack1").innerHTML= HTTP.responseText; to: document.getElementById("ack1").innerHTML= "it worked"; By doing this I discovered that your function call at this point was working but your HTTP.onreadystatechange=function(){} was unable to access the responseText. Here is the new ajax.js file code below: //moved variable outside of functions to give it the global scope var xmlhttp; function loadXMLDoc() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } return xmlhttp; } function hello2(HTTP){ var username = encodeURIComponent(document.getElementById('username').value); var passwo…
accepted answer of: http://stackoverflow.com/q/27400404
answers question: http://stackoverflow.com/q/27400404
has comment: http://stackoverflow.com/comment/43297162
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43289002
has comment: http://stackoverflow.com/comment/43247898
has comment: http://stackoverflow.com/comment/43288544
type: Answer
has comment: http://stackoverflow.com/comment/43250841
has comment: http://stackoverflow.com/comment/43298551

http://stackoverflow.com/comment/43326467
type: QuestionComment
score: 1
has text: This is way too much code for anyone to look at. Please reduce it to 20%, or ideally 10%. The good news: as you're doing that, you'll probably find the problem yourself!
comment on: http://stackoverflow.com/q/27443708
type: Comment

http://stackoverflow.com/a/43255777
upvote count: 1
answers question: http://stackoverflow.com/q/27381591
type: Answer
downvote count: 0
has body: You can use this in your twig &lt;script type="text/javascript"&gt; /* &lt;![CDATA[ */ var settings = { example: {{ 'something' | trans }} } }; /* ]]&gt; */ &lt;/script&gt; then you can access them in your js: console.log(settings.example);
score: 1

http://stackoverflow.com/comment/43257975
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27406682
has text: It's a shame that such a thing can be achieved with 2 small lines of jQuery but I don't want to start mixing the two!

http://stackoverflow.com/a/27400552
answers question: http://stackoverflow.com/q/27400179
score: 0
has body: Officially, the only date format supported by JavaScript is a simplified version of ISO-8601: yyyy-mm-dd, and almost all browsers also support yyyy/mm/dd as well. So you need to do something like this to parse your dates: var parts = start.split('-'); start = new Date(parseInt(parts[2], 10), parseInt(parts[1], 10) - 1, parseInt(parts[0], 10)); //Date uses zero-based month numbers, and so we have to subtract one from the month number Take a look here for more details.
type: Answer

http://stackoverflow.com/comment/43128144
has text: Please don't use submit as function name because it is a reserved keyword. (see this [SO question](http://stackoverflow.com/questions/25222715/javascript-form-onsubmit-does-not-work-when-function-is-called-submit)). Also your function is not available in global namespace e.g use `window.sendData = sendData` if sendData is your new function name for `submit()`
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/27335531

http://stackoverflow.com/q/27464992
has body: I have a problem I want to solve with jQuery. In a list, I want to check if two items have the same text, and if so I want to delete the second one. I am not really sure how to go about it. The markup is simple, kinda like this Text1 Text2 Text1 Text3 Text3 Text4 I cannot use an active/inactive class because this list is dynamic and I don't know in advance how it's going to be populated. Any idea?
type: AnsweredQuestion
has title: Hide same elements in a list
possible better answer: http://stackoverflow.com/a/27465018
type: Question
has answer: http://stackoverflow.com/a/27465018
has answer: http://stackoverflow.com/a/27465026
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27465232
has answer: http://stackoverflow.com/a/27465087
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/27465087
downvote count: 2

http://stackoverflow.com/a/27443037
has body: You need to use the target element instead of 'this', which is the actual element that you hover over and use stopPropagation in order to not repeat the process for each element behind: $('body').children().mouseover(function(e){ e.stopPropagation(); $(".hova").removeClass("hova"); $(e.target).addClass("hova"); }).mouseout(function(e) { $(e.target).removeClass("hova"); });
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/27442664
downvote count: 0

http://stackoverflow.com/comment/43134818
comment on: http://stackoverflow.com/q/27339132
score: 0
type: QuestionComment
type: Comment
has text: Yes, an object that is in JSOn format. Will want to use `JSON.parse(text[, reviver])` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse

http://stackoverflow.com/q/27447494
possible better answer: http://stackoverflow.com/a/27448104
favorite count: 0
score: -3
answer count: 4
has body: I have four groups, each group contains three keys: question, hint, and answer. I need to randomly output only two values of question and hint, then execute them against the answer value, where the user has to enter in a text field. My thought is to loop through the entire array, then randomly output, and finally do the execution. How can this be possible? http://jsfiddle.net/vo01u94p/ jQuery/JS $('.submit').on('click', function () { var HISTORY; var question_1 = { question: 'When did Martin Luther King, Jr. die?', hint: 'He was born on January 15, 1929 and he died at the age of 39.', answer: 'April 4, 1968', }; var question_2 = { question: 'Who discovered America?', hint: 'This person led three ships - the Nina, the Pinta and the Santa Maria - out of the Spanish port of Palos on August 3, 1492.', answer: 'Christopher Columbus', }; var question_3 = { question: 'What event occured on July 4, 1776?', hint: 'Thomas Jefferson played an important role.', answer: 'The United States Declaration of Independence was written', }; var question_4 = { question: "What continent covers 8.3% of the Earth's total surface area (28.4% of its land area)?", hint: 'Also known as the New World', answer: 'The Americas, or America', }; var questions = []; questions[0] = question_1; questions[1] = question_2; questions[2] = question_3; questions[3] = question_4; var library = { questions: questions } var libraries = []; libraries[HISTORY] = library; var questionNo = 3; console.log(libraries[HISTORY].questions[questionNo].question); console.log(libraries[HISTORY].questions[questionNo].hint); console.log(libraries[HISTORY].questions[questionNo].answer); });
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27448705
type: Question
has title: How to loop through an array, randomly output two strings, and execute them against the answer?
tagged with: javascript
has answer: http://stackoverflow.com/a/27448104
has answer: http://stackoverflow.com/a/27448241
tagged with: random
downvote count: 3
has answer: http://stackoverflow.com/a/27448518
accepted answer: http://stackoverflow.com/a/27448518
tagged with: arrays
tagged with: jquery

http://stackoverflow.com/comment/43249851
has text: 1- I get a error in the console "Uncaught TypeError: Cannot read property 'getStoredData' of undefinedPT_PAGESCRIPT_win0_MIN_1.jsp" For 2, the SSO happens for the first app like Liferay, however the user did try to go the second app Peoplesoft yet, so the SSO cookies are not yet in the session. So when we access the page with the iFrame containing the Peoplesoft page, it pops out of the frame in IE trying to establish SSO session and cookies with PeopleSoft. Hope this makes sense. Thanks for the insight.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27385311

http://stackoverflow.com/comment/43187509
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27367695
has text: See the live example, you had one more error: `document.getElementById("total").value = pizza_total;` note we're again using `value` here, not `innerHTML`.

http://stackoverflow.com/comment/43289326
comment on: http://stackoverflow.com/a/27423626
score: 0
type: Comment
has text: @JLRishe: I added a second option.
type: AnswerComment

http://stackoverflow.com/comment/43346139
comment on: http://stackoverflow.com/a/27453957
has text: YOU SIR ARE AMAZING! I am literally about to cry with joy.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43239382
comment on: http://stackoverflow.com/q/27396414
type: Comment
has text: Ok, but When I am typing, the submit button enabled/disabled alternatively, it is not usability
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43319268
comment on: http://stackoverflow.com/q/27420367
has text: The interceptors catch all the request of $http object include the ui-route. I hope it helps someone using alternative method for loading the external link.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27414944
answers question: http://stackoverflow.com/q/27411334
score: 0
has body: What about this? function setSites(sel) { // Reuse your function, just in case other logic becomes needed (validation). var siteCode = getSite(sel).replace('$', '$$$$'); // escape for `''.replace()` var elements = document.getElementsByTagName("a"); for (var i = 0; i &lt; elements.length; i++) { var element = elements[i]; var href = element.href; // Any &lt;a&gt; without an `href=` attribute should be skipped. if (href) { if (/[&amp;\?]s=(.*?)[&amp;$]/.test(href)) { // There already exists a selection here, and we don't want to duplicate // it. Also, the regex is made such that `s=` can be anywhere. The value // can be of any length, in case more characters are needed. element.href = href.replace(/([&amp;\?]s=).*?([&amp;$])/, '$1' + siteCode + '$2'); } else { // Just append the new selection if it doesn't yet exist. element.href += '&amp;s=' + siteCode; } } } } If you want just some of the &lt;a&gt; elements (e.g. in a named &lt;div&gt;), then you can replace document with document.getElementById("id") or something similar that returns a single HTMLElement. Also, you could change the if-statement to filter any other &lt;a&gt; elements you would like. In case you're curious, here's the jQuery solution for comparison: function setSites(sel) { // Reuse your function, just in case other logic becomes needed (validation). var siteCode = getSite(sel).replace('$', '$$$$'); // escape for `''.replace()` $('a[href]').each(function () { var $elem = $(this); var href = $elem.attr('href'); if (/[&amp;\?]s=(.*?)[&amp;$]/.test(href)) { // There already exists a selection here, and we don't want to duplicate // it. Also, the regex is made such that `s=` can be anywhere. The value // can be of any length, in case more characters are needed. $elem.attr('href', href.replace(/([&amp;\?]s=).*?([&amp;$])/, '$1' + siteCode + '$2'); } else { // Just append the new selection if it doesn't yet exist. $elem.attr('href', href + '&amp;s=' + siteCode); } }); }
type: Answer

http://stackoverflow.com/comment/43091029
type: QuestionComment
has text: @spender, I have to send the file as base64 string as the server side code is written in that way. As of now, it would be very difficult for me to change that. Is there any work around for the base64 method? Also, I did some R & D and found that the browser crashes when the file is converted into base64 string.
comment on: http://stackoverflow.com/q/27315087
score: 0
type: Comment

http://stackoverflow.com/a/27342817
type: Answer
has body: The files size of an image is not just down to the actual pixel size but also you can reduce it by using either photoshop or using a service like http://www.smushit.com/ysmush.it/ that will make your images smaller in file size or try this free website image editor https://pixlr.com .. 100m website page is a big no no! the load time and bandwidth to actual display it would be to much for mobile data and also is not necessary to have in this day and age. You can use lazy load image that will help to load images as needed to reduce the loading of all the images from the start. I don't think that a loading screen will help you first of all you need to reduce the file sizes of the image so that they are smaller in mb 100mb divided by 62 is 1.6mb per image so you could reduce the image to around 300kb this would mean that your total images would then come to around 18mb this will have a huge impact on your loading of the site and then give you a base to start to optimise even more with lazy load images and other tools. Hope this helps you to get started on getting the file size down.
has comment: http://stackoverflow.com/comment/43154063
accepted answer of: http://stackoverflow.com/q/27342652
answers question: http://stackoverflow.com/q/27342652
has comment: http://stackoverflow.com/comment/43147174
score: 0
has comment: http://stackoverflow.com/comment/43147236
has comment: http://stackoverflow.com/comment/43152838
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43188221

http://stackoverflow.com/comment/43239237
comment on: http://stackoverflow.com/q/27396253
type: Comment
has text: Just a question. have you put the code inside document.ready?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/43276921
comment on: http://stackoverflow.com/q/27393016
has text: http://jsfiddle.net/KashifMKH/v1xx9nd1/ here is the code .i write it by using velocity.js
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27424148
type: Question
has answer: http://stackoverflow.com/a/27438907
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
tagged with: mouseevent
score: 0
answer count: 1
type: UnansweredQuestion
has title: How to solve vmouseup being interrupted
has body: I'm using jQuery Mobile to develop one single page to use in Android Webview. There is an button which I need put some pressed effect, and then I use vmousedown to add press style class and vmouseup to remove the class added before. However, there are something interrupt the vmouseup process. Reproduce: First, press one button, and it trigger the vmousedown event. Then, keep hold your finger and move outside the trigger area. Finally, loosen your finger and you will see it keeps the state that you hold it. I have done a demo to test, and find that it even won't trigger vmouseout or vmousecancel, the last event have been triggered is vmousedown. Is there anyone know why this happen and how to solve this? This is code : Fiddle

http://stackoverflow.com/a/27343005
type: Answer
answers question: http://stackoverflow.com/q/27342732
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/43141610
downvote count: 0
has body: I would do it more like this: var x, transY, transform, scale, c = $('#myCarousel .carousel-inner'); $(window) .scroll(function() { x = $(this) .scrollTop(); transY = (x * 0.5); scale = 1 + (x * 0.0003); transform = 'translateY(' + transY + 'px) scale(' + scale + ') translate3d(0,0,0)'; }); requestAnimationFrame(function anim() { c.css({ opacity: 1 - (x * 0.0008), WebkitTransform: transform, MozTransform: transform, msTransform: transform, transform: transform }); requestAnimationFrame(anim); }); But I never saw the flickering you are talking about in chrome.

http://stackoverflow.com/a/27315621
has body: Use unique id for forms or buttons. then call them with: $('#form-one button') // if you set ID to form or $('#my-button-id') // if you set id to button. IDs must be unique to follow HTML rules and for jQuery to work
downvote count: 1
upvote count: 0
score: -1
type: Answer
answers question: http://stackoverflow.com/q/27315482

http://stackoverflow.com/a/27424083
answers question: http://stackoverflow.com/q/27423983
has comment: http://stackoverflow.com/comment/43296976
type: Answer
has comment: http://stackoverflow.com/comment/43292962
has body: Try it like this. AuthService.forgatPassword($scope.user) .success(function(res) { $scope.message = true; }) .error( function(error) { console.log('rejected'); });
score: 0

http://stackoverflow.com/q/27353094
tagged with: selection
type: Question
has comment: http://stackoverflow.com/comment/43160282
linked to: http://stackoverflow.com/q/19953220
linked to: http://stackoverflow.com/q/18387540
has answer: http://stackoverflow.com/a/27354937
tagged with: javascript
tagged with: replace
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/27353231
has title: JavaScript: Selected text is not getting replaced when the text is inside a textarea
has comment: http://stackoverflow.com/comment/43160145
favorite count: 0
possible better answer: http://stackoverflow.com/a/27353231
linked to: http://stackoverflow.com/q/25790778
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/27354937
has body: I have a problem replacing a selected text inside a textarea with a predefined replacement text. To replace a text, I have to select it and right click. The replacement happens properly, if the text is inside a or a tag. But if the text is inside a , it is not getting replaced correctly. A sample is available in this Fiddle Here is my code: HTML: Select any text in this sentence and right click to replace it This text is not getting replaced as expected JS: if (document.addEventListener) { document.addEventListener('contextmenu', function(e) { replaceSelectedText("<<replaced>>"); e.preventDefault(); }, false); } else { document.attachEvent('oncontextmenu', function() { alert("You've tried to open context menu"); window.event.returnValue = false; }); } function replaceSelectedText(replacementTxt) { var sel, range; if (window.getSelection) { sel = window.getSelection(); console.log(sel); if (sel.rangeCount) { range = sel.getRangeAt(0); console.log(range); range.deleteContents(); range.insertNode(document.createTextNode(replacementTxt)); } } else if (document.selection && document.selection.createRange) { console.log("!!") range = document.selection.createRange(); range.text = replacementTxt; } } Is there something wrong with the way I implemented it? Any suggestions would be appreciated.
has comment: http://stackoverflow.com/comment/43160111
has answer: http://stackoverflow.com/a/27353359

http://stackoverflow.com/comment/43260158
type: QuestionComment
comment on: http://stackoverflow.com/q/27407575
has text: @philtune It's interfering with a modal window.
score: 0
type: Comment

http://stackoverflow.com/a/27351888
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43157790
type: AcceptedAnswer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/27351653
has body: Spring MVC will populate the model from html select, but your drop down is based on ul/li which are not html inputs. If you can switch to select or spring tasgs form:select, form:option or form:options it will work. You will need to use the taglib for spring tags, place it on the top of your jsp &lt;%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %&gt; If you have to keep the ul/li you need to back it with an hidden field. To use hidden remove the name dropDown from the ul. In javaScript attach an event listener on selection change and sync the ul/li with the hidden The hidden feild should have the name dropDown. &lt;input type="hidden" name="dropDown" /&gt; Try the following link for hints http://www.mkyong.com/spring-mvc/spring-mvc-dropdown-box-example/ Spring related documentation http://docs.spring.io/spring/docs/current/spring-framework-reference/html/view.html
type: Answer
answers question: http://stackoverflow.com/q/27351653

http://stackoverflow.com/comment/43314240
type: QuestionComment
has text: There should be a headers function in `rejection` object, that can get you header with rejection.headers('headername')
score: 0
comment on: http://stackoverflow.com/q/27436754
type: Comment

http://stackoverflow.com/comment/54991224
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27360109
type: Comment
has text: @ArtjomB. well you have been a great help to me in the last few weeks. Really appreciate it.

http://stackoverflow.com/comment/43098916
comment on: http://stackoverflow.com/q/27319647
score: 0
type: QuestionComment
type: Comment
has text: Appreciate the thoughts, however, the parameters are arbitrary too so `abc` can be `foo` and other times maybe `bar`, etc.

http://stackoverflow.com/q/27366961
has answer: http://stackoverflow.com/a/27367053
possible better answer: http://stackoverflow.com/a/48169749
type: Question
has comment: http://stackoverflow.com/comment/43186441
has comment: http://stackoverflow.com/comment/43186394
tagged with: javascript
has body: in PHP: $var=0; $var=""; $var="0"; $var=NULL; to verify if $var is 0 or "0" or "" or NULL if (!$var) {...} in jQuery/JavaScript: $var=0; $var=""; $var="0"; $var=NULL; if (!$var) works for every value except for "0" Is there a general way in JavaScript/jQuery to check all kinds of those empty/null/zero values, exactly like php does?
answer count: 6
has answer: http://stackoverflow.com/a/27367148
score: 11
has comment: http://stackoverflow.com/comment/43186045
has answer: http://stackoverflow.com/a/27367310
has title: Check if string zero, zero, empty string, null
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27367162
upvote count: 11
has answer: http://stackoverflow.com/a/48169749
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27367310
has answer: http://stackoverflow.com/a/27367118

http://stackoverflow.com/a/27341751
has comment: http://stackoverflow.com/comment/43139325
has comment: http://stackoverflow.com/comment/43139287
type: Answer
answers question: http://stackoverflow.com/q/27341503
has body: Just copy/paste this: Jquery Welcome to my site
score: 0

http://stackoverflow.com/comment/43233163
comment on: http://stackoverflow.com/a/27381444
type: AnswerComment
score: 0
has text: i have tried but same results..will you please elaborate your answer.Thanks
type: Comment

http://stackoverflow.com/a/27317247
has comment: http://stackoverflow.com/comment/43094111
has body: Every tag supports id. In your case, would work well. document.getElementById("user").innerHTML="Arvin"; Name : user1
upvote count: 4
has comment: http://stackoverflow.com/comment/43094133
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/27317193
has comment: http://stackoverflow.com/comment/43094139
has comment: http://stackoverflow.com/comment/43094980
has comment: http://stackoverflow.com/comment/43094199
type: Answer
has comment: http://stackoverflow.com/comment/43094374

http://stackoverflow.com/a/27378977
accepted answer of: http://stackoverflow.com/q/27377232
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/43207836
has body: No, getting a property on a Parse object does not make an HTTP request. If the property is a Pointer to another object and you need a property on that object, then use the Parse.Query.include() method to include the full object on your query. To illustrate, make this the first line in your success function: console.log(results); Update: If the username is all you're after, then use pluck in underscore (or lodash): _ = require('underscore'); ... success: function (results) { usernamesArray = _.pluck(results, 'username');
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/27377232

http://stackoverflow.com/comment/43231158
comment on: http://stackoverflow.com/a/27391632
type: Comment
has text: removing the u makes it all work! thanks much. Maybe you should edit your answer to make it compatible with both python 2 and 3
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43285405
type: Comment
type: QuestionComment
has text: have you tried this? $("head").append(' ');
comment on: http://stackoverflow.com/q/27420777
score: 0

http://stackoverflow.com/q/27380647
score: 3
type: Question
has answer: http://stackoverflow.com/a/37910538
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: gulp
favorite count: 0
has body: I have the following gulp task: gulp.task('app-scripts', function() { return getEnvScriptsStream() .pipe(gulpif(stgOrProd(), uglify())) .pipe(gulpif(stgOrProd(), concat('embed'))) .pipe(gulp.dest(paths.js)) .pipe(connect.reload()); }); How can I combine the two gulpif() into one?
has answer: http://stackoverflow.com/a/27381319
tagged with: node.js
upvote count: 3
type: UnansweredQuestion
has title: Combine two gulpif into one

http://stackoverflow.com/comment/43233149
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27392931
type: Comment
has text: The value of which dropdown. What have you tried?

http://stackoverflow.com/comment/43250777
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27395158
type: Comment
has text: Yeah, I'm sure what is the requirement of the OP. He said the counter should work even after refreshing. But if there is something that, if one user clicks it'll update for every user, then you need to send the count to the server.

http://stackoverflow.com/a/36312535
type: Answer
answers question: http://stackoverflow.com/q/27407358
score: 0
has body: Rather than using a basic array, you should use an array of objects like so: - var data = [ {'title':'Strategic Overview', 'content':'Your content 1'}, {'title':'Our approach', 'content':'Your content 2'} ] each item in data +list(item.title) p= item.content

laravel
tags question: http://stackoverflow.com/q/27314946
tags question: http://stackoverflow.com/q/27465490
tags question: http://stackoverflow.com/q/27455405
tags question: http://stackoverflow.com/q/27371965
tags question: http://stackoverflow.com/q/27356961
tags question: http://stackoverflow.com/q/27455561
tags question: http://stackoverflow.com/q/27324958
tag name: laravel
tags question: http://stackoverflow.com/q/27322089
tags question: http://stackoverflow.com/q/27374627
tags question: http://stackoverflow.com/q/27373541
tags question: http://stackoverflow.com/q/27350733
type: Tag
tags question: http://stackoverflow.com/q/27347331

http://stackoverflow.com/a/27469796
downvote count: 0
score: 1
has body: You can get specific menu-item by this keyword, and use jQuery(this) to transform it to a jQuery object. Try this: jQuery(document).ready(function(){ jQuery('.menu &gt; li &gt; a').hover(function() { jQuery(this).children('span').toggleClass('nav-label'); }); });
answers question: http://stackoverflow.com/q/27469701
has comment: http://stackoverflow.com/comment/43390966
upvote count: 1
type: Answer

http://stackoverflow.com/comment/43123961
score: 1
comment on: http://stackoverflow.com/q/27333105
type: Comment
type: QuestionComment
has text: is the iFrame from the same domain as the main HTML?

http://stackoverflow.com/q/27343278
tagged with: javascript
has body: I need to have a growing and decreasing circle in made in javascript. My idea is to use a div with border-radius : 50% To get a circle. I need to make it scale from 0.2 to 1 every [x] seconds . Like It grows from 0.2 to 1 in 5 seconds, then it decreases from 1 to 0.2 in5 seconds too. THen the movement starts again. I think i have to use sin or cos functions but i don't know how to get this interval depending on time. I need it to be coupled with a javascript timing function, so that when i satr a timer, the animation begins, and when I pause it it pauses the animation. Thanks for advice !
score: 0
answer count: 3
has title: Ocillate function between two values javascript
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
tagged with: trigonometry
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/27343335
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27343406
has answer: http://stackoverflow.com/a/27343376
has comment: http://stackoverflow.com/comment/43142019
type: Question

http://stackoverflow.com/comment/43307874
score: 0
type: Comment
has text: I believe you'd already checked its contents. May I ask why it is not relevant/why you are unable to treat it as a string to pass to the request in this regard? This is an interesting issue.
comment on: http://stackoverflow.com/a/27433314
type: AnswerComment

http://stackoverflow.com/comment/43177085
has text: @David, that WOULD work, but I wouldn't recommend it because it discourages organization, which in turn encourages bad programming IMO.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27361489
score: 0

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/27442464
tags question: http://stackoverflow.com/q/27334753
tags question: http://stackoverflow.com/q/27459451
tags question: http://stackoverflow.com/q/27469675
tags question: http://stackoverflow.com/q/27343938
tags question: http://stackoverflow.com/q/27401624
tags question: http://stackoverflow.com/q/27463520
tags question: http://stackoverflow.com/q/27349841
tags question: http://stackoverflow.com/q/27368957
tags question: http://stackoverflow.com/q/27368725
tags question: http://stackoverflow.com/q/27393016
tags question: http://stackoverflow.com/q/27358415
tags question: http://stackoverflow.com/q/27321215
tags question: http://stackoverflow.com/q/27346755
tags question: http://stackoverflow.com/q/27442162
tag name: svg
tags question: http://stackoverflow.com/q/27381452
tags question: http://stackoverflow.com/q/27431850
tags question: http://stackoverflow.com/q/27468586
tags question: http://stackoverflow.com/q/27411919
tags question: http://stackoverflow.com/q/27369795
tags question: http://stackoverflow.com/q/27405776
tags question: http://stackoverflow.com/q/27458729
tags question: http://stackoverflow.com/q/27383573
tags question: http://stackoverflow.com/q/27321774
tags question: http://stackoverflow.com/q/27414485
tags question: http://stackoverflow.com/q/27419663
tags question: http://stackoverflow.com/q/27352528
tags question: http://stackoverflow.com/q/27316125
tags question: http://stackoverflow.com/q/27426419
tags question: http://stackoverflow.com/q/27332249
tags question: http://stackoverflow.com/q/27430389
tags question: http://stackoverflow.com/q/27432703
tags question: http://stackoverflow.com/q/27383179
tags question: http://stackoverflow.com/q/27318727
tags question: http://stackoverflow.com/q/27322817
tags question: http://stackoverflow.com/q/27473402
tags question: http://stackoverflow.com/q/27382588
tags question: http://stackoverflow.com/q/27422884
tags question: http://stackoverflow.com/q/27350813
tags question: http://stackoverflow.com/q/27407415
tags question: http://stackoverflow.com/q/27344688
type: Tag

http://stackoverflow.com/comment/43403010
has text: Thank you, sorry i dont have enough reputation points to make upvote. If Possible let me know how to make it less code.""i am calling same chart function, thrice, is there a way to make it less code.""
type: Comment
comment on: http://stackoverflow.com/a/27396089
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43200827
comment on: http://stackoverflow.com/q/27366207
score: 0
type: QuestionComment
has text: Updated post to reflect these questions! Thanks.
type: Comment

http://stackoverflow.com/a/32937262
downvote count: 0
has body: I too had problem with the seach api of the Semantic-UI. So after some researchs, i learned that it can be used this way: I am using Ruby on Rails also. jQuery File to autocomplete cities names: # Semantic-Ui Search # Sets for autocomplete name of cities while typing. $('.ui.search.city').search apiSettings: action: 'search', url: '/cities/autocomplete.json?query={query}' fields: results : 'cities' title : 'name' description : 'state' minCharacters : 3 Semantic-UI (search) expects a "results" as root and nodes with childs content with title and description, and others that api specify. So if you had json result with other names, then you have to change in the method call of searc function. Because of this, i changed results for cities, title for name and description to state. In my Controller i just made a query like this: def autocomplete @cities = City.includes(:state).order(:name).where('name like ?', "%#{params[:query]}%") end In my Routes file i specify the get method that return a collection. # Resources for cities. resources :cities, only: :index do get :autocomplete, :on =&gt; :collection end And using the Rabl gem i format the output of json file: collection @cities, root: :cities , object_root: false attributes :id, :name node(:state) { |city| city.state.name } node(:query) { params[:query] } Thats it's all, it works for me.
type: Answer
answers question: http://stackoverflow.com/q/27374340
upvote count: 3
score: 3

http://stackoverflow.com/comment/43287384
type: Comment
has text: I don't want code, in controller row details are submited it display on another window. but i need that details will come in lightbox.
comment on: http://stackoverflow.com/a/27415902
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43215074
has text: html code and snippet or jsfiddle will be better
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27383209
score: 0

http://stackoverflow.com/comment/43362056
score: 0
type: Comment
type: QuestionComment
has text: Take a look at this: http://stackoverflow.com/questions/1640391/how-do-i-make-a-jsonp-call-with-jquery-with-basic-authentication
comment on: http://stackoverflow.com/q/27462773

http://stackoverflow.com/q/27353225
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/10506117
has answer: http://stackoverflow.com/a/27353301
possible better answer: http://stackoverflow.com/a/27353261
has answer: http://stackoverflow.com/a/27353261
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7938259
has body: I want to use jQuery to select everything on a page except a certain div. My question is similar to this answer, but that solution selects only divs, I want to select everything. In this example Fiddle, I want to select everything that does not have, or not the descendent of an element with, a class of "kids". So clicking on the "grandkids" and "kids" should not show a log entry, but clicking on the "parent" or the image would. The page will have a very complex structure so something like this wouldn't be feasible.
type: Question
has answer: http://stackoverflow.com/a/27353361
accepted answer: http://stackoverflow.com/a/27353361
has title: jQuery - Select everything but
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: jquery-selectors

http://stackoverflow.com/comment/43147423
has text: don't involve js if you don't have to. instead of background colors i've used float right to every third 'mix' class of group of four (only on min-width: 568px). like before, i've used the #999 for the contrast but change it to #F2F2F2 or remove it, the game now is not about the color, it's about placements. result: http://jsfiddle.net/7h36fjnq/1/
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27337880

http://stackoverflow.com/comment/43089029
type: AnswerComment
score: 0
type: Comment
has text: It would, but maybe its not just the body that needs to be altered, but rather the whole CSS set?
comment on: http://stackoverflow.com/a/27314454

jqbootstrapvalidation
type: Tag
tag name: jqbootstrapvalidation
tags question: http://stackoverflow.com/q/27348361

http://stackoverflow.com/comment/43147226
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27338203
type: Comment
has text: Part 2: so a match would be "word" and "swords" if word is the query. Your solution is faster because it exits as soon as a non matching character is found. Again, sorry if that was mixed up in my question.

http://stackoverflow.com/q/27416161
has comment: http://stackoverflow.com/comment/43276693
has comment: http://stackoverflow.com/comment/43276183
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: jqxgrid
tagged with: jqwidget
has body: I am using Bootstrap 3.2.0 Modal for displaying the jqxGrid with filtering functionality. All functionality of jqxGrid filtering (Sorting, Select Box) is working, except for typing text in the filtering input box. I am not able to find a solution on this issue. Please help. I am not able to type in the input boxes given below. It is not focusing, but I am able to inspect element using dev tools. Not even the value is getting placed, when edited with dev tools. CODE: http://fiddle.jshell.net/yprLbyu7/3/show/ or http://jsfiddle.net/yprLbyu7/3/
has title: jqxGrid + Bootstrap 3.2.0 modal – unable to select input 'text' box
tagged with: twitter-bootstrap-3
has answer: http://stackoverflow.com/a/27416278
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/27391310
type: Answer
has body: *{ margin:0px; padding:0px; } body{ background:url(../images/background.jpg); height:100%; width:100%; } #container { float:left; width:100%; overflow:hidden; position:relative; } #container ul { clear:left; float:left; list-style:none; margin:0; padding:0; position:relative; left:50%; text-align:center; } #container ul li { display:block; float:left; list-style:none; margin:0; padding:0; position:relative; right:50%; } #container ul li a { display:block; margin:0 0 0 1px; padding:3px 10px; text-decoration:none; line-height:1.3em; } .menu{ list-style:none; } .menu li{ display:block; height:50px; width:125px; float:left; background: rbackground: #ffffff; /* Old browsers */ background: -moz-linear-gradient(top, #ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f1f1f1), color-stop(51%,#e1e1e1), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* IE10+ */ background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */ line-height:50px; text-align:center; border-right:1px solid #000; font-family: 'Francois One', sans-serif; } .child{ border-bottom-left-radius:50px; border-top-left-radius:50px; } .child1{ border-bottom-right-radius:50px; border-top-right-radius:50px; } .menu li:hover{ background:background: #ffffff; /* Old browsers */ background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */ background: -webkit-gradient(radial, center center, 0px, center c…
answers question: http://stackoverflow.com/q/27389622
score: 0

http://stackoverflow.com/comment/43258108
comment on: http://stackoverflow.com/q/27406738
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [Toggling an image src with jQuery](http://stackoverflow.com/questions/19057513/toggling-an-image-src-with-jquery)

http://stackoverflow.com/comment/43372200
score: 3
comment on: http://stackoverflow.com/a/27468446
type: AnswerComment
type: Comment
has text: @idanshmu it smells like an [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) to me.

http://stackoverflow.com/comment/43160846
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27322141
type: AnswerComment
has text: so what you are getting now??

http://stackoverflow.com/comment/43227143
type: QuestionComment
has text: It works for me too. I tried heights greater and less than 165 (tested Chrome, Firefox, and IE8)
score: 0
comment on: http://stackoverflow.com/q/27389529
type: Comment

coding-style
tags question: http://stackoverflow.com/q/27429800
type: Tag
tag name: coding-style

http://stackoverflow.com/a/27431982
type: AcceptedAnswer
type: Answer
has body: Here's the concept: var counter = 60; setInterval(function(){ counter--; ... $('b').text(counter); //update counter output every second }, 1000); $("#box").click(function(){ counter += 31; $('b').text(counter); //immediately update counter again });
accepted answer of: http://stackoverflow.com/q/27431069
answers question: http://stackoverflow.com/q/27431069
score: 0

http://stackoverflow.com/a/27343333
has comment: http://stackoverflow.com/comment/43144521
downvote count: 1
has comment: http://stackoverflow.com/comment/43142261
score: 5
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27342945
has body: If your disallowed characters list is thorough (!@#$%^&amp;*()=+./,[{]};:'"?&gt;&lt;), then the regex is: ^#?[^\s!@#$%^&amp;*()=+./,\[{\]};:'"?&gt;&lt;]+$ Demo This allows an optional leading # sign: #?. It disallows the special characters using a negative character class. I just added \s to the list (spaces), and also I escaped [ and ]. Unfortunately, you can't use constructs like \p{P} (Unicode punctuation) in JavaScript's regexes, so you basically have to blacklist characters or take a different approach if the regex solution isn't good enough for your needs.
has comment: http://stackoverflow.com/comment/43143320
accepted answer of: http://stackoverflow.com/q/27342945
type: Answer
has comment: http://stackoverflow.com/comment/43142367
has comment: http://stackoverflow.com/comment/43156862
upvote count: 6

http://stackoverflow.com/comment/43257370
type: QuestionComment
has text: Where are these two lines *"Notified of runtime.onMessage"* and *"Invoked tabs.sendMessage"*? I can't see any debug message like those. Include more relevant code in your question, please.
comment on: http://stackoverflow.com/q/27405698
score: 0
type: Comment

http://stackoverflow.com/comment/43280067
score: 1
comment on: http://stackoverflow.com/a/27413520
type: AnswerComment
type: Comment
has text: Interesting, I'll read about that function, thank you. And if only exists these two tags, I think I can do this easily :)

http://stackoverflow.com/a/27432998
score: 1
upvote count: 1
has body: While lunr is indexing the browser cannot do anything else, which includes, in your case, properly animating the progress bar. You could try performing the indexing off the main ui thread by using a web worker. This is how lunr is used on the Angular docs site, there is a good article explaining some of the implementation here http://www.bacondarwin.co.uk/angularjs-docs-performance/ If your data is fairly static you might also look into pre-building the lunr index. Loading a pre-built index is much faster and you should see no issues with indexing locking up the browser. You can use https://github.com/olivernn/lunr-index-builder for building the index from the command line and then loading the index in the browser like so: var index = lunr.Index.load(serialised_index)
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43463304
accepted answer of: http://stackoverflow.com/q/27402736
answers question: http://stackoverflow.com/q/27402736
type: Answer

http://stackoverflow.com/comment/47758008
type: QuestionComment
type: Comment
has text: @circy Can you move that comment as an answer and mark it as a solution? Thanks.
comment on: http://stackoverflow.com/q/27421528
score: 0

http://stackoverflow.com/comment/43228049
has text: The former is completely wrong. http://blog.slaks.net/2013-09-03/traditional-inheritance-in-javascript/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27390009
score: 0

http://stackoverflow.com/q/27466817
tagged with: sendmessage
tagged with: google-chrome-extension
downvote count: 0
answer count: 1
favorite count: 0
has title: Chrome.extension.sendMessage within chrome.tabs.create
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: google-chrome
type: Question
has body: I need to create a chrome extension which captures the current visible tab and open it in a new tab. I use the following code: send.js function openNextPage(imagesrc) { chrome.tabs.create({url: "newScreen.html"},function(tab){ chrome.runtime.sendMessage({someParam: imagesrc},function(response){console.log(response);}); } ); } And inside newScreen.html I had included receive.js as follows: window.addEventListener("load",function(){ console.log('contents Loaded'); chrome.runtime.onMessage.addListener(function(request,sender,response) { console.log(request.someParam); }); }); The problem is, once the new tab is created(first newScreen.html ) I could see Contents Loaded message, but not the imagesrc. Maybe because the onMessage.addEventListener is executed later(after sendMessage). But if I click my extension again and it opens the 2nd newScreen.html , the previous newScreen.html receives the message and prints it. If I open a third tab, the first and second tabs are receiving the message again. The problem is sendMessage executes even before onMessageListener is added. I used TimeOut for sendMessage but in vain. Help me out!
has answer: http://stackoverflow.com/a/27467467
accepted answer: http://stackoverflow.com/a/27467467
tagged with: javascript

http://stackoverflow.com/comment/43159360
comment on: http://stackoverflow.com/q/27352812
score: 0
type: QuestionComment
has text: i should have used ("#img5")..i got it wrong when i asked the question
type: Comment

http://stackoverflow.com/comment/135918885
type: Comment
comment on: http://stackoverflow.com/a/48664093
has text: Is it for [IIS](https://en.wikipedia.org/wiki/Internet_Information_Services)?
score: 0
type: AnswerComment

http://stackoverflow.com/q/27458854
has comment: http://stackoverflow.com/comment/43354692
score: 2
type: AnsweredQuestion
tagged with: angularjs-ng-route
has body: I am creating an AngularJS application which will get content from The Guardian API. I am using routing, so when it's at "articles/:articleId", I can get the articleId parameter. In this case, "articles/123" works fine, it returns 123, but The Guardian API id's are: technology/competition/2013/nov/01/observer-tech-monthly-student-competition So, it doesn't recognise news/:articleId as the route anymore, instead, it skips that controller and goes back to the normal (.otherwise()) controller. Is there any way that I could get the whole things after /news, in this case, the whole parameter to be returned: technology/competition/2013/nov/01/observer-tech-monthly-student-competition Thanks.
type: Question
tagged with: javascript
has title: AngularJS route parameter random number of slashes
upvote count: 2
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/27458972
accepted answer: http://stackoverflow.com/a/27458972

http://stackoverflow.com/comment/43205584
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27376729
has text: yes there also i am using `$scope.myDate = new Date('2014-11-21 07:30:00'); `
type: AnswerComment

http://stackoverflow.com/q/27334504
accepted answer: http://stackoverflow.com/a/27334640
has body: Code: var pictures = ["url(bildes/unity.png)", "url(bildes/xna.png)", "url(bildes/bge.png)"]; var countthearray = pictures.length; var i = 0; function MoveOneUp(){ i++; document.getElementById("slaideris").style.backgroundImage=pictures[i]; if (i == countthearray-1) { i =-1; } } function MoveOneDown(){ --i; document.getElementById("slaideris").style.backgroundImage=pictures[i]; if (i&lt;0){ i=countthearray; } } I'm trying to change the backgroundImage of a element via buttons, which have JS attached. If I use function MoveOneUp() everything works alright, but function MoveOneDown() seems to have some kind of problem that I don't understand. Whenever I reach the last item of array, I have to click 2 times and only then it returns the array length value. Can someone explain me please where is the problem and how can I fix it?
type: Question
answer count: 2
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43126090
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27334640
has answer: http://stackoverflow.com/a/27334573
has comment: http://stackoverflow.com/comment/43126164
type: AnsweredQuestion
has title: Making array elements change with JavaScript and buttons
possible better answer: http://stackoverflow.com/a/27334573

http://stackoverflow.com/q/27365608
has answer: http://stackoverflow.com/a/27366155
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43183304
downvote count: 3
has body: In this JSFiddle demo, i tried to add a row dynamically only knowing the id of one of the previous element of the table. The code works perfectly, otherwise i want to beautify it. In particular i wish to highlight the new inserted row, using this property: .effect("highlight", color: '#4BADF5'}, 1000); Any suggestions? Thanks
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/848797
has comment: http://stackoverflow.com/comment/43185370
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/27366155
tagged with: css
has title: How to set effect dynamically in javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/43183311
score: -3

http://stackoverflow.com/comment/43246091
type: Comment
score: 1
has text: Can you please provide the _input array as a javascript variable and not as a php inline script?
type: QuestionComment
comment on: http://stackoverflow.com/q/27400188

http://stackoverflow.com/comment/43095129
score: 0
comment on: http://stackoverflow.com/q/27317612
type: Comment
type: QuestionComment
has text: I view this on fullscreen on the computer and the is behind the navbar, only the content after the page-header is visible

http://stackoverflow.com/comment/43274986
has text: This matches 00.00 but i dont want this also 0.00,0,00.00,00.0. these have got no meaning.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27415482

http://stackoverflow.com/q/27326772
type: Question
has answer: http://stackoverflow.com/a/27326824
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have a nav bar that I have positioned 'fixed' at the top of my page. The problem that I have is that I want to displace the entire page down by the (dynamic) size of my nav depending on the size of the screen used. Basically, I want to move the whole page down the height of this nav. To do this, I'm going to be using a padding to the nav that will affect it's height. I am using a box-sizing:border-box attribute on this nav but whenever I try and load the page, it doesn't account for the extra height added with the padding when I use jQuery's .height() function. The div with the 'displacement' class does not have anything to it except a 100% width initially. This is the ugly result along with all of the current code http://jsbin.com/qomepe/2 Can anyone tell me why this is happening or if I've overlooked something?
possible better answer: http://stackoverflow.com/a/27326832
score: 0
has comment: http://stackoverflow.com/comment/43112631
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43112578
has comment: http://stackoverflow.com/comment/43112659
has comment: http://stackoverflow.com/comment/43112709
tagged with: css
has title: jQuery .height() not working with box-sizing: border-border
accepted answer: http://stackoverflow.com/a/27326824
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27326832
has comment: http://stackoverflow.com/comment/43112719

http://stackoverflow.com/comment/43247568
type: Comment
comment on: http://stackoverflow.com/q/27401106
score: 0
type: QuestionComment
has text: I think you would like to know this is a very insecure way of "protecting" things :) - If you wanna know why its insecure I suggest that you take the Cryptography course at Khan Academy, will take you less than an hour and its free

http://stackoverflow.com/q/27359591
has comment: http://stackoverflow.com/comment/43171304
has title: Are my IF statements incorrect?
answer count: 4
has answer: http://stackoverflow.com/a/27361433
upvote count: 2
has body: I have the following: var detail = 'two'; function chkDetail(detail){ if(detail == 'one') { jQuery('#valMsg').text('one'); } if(detail == 'two') { jQuery('#valMsg').text('two'); } if(detail == 'three') { jQuery('#valMsg').text('three'); } else { jQuery('#valMsg').text('NO'); } } Depending on what string is passed into my function, I want the appropriate message to be passed into my valMsg div. In the above scenario, my function keeps returning NO. Can anyone tell me why this is? Are the if statements incorrect?
has comment: http://stackoverflow.com/comment/43172633
has answer: http://stackoverflow.com/a/27359644
has answer: http://stackoverflow.com/a/27359661
possible better answer: http://stackoverflow.com/a/27359615
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27359615
tagged with: if-statement
has comment: http://stackoverflow.com/comment/43175339
has comment: http://stackoverflow.com/comment/43171333
type: Question
has comment: http://stackoverflow.com/comment/43171908
accepted answer: http://stackoverflow.com/a/27359661
tagged with: javascript
score: 1
favorite count: 0

http://stackoverflow.com/comment/43171593
score: 0
type: Comment
has text: dude <context:component-scan base-package="com.controller.UserLoginController" /> should be <context:component-scan base-package="com.controller" />
type: AnswerComment
comment on: http://stackoverflow.com/a/27322141

http://stackoverflow.com/a/27323820
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/43217239
has comment: http://stackoverflow.com/comment/43201098
has comment: http://stackoverflow.com/comment/43215018
has comment: http://stackoverflow.com/comment/43200858
has comment: http://stackoverflow.com/comment/43210348
has body: It looks like you need a utf-16 le bom in the file, which you can't do with a string in js, so you'll have to use a byte array. See example below var stringHere = '%ff%fe%22%00%41%00%22%00%09%00%22%00%42%00%22%00'; var byteArray = []; stringHere.replace(/([0-9a-f]{2})/gi, function(d){ byteArray.push(parseInt(d, 16)); }); var blob=new Blob([new Uint8Array(byteArray)],{type:'text/csv;charset=UTF-16LE;'}); var blobUrl=URL.createObjectURL(blob);
has comment: http://stackoverflow.com/comment/43164970
upvote count: 2
has comment: http://stackoverflow.com/comment/43211271
accepted answer of: http://stackoverflow.com/q/27318715
has comment: http://stackoverflow.com/comment/43212802
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27318715
has comment: http://stackoverflow.com/comment/43167924
has comment: http://stackoverflow.com/comment/43181195
type: Answer

http://stackoverflow.com/q/27420567
has comment: http://stackoverflow.com/comment/43284074
favorite count: 0
has title: Uncaught Error: cannot call methods on page prior to initialization; attempted to call method 'bindRemove'
has comment: http://stackoverflow.com/comment/43283826
has comment: http://stackoverflow.com/comment/43283751
has comment: http://stackoverflow.com/comment/43284009
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43328383
upvote count: 7
tagged with: php
has body: I am developing a web application using jQuery mobile 1.4.5. The error: Uncaught Error: cannot call methods on page prior to initialization; attempted to call method 'bindRemove' It appears when I connect the front end with back end (using PHP to connect to the database) and I try to login: Link to web app You should've got an error message displayed on the screen if you haven't typed anything User: 10001 | Pass: 1q2w3e You can also notice that it is going to log you in, but only if you refresh the page. Log out by pressing on the avatar If i disable jQuery mobile, the Login works fine and I do not receive the console error (back end is functional on it's own) I guess the problem is the order in which I call or initialize some functions. I think the best way would be to post my files here. If you have any suggestions about how can we help each other solve the problem quicker, please let me know. Thank you ^_^ index.php <?php ob_start(); include 'core/init.php'; // Database connection (works) include 'includes/header.php'; // Checkes is it is an admin session if (logged_in() === true){ if (is_admin($session_user_id) === true){ header('Location:admin.php'); exit(); } } include 'includes/footer.php'; ob_end_flush(); ?> header.php <?php include 'includes/head.php'; if (logged_in() === true) { include 'loggedin.php'; // Landing screen } else{ include 'core/widgets/login.php'; // Login screen } ?> head.php Studenterhus Odense - Loyalty Program login.php <?php ob_start(); include 'core/init.php'; logged_in_redirect(); include 'includes/header.php'; if (empty($_POST) === false) { $user_id = $_POST['username']; $password = $_POST['password']; if (empty($user_id) === true || empty ($password) === true) { $errors[] = 'You need to enter a username and password'; } else if (user_exists($user_id) === false) { $errors[] = 'We cant find that card number!'; } /*else if (user_active($username) === false) { $errors[] = 'you havent activated your account!'; }*/ else { $login = login($u…
score: 7
has comment: http://stackoverflow.com/comment/54770424
has comment: http://stackoverflow.com/comment/43283873
type: Question
has comment: http://stackoverflow.com/comment/43283847
has comment: http://stackoverflow.com/comment/43284922
downvote count: 0
tagged with: jquery-mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/43286421
tagged with: jquery

http://stackoverflow.com/q/27426195
upvote count: 4
has title: jQuery : should i check for visibility before hiding an element?
has comment: http://stackoverflow.com/comment/43294348
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43294399
favorite count: 0
accepted answer: http://stackoverflow.com/a/27426396
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43294220
type: Question
has body: Is it best practice to check if an element is visible before hiding it, or is ok just to hide it? What are the benefits either way? In the example below, the first checks for visibility before hiding the .foo element... $('.dropdown').hover(function(){ $(this).find('.menu').fadeToggle(); if($('.foo').is(':visible')){ $('.foo').fadeOut(); }; }); or $('.dropdown').hover(function(){ $(this).find('.menu').fadeToggle(); $('.foo').fadeOut(); });
has comment: http://stackoverflow.com/comment/43294189
tagged with: performance
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/27426396

http://stackoverflow.com/a/28479517
has body: for the animation thing, I'm looking for the exact same thing ;) But, for the colors, your data array must be like this one: var data = { labels: ["l1", "l2", "l3"], datasets: [ { label: "In", fillColor: "rgba(220,220,220,0)", strokeColor: "rgba(37,131,154,1)", pointColor: "#fff", pointStrokeColor: "#rgba(37,131,154,1)", pointHighlightFill: "rgba(37,131,154,1)", pointHighlightStroke: "rgba(37,131,154,1)", data: [1000, 2000, 3000] }, { label: "Out", fillColor: "rgba(220,220,220,0)", strokeColor: "#ffa874", pointColor: "#fff", pointStrokeColor: "#ffa874", pointHighlightFill: "#ffa874", pointHighlightStroke: "#ffa874", data: [3000, 2000, 1000] } ]}; If you want different colors on a same dataset, I think it's not a native option... Maybe I'm wrong and if you've fund something, please share ;)
answers question: http://stackoverflow.com/q/27441502
score: 0
type: Answer

http://stackoverflow.com/q/27389224
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43226757
has title: jQuery ui autocomplete stay focus on mouseout
tagged with: jquery-ui
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/27389495
has comment: http://stackoverflow.com/comment/43226935
has body: I am using the this autocomplete, so far everything is good, but I was wondering how can I make the focus to stay if we mouseout.. I mean if I type something and mouseover to it they will be gray background on that focus and if I mouseout it will return to white, I want it to stay gray background. in other words I want the hover to stay. this is an example how I want it to be http://xdsoft.net/jqplugins/autocomplete/ but for some reasons I want to use jquery ui autocomplete. I don't think this is possible with css ? so.. demo http://jsfiddle.net/2wyqjhmk/ code $.widget("ui.autocomplete", $.ui.autocomplete, { options: { maxItems: 9999 }, _renderMenu: function (ul, items) { var that = this, count = 0; $.each(items, function (index, item) { if (count &lt; that.options.maxItems) { that._renderItemData(ul, item); } count++; }); } }); $(function () { $("#tags").autocomplete({ source: availableTags, maxItems: 10 }); });
type: Question

http://stackoverflow.com/q/27327122
score: 1
has body: Having problem with removing the previous value from the array and updating with the remaining data. For example, in the code JSFiddle I have four values in the array: BMW, Nissan, Volvo and Saab. var cars = ["Saab", "Volvo", "BMW" , "Nissan"]; shuffle(cars); document.getElementById("demo").innerHTML = cars[0]; So, once I "Press a button" it shows "BMW" or any other value, next time reloading should only randomize within the rest of the value i.e. Nissan, Volvo and Saab. var cars = ["Saab", "Volvo", **"BMW"** , "Nissan"]; until all ends and it shows "No more value to be shown"
has comment: http://stackoverflow.com/comment/43113269
type: Question
has answer: http://stackoverflow.com/a/27327251
answer count: 2
has title: Remove the previous value and update the array
tagged with: arrays
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27327251
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/27327205
has comment: http://stackoverflow.com/comment/43113239
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27327205
has comment: http://stackoverflow.com/comment/43113316

http://stackoverflow.com/comment/43343635
comment on: http://stackoverflow.com/a/27452595
type: AnswerComment
score: 0
type: Comment
has text: how to override "Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context."

jqgrid
tags question: http://stackoverflow.com/q/27340877
tags question: http://stackoverflow.com/q/27387295
tags question: http://stackoverflow.com/q/27354432
tags question: http://stackoverflow.com/q/27415427
tags question: http://stackoverflow.com/q/27369848
type: Tag
tags question: http://stackoverflow.com/q/27365779
tags question: http://stackoverflow.com/q/27427535
tags question: http://stackoverflow.com/q/27434039
tags question: http://stackoverflow.com/q/27395741
tag name: jqgrid
tags question: http://stackoverflow.com/q/27322113
tags question: http://stackoverflow.com/q/27358020
tags question: http://stackoverflow.com/q/27458359

http://stackoverflow.com/q/27454931
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43348859
has comment: http://stackoverflow.com/comment/43355169
has answer: http://stackoverflow.com/a/27455015
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43355777
has comment: http://stackoverflow.com/comment/43354426
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27455015
has title: JavaScript Regex Match Index
score: 0
has comment: http://stackoverflow.com/comment/43354435
has body: I have the following little block of code to find an image source in a web page: var reImg = [ 'src=\"(.*?)\" class=\"attachment-img-', 'src=\"(.*?)\" class=\"image attachment-img-', 'src=\"(.*?)-[0-9]+x[0-9]+(.*?)\" class=\"attachment-img-', 'src=\"(.*?)\" class=\"full-size-gal' ]; var u = new RegExp(reImg.join('|'), 'i').exec(pageSource); if (u) { print(u); } I use an array to store the regexes because I may need to add more expressions later. Also, the double-quotes are escaped because the code above will be stored in a JSON file. Now, the variable u has the results in it, but I need to get the value of u[1] or u[3] or u[5] - basically the stuff within the parenthesis. The problem is that I don't know which one matched. How do I get just the source URL?
has comment: http://stackoverflow.com/comment/43347839
tagged with: regex
has answer: http://stackoverflow.com/a/27487934
has comment: http://stackoverflow.com/comment/43348670
has comment: http://stackoverflow.com/comment/43347874
accepted answer: http://stackoverflow.com/a/27487934

http://stackoverflow.com/comment/43371318
has text: Yes, and you need to control the WebBrowser control from that Windows App,right? Those code samples are running from an Windows .NET app (or from a unit which is equivalent to a WinForms app)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27467924

http://stackoverflow.com/q/27329360
has body: I have a asp radio button and i want to set it's visibility to false in javascript. &lt;asp:RadioButton ID="rad1" Text="my radio button" runat="server" GroupName="b" /&gt; I am trying below code in javascript . document.getElementById("rad1").style.visibility = "hidden"; But it disables only radio button but the text "my radio button" is visible. I tried setting text , value property to blank text but it didn't work. So how can i hide the text of that radio button.
type: Question
has answer: http://stackoverflow.com/a/27329393
downvote count: 0
tagged with: javascript
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/27329466
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/27330392
score: 2
has title: Hide asp radio button text
upvote count: 2
possible better answer: http://stackoverflow.com/a/27329568
accepted answer: http://stackoverflow.com/a/27329466
has answer: http://stackoverflow.com/a/27329568
type: AnsweredQuestion

http://stackoverflow.com/a/27445456
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27445440
answers question: http://stackoverflow.com/q/27445440
has body: Just use anchors to indicate the beginning of the word (^) and the end of it ($): var patt = new RegExp("^[0-9]{4}[A-Z]{2}$"); ^ ^ As per your comments, you also want to capitalize the input. For this, you can use .toUpperCase(): Test ---> JSBIN $(document).ready(function(){ $('[name=postcode]').keyup(function(){ var str = $(this).val().toUpperCase(); var patt = new RegExp("^[0-9]{4}[A-Z]{2}$"); var res = patt.test(str); console.log(res); }); }); Alternatively, you can use ^[0-9]{4}[a-zA-Z]{2}$ (note the [a-zA-Z] part) to check the four letters, no matter upper or lowercase.
upvote count: 2
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/27444535
tagged with: asynchronous
has body: I am having difficulties loading data from Firebase into my AngularJS factory and thus controllers. Basically I have the following factory: .factory('usersList', ['fbutil', function(fbutil) { return { all: function() { return fbutil.syncArray('users'); }, get: function(userId) { fbutil.syncArray('users').then( function(result) { window.alert(result.length) // FIRST ALERT var x = 0; for (var i = 0, len = result.length; i &lt; len; i++) { if (result[i].uid == userId) { window.alert("fount id") // SECOND ALERT x = i; } else { window.alert("nope"); // THIRD ALERT } } return result[x]; }) // then } // get } // return }]); // usersList And my controller looks like: .controller('OverviewCtrl', ['$scope', 'fbutil', 'usersList', function($scope, fbutil, usersList) { $scope.usersList = usersList.all(); $scope.testUser = usersList.get("simplelogin:29"); // OTHER CODE }; }]) In my HTML file, when I call {{usersList}} then it produces the result: [{"color":"#CC0066","email":"a@a.com","name":"Eva","uid":"simplelogin:27"},{"color":"#009933","email":"b@b.com","name":"Semko","uid":"simplelogin:28"},{"color":"#CC0066","email":"c@c.com","name":"Caroline","uid":"simplelogin:29"}] But testUser does not load, just shows {{tesUser}} in the index file. Does anyone know how to handle this correctly? Without using the then(), which in this example also does not work, I figured out from the first alert that the result.length equaled 0, which gave me the suggestion that I am dealing with asynchronous loading. That is why I am trying to handle it whit .then() but apparently it is not working.
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/27444749
has title: Asynchronous loading data issue AngularJS and Firebase
score: 0
answer count: 1
tagged with: javascript
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/27444749

http://stackoverflow.com/a/27488560
score: 8
downvote count: 0
upvote count: 8
answers question: http://stackoverflow.com/q/27368184
has body: Here's a method to try: an iterative search using a simulated repulsive force. Algorithm First initialize the data set by arranging the circles across the surface in any kind of algorithm. This is just for initialization, so it doesn't have to be great. The periodic table code will do nicely. Also, assign each circle a "mass" using its radius as its mass value. Now begin the iteration to converge on a solution. For each pass through the main loop, do the following: Compute repulsive forces for each circle. Model your repulsive force after the formula for gravitational force, with two adjustments: (a) objects should be pushed away from each other, not attracted toward each other, and (b) you'll need to tweak the "force constant" value to fit the scale of your model. Depending on your math ability you may be able to calculate a good constant value during planning; other wise just experiment a little at first and you'll find a good value. After computing the total forces on each circle (please look up the n-body problem if you're not sure how to do this), move each circle along the vector of its total calculated force, using the length of the vector as the distance to move. This is where you may find that you have to tweak the force constant value. At first you'll want movements with lengths that are less than 5% of the radius of the sphere. The movements in step 2 will have pushed the circles off the surface of the sphere (because they are repelling each other). Now move each circle back to the surface of the sphere, in the direction toward the center of the sphere. For each circle, calculate the distance from the circle's old position to its new position. The largest distance moved is the movement length for this iteration in the main loop. Continue iterating through the main loop for a while. Over time the movement length should become smaller and smaller as the relative positions of the circles stabilize into an arrangement that meets your criteria. Exit the loop w…
has comment: http://stackoverflow.com/comment/43496436
type: Answer

http://stackoverflow.com/comment/43258406
comment on: http://stackoverflow.com/a/27406915
has text: And your edit makes my comment look stupid. `+1` for the same answer.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27348036
tagged with: forms
linked to: http://stackoverflow.com/q/13798313
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/62059194
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/39809943
tagged with: jquery
tagged with: validation
has body: How do I retain the default HTML form validation and yet prohibit form submitting? I have tried using event.preventDefault() and return false. Both are successful in stopping the form from submitting but both fail in form validation. I have also tried this solution, but even that does not work. Is anybody able to help me?
has title: Prevent form submit but retain form validation
has answer: http://stackoverflow.com/a/27348355
accepted answer: http://stackoverflow.com/a/27348355
favorite count: 0
score: 28
has comment: http://stackoverflow.com/comment/107238605
has answer: http://stackoverflow.com/a/62059194
linked to: http://stackoverflow.com/q/1357118
upvote count: 28
type: AnsweredQuestion

http://stackoverflow.com/a/27442496
has body: var defaults = { // default width of columns width:400px, change in your code to have pixels will fix your problem.
answers question: http://stackoverflow.com/q/27441957
has comment: http://stackoverflow.com/comment/43325758
has comment: http://stackoverflow.com/comment/43325278
score: 0
type: Answer

http://stackoverflow.com/comment/43193995
score: 2
comment on: http://stackoverflow.com/q/27371243
has text: don't trust your calculation total inside the hidden input, they could just change it from there, i suggest making those calculation total in backend. i'm not saying scrap the calculation on the front, just use it as presentation.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43226438
has text: @john the possibility of having the `targetName` being generated wrong had been brought up a while ago. You should keep a sharp eye out for these kinds of things! :) And always double-check, even if you're sure, haha.
type: Comment
comment on: http://stackoverflow.com/a/27389137
score: 0
type: AnswerComment

http://stackoverflow.com/a/27468953
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/43373254
upvote count: 1
has body: Removing the margin from nav.main-nav > ul > li > ul might help you. FIDDLE. I also added some padding to nav.main-nav > ul > li > ul > li. .clearfix:after { content: " "; /* Older browser do not support empty content */ visibility: hidden; display: block; height: 0; clear: both; } body { font-family: 'Open Sans', sans-serif; overflow-x: hidden; /* trick for navigation */ } nav.main-nav > ul { padding: 0; background-color: #f6a000; border-bottom: 1px solid #fff; } nav.main-nav > ul > li { display: inline-block; position: relative; z-index: 100; width: 30%; height: 60px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; border-right: 1px solid #fff; float: left; } nav.main-nav > ul > li.small { width: 2%; } nav.main-nav > ul > li > a { width: 100%; height: 100%; display: block; text-align: center; line-height: 60px; font-size: 16px; color: #fff; } nav.main-nav > ul > li > ul { position: absolute; left: 0; top: 100%; width: 100%; padding: 0; _margin: 0 -1000em; z-index: 101; visibility: hidden; opacity: 0; background-color: #F67900; list-style: none; } nav.main-nav > ul > li:hover { background-color: #F67900; } nav.main-nav > ul > li:hover > ul { visibility: visible; opacity: 1; } nav.main-nav > ul > li > ul > li { padding: 20px; } nav.main-nav > ul > li > ul > li > a { color: #fff; font-size: 16px; } nav.main-nav > ul > li:hover .drop { font-weight: bold; } about us who we are what we do where we are other information accomodation apartments hotels
answers question: http://stackoverflow.com/q/27468871
downvote count: 0

http://stackoverflow.com/a/27353618
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43163619
accepted answer of: http://stackoverflow.com/q/27353139
type: Answer
answers question: http://stackoverflow.com/q/27353139
has body: I think i know whats the problem i tested your case and found that i worked https://regex101.com/r/xU6qJ6/1 You probably just need to add a capture group try using this: /\[\[([\u3040-\u309F]+)\]\]/gm In regex stuff between () is a capture group which you can then later return
score: 0

http://stackoverflow.com/a/27332708
type: Answer
answers question: http://stackoverflow.com/q/27332580
has body: Or just set id to input field (&lt;input autofocus="autofocus" id="hid_inp" >) and use $("#hid_inp").focus(); instead of searchArea.elements['input'].focus();"
score: 0

http://stackoverflow.com/a/28556188
type: Answer
has body: ajax.js var interval = setInterval( function() { $.ajax ({ url: "user.php", success: function(data) { $("#users").html(data); } }); }, 3000); Above syntax refreshes pages every 3 seconds. You can compare old id of table in every 3 seconds. If new id is there eventually its new inserted values. So popup like below $result2 = mysqli_query($con, "SELECT id FROM user ORDER BY id ASC"); while($rows = mysqli_fetch_assoc($result2)) { $NEW_id = $rows["id"]; } if($NEW_id &gt; $_SESSION["OLD_id"]) { $_SESSION["destination_OLD"] = $id_flexi; echo '&lt;audio controls="controls" autoplay&gt; &lt;source src="beep.wav" type="audio/wav"&gt; &lt;embed src="beep.wav"&gt; Your browser is not supporting audio &lt;/audio&gt;'; } I have same problem as yours and this is my solutions. Experts recommend other things but I have only this much knowledge. Good day.
upvote count: 1
answers question: http://stackoverflow.com/q/27425262
score: 1
downvote count: 0

http://stackoverflow.com/a/27459402
has comment: http://stackoverflow.com/comment/116001106
has body: First and foremost, one of the things preventing node from interfacing with other interactive shells is that the child application must keep its "interactive" behavior, even when stdin doesn't look like a terminal. python here knew that its stdin wasn't a terminal, so it refused to work. This can be overridden by adding the -i flag to the python command. Second, as you well mentioned in the update, you forgot to write a new line character to the stream, so the program behaved as if the user didn't press Enter. Yes, this is the right way to go, but the lack of an interactive mode prevented you from retrieving any results. Here's something you can do to send multiple inputs to the interactive shell, while still being able to retrieve each result one by one. This code will be resistant to lengthy outputs, accumulating them until a full line is received before performing another instruction. Multiple instructions can be performed at a time as well, which may be preferable if they don't depend on the parent process' state. Feel free to experiment with other asynchronous structures to fulfil your goal. var cp = require('child_process'); var childProcess = cp.spawn('python', ['-i']); childProcess.stdout.setEncoding('utf8') var k = 0; var data_line = ''; childProcess.stdout.on("data", function(data) { data_line += data; if (data_line[data_line.length-1] == '\n') { // we've got new data (assuming each individual output ends with '\n') var res = parseFloat(data_line); data_line = ''; // reset the line of data console.log('Result #', k, ': ', res); k++; // do something else now if (k &lt; 5) { // double the previous result childProcess.stdin.write('2 * + ' + res + '\n'); } else { // that's enough childProcess.stdin.end(); } } }); childProcess.stdin.write('1 + 0\n');
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27458502
answers question: http://stackoverflow.com/q/27458502
downvote count: 1
type: Answer
upvote count: 12
score: 11
has comment: http://stackoverflow.com/comment/116000929

http://stackoverflow.com/q/27419607
accepted answer: http://stackoverflow.com/a/27420704
type: Question
has comment: http://stackoverflow.com/comment/43283106
has comment: http://stackoverflow.com/comment/43283006
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: angularjs
has body: I am using this jquery plugin selectric and trying to hook it up with my angular drop down. It works fine if my html for the dropdown has the options hardcoded in the html and I just do $('select, .select').selectric(); But if I load my dropdown data dynamically like this I get a javascript error in the selectric plugin TypeError: $li[index] is undefined I tried adding the selectric plug in as a directive and my directive .directive('selectric', function(){ 'use strict'; return{ restrict: 'AE', link: function(scope, element, attrs) { $(element).selectric(); } }; }); Any Ideas of what could be going wrong here ?
has answer: http://stackoverflow.com/a/27420704
favorite count: 0
has title: Angular Using Jquery Plugin issues...dynamic dropdown data
has comment: http://stackoverflow.com/comment/43282909
upvote count: 1
linked to: http://stackoverflow.com/q/14586249
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/43211970
comment on: http://stackoverflow.com/q/27381620
type: QuestionComment
type: Comment
has text: Without seeing the exact code causing the issue no, we can't say why.
score: 0

http://stackoverflow.com/comment/43355170
type: QuestionComment
comment on: http://stackoverflow.com/q/27459175
has text: Why is $page an integer? shouldn't it be a string?
score: 0
type: Comment

http://stackoverflow.com/comment/43344319
type: Comment
has text: I have moved ng-repeat into <il> but it's still showing nothing. Any thought
comment on: http://stackoverflow.com/a/27452569
score: 0
type: AnswerComment

http://stackoverflow.com/q/27432759
answer count: 1
downvote count: 0
favorite count: 0
tagged with: promise
has body: How can we use promise on top of Duktape? My Scenario: Migrating a client side javascript code that loads well on web browsers to Duktape. I am using Dukluv (binding with Duktape and libuv library) binary to run the JavaScript. However my javascript depends on BlueBird library. When I try to execute I get an error: no async scheduler available The problem is in bluebird's schedule.js line 33. Code is below for reference: else if ((typeof MutationObserver !== "undefined" &amp;&amp; (_MutationObserver = MutationObserver)) || (typeof WebKitMutationObserver !== "undefined" &amp;&amp; (_MutationObserver = WebKitMutationObserver))) { schedule = (function() { var div = document.createElement("div"); var queuedFn = void 0; var observer = new _MutationObserver( function Promise$_Scheduler() { var fn = queuedFn; queuedFn = void 0; fn(); } ); observer.observe(div, { attributes: true }); return function Promise$_Scheduler(fn) { queuedFn = fn; div.classList.toggle("foo"); }; })(); } There is no webkitmutationobserver nor document object as I am running my script on Dukluv without any browser. I also tried to use Q library, even there I get an error setTimeout not defined. Please suggest me a solution, if possible with some snippet of code. Thanks
accepted answer: http://stackoverflow.com/a/27435295
tagged with: bluebird
upvote count: 3
has title: Use promise on Duktape
type: Question
type: AnsweredQuestion
score: 3
tagged with: duktape
tagged with: javascript
has answer: http://stackoverflow.com/a/27435295

http://stackoverflow.com/q/27455899
has answer: http://stackoverflow.com/a/27457567
tagged with: node.js
type: AnsweredQuestion
has title: Connect to socket on form submit node js
upvote count: 1
tagged with: socket.io
type: Question
has body: I want to io.connect() on form submit for that I had coded like below var socket; $('#registration').submit(function(e) { socket = io.connect(); }); socket.on('newuser', function(data) { // getting error as "cannot read property on of undefined" }); Is this correct way to connect to socket on some front end actions(like form submit). I think due to that only I am getting error as "cannot read property on of undefined". Please direct me to correct way.
score: 1
accepted answer: http://stackoverflow.com/a/27457567
has comment: http://stackoverflow.com/comment/43350222
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43350044
favorite count: 0
tagged with: sockets
has comment: http://stackoverflow.com/comment/43349411

http://stackoverflow.com/a/27356286
has body: Replace $scope.registrationForm.lname.$dirty with $scope.registrationForm.lname.$setDirty(); $setDirty(); Sets the form to a dirty state. This method can be called to add the 'ng-dirty' class and set the form to a dirty state (ng-dirty class). This method will also propagate to parent forms. AngularJS Doc
has comment: http://stackoverflow.com/comment/43165688
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27356244
answers question: http://stackoverflow.com/q/27356244
score: 3
type: Answer
upvote count: 3

http://stackoverflow.com/q/27379306
answer count: 2
tagged with: validation
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27380790
has title: Calling object's method with only the string of the method's name
has answer: http://stackoverflow.com/a/27380790
tagged with: node.js
has answer: http://stackoverflow.com/a/27380723
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/912596
linked to: http://stackoverflow.com/q/359788
type: Question
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/27380723
has body: I am trying to build a Node.js app using express-validator, which would let me validate a request parameter in the body like so - req.checkBody('email_id', 'Invalid email ID!').notEmpty().isEmail(); Now I am trying to build one big JSON configuration file which will have all the fields and their rules (which is the function name, like isEmail(), for example) for each route in the application. I want to write to a middleware that intercepts each request, finds out the route, picks up the fields and their validation rules from the JSON file, and then runs those rules. The configuration file would look like this - { "VALIDATION_RULES": { "/createUser": { "RULES": { "email_id": { "message": "Invalid email ID!", "rules": ["notEmpty","isEmail"] } } } } } I can look into the express-validator module's exports to get all the available validation function names. If they were standalone function calls, I see how I would call the function with just the string of it's name as shown here and here. How do I pick the rules (notEmpty or isEmail), which are strings in the JSON, turn them into functions and chain them onto req.checkBody($field, $field.message)?
score: 0

http://stackoverflow.com/comment/43210942
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27380962
has text: @user3452098 that is what we are asking. Which value in particular do you want?

http://stackoverflow.com/comment/43374058
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27469496
has text: You cannot hide link, it's either on a page either not.

http://stackoverflow.com/comment/43383896
type: Comment
score: 1
has text: And on a side note: I personally find it more _angularish_ to return the promise generated by the `http.get` call instead of passing in a callback.
type: AnswerComment
comment on: http://stackoverflow.com/a/27474778

ace-editor
tags question: http://stackoverflow.com/q/27413644
tag name: ace-editor
type: Tag

http://stackoverflow.com/q/27469241
accepted answer: http://stackoverflow.com/a/27469412
score: 0
tagged with: canvas
answer count: 1
duplicate of: http://stackoverflow.com/q/17130395
has title: Canvas mouse position
has body: Here is my fiddle: jsfiddle In the original website (Slide Section) when the mouse moves, the canvas is moving under the cursor. However, in my fiddle, the cursor coordinates seem to be off. As in, a few inches above the cursor. Why is this happening? Here's my mousePosition object: var mousePosition = { x: 30 * canvas.width / 100, y: 30 * canvas.height / 100 }; Any Ideas?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27469412
linked to: http://stackoverflow.com/q/17130395
type: Question
tagged with: javascript

http://stackoverflow.com/a/27331867
has comment: http://stackoverflow.com/comment/43121621
downvote count: 1
has comment: http://stackoverflow.com/comment/43122116
has comment: http://stackoverflow.com/comment/43122261
answers question: http://stackoverflow.com/q/27331791
has comment: http://stackoverflow.com/comment/43122254
type: Answer
has body: use click() to do that or use .on('click') .. like this change your class to icon_png instead of icon.png $(document).ready(function(){ $('.icon_png').on('click',function(){ KlaviyoSubscribe.attachModalSignUp({ list: 'g9cZtX', delay_seconds: 0.5, content: { clazz: ' klaviyo_modal_g9cZtX', header: "Interested in our Newsletter?", subheader: "Stay in the know with news and promotions.", button: "Subscribe", success: "Thanks! Check your email for a confirmation.", styles: '.klaviyo_modal.klaviyo_modal_g9cZtX { font-family: "Helvetica Neue", Arial}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_header { color:#222;}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_subheader { color:#222;}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button,.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button span { background-color:#07234F; background-image: none; border-radius: 2px;}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button:hover,.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button span:hover { background-color:#2A4D85; background-image: none; }.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_inner,.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_fieldset .klaviyo_field_group input[type=text],.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_fieldset .klaviyo_field_group input[type=email] { border-radius: 2px;}' } }); }); });
has comment: http://stackoverflow.com/comment/43121992
upvote count: 1
score: 0

http://stackoverflow.com/q/27398874
tagged with: javascript
type: UnansweredQuestion
has body: Ive attached a plugin to my template which shows a calendar and events for particular dates. It works great except events aren't displayed for December. (function ($) { var eCalendar = function (options, object) { // Initializing global variables var adDay = new Date().getDate(); var adMonth = new Date().getMonth(); var adYear = new Date().getFullYear(); var dDay = adDay; var dMonth = adMonth; var dYear = adYear; var instance = object; var settings = $.extend({}, $.fn.eCalendar.defaults, options); function lpad(value, length, pad) { if (typeof pad == 'undefined') { pad = '0'; } var p; for (var i = 0; i &lt; length; i++) { p += pad; } return (p + value).slice(-length); } var mouseOver = function () { $(this).addClass('c-nav-btn-over'); }; var mouseLeave = function () { $(this).removeClass('c-nav-btn-over'); }; var mouseOverEvent = function () { $(this).addClass('c-event-over'); var d = $(this).attr('data-event-day'); $('div.c-event-item[data-event-day="' + d + '"]').addClass('c-event-over'); }; var mouseLeaveEvent = function () { $(this).removeClass('c-event-over') var d = $(this).attr('data-event-day'); $('div.c-event-item[data-event-day="' + d + '"]').removeClass('c-event-over'); }; var mouseOverItem = function () { $(this).addClass('c-event-over'); var d = $(this).attr('data-event-day'); $('div.c-event[data-event-day="' + d + '"]').addClass('c-event-over'); }; var mouseLeaveItem = function () { $(this).removeClass('c-event-over') var d = $(this).attr('data-event-day'); $('div.c-event[data-event-day="' + d + '"]').removeClass('c-event-over'); }; var nextMonth = function () { if (dMonth &lt; 11) { dMonth++; } else { dMonth = 0; dYear++; } print(); }; var previousMonth = function () { if (dMonth &gt; 0) { dMonth--; } else { dMonth = 11; dYear--; } print(); }; function loadEvents() { if (typeof settings.url != 'undefined' &amp;&amp; settings.url != '') { $.ajax({url: settings.url, async: false, success: function (result) { settings.events = result; } }); } } function …
tagged with: jquery
has comment: http://stackoverflow.com/comment/43243323
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/43243308
score: 0
tagged with: calendar
has title: calendar event plugin unable to display events for december alone

http://stackoverflow.com/q/27384672
has body: I have imported many class files and many interface files into a WebStorm Typescript project. How can I handle references for the case where one class (single file) references multiple interfaces (multiple files)? Do I need to have many references to each of the interface files at the top of each class (file)? Note that I am using Webstorm. I am not sure if this is different but previously I was working on a Typescript application in Visual Studio and I don't recall any reference links being needed at the top of each of the files that contained my classes.
type: AnsweredQuestion
tagged with: typescript
has title: How do I reference multiple interface files in a Typescript project using Webstorm IDE?
possible better answer: http://stackoverflow.com/a/27385204
has answer: http://stackoverflow.com/a/27394605
has answer: http://stackoverflow.com/a/27390839
type: Question
has answer: http://stackoverflow.com/a/27385204
score: 0
tagged with: javascript
tagged with: webstorm
answer count: 3
accepted answer: http://stackoverflow.com/a/27390839

http://stackoverflow.com/comment/43190932
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27369410
has text: You say you know the issue is top:50px; is there a reason you need it to be there?
score: 0

http://stackoverflow.com/comment/43327522
comment on: http://stackoverflow.com/q/27444148
has text: use fullscreen option inside toolbar
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27320940
tagged with: angularjs
type: Question
tagged with: android
tagged with: cordova
has body: Say we're using the backbutton event (Android specific), and attach it like so in controller A: app.controller('aController', ['$scope', function($scope){ function LogicA(){ //Logic A } document.addEventListener("backbutton", LogicA, false); }]); And we want to do different logic in a separate controller: app.controller('bController', ['$scope', function($scope){ function LogicB(){ //Logic B } document.addEventListener("backbutton", LogicB, false); }]); What is the correct way to handle this so that the active controller's logic would predominate on the backbutton event?
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27321526
tagged with: javascript
has title: Context aware Cordova events in Angular Controllers
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27321526

http://stackoverflow.com/a/76638789
upvote count: 1
answers question: http://stackoverflow.com/q/27323631
score: 1
downvote count: 0
has body: I found a way to do this without opening security holes. It's a bit complicated, but overriding security rules should be. You need: A browser plugin that can add headers to http responses. I used simple-modify-headers for Mozilla. A web server where you can host your script. I used Rebex Tiny Web Server for Windows on the local machine. Host the .js file on the web server. Configure the plugin to add the header Content-Security-Policy: script-src <url>; to any site you might want to load from, where <url> is the url of the script, or the directory it's in. For example, http://localhost/Programming/. Make sure your plugin modifies any existing header instead of overwriting, or the site can break.* You can now load the script from the console or a bookmarklet: javascript:(function() {const script = document.createElement('script'); script.src = 'http://localhost/???.js'; document.head.append(script);})(); I have tried to whitelist a file:// uri instead, which would remove the need for the web server, but that doesn't work. Makes sense, since that would allow web pages to access your drive. *: Weirdly enough, with Simple Modify Headers, it only seems to work if I run it with "Filter URL per rules" on. (under "parameters")
type: Answer

http://stackoverflow.com/q/27461083
accepted answer: http://stackoverflow.com/a/27461218
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I have a couple of HTML elements that create a Dialogue Box that show a loading spinner. It also has a semi-opaque background that fills the page. It fills up the whole page except the navbar. How could I cover up the navbar as well in CSS? Example Here is my CSS for the background: .dialog { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-background-clip: padding-box; background-clip: padding-box; padding: 0; margin: 0; font: inherit; color: inherit; background: transparent; border: none; line-height: normal; cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-weight: 400; font-size: 17px; position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%); transform: translate(-50%, -50%); margin: auto auto; background-color: rgba(255, 255, 255, 0.92); -webkit-box-shadow: 0 2px 12px rgba(0,0,0,0.07); box-shadow: 0 2px 12px rgba(0,0,0,0.07); overflow: hidden; min-width: 270px; min-height: 100px; text-align: left; -webkit-border-radius: 4px; border-radius: 4px; z-index: 999; } #loadingDialog { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-background-clip: padding-box; background-clip: padding-box; white-space: nowrap; overflow: hidden; word-spacing: 0; padding: 0; margin: 0; font: inherit; color: inherit; background: transparent; border: none; line-height: normal; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-background-clip: padding-box; background-clip: padding-box; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font…
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/43358855
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/27461266
has answer: http://stackoverflow.com/a/27461218
possible better answer: http://stackoverflow.com/a/27461266
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has title: Cover HTML Navbar in CSS

http://stackoverflow.com/a/27435072
has body: You can use Date.UTC The UTC() method differs from the Date constructor in two ways. Date.UTC() uses universal time instead of the local time. Date.UTC() returns a time value as a number instead of creating a Date object. EDIT - why does SO insist on making links so hard to spot? That, up there, is a link to the docs in case that wasn't obvious. EDIT 2 - I think I misunderstood. Try this: var d = new Date('2014-11-30T00:00:00.0000000'); var utc = new Date( d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds() ); alert('d: ' + d + "\n" + 'utc: ' + utc);
answers question: http://stackoverflow.com/q/27435021
accepted answer of: http://stackoverflow.com/q/27435021
has comment: http://stackoverflow.com/comment/43311341
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43311049
has comment: http://stackoverflow.com/comment/43311593
type: Answer
has comment: http://stackoverflow.com/comment/43311113
downvote count: 0
score: 1

http://stackoverflow.com/q/27340990
linked to: http://stackoverflow.com/q/7744611
duplicate of: http://stackoverflow.com/q/9437981
tagged with: javascript
has answer: http://stackoverflow.com/a/27341113
answer count: 6
has body: In the below code we are passing an object. So, according to javascript we are passing a reference and manipulating. var a = new Number(10); x(a); alert(a); function x(n) { n = n + 2; } But 10 is alerted instead of 12. Why?
has answer: http://stackoverflow.com/a/27341054
upvote count: 8
possible better answer: http://stackoverflow.com/a/27341113
has answer: http://stackoverflow.com/a/27341101
has answer: http://stackoverflow.com/a/27341092
favorite count: 0
has answer: http://stackoverflow.com/a/27342393
accepted answer: http://stackoverflow.com/a/27341101
has comment: http://stackoverflow.com/comment/43138125
has answer: http://stackoverflow.com/a/27341097
tagged with: pass-by-reference
has title: Javascript - primitive vs reference types
type: AnsweredQuestion
score: 7
downvote count: 1
linked to: http://stackoverflow.com/q/9437981
type: Question
linked to: http://stackoverflow.com/q/518000

http://stackoverflow.com/a/27335667
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43129123
has comment: http://stackoverflow.com/comment/43128798
answers question: http://stackoverflow.com/q/27335522
has comment: http://stackoverflow.com/comment/43128428
has comment: http://stackoverflow.com/comment/43129983
downvote count: 0
has comment: http://stackoverflow.com/comment/43128272
has comment: http://stackoverflow.com/comment/43129191
has body: Try dispatching onchange event once you have changed its value: var number = document.getElementById('level1-option'); setSelectedValue(number, "p3"); var evt = document.createEvent("HTMLEvents"); evt.initEvent("change", false, true); number.dispatchEvent(evt);
type: Answer

http://stackoverflow.com/comment/43118424
comment on: http://stackoverflow.com/a/27329800
type: AnswerComment
has text: Avoid inline event listeners. Just write the code you want to run at on click in `handler` function.
score: 0
type: Comment

google-sheets
tags question: http://stackoverflow.com/q/27325176
tags question: http://stackoverflow.com/q/27448209
tags question: http://stackoverflow.com/q/27430816
type: Tag
tags question: http://stackoverflow.com/q/27427492
tags question: http://stackoverflow.com/q/27369597
tags question: http://stackoverflow.com/q/27374975
tags question: http://stackoverflow.com/q/27403933
tag name: google-sheets
tags question: http://stackoverflow.com/q/27384809

modulo
tags question: http://stackoverflow.com/q/27324486
tag name: modulo
tags question: http://stackoverflow.com/q/27317226
type: Tag

cors
type: Tag
tags question: http://stackoverflow.com/q/27462773
tags question: http://stackoverflow.com/q/27338319
tag name: cors
tags question: http://stackoverflow.com/q/27366814
tags question: http://stackoverflow.com/q/27350540
tags question: http://stackoverflow.com/q/27347656
tags question: http://stackoverflow.com/q/27336489
tags question: http://stackoverflow.com/q/27329812

http://stackoverflow.com/a/27379298
score: 2
upvote count: 2
has body: var date = '09-Dec-2014'.split("-"); var newDate=date[2]+date[1]+date[0]; Something really quick may be, split and generate your own.
answers question: http://stackoverflow.com/q/27379243
downvote count: 0
type: Answer

http://stackoverflow.com/comment/43295881
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27426679
has text: it is present the moment he tries to focus yes - as said, from the explanation given, we can only guess whats happening - and my guess is that the element to be clicked is not yet there when he maybe tries to attach the click handler, which will do stuff later - hence delegate it;

http://stackoverflow.com/comment/43103031
type: QuestionComment
comment on: http://stackoverflow.com/q/27321859
has text: Why don't you make the effect on `hover` instead of `focus`? You would not need jquery, because pure css will be enough. Just replace `.panel-primary` in your css with `.panel:hover`.
score: 0
type: Comment

http://stackoverflow.com/q/27412478
answer count: 1
type: UnansweredQuestion
has body: I am attempting to recall a selected value of a drop down box after my servlet has ran the query on my database. There is no limit on variables so i have used c:foreach to populate the drop-down. The code is as follows function moduleLookup() { var trainId = document.getElementById("Selector").value; document.trainForm.trainId.value = trainId; document.trainForm.submit(); } Select module All Modules <c:forEach items="${modules}" var="module"> ${module.title } </c:forEach> I have tried every method I can find to get the refreshed drop down to have the previously selected value. I have tried to add cookie data but, I am new to jquery.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27412669
has comment: http://stackoverflow.com/comment/43269509
has comment: http://stackoverflow.com/comment/43269859
has comment: http://stackoverflow.com/comment/43269935
type: Question
has title: Recall selected value of a dropdown
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43269662

http://stackoverflow.com/comment/43295722
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27426401
score: 0
has text: @JamesThorpe `editProperties` is a valid window name.

http://stackoverflow.com/q/27430954
has answer: http://stackoverflow.com/a/27432573
answer count: 2
has body: I have different attributes which contains identical text strings. Like: How do I find and rename "carousel-example-generic" on those elements using jquery?
downvote count: 0
has answer: http://stackoverflow.com/a/27431076
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has title: search strings across attributes with jquery
upvote count: 1
type: Question
score: 1

http://stackoverflow.com/comment/43205208
type: Comment
has text: Does the `.add-new` element exist on your page when the document ready handler is executed?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27377882

http://stackoverflow.com/comment/43326381
type: Comment
has text: how wud i use query string method
type: AnswerComment
comment on: http://stackoverflow.com/a/27443548
score: 0

http://stackoverflow.com/comment/43317731
type: Comment
has text: Why is it necessary to listen for a *response* to make the *request* work?
type: AnswerComment
comment on: http://stackoverflow.com/a/27438873
score: 0

http://stackoverflow.com/a/27339809
answers question: http://stackoverflow.com/q/27339590
score: 2
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has body: The way it could be - is to use assert and inlined declaration: class MyClass { abc = &lt;{ def : number }&gt;{ def: 1, }; } The same, but a bit more readable with explicit interface interface IMyObject{ def : number } class MyClass1 { abc = &lt;IMyObject&gt;{ def: 1, }; } Check it here And why this? class a { abc = { def: number = 22 // won't work } ghi: number = 23; // works because the ghi is the member/property of class a - so it is just like this: class MyClass { // standard way how to define properties/members of a class public obj: number; private other: string; }
accepted answer of: http://stackoverflow.com/q/27339590
type: Answer

http://stackoverflow.com/q/27450106
tagged with: javascript
has comment: http://stackoverflow.com/comment/43343607
has title: angular-masonry directive showing images in only one column
has answer: http://stackoverflow.com/a/33182992
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43343496
tagged with: css
has comment: http://stackoverflow.com/comment/43349314
has comment: http://stackoverflow.com/comment/43345012
score: 2
upvote count: 2
has body: Trying to use the angular-masonry directive by passy (https://github.com/passy/angular-masonry) It's showing the images in one column, rather than the grid layout. Any help would be appreciated! My html My CSS: .masonry-brick { width: 25%; margin: 0.1em; } .masonry-brick img { width:100%; } Now, if I include float: left styling in the .masonry-brick class, then it kind of works, but with major gaps. Also, for some reason my masonry-options aren't working. If I was to add transitionDuration: It shows no change in how the images load. However, angular-masonry is installed correctly and all the files are included and injected correctly. I am getting no errors in that regard. Thanks for your help!
has comment: http://stackoverflow.com/comment/43348978
has comment: http://stackoverflow.com/comment/43344963
type: Question
tagged with: masonry

http://stackoverflow.com/comment/43335045
type: QuestionComment
has text: @Leo by removing the 'console.log(editor.test1.id)' thus allowing the test2 to execute test2 does work.
score: 0
comment on: http://stackoverflow.com/q/27447728
type: Comment

http://stackoverflow.com/a/27451385
has body: You'll need to specify a time interval with setInterval. Without it, your interval won't be defined as browsers generally have a minimum and enforced interval requirement. For example: $(document).ready(function() { var Right = true; var div = $("div"); var Inter; $("#Start").click(function() { Inter = setInterval(function() { if(Right) { Right = false; div.animate({left:'900px'},"slow"); } else { Right = true; div.animate({left:'0px'},"slow"); } }, 500); }); $("#Stop").click(function() { clearInterval(Inter); }; }); Alternatively, as mentioned in the comments, you can stop the animation using div.stop(); That would look something like this: $("#Start").click(function() { if(Right) { Right = false; div.animate({left:'900px'},"slow"); } else { Right = true; div.animate({left:'0px'},"slow"); } }); $("#Stop").click(function() { div.stop(); };
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/43341352
score: 2
answers question: http://stackoverflow.com/q/27451306
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27451306

http://stackoverflow.com/comment/43232120
type: Comment
has text: Please post a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve). Are you using the geocoder?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27392333

http://stackoverflow.com/a/27419823
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27361648
type: Answer
accepted answer of: http://stackoverflow.com/q/27361648
has body: +Vadim Gremyachev's answer is valid with IE, but doesnt work with chrome, here is the workaround I've used (inspirated from https://stackoverflow.com/a/2956980/381149 ): function sh(){ SyntaxHighlighter.highlight(); }; function setIntervalX(callback, delay, repetitions) { var x = 0; var intervalID = window.setInterval(function () { callback(); if (++x === repetitions) { window.clearInterval(intervalID); } }, delay); } $(document).ready(function () { if( $('.syntaxhighlighter').length == 0 ){ setIntervalX(function() { sh() }, 1000,5); } $("a").on("click",function () { if( $('.syntaxhighlighter').length == 0 ){ setIntervalX(function() { sh() }, 1000,5); } return true; }); });
downvote count: 0
score: 1

addeventlistener
tags question: http://stackoverflow.com/q/27317308
tags question: http://stackoverflow.com/q/27363891
tags question: http://stackoverflow.com/q/27328528
tags question: http://stackoverflow.com/q/27446520
tags question: http://stackoverflow.com/q/27449718
tags question: http://stackoverflow.com/q/27461595
tags question: http://stackoverflow.com/q/27336182
tag name: addeventlistener
type: Tag

http://stackoverflow.com/a/27338241
has body: The code below will convert JS date/time to MySQL format: function SQLdate_now() { /* MySQL format */ var d = new Date(); var month = d.getMonth()+1; var day = d.getDate(); var hour = d.getHours(); var minute = d.getMinutes(); var second = d.getSeconds(); var output = d.getFullYear() + '-' + ((''+month).length&lt;2 ? '0' : '') + month + '-' + ((''+day).length&lt;2 ? '0' : '') + day + ' ' + ((''+hour).length&lt;2 ? '0' :'') + hour + ':' + ((''+minute).length&lt;2 ? '0' :'') + minute + ':' + ((''+second).length&lt;2 ? '0' :'') + second; return(output); };
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27338161
has comment: http://stackoverflow.com/comment/43133051
has comment: http://stackoverflow.com/comment/43133261

http://stackoverflow.com/comment/43200794
type: AnswerComment
comment on: http://stackoverflow.com/a/27374473
score: 0
type: Comment
has text: @Elfy: jQuery doesn't actually have its own event system, it merely hatches on to JS's event loop, and provides a consistent API for it. You can register _"fake"_ events, though, and manually invoke the handler: `jQObject.trigger('myevent');`, but that still means you have to _manually_ trigger the event, and rather defeats the point, imo

http://stackoverflow.com/q/27348450
accepted answer: http://stackoverflow.com/a/27348581
has body: I have some divs in my page, and each one of them has got a content I want to toggle via jQuery. This is actually how my code looks like: $('.my_div').click(function() { $( ".my_div_B" ).slideToggle( "slow" ); }); $('.my_div2').click(function() { $( ".my_div_B2" ).slideToggle( "slow" ); }); $('.my_div3').click(function() { $( ".my_div_B3" ).slideToggle( "slow" ); }); and so on... of course it's not the best way to do that, repeating the name of the divs always in the same part of code. HTML pattern: text How can I make it shorter without opening ALL my divs clicking on $('this')? - ps. I know there are some similar questions, but the answers seem to be specific for that markup.
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has title: Single function to toggle multiple divs inside other divs individually
upvote count: 2
has answer: http://stackoverflow.com/a/27348581
type: Question

http://stackoverflow.com/comment/43206978
type: Comment
type: QuestionComment
has text: When i try to convert into image it gives me error that parameter is not valid. My be my data is not properly convert into the image bytes.
comment on: http://stackoverflow.com/q/27377671
score: 0

http://stackoverflow.com/q/27330953
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27414719
type: Question
tagged with: mongodb
answer count: 1
has comment: http://stackoverflow.com/comment/43273362
tagged with: javascript
tagged with: express
has body: So I'm following the following Egghead.io guide: https://egghead.io/lessons/angularjs-finalizing-jwt-authentication-with-angularjs With a twist, I am trying to incorporate a MongoDB to retrieve my users. I have everything working so far, except the last part where he states that the /me route should just return req.user and it should be fine on refreshes. I don't get that. What I do get is blank user returned from my server. My server code is setup like this: var jwtSecret = 'fjkdlsajfoew239053/3uk'; app.use(cors()); app.use(bodyParser.json()); app.use(expressJwt({ secret: jwtSecret }).unless({ path: [ '/login' ]})); app.use(compression()); app.use(express.static(__dirname + '/client')); app.get('/', function(req, res){ res.render(__dirname + '/client/bundle.js'); }); app.get('/me', function (req, res) { res.send(req.user); }); ... setup for user schema and other boring stuff ... function authenticate(req, res, next) { var body = req.body; if (!body.username || !body.password) { res.status(400).end('Must provide username or password'); } //do salting, hashing, etc here yo User.findOne({ username: body.username }, function(err, user){ if (user === null || body.password !== user.password) { res.status(401).end('Username or password incorrect'); }else{ req.user = user; next(); } }); } // ROUTES app.post('/login', authenticate, function (req, res, next) { var token = jwt.sign({ username: req.user.username }, jwtSecret); res.send({ token: token, user: req.user }); }); app.listen(process.env.PORT || 5000); And my controller (Client-side) handling the basic authentication is: module.exports = function($scope, $state, $modal, UserFactory) { var vm = this; $scope.$state = $state; $scope.sign_in = false; $scope.open = function () { var $modalInstance = $modal.open({ templateUrl: 'suggestion-modal.html', controller: 'modalCtrl' }); }; // initialization UserFactory.getUser().then(function success(response) { vm.user = response.data; }); function login(username, password) { User…
tagged with: angularjs
tagged with: node.js
has title: JWT Angular Authentication on Refresh
score: 0
has comment: http://stackoverflow.com/comment/43148996
has answer: http://stackoverflow.com/a/27414719

http://stackoverflow.com/comment/43264910
has text: Yes, that's better, and now you have the function again ;-) But I can't imagine how this would work when the original code did not, even though it's better and more clear.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27410151
type: AnswerComment

http://stackoverflow.com/q/27350832
has answer: http://stackoverflow.com/a/27351144
type: AnsweredQuestion
has body: Can someone point me in the right direction to have add/remove functionality for top-level and sublists, that could produce a serialized output at the end? Example: Add Question Question 1 | Delete Answer 1 | Delete Answer 2 | Delete Add Answer Question 2 | Delete Answer 1 | Delete Answer 2 | Delete Add Answer Thanks in advance for the help
type: Question
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/27351144
score: 0
answer count: 1
tagged with: javascript
has title: Jquery nested Add/Remove
tagged with: jquery

http://stackoverflow.com/a/27332499
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27332439
has comment: http://stackoverflow.com/comment/43122618
has comment: http://stackoverflow.com/comment/43122641
has body: One jquery library is enough, you do not need more, also, if you see a feature on a website and you see that website using a different library version than yours it doesn't mean that you have to include that one too one is enough. You also might want to add the .ui version of the library because some features will not work without the UI since they use banckground animations and other stuff.
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43122559
type: Answer
has comment: http://stackoverflow.com/comment/43122668
answers question: http://stackoverflow.com/q/27332439
score: 2

http://stackoverflow.com/q/27360571
tagged with: javascript
score: 0
answer count: 1
has body: According to this MSDN article, the AddSearchProvider method (introduced in IE7) was deprecated in IE10. However the method suddenly seems to work in IE11, and this article says nothing about the method being deprecated. Can somebody confirm? I can't find any information about the subject.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43174807
has comment: http://stackoverflow.com/comment/43176257
has answer: http://stackoverflow.com/a/32879929
has title: AddSearchProvider was deprecated in IE10 but reintroduced in IE11?
has comment: http://stackoverflow.com/comment/43174855
type: Question
tagged with: internet-explorer

http://stackoverflow.com/comment/130946633
type: Comment
comment on: http://stackoverflow.com/a/27404645
score: 1
has text: looks like bind2 only works for functions that where bound with bind2.
type: AnswerComment

http://stackoverflow.com/q/27401583
has comment: http://stackoverflow.com/comment/80759018
has answer: http://stackoverflow.com/a/27402635
tagged with: javascript
has comment: http://stackoverflow.com/comment/43248435
score: 0
answer count: 1
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/27402635
has title: Send file by Ajax and FormData fail
type: AnsweredQuestion
type: Question
has body: I'm trying to send a file using Ajax in Jquery creating a FormData previously. This is my code: var inputFileImage = document.getElementById('uploadImage'); var file = inputFileImage.files[0]; var data = new FormData(); data.append('archivo',file); jQuery.ajax({ url: '/services/rpc.php', type: 'post', data: {functionName: 'saveProfileImage', data : data}, contentType:false, processData:false, }) .done(function(response) { alert(response); }.bind(this)) .fail(function(response) { alert('Sorry, there was an unexpected error, please try again later.\n\nInformation about the error:\n'+response); }); This ajax always goes to the fail function, and if I change the processData to true returns my another error saying Error: TypeError: 'append' called on an object that does not implement interface FormData. Thanks for your help!

http://stackoverflow.com/comment/43343909
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27452335
type: Comment
has text: oop, forgot to drop the console log. Take it out if you use this

http://stackoverflow.com/q/27413115
has title: JSON parsing with multiple data
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27413225
has body: Jsonlint display that this JSON object is valid: [{"obj":{"markers":"[{\"k\":47.040182144806664,\"B\":0.52734375},{\"k\":50.90303283111257,\"B\":10.37109375},{\"k\":52.53627304145945,\"B\":-1.7578125},{\"k\":41.77131167976406,\"B\":-6.591796875}]","path":"[[47.040182144806664,0.52734375],[50.90303283111257,10.37109375],[52.53627304145945,-1.7578125],[41.77131167976406,-6.591796875]]"}}] I'm trying to access to markers with the k, B and path elements but it's always set to undefined. Here is my code: try { var jsonData = JSON.parse(myJson); console.log(jsonData.obj[0].markers[0].k); } catch (e) { console.error("Parsing error:", e); } Can someone tell me how to access to the element of my JSON object properly? Thanks for the help.
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43270610
type: Question
answer count: 2
upvote count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/27413275
accepted answer: http://stackoverflow.com/a/27413275
has comment: http://stackoverflow.com/comment/43270554
has answer: http://stackoverflow.com/a/27413225
score: 0
has comment: http://stackoverflow.com/comment/43270731
tagged with: parsing
has comment: http://stackoverflow.com/comment/43270524
has comment: http://stackoverflow.com/comment/43270665
downvote count: 1

http://stackoverflow.com/a/27350307
type: Answer
answers question: http://stackoverflow.com/q/27350114
has comment: http://stackoverflow.com/comment/43155315
has comment: http://stackoverflow.com/comment/43155240
score: 0
has body: Since you are sharing a timer among different users, I think you need to maintain the timer in the backend. And in the front-end JavaScript, maintain a separate timer for each user (on their local browser). Say, your front-end code maybe: var timer = null; document.onload = function() { $.ajax({ url: '/server/timer', type: 'get', data: {userName: 'user A'} }).done(function (res) { if (res.remaining &amp;&amp; res.remaining &gt;= 0) { alert('Hi, please wait for ' + res.remaining + ' seconds to start playing video'); timer = setTimeout(function() { // play the video }, res.remaining * 1000); } else { alert('Sorry, you cannot watch the video now'); } }); } In your backend code, maintain the API /server/timer to make sure the countdown is the same for every user.

http://stackoverflow.com/q/27460506
type: AnsweredQuestion
has title: Get URL parameter value when parameter is defined multiple times
score: 1
has answer: http://stackoverflow.com/a/27460746
type: Question
accepted answer: http://stackoverflow.com/a/27460746
tagged with: javascript
downvote count: 0
answer count: 1
has body: I have the following URL: products?feature_filters[]=&amp;feature_filters[]=on&amp;feature_filters[]=on From this I need to get an array, something like this: var feature_filters = [1, 2] NOTE: As MightyPork has pointed out, this would be zero-based.. so I would need to reject 0, and keep 1, and 2. I have successfully employed this example to get URL parameters when they are defined once. However I am not able to parse this set of parameters, created by my app.
favorite count: 0
has comment: http://stackoverflow.com/comment/43357448
has comment: http://stackoverflow.com/comment/43357415
upvote count: 1
linked to: http://stackoverflow.com/q/19491336

http://stackoverflow.com/comment/43255929
type: QuestionComment
has text: So what is expected behaviour, clear all inputs or only specific one??? Not clear what you are asking. `but I have to many form inputs on my form. the form submit with ajax` Using `reset` will clear **ALL**
score: 0
comment on: http://stackoverflow.com/q/27405279
type: Comment

http://stackoverflow.com/a/27356456
type: Answer
answers question: http://stackoverflow.com/q/27355703
score: 0
has body: You can use below code which is much simpler. var vJson = [{"Country":"Europe","City":["Berlin","Istanbul","London","Manchester","Milan","Paris"]}]; $.each(vJson, function(idx, obj) { alert(obj.Country); // Get Country $.each(obj.City, function(idx1, obj1) { alert(obj1); // Get multiple city of country }); });

http://stackoverflow.com/q/27322267
has title: Mathemmatical formula for incremental breakdowns
favorite count: 0
tagged with: increment
accepted answer: http://stackoverflow.com/a/27323462
tagged with: python
type: AnsweredQuestion
upvote count: 2
score: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/43103730
tagged with: javascript
possible better answer: http://stackoverflow.com/a/27322453
has answer: http://stackoverflow.com/a/27323462
has answer: http://stackoverflow.com/a/27322453
answer count: 2
has body: I have a dialog that displays buttons according to users settings. I want to have the buttons layed out in the best sequence of rows of 6. Meaning, if the user entered 1-6 entries, there should be 1 row of 6 buttons. If he entered 7 entries, it shouldn't be 6 on row 1 and 1 on row 2, rather, 4 on row 1 and 3 on row 2. If he entered 8, it should have 4 buttons on each row And so on..... Being that I am a somewhat seasoned developer, I feel a little dumb by this.... but I am having difficulty figuring out the correct method of finding out these numbers programmatically. If anyone can help me with this I would appreciate it Thanks, David

http://stackoverflow.com/comment/43287785
score: 0
type: Comment
has text: did you get any error from the console? If yes can you post it?
type: AnswerComment
comment on: http://stackoverflow.com/a/27422427

http://stackoverflow.com/a/27450480
score: 1
has comment: http://stackoverflow.com/comment/43339459
upvote count: 1
has body: var min = 0, max = 1000, buckets = 8, i, array = []; for (i = min; i &lt;= max; i += (max - min) / buckets) { array.push(i); }
answers question: http://stackoverflow.com/q/27450216
type: Answer
downvote count: 0

http://stackoverflow.com/q/27329444
favorite count: 0
has comment: http://stackoverflow.com/comment/43141175
has comment: http://stackoverflow.com/comment/43117232
has comment: http://stackoverflow.com/comment/43117221
has body: In the following code, I expected both a and b to be 3. However, a is undefined and b is 3. Why? (function(){ var a = b = 3; })(); console.log(typeof a);//"undefined" console.log(b);//3
possible better answer: http://stackoverflow.com/a/27329477
has comment: http://stackoverflow.com/comment/43128503
has comment: http://stackoverflow.com/comment/43128345
has answer: http://stackoverflow.com/a/27329652
score: 29
has answer: http://stackoverflow.com/a/27329477
type: AnsweredQuestion
upvote count: 35
has comment: http://stackoverflow.com/comment/121902901
answer count: 6
has comment: http://stackoverflow.com/comment/43129267
has answer: http://stackoverflow.com/a/27329475
accepted answer: http://stackoverflow.com/a/27329475
has answer: http://stackoverflow.com/a/73137363
has answer: http://stackoverflow.com/a/27329494
type: Question
has title: Why a is undefined while b is 3 in var a=b=3?
has answer: http://stackoverflow.com/a/27406354
tagged with: javascript
downvote count: 6

http://stackoverflow.com/q/27385691
has comment: http://stackoverflow.com/comment/43219941
has answer: http://stackoverflow.com/a/27386079
has comment: http://stackoverflow.com/comment/43219944
has comment: http://stackoverflow.com/comment/43219988
has answer: http://stackoverflow.com/a/27386058
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/27386058
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/27385834
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43219974
has body: How to make accordion not expand as default ? Expand it when a user click on it. Then, after it's expand, I want to switch the header from "Show" to "Hide". Here is what I got so far. FIDDLE HTML Show In software, a stack overflow occurs when the stack pointer exceeds the stack bound. The call stack may consist of a limited amount of address space, often determined at the start of the program. The size of the call stack depends on many factors, including the programming language, machine architecture, multi-threading, and amount of available memory. When a program attempts to use more space than is available on the call stack (that is, when it attempts to access memory beyond the call stack's bounds, which is essentially a buffer overflow), the stack is said to overflow, typically resulting in a program crash. JS
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap
has title: How to make accordion not expand by default?
possible better answer: http://stackoverflow.com/a/27386079
type: Question

http://stackoverflow.com/q/27423003
has answer: http://stackoverflow.com/a/27424334
type: UnansweredQuestion
has body: I've got an old IE adapted site using a grid component which refuses to work with anything but IE 11 using IE 9 user agent string mode (i.e. the browser pretends to be IE 9 without emulating 9 behaviour if I've unverstood correctly). Due to budgeting constraints I'm not able to change this black box component and I'd prefer not to have the user turn on their agent string mode explicitly in their developer tools: is it possible for the site to make IE 11 choose a user agent string for IE9 without using developer tools?
has title: Make IE 11 user agent string IE 9
has comment: http://stackoverflow.com/comment/43293358
has comment: http://stackoverflow.com/comment/43290342
type: Question
tagged with: internet-explorer
tagged with: internet-explorer-11
tagged with: internet-explorer-9
has comment: http://stackoverflow.com/comment/43288817
tagged with: javascript
score: 0
answer count: 1
tagged with: asp.net

http://stackoverflow.com/comment/43355484
has text: @Bergi, it's probably close. I just didn't know how to declare an uninitialized variable.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27457218

http://stackoverflow.com/a/27433708
accepted answer of: http://stackoverflow.com/q/27410945
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27410945
score: 0
type: Answer
has body: Ok, issue tracked down. It seems that the problem caused by a duplicate 'include' of the jquery-ui library. The template I've used was making a second reference to a jquery-ui library (which was also an older one from what I've used) and caused a conflict. Removing the second reference just solved the problem.

http://stackoverflow.com/comment/43324593
has text: no in firefox it will work for sure because i have tested there.just check your version.
type: Comment
comment on: http://stackoverflow.com/a/27442002
score: 0
type: AnswerComment

modal-dialog
tag name: modal-dialog
tags question: http://stackoverflow.com/q/27410331
tags question: http://stackoverflow.com/q/27411179
type: Tag
tags question: http://stackoverflow.com/q/27405268
tags question: http://stackoverflow.com/q/27317982
tags question: http://stackoverflow.com/q/27417516
tags question: http://stackoverflow.com/q/27406486
tags question: http://stackoverflow.com/q/27457406

http://stackoverflow.com/q/27322170
has answer: http://stackoverflow.com/a/27322241
answer count: 1
downvote count: 0
has title: Change center img to smaller ones on mouseover
has comment: http://stackoverflow.com/comment/43104423
has body: need help with code i need a big img in the center and a row of 6 smaller ones. Here is what I did so far i cant get it to change for some reason ... Assignment 5
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: image

http://stackoverflow.com/a/27460449
answers question: http://stackoverflow.com/q/27460065
has comment: http://stackoverflow.com/comment/43362773
has comment: http://stackoverflow.com/comment/43357508
has comment: http://stackoverflow.com/comment/43357436
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/43357411
type: Answer
has body: Do all of your images have the same aspect ratio? The aspect ratio is the width divided by the height. If all images have the same aspect ratio, you can scale them to the same shape by choosing a width and calculating the height, or choosing a height and calculating the width. If the aspect ratios differ, there is no way to fit the images into the same shape without mangling images. There are two ways to mangle an image: Cut off part of the image so that it fits your chosen shape. Squeeze or stretch the image into your chosen shape. If you don't want to mangle your images, you must preserve their aspect ratios. This means, indeed, that the thumbnails will have different shapes. You may think that this looks weird, but most people think it's even weirder when thumbnails are truncated, squeezed, or stretched in order to fit them into a uniform shape.
has comment: http://stackoverflow.com/comment/43357571
score: 1
has comment: http://stackoverflow.com/comment/43366205

http://stackoverflow.com/comment/43108284
score: 0
type: Comment
type: QuestionComment
has text: @Brett, that was my first try (without dots). The dots were an attempt to force the code to find the controller. It doesn't work in either scenario :/
comment on: http://stackoverflow.com/q/27323213

http://stackoverflow.com/comment/43240483
type: AnswerComment
score: 0
has text: Oh I thought the second one would be considered as *less verbose* as it doesn't need to `return` something at the end, etc. ;) If you had to do a choice, which one of these 2 (or maybe another pattern?) would you use for https://github.com/josephernest/bigpicture.js/blob/master/bigpicture.js ?
type: Comment
comment on: http://stackoverflow.com/a/27397167

http://stackoverflow.com/a/27425297
has body: You can do it using a regex like so: var string = 'Body&lt;input value="CourseName" class="emailButtonSnip" type="button"&gt;&lt;input value="CourseDescription" class="emailButtonSnip" type="button"&gt;&lt;input value="CourseEnrollmentDeadline" class="emailButtonSnip" type="button"&gt;'; var re = /\&lt;input.*?\&gt;/ig var match; while ((match = re.exec(string)) != null){ console.log(match[0]); } Produces: &lt;input value="CourseName" class="emailButtonSnip" type="button"&gt; &lt;input value="CourseDescription" class="emailButtonSnip" type="button"&gt; &lt;input value="CourseEnrollmentDeadline" class="emailButtonSnip" type="button"&gt; However, as has been pointed out in the comments, this is probably not the best idea. Edit (as per your request in the comments): var string = 'Body&lt;input value="CourseName" class="emailButtonSnip" type="button"&gt;&lt;input value="CourseDescription" class="emailButtonSnip" type="button"&gt;&lt;input value="CourseEnrollmentDeadline" class="emailButtonSnip" type="button"&gt;'; var re = /\&lt;input.*?\&gt;/ig var match; while ((match = re.exec(string)) != null){ var input = match[0], re1 = /value="(.*?)"/ig; console.log(re1.exec(input)[1]); } Produces: CourseName CourseDescription CourseEnrollmentDeadline You could of course just match the values in your original string straight off, but as I have no idea what you're trying t do, I'll leave it like this.
has comment: http://stackoverflow.com/comment/43293562
type: Answer
has comment: http://stackoverflow.com/comment/43294904
upvote count: 2
has comment: http://stackoverflow.com/comment/43294067
accepted answer of: http://stackoverflow.com/q/27424968
answers question: http://stackoverflow.com/q/27424968
score: 2
has comment: http://stackoverflow.com/comment/43294243
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/27451758
has body: You need to check if the last line is empty. Demo. if (e.which === 8 &amp;&amp; rows !== 2) { lines = $(this).val().split('\n'); if(!lines[lines.length - 1]) { $this.attr('rows', rows - 1); } }
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27451592
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/27451592

google-pie-chart
tag name: google-pie-chart
tags question: http://stackoverflow.com/q/27422974
type: Tag
tags question: http://stackoverflow.com/q/27468441

http://stackoverflow.com/comment/43311958
comment on: http://stackoverflow.com/a/27417904
score: 0
type: Comment
type: AnswerComment
has text: Also, my webserver yeilds the following error: `ActionController::RoutingError (No route matches [GET] "/javascripts/tasks/index.jade.js")` , which is odd as its interpreting the file as jade.js

http://stackoverflow.com/comment/43249704
has text: You're a star! Thank you :D
comment on: http://stackoverflow.com/a/27401989
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/43901099
has text: That should not be default behaviour. I would log a bug with Adobe on this and follow up with them to get it resolved.
comment on: http://stackoverflow.com/a/27324907
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/q/27397526
accepted answer: http://stackoverflow.com/a/27397578
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27397578
type: AnsweredQuestion
has title: Javascript custom eventlistener not working?
has body: These are the sections of code from my custom event listeners that is not working. Why does this return '-1' var idx=functionList[eventType].indexOf(callback) when they are the same? When I use the following in the myObject.removeCustomEventListenr() method console.log(functionList[eventType][0]) /*the console shows function(){console.log('firedEvent')*/ console.log(callback) /*the console shows function(){console.log('firedEvent')*/ both the same thing so why does it not work Below is the full part that is causing trouble var myObject = {} var functionList = {} myObject.addCustomEventListener = function(eventType,callback){ if(!functionList[eventType]){ functionList[eventType] = [] } functionList[eventType].push(callback) //creates functionList.start[0] = function(){console.log('firedEvent')} } myObject.removeCustomEventListener = function(eventType,callback){ if(functionList[eventType]){ var idx = functionList[eventType].indexOf(callback) console.log(idx) //logs '-1' should however match and return 0 if(idx!=-1){ functionList[eventType].splice(idx,1) console.log('removed')//obviously does not remove the function form the array } } } myObject.addCustomEventListener('start',function(){console.log('firedEvent')}) myObject.removeCustomEventListener('start',function(){console.log('firedEvent')}) Please explain why this occurs and how I can fix it? Thanks
type: Question
tagged with: javascript

http://stackoverflow.com/a/27456932
answers question: http://stackoverflow.com/q/27456867
accepted answer of: http://stackoverflow.com/q/27456867
has comment: http://stackoverflow.com/comment/43351104
has comment: http://stackoverflow.com/comment/43351088
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has body: Something like this: I put a checkbox if checked disable select element else enable $("#myCheckbox").on("change", function (){ if ($("#myCheckbox").is(":checked")) $("#DataSetDDL").prop("disabled", true); else $("#DataSetDDL").prop("disabled", false); }) select 1</ption> 2</ption> disable select Or with less code as suggested by @ Tieson T.: $("#myCheckbox").on("change", function (){ $("#DataSetDDL").prop("disabled", $(this).is(":checked")); })
upvote count: 2
has comment: http://stackoverflow.com/comment/43353096

http://stackoverflow.com/comment/43286047
type: Comment
comment on: http://stackoverflow.com/a/27397578
has text: @Kwiksilver: `if(demoList[x] == callback)` should work
type: AnswerComment
score: 0

http://stackoverflow.com/q/27364250
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27365152
score: 0
answer count: 2
favorite count: 0
type: UnansweredQuestion
has title: Check link click happen within a div
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43180346
has comment: http://stackoverflow.com/comment/43180556
has answer: http://stackoverflow.com/a/27364295
has body: I would like the Javascript returning true when users click on the links within specific div For example: When users click on links in div having class="span1", it will return true Title 3 Example 1 Example 2 Title 4 Example 1 Example 2 Thanks a lot!!
upvote count: 1

http://stackoverflow.com/q/27387658
tagged with: jquery
has comment: http://stackoverflow.com/comment/43223339
favorite count: 0
tagged with: ajax
has title: Prevent Params to display in browser via jquery ajax call.
tagged with: php
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/27387812
type: Question
has body: I just want to prevent my parameter is being display in my browser using firebug/debug tool. i.e. is there any way to hide these details so registration can be done via ajax. I am using following code in my javascript: $( "#myform" ).submit(function( event ) { event.preventDefault(); var email = $('#email').val(); var password = $('#password').val(); var mobile = $('#mobile').val(); $(".blog-header").mask("Waiting..."); var request = $.ajax({ url: "registrarscript.php", type: "get", data: "box="+jQuery("#myform").serialize(), cache: false, dataType: "html" }); request.done(function( msg ) { $('.blog-header').html(msg); $(".blog-header").unmask(); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }); Thanks
tagged with: javascript
has answer: http://stackoverflow.com/a/27387812
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/43141447
type: Comment
comment on: http://stackoverflow.com/a/27342532
has text: Optional milkyway: draw in a subtle gradient in the background replacing the clearRect.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43151920
comment on: http://stackoverflow.com/q/27348530
score: 0
type: Comment
type: QuestionComment
has text: Yes, put some `console.log` in your express code to be 100% certain the code you think is responding is actually responding, and what the response body looks like. Almost certainly a routing issue or a control flow error.

http://stackoverflow.com/q/27412260
possible better answer: http://stackoverflow.com/a/27412387
upvote count: 7
downvote count: 1
has answer: http://stackoverflow.com/a/27412387
type: Question
type: AnsweredQuestion
has title: converting string array into a key value pair object
has answer: http://stackoverflow.com/a/32432846
has answer: http://stackoverflow.com/a/27412320
has comment: http://stackoverflow.com/comment/43268893
has answer: http://stackoverflow.com/a/27412330
tagged with: javascript
has comment: http://stackoverflow.com/comment/43268910
tagged with: jquery
favorite count: 0
has body: I am getting an output which looks like this var x = ["title: x_one", " description: 1", " value: 4"] where x[0] returns title: x_one Which is a string. I cant read the property of title. How would I convert it into an object so that eventually I will be able to loop through the array and read the properties such as title, description and value. I am trying to do this through jquery I have been looking for a solution but havent really found one. If there is any out there which I am missing I would highly appreciate if anyone else have and could point me to that
has answer: http://stackoverflow.com/a/37653386
has comment: http://stackoverflow.com/comment/43268955
accepted answer: http://stackoverflow.com/a/27412330
answer count: 5
score: 6

http://stackoverflow.com/comment/43169356
has text: No not that.. What I meant was that it should be in the js code. Because even if the CSS contains single `:` colon, the browser will make it double `::` on its own. Then, you won't have to worry about the CSS...the js will work anyways. Hope am able to convey it clearly :)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27358311

http://stackoverflow.com/comment/43101758
comment on: http://stackoverflow.com/a/27320263
has text: Maybe there a string somewhere (value2?) before the operation is done. Parseint() everything before performing operations?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27317119
has answer: http://stackoverflow.com/a/27317835
downvote count: 1
type: Question
has title: NodeJS/Express app.use sequence and usage
score: 10
accepted answer: http://stackoverflow.com/a/27317835
answer count: 1
tagged with: javascript
tagged with: express
favorite count: 0
tagged with: node.js
upvote count: 11
has body: I tried to separate my node routing into two parts: HTML/App and REST. Here is what I've done: app.js: var appPort = process.env.PORT || 80; var express = require('express'); var http = require('http'); var appRouter = require('./routes/index'); var restRouter = require('./routes/rest'); var app = express(); var srv = http.createServer(app); app.set('port', appPort); app.set('view engine', 'jade'); app.use(express.static(path.join(__dirname, 'public'))); app.use('/api/rest/', restRouter); // this seems not working .. I never get the expected response app.use('/', appRouter); // I get this even with localhost/api/rest/... var server = srv.listen(app.get('port'), function() { debug('Express server listening ' + server.address().address + ':' + server.address().port); }); index.js: var express = require('express'); var router = express.Router(); router.get('/*', function (req, res) { res.send('HOME') }); module.exports = router; rest.js var express = require('express'); var router = express.Router(); router.get('/api/rest/*', function(req, res) { res.send('REST API'); }); module.exports = router; My questions: 1. It's possible in general to build multiple routers in this way? 2. Does the sequence of get.use matter, and/or do I have to deal with 'next'? 3. In case I would like to access a database inside the router can I hand over a parameter like this: // ... var client = new pg.Client(dbConnection); // ... app.use('/', appRouter(client));
type: AnsweredQuestion

http://stackoverflow.com/comment/43321482
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27440459
score: 0
has text: You need to see the dom with Firebug or Chrome (example) to see what it prints :) dom != html

tabs
type: Tag
tags question: http://stackoverflow.com/q/27388096
tag name: tabs
tags question: http://stackoverflow.com/q/27413500

http://stackoverflow.com/q/27374352
has comment: http://stackoverflow.com/comment/43199400
accepted answer: http://stackoverflow.com/a/27374780
has comment: http://stackoverflow.com/comment/43199072
type: AnsweredQuestion
has title: functions, forms, and user entered data
has comment: http://stackoverflow.com/comment/43199322
has answer: http://stackoverflow.com/a/27374780
type: Question
has comment: http://stackoverflow.com/comment/43199218
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/43199505
has body: I'm a little lost here. What I have is a basic menu with an item and a price, set up as table within a form. I have a text input box for the user to enter a value — the number of that item wanted. I want to know how I use the data entered into the input text box after the user clicks the calculate button, so that I can validate it and use it in an equation. If the user wants "2" of the item, I need to bring that value into my function so I can validate it as a numeric value. I'll then use it as an integer to multiply it by the price associated with that item... Here is a sample of my code: function calculate(){ var error = false; if (isNaN(*"what would I put here??"*){ alert("A numeric value is required when ordering steak"); error = true; } else{ var numbercrabcakes = parseInt(-------); } if (!error) { total = numbercrabcakes * 15 * 1.0825; window.alert("Your order totals: " + total.toFixed(2)) } } ......... The function section of the code was given as a sample/guideline to be used and edited for our specific page. Do I need to give the input box an id or name and use getElementbyId so I can check it against the isNaN then use the parseInt to convert it as the function shows. I did try that, but it didn't seem to work for me.

http://stackoverflow.com/q/27397099
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/21925720
has answer: http://stackoverflow.com/a/27415670
accepted answer: http://stackoverflow.com/a/27397176
tagged with: revealing-module-pattern
tagged with: design-patterns
has body: Is it good practice to use, instead of this Revealing Module Pattern ... var MyModule = ( function() { function Method1() { alert( 'method1' ); } function Method2() { Method1(); alert( 'method2' ); } function Method3() { Method1(); alert( 'method3' ); } function Method4() { Method1(); alert( 'method4' ); } return { Method1 : Method1, // these Method2 : Method2, // lines Method3 : Method3, // are Method4 : Method4 }; // redundant... } )(); MyModule.Method1(); MyModule.Method2(); ... this slight variation: var MyModule = {}; ( function() { var Method1 = MyModule.Method1 = function () { alert( 'method1' ); }; var Method2 = MyModule.Method2 = function () { Method1(); alert( 'method2' ); }; var Method3 = MyModule.Method3 = function () { Method1(); alert( 'method3' ); }; var Method4 = MyModule.Method4 = function () { Method1(); alert( 'method4' ); }; } )(); MyModule.Method1(); MyModule.Method2(); Is it 100% the same at the end? Would this considered as good practice?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27397167
has answer: http://stackoverflow.com/a/27397167
type: Question
has title: Slight variation of the Revealing Module Pattern
has answer: http://stackoverflow.com/a/27397176
tagged with: javascript

http://stackoverflow.com/a/27453184
upvote count: 0
downvote count: 1
answers question: http://stackoverflow.com/q/27453142
score: -1
has body: If u want to have specific speed to specific sections, you have to declare some ID's on the section.The Idea is to seperate your different sections and to initialize them all seperate. Then you can do this: $('#YourSection').fullpage({ //Navigation anchors:['some anchors'], navigation: false, //Scrolling css3: true, scrollingSpeed: your specific speed, autoScrolling: true, scrollBar: false, easing: 'easeInQuart', easingcss3: 'ease', loopBottom: false, loopTop: false, loopHorizontal: true, continuousVertical: false, scrollOverflow: false, touchSensitivity: 15, normalScrollElementTouchThreshold: 15 });
type: Answer

http://stackoverflow.com/q/27396800
type: AnsweredQuestion
type: Question
has body: My localstorage save and load won't work I can't load or save. Can you please help me out? I don't know whether it is the variables or functions that has been put up incorrectly The functions are being called by HTML buttons that goes "onclick" and has ID's var faze = 0; function fazeClick(number){ faze = faze + number; document.getElementById('faze').innerHTML = faze; } var mntDew = 0; function buyDew(){ var mntDewCost = Math.floor(10 * Math.pow(1.1,mntDew)); if(faze >= mntDewCost){ mntDew = mntDew +1; faze = faze - mntDewCost; document.getElementById('mntDew').innerHTML = mntDew; document.getElementById('faze').innerHTML = faze; }; var nextCost = Math.floor(10 * Math.pow(1.2,mntDew)); document.getElementById('mntDewCost').innerHTML = nextCost; }; window.setInterval(function(){ fazeClick(mntDew); }, 1000); function save(){ localstorage.setItem.faze; }; function load(){ document.getElementById("faze").innerHTML = localstorage.getItem.faze; }; document.write(faze); // Buy Mountain Dew #buyCursor //Mountain Dew: 0 #cursors //cost: 10 #cursorCost
answer count: 2
has answer: http://stackoverflow.com/a/27396853
tagged with: javascript
has title: LocalStorage Save Javascript
score: 0
possible better answer: http://stackoverflow.com/a/27396884
accepted answer: http://stackoverflow.com/a/27396853
has comment: http://stackoverflow.com/comment/43241203
has answer: http://stackoverflow.com/a/27396884
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43239878

http://stackoverflow.com/q/27430389
type: Question
score: 9
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43305442
has body: I want to get the coordinates of a mouse click on a rectangular shaped svg. I'm trying to print the mouse click coordinates to the console. I can use pageX and pageY to get the coordinates, but that is of the entire page. I just need the coordinates inside the svg. I'm using d3.v3.min.js So I tried: $(document).mousedown(function () { console.log(d3.mouse(this)); }); I get the error: Uncaught TypeError: Cannot read property 'sourceEvent' of null I also tried: $(document).mousedown(function () { console.log(d3.mouse(document.getElementById("svg_id"))); }); I get the same error. When I try with d3.svg.mouse(this), I get error: Uncaught TypeError: undefined is not a function How can I get the click coordinates in the svg and why are these d3.mouse() functions not working?
favorite count: 0
has comment: http://stackoverflow.com/comment/43304456
tagged with: http://stackoverflow.com/tag/svg
has title: Get coordinates of mouse click on svg using d3
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/72991022
has comment: http://stackoverflow.com/comment/43307625
has answer: http://stackoverflow.com/a/27434285
has comment: http://stackoverflow.com/comment/43305103
linked to: http://stackoverflow.com/q/16770763
upvote count: 9

http://stackoverflow.com/comment/43276897
has text: check this link http://www.justinball.com/2013/02/25/jqxhr-returning-readystate-0-and-status-0/
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27416274
type: Comment

http://stackoverflow.com/q/27394240
has answer: http://stackoverflow.com/a/27394301
has answer: http://stackoverflow.com/a/27394270
answer count: 4
type: AnsweredQuestion
has body: I currently have the following array in javascript. array = [2, 3, "+"] My goal is to write code that will take the second element of the array (array[1]), perform whatever operator is in element 3 (array[2]) to element 1 (array[0]). For example the code should be able to do the following. [2,3,"+"] should output 5 (3+2) [2,4,"*"] should output 8 (4*2) Currently I can write code that will return "3+2" and "4*2" as strings, but it won't perform the operation. Any help would be greatly appreciated!
tagged with: arrays
has answer: http://stackoverflow.com/a/27394262
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27394270
type: Question
possible better answer: http://stackoverflow.com/a/27394262
score: 0
has answer: http://stackoverflow.com/a/27394322
has title: Accessing operators in Javascript Arrays

http://stackoverflow.com/comment/43174896
has text: Thanks @wisew for the pointers! The reason why "npm update" needs to happen automatically is that 1. The module B will also be published by me 2. Updates to module B will be critical bug fixes. The idea is to abstract the frequently updated (with fixes) part of the ecosystem into a separate module and all other modules will have "dependency" on it. Module B will be curated before published to NPM. I want the consumers of module A to get the curated versions of Module B with critical fixes without their intervention.
score: 0
comment on: http://stackoverflow.com/a/27349337
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43265162
comment on: http://stackoverflow.com/q/27410188
has text: Sorry, I don't understand the question. The top link can be used on any webpage. When you click it, it runs file:///Applications/MAMP/htdocs/laravel/public/bookmarklet/poolapp.js which loads all the scripts and markup for the navigation menu. However even though all these scripts are loaded, they dont add the expected classes to the nav, ul, li tags that create the menu and the menu does not open.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27339405
type: Answer
downvote count: 0
score: 1
has body: Skip a iteration with keyword continue: for(var i = 0; i &lt; ary.length; i++) { if(i % 4 === 3) { continue; // this keyword means skip following steps, jump to next iteration } // work to do }
upvote count: 1
answers question: http://stackoverflow.com/q/27339211

http://stackoverflow.com/comment/43162803
has text: @Juhana simply do it by switch(boolean_expression) where boolean expression can be anything that evaluates true or false. That's also something like case (grade > 10 && grade < 20). Look at my answer I posted an interesting link where this can be read.
comment on: http://stackoverflow.com/q/27354665
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43237473
score: 0
has text: This is probably an X-Y problem where the solution to the actual problem is [this](http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27395483

http://stackoverflow.com/comment/43303453
comment on: http://stackoverflow.com/q/27430490
type: Comment
type: QuestionComment
score: 0
has text: @Chris Pratt - Sorry about that I've never used jsfiddle before so I wasn't sure if I could replace everything or not. The question has been updated.

http://stackoverflow.com/comment/43120554
comment on: http://stackoverflow.com/a/27331201
score: 0
type: Comment
type: AnswerComment
has text: this method will become more complex because i have different scenario but i will try it.can u suggest me another method without drawing multiple images on canvas like html2canvas.

http://stackoverflow.com/q/27403315
has comment: http://stackoverflow.com/comment/43251389
accepted answer: http://stackoverflow.com/a/27404641
has body: I am building a HTML form for a subdomain maker. I am not great in using javascript, so my question may be silly. But I ask here as this is the place that has given me the best answers yet :-) The subdomain will consist of {users-input}.{oneofmanypredefined.domains} The user will be able to make a subdomain where they can 1) enter any value (a-z,0-9,-) in a text field, and 2) then choose what predefined main domain they want to add the subdomain to. I have made it work now by using a input text field + a select options. This way I need to mix them into one hidden field on the next page (form action="nextpage.php") Possible solution 1: Is there a way where I can make ONE text field has one part that is like a normal text field, and then one part that is a dropdown, but with the same id and name? I tried to post an image, but need more reputations: http://bildr.no/image/cSsyNWdQ.jpeg I have googled and searched here, but not found any solution for this. It may because there is none, but at least I can ask :-) The reason I ask is if this exists, then it will help me save time redoing all javascript and all other code built on this one input field. Possible solution #2: Is there is a good way to use javascript to combine "on the fly" a value entered into a text field + a value chosen in a select, so I can use that combined value to enter into all javascript. So that every time I write in a text field, or make a new select choice, the javascript updates on the fly?
tagged with: input
has title: Forms: How to add dropdown choice at the end of an input text field?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27410383
tagged with: select
has answer: http://stackoverflow.com/a/27410383
tagged with: forms
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/43252143
has comment: http://stackoverflow.com/comment/43264571
tagged with: javascript
has answer: http://stackoverflow.com/a/27404641
score: 0

http://stackoverflow.com/comment/43129432
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27336332
has text: I have my onClick based off of hovering over objects that I created. So if a click is detected as well as hovering over an object is happening then it should activate the click event.
type: Comment

http://stackoverflow.com/a/27354917
has comment: http://stackoverflow.com/comment/43162787
score: 0
has body: you should use the function ob_flush(); if you want to publish this kind of document in explorer
has comment: http://stackoverflow.com/comment/55700448
type: Answer
answers question: http://stackoverflow.com/q/27354692

http://stackoverflow.com/comment/43091112
type: QuestionComment
comment on: http://stackoverflow.com/q/27315468
score: 0
has text: That's problem 3 and YES I know this is not supposed way to solve it.
type: Comment

http://stackoverflow.com/q/27378023
has answer: http://stackoverflow.com/a/27378982
type: UnansweredQuestion
tagged with: dynamics-crm-2013
tagged with: dynamics-crm
type: Question
has body: I use in CRM 2011 this code var option = optionset.OptionSet.Options[i]; var oValue = option.Value; But it not work in CRM2013. How I can refactor it?
tagged with: dynamics-crm-2011
score: 0
answer count: 1
tagged with: javascript
has title: MS CRM2013 JavaScript option issue

http://stackoverflow.com/q/27417705
has answer: http://stackoverflow.com/a/27418253
has body: I'm very new in AngularJS. I want to post registration data to a json file. Post request is working correctly,but data is not writing to file. I can't understand that position. Is there something wrong with my post request code? And how can I fix that? Thanks! var regModel = { FirstName: 'Someone', LastName: 'Somebody', Address: 'somewhere', Email: 'something@gmail.com' }; $scope.insertUser = function () { $http.post('../DB/users.json', regModel). success(function(data, status, headers, config) { // this callback will be called asynchronously // when the response is available }). error(function(data, status, headers, config) { // called asynchronously if an error occurs // or server returns response with an error status. }); }
score: 2
type: AnsweredQuestion
has title: AngularJS post model to a json file using $http.post()
possible better answer: http://stackoverflow.com/a/27418253
tagged with: http://stackoverflow.com/tag/json
tagged with: http
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/27417963
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/27417963
tagged with: angularjs
upvote count: 2

http://stackoverflow.com/comment/43224400
type: Comment
type: QuestionComment
has text: what kinde of inputfield do you have ? because you can specify the inputfield as number as well. Than your regexp could be way easier. Depending on what you want to do... because not all browsers support all input types.
score: 0
comment on: http://stackoverflow.com/q/27388094

http://stackoverflow.com/a/27361459
answers question: http://stackoverflow.com/q/27360449
downvote count: 0
has comment: http://stackoverflow.com/comment/43181327
has body: this.$get = function($q, $rootScope, $window) { return { finalize: function() { var deferred = $q.defer(); var dbRequest = $window.indexedDB.open(dbName, dbVersion); dbRequest.onupgradeneeded = function(event) { // XXX do something here. }; dbRequest.onsuccess = function(event) { db = event.target.result; console.log('Success!'); $rootScope.$apply(function () { deferred.resolve(event); }); }; dbRequest.onerror = function (error) { $rootScope.$apply(function () { deferred.reject(error); }); } return deferred.promise; } }; }; Also you should use var promise = resource.finalize(); one time for all tests
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/101118892
has text: I've answered a similar duplicate question here: https://stackoverflow.com/a/57313280/1075062. It's basically the same solution as dandavis with an example Handlebars helper.
comment on: http://stackoverflow.com/q/27389867
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27420412
has comment: http://stackoverflow.com/comment/43294676
has body: Then, you'll have to make the last group optional. You do that by capturing the /something part in a group and following it with ? which makes the previous token, here the captured group, optional. var regEx = new RegExp("(users)(\/[\w|\W]*)?");
has comment: http://stackoverflow.com/comment/43283609
has comment: http://stackoverflow.com/comment/43284489
type: Answer
score: 2
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/27420364

http://stackoverflow.com/q/27353840
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has body: I am checking some date whether available or not from DB using Ajax using below my code, var url = "ValidateDateFromDB.jsp?cdate="+selecteddate.value; if (window.XMLHttpRequest) req = new XMLHttpRequest(); else if (window.ActiveXObject) req = new ActiveXObject("Microsoft.XMLHTTP"); req.open("GET", url, true); req.onreadystatechange =callback; req.send(null); function callback() { if (req.readyState == 4) { if (req.status == 200) { var message = req.responseText; alert(message); if(message.startsWith("Available")) { alert("Availabe"); } else { alert("Not Availabe"); } } } } I am getting output like below image, It is working fine in firefox but not working in chrome.I checked out that startsWith works only chrome above 40 version.So to fix this i used == operation like below, if(message=="Available") { alert("Availabe"); } else { alert("Not Availabe"); } But this code always goes to else part that i know why. someone tell me how to fix this?
answer count: 0
score: 1
upvote count: 1
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/43165691
has title: how to fix startWith not working in chrome
tagged with: javascript
has comment: http://stackoverflow.com/comment/43162173
downvote count: 0

http://stackoverflow.com/comment/43466397
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27320792
has text: Hi, any chance you can put a JS Fiddle link so we can see what you've tried so far and why it's not working? Are you using the same data array for both series?
score: 0

http://stackoverflow.com/comment/43225089
type: Comment
score: 0
type: AnswerComment
has text: That's no where near enough detail to say anything.
comment on: http://stackoverflow.com/a/27386088

http://stackoverflow.com/comment/43121361
comment on: http://stackoverflow.com/q/27331669
has text: Add your app.js code too.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43125593
has text: @Pointy I came across this issue because I was working on one of our legacy systems that had `\r\n` in values in a select box (horrible, but true). I was trying `$("select").append(" " + text + " ");`. And it wasn't producing the correct result. I realize now that I could do `$("select").append($(" ").val(val).text(text))`, but I was curious why it didn't work.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27334074
score: 0

checkbox
tag name: checkbox
tags question: http://stackoverflow.com/q/27317784
tags question: http://stackoverflow.com/q/27462154
tags question: http://stackoverflow.com/q/27320636
tags question: http://stackoverflow.com/q/27391113
tags question: http://stackoverflow.com/q/27368878
tags question: http://stackoverflow.com/q/27432251
tags question: http://stackoverflow.com/q/27340750
tags question: http://stackoverflow.com/q/27455929
tags question: http://stackoverflow.com/q/27464520
tags question: http://stackoverflow.com/q/27457202
tags question: http://stackoverflow.com/q/27380567
tags question: http://stackoverflow.com/q/27449621
tags question: http://stackoverflow.com/q/27339750
tags question: http://stackoverflow.com/q/27411826
tags question: http://stackoverflow.com/q/27471285
tags question: http://stackoverflow.com/q/27365628
tags question: http://stackoverflow.com/q/27408576
tags question: http://stackoverflow.com/q/27468503
tags question: http://stackoverflow.com/q/27356889
tags question: http://stackoverflow.com/q/27325439
type: Tag
tags question: http://stackoverflow.com/q/27409016
tags question: http://stackoverflow.com/q/27395860
tags question: http://stackoverflow.com/q/27452229
tags question: http://stackoverflow.com/q/27400402
tags question: http://stackoverflow.com/q/27424335
tags question: http://stackoverflow.com/q/27442816

http://stackoverflow.com/comment/43297651
type: QuestionComment
has text: You can make an ajax call post type (i see you use jquery), so $.ajax or $.post maybe
comment on: http://stackoverflow.com/q/27428078
score: 0
type: Comment

http://stackoverflow.com/comment/43305124
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27431867
has text: yes , obj blue is ok , obj red isn't ok

http://stackoverflow.com/comment/111943312
type: AnswerComment
has text: This should be the correct answer and shows good practices, avoids executing functions thousands of times.
comment on: http://stackoverflow.com/a/62536793
type: Comment
score: 1

http://stackoverflow.com/q/27323342
accepted answer: http://stackoverflow.com/a/28068927
tagged with: android
has comment: http://stackoverflow.com/comment/43122014
favorite count: 0
has comment: http://stackoverflow.com/comment/44507451
upvote count: 1
tagged with: webview
has answer: http://stackoverflow.com/a/28068927
type: AnsweredQuestion
score: 1
has title: Android webview wont consistently open to last-scroll location
type: Question
has body: I have an Android app that uses a KitKat-level WebView to display documents (primarily as an e-reader which consumes HTML files). When a user opens a document within the app (and thus the webview is thus newly instantiated for that document) I want to scroll to the last known cursor location within the document, so that the user can pick up reading where they left off. Obviously I retain and persist the cursor location indepedently of the webview to allow such scrolling when I first open up the document. PROBLEM: When the document first opens, I can see the initial highlighting of the last known location (cursor) in my javascript document, but then in perhaps 50% of the cases I've seen the document somehow scrolls back to the top and so the cursor location is no longer shown. How and why it scrolls back to the top in these cases is a mystery to me (I dont believe I programatically make it scroll back to the top in any way). NOTES: To achieve the scrolling within the webview I'm using a javascript function which is invoked from my webview fragment (via webview.loadUrl) once the webview has signalled it has loaded and ready to use. This is the callback from the document view fragment to the webview: @TargetApi(Build.VERSION_CODES.KITKAT) @SuppressLint("ClickableViewAccessibility") @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View mainView = inflater.inflate(R.layout.document_webview_reader, container, false); getReaderActivity().setFooterLocationBarValues(mainView); mWebviewLoading = true; final WebView webview = (WebView) mainView.findViewById(R.id.document_webReader_webView); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setAllowFileAccessFromFileURLs(true); webview.getSettings().setAllowUniversalAccessFromFileURLs(true); webview.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); webview.setBackgroundColor(0); webview.setBackgroundColor(Color.LTGRAY); if(Build.VERSION.SDK_INT …
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/27428471
downvote count: 0
answers question: http://stackoverflow.com/q/27427793
type: Answer
upvote count: 11
score: 11
has body: This is one way: var max = -1; $('#formID [tabindex]').attr('tabindex', function (a, b) { max = Math.max(max, +b); }); max = -1 indicates, that there's no tabindexes in the form, or elements are excluded from tabbing order. A live demo at jsFiddle.

http://stackoverflow.com/a/27425793
has body: If you want to delete element at all, just make some changes: itemArray[index]=""; change to: itemArray = itemArray.splice(index, 1) and you will not see this element again
type: Answer
answers question: http://stackoverflow.com/q/27425459
score: 0

http://stackoverflow.com/q/27456597
score: 0
tagged with: element
has title: Outputting array elements one at a time
has answer: http://stackoverflow.com/a/27456646
tagged with: innerhtml
type: UnansweredQuestion
has body: Currently I am pushing form data (a single text field) to an empty array so that every time I click 'submit' the data is pushed to the end of the array (and thus, the array gets larger) What I am experiencing: I would like to output each element in a table, but I would like to do it one element per row, but right now it outputs like this per row First row: Data entered and submit pressed once -> enteredData Second row: More data entered and submit pressed -> enteredData enteredData1 If I enter another element it does enteredData enteredData1 enteredData2 And so forth and so on.... Here's the code block that I have looping: userInputName.push(userString); for (arrayIndex = 0; arrayIndex &lt; userInputName.length; arrayIndex++) { output.innerHTML += "&lt;tr&gt;&lt;td&gt;" + userInputName[arrayIndex] + "&lt;/td&gt;&lt;/tr&gt;"; } I feel like I'm missing some kind of conditional logic inside the for loop, but at this moment (too little sleep) I can't piece it together rationally :| Any suggestions on what I'm missing? This is what my full javascript code block looks like--I may reference this to my other thread asking a related question: //Declare global variable var userInputName = []; function displayTableAndTotals() { // Your code goes in here. //var totalStrings = []; var userString; var arrayIndex; var output; var outputTotal; var form; form = document.getElementById("userFormId"); output = document.getElementById("userEntriesId"); outputTotal = document.getElementById("testId"); userString = form.string.value; userInputName.push(userString); for (arrayIndex = 0; arrayIndex &lt; userInputName.length; arrayIndex++) { output.innerHTML += "&lt;tr&gt;&lt;td&gt;" + userInputName[arrayIndex] + "&lt;/td&gt;&lt;/tr&gt;"; } form.string.select(); return false; }
has answer: http://stackoverflow.com/a/27461511
has comment: http://stackoverflow.com/comment/43350631
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/43358911

http://stackoverflow.com/q/27361487
has comment: http://stackoverflow.com/comment/43175225
has title: How can I remove array columns with all null values?
has answer: http://stackoverflow.com/a/27361817
type: Question
accepted answer: http://stackoverflow.com/a/27361817
tagged with: arrays
downvote count: 0
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/43175746
favorite count: 0
has body: Say I have this array, [ ["First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh"], ["A" , 1 , 2 , 3 , 4 , 5 , null ], ["B" , 1 , 2 , null , null , 5 , null ], ["C" , null , 2.5 , 3 , 4 , 5 , null ], ] Now, it's a mix of Strings, integers, floats/doubles, and null values. In the last column, every value is null, and I need to remove that column (ignore the fact that the first row isn't null). That only way I can think to do this, is loop over the entire array (and sub arrays), and keep a boolean for each column stating whether all the values are null or not, and then loop over it all again, and if the column is entirely null, remove the indexes. This to me seems really inefficient, and I'm wondering if there's a better way I can do this. Just so you have an idea, the output array, needs to be like so. [ ["First", "Second", "Third", "Fourth", "Fifth", "Sixth"], ["A" , 1 , 2 , 3 , 4 , 5 ], ["B" , 1 , 2 , null , null , 5 ], ["C" , null , 2.5 , 3 , 4 , 5 ], ] // The "Seventh" column was removed due to all it's values being null. I'm going to set up a jsfiddle example, and I'll edit the link in once done. Here's my rough proof of concept for the looping idea I had.
upvote count: 2
type: AnsweredQuestion
score: 2

http://stackoverflow.com/comment/43220534
type: Comment
has text: @meagar using your first snippet, if I run `var base = new Base(); base.hello();`, `hello` is not defined for `base`, why is that?
comment on: http://stackoverflow.com/a/27385487
score: 0
type: AnswerComment

http://stackoverflow.com/q/27449453
type: Question
has body: I'm looking to create a Windows 8 desktop application using HTML5/JavaScript/CSS. I recently created an iOS mobile application, and to securely encrypt the data we retrieved a key from the iOS KeyChain to encrypt it on the mobile device. For a Windows 8 desktop application, I'm wondering if there's anything similar we can use.
tagged with: windows-8
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/27452937
tagged with: security
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: encryption
accepted answer: http://stackoverflow.com/a/27452937
has title: Is there an iOS KeyChain equivalent for Windows 8 [desktop] apps?
type: AnsweredQuestion

http://stackoverflow.com/q/27474340
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: My current objective is to animate div elements by moving it by slightly every time interval. ( I want to do it without 'animate' feature of jQuery ) To do so, I first make array of elements like this: var elements = $('.vz_container div.vz_element'); , and I use it like this in update function: function update() { for (var ei = 0; ei &lt; elements.length; ++ei) { elements[ei].style.top += "10px"; elements[ei].style.left += "10px"; } } , and I create Interval like this: setInterval(update, 1000); Although, it seems 'update' function is indeed called every seconds, divs only move once on my screen and will stay there for the rest of the time. I have no idea where it went wrong.
downvote count: 1
has comment: http://stackoverflow.com/comment/43385546
type: Question
accepted answer: http://stackoverflow.com/a/27474389
linked to: http://stackoverflow.com/q/12115258
has answer: http://stackoverflow.com/a/27474452
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/43383028
has title: setInterval and jquery
duplicate of: http://stackoverflow.com/q/12115258
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/27474386
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/43383708
possible better answer: http://stackoverflow.com/a/27474386
has answer: http://stackoverflow.com/a/27474389

http://stackoverflow.com/a/27334910
has comment: http://stackoverflow.com/comment/43126986
has comment: http://stackoverflow.com/comment/43127348
answers question: http://stackoverflow.com/q/27334701
has comment: http://stackoverflow.com/comment/43127487
has comment: http://stackoverflow.com/comment/43127393
has comment: http://stackoverflow.com/comment/43127440
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43126830
has comment: http://stackoverflow.com/comment/43126864
has body: Please change your CSS a little bit as follows #accordion { width:100%; margin:10px auto; border:1px solid black; -webkit-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4); -moz-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4); box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4); } #accordion h2 { clear: both; cursor:pointer; margin:0px 0px; padding:7px 15px; background-color:#ff6600; font:bold 16px Petua One; color:#ffffff; text-shadow:0px 1px 0px rgba(0, 0, 0, 0.4); } #accordion .content { background-color:#ffffff; padding:10px 15px; color:black; height:150px; width:50%; float:left; } #accordion h2.active { background-color:#000000; } Here i've specified a width of 50% for the content div and floated them.And to clear the floats from the accordion, i added a clear:both to #accordion h2 Check this fiddle
type: Answer
has comment: http://stackoverflow.com/comment/43127084
accepted answer of: http://stackoverflow.com/q/27334701

http://stackoverflow.com/comment/43327620
score: 0
type: Comment
has text: Yeah, I was thinking about using a type of jquery library to configure it to act as needed. Just couldn't seem to find one! Guess I'll keep on looking! Cheers for the headsup guys
type: QuestionComment
comment on: http://stackoverflow.com/q/27444227

http://stackoverflow.com/a/27417142
accepted answer of: http://stackoverflow.com/q/27417064
type: Answer
downvote count: 0
has body: Check the DEMO $('input[type="checkbox"]').change(function(){ var totalprice =0; var serv = []; $('input[type="checkbox"]:checked').each(function(){ totalprice= totalprice + parseInt($(this).val()); serv.push($(this).closest('tr').find('label').html()); }); $('#price').val(totalprice); $('#services').html(serv); });
score: 1
has comment: http://stackoverflow.com/comment/43277745
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27417064

http://stackoverflow.com/a/27435217
answers question: http://stackoverflow.com/q/27430226
accepted answer of: http://stackoverflow.com/q/27430226
score: 0
type: AcceptedAnswer
has body: You're initializing a var scale = 10 to represent that initial zoom, and you're applying that to zoomer via .scale(10). So zoomer knows the initial scale, but nothing in your code is doing the work of applying the initial scale to the d3 selection vis. The first time the scale is actually applied is once the user interacts, which in turn calls function zoom() {...}, where the scale is finally applied. The time/place to apply the initial scale, is when you create vis: //create a group that will hold all the content to be zoomed var vis = graph.append("svg:g") .attr("class", "plotting-area") .attr("transform", "scale(" + scale + ")");// &lt;-- THIS Here's an updated fiddle
type: Answer

livereload
type: Tag
tag name: livereload
tags question: http://stackoverflow.com/q/27325207

http://stackoverflow.com/comment/43174743
comment on: http://stackoverflow.com/a/27336742
has text: @Anima-t3d I saw that but couldn't get it to work under Windows/Firefox. Will try again under Opera tonight and see if I can use the node.js app to import my scripts into Opera.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43209187
type: Comment
comment on: http://stackoverflow.com/a/27379907
score: 0
type: AnswerComment
has text: this is actually issue your would be as similar issue I faced earlier.

http://stackoverflow.com/q/27314855
answer count: 5
tagged with: android
has body: I successfully installed all the tools required for meteor android build. When i run meteor run android The following error occurs Error while running for mobile platforms: spawn EACCES And when i run by sudo command like sudo meteor run android I get following error: Error while running for mobile platforms: Error running /Users/black_monk/.meteor/packages/meteor-tool/.1.0.35.wql4jh++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/cordova-scripts/cordova.sh Current working directory is not a Cordova-based project. What is wrong ?
has answer: http://stackoverflow.com/a/27356066
tagged with: node.js
possible better answer: http://stackoverflow.com/a/27327585
type: AnsweredQuestion
has title: Meteor run Android
tagged with: cordova
upvote count: 3
has answer: http://stackoverflow.com/a/28971687
has comment: http://stackoverflow.com/comment/43099220
type: Question
score: 3
accepted answer: http://stackoverflow.com/a/27417659
tagged with: javascript
has answer: http://stackoverflow.com/a/34630136
has answer: http://stackoverflow.com/a/27327585
has answer: http://stackoverflow.com/a/27417659
downvote count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/43218744
favorite count: 0

http://stackoverflow.com/a/27358774
has body: You currently can't override the default "main" files in a bower package unfortunately, but there is an open pull request for the bower.json spec that would let you do just that. If you want to use any files in a bower package not defined as main, you have to manually specify the paths to them in your scripts. (There are some other solutions though if say you're doing this in the context of a task runner like Gulp or Grunt.)
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/43170751
has comment: http://stackoverflow.com/comment/43170514
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/27357777
answers question: http://stackoverflow.com/q/27357777
type: Answer

http://stackoverflow.com/comment/43093587
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27316659
has text: i know the animate tag, but i want to try out all possible solutions for svg animations, to do a browser test with all of them and check their compatibility. I've tried the animate and also css transofmrations within the .svg file.

http://stackoverflow.com/q/27398304
answer count: 1
accepted answer: http://stackoverflow.com/a/27401803
favorite count: 0
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: socket.io
type: Question
has answer: http://stackoverflow.com/a/27401803
has title: Trouble getting started with NodeJS and SocketIO
downvote count: 0
has body: I'm trying to get a basic structure going using socket.io and node.js while implementing the tcp functionality shown on the home-page of node.js using the ('net') to create a server. As there's not much code, here's what I have so far Server: // Setup the server var tcpProtocol = require('net'); var serverListener = tcpProtocol.createServer(tcpHandler); var socketIO = require('socket.io').listen(serverListener); function tcpHandler(socket) { console.log("TCP Handler received a call."); socket.pipe(socket); } socketIO.sockets.on('connection', function(socket) { console.log("Connection maid."); }); socketIO.sockets.on('login', function(username, password) { console.log("login called."); console.log('username: ' + username); console.log('password: ' + password); }); serverListener.listen(5055, '127.0.0.1'); console.log("Server started on port 5055"); Then ofcourse, the client: Test Client The server is printing out the call for the tcpHandler, however the socketIO calls aren't getting any recognition. The sent from the client is printed, however I notice that the tcpHandler call gets called repetitively a few times, like it's still attempting to send the data after it failed or something? Just an assumption.
tagged with: javascript

http://stackoverflow.com/q/27387181
has comment: http://stackoverflow.com/comment/43222522
linked to: http://stackoverflow.com/q/203198
has body: I have the following piece of code: $(document).ready(function() { $("a[href*='window']").on("mouseover", function() { $(this).css('color', 'green'); }); $("a:eq(2)").click(function() { $(this).attr("href", "#window_1"); }); }); a { padding-left: 20px; } link 1 link 2 link 3 (click to add substring "window") Here I'm basically trying to apply some css to a tags having the substring 'window' in their 'href' attribute on 'mouseover' event. The code works fine for ones with predefined attribute (having the specified substring) but fails for dynamically added attributes. How do I solve this issue?
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: attribute contains selector not working for dynamically added attribute
answer count: 0
has comment: http://stackoverflow.com/comment/43222635
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/43222489
type: Question
has comment: http://stackoverflow.com/comment/43222615
has comment: http://stackoverflow.com/comment/43222659
score: 0

http://stackoverflow.com/comment/43374094
has text: Ya it works exactly fine..What i wanted to know was if there was any other solution...As i considered using it evry millisecond was costly, if not on web but atleast on mobile it would kill the performance..
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/27462286
type: Comment

http://stackoverflow.com/comment/43352475
score: 0
type: AnswerComment
has text: Great, thank you changepicture, it works, you're the best !!! I just changed id in class. Have a nice day to all of you
type: Comment
comment on: http://stackoverflow.com/a/27457670

http://stackoverflow.com/q/27349825
type: AnsweredQuestion
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/27349961
has answer: http://stackoverflow.com/a/27349874
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27349855
score: 0
has answer: http://stackoverflow.com/a/27349833
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27349833
has body: I have added a form to my html page dynamically using javascript. The .submit on the form does not work when I do this. However if I create the exact same form in html, it works as expected. Here is a fiddle: http://jsfiddle.net/dwha77g4/4/ The following code: $('.submit-form').submit(function(e){ alert("test"); e.preventDefault(); }); runs on the first button in the fiddle, but not the second dynamically created one.
linked to: http://stackoverflow.com/q/1357118
answer count: 4
has title: HTML Form created in javascript does not respond to .submit
possible better answer: http://stackoverflow.com/a/27349874

http://stackoverflow.com/comment/43231844
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/27392069
type: Comment
has text: And if you're curious why 120 is such a common value: http://blogs.msdn.com/b/oldnewthing/archive/2013/01/23/10387366.aspx

http://stackoverflow.com/q/27445864
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/27446229
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/27447578
type: Question
has title: Transition effect on page load with url
has answer: http://stackoverflow.com/a/27447578
upvote count: 1
tagged with: php
tagged with: css
answer count: 3
has body: This code redirects to example-page.php: setTimeout(function() { window.location.href = "/example-page.php"; }, 5000); I'm trying to add a transition effect, so when it redirects, it looks like it's scrolling left or right off the page to the other. Any help would be greatly appreciated! I've tried using Jquery but i'm still fairly new and struggling.
has answer: http://stackoverflow.com/a/27446229
has answer: http://stackoverflow.com/a/27446223
downvote count: 0
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion

http://stackoverflow.com/comment/43345163
type: QuestionComment
comment on: http://stackoverflow.com/q/27453212
has text: @dandavis - That will not be affected here. For example, here is one that iterates 60,000 times (1 minute). http://jsfiddle.net/twn8bmqq/ It will not crash your computer or lock your browser, it just takes a minute to execute. There are console logs every 10 seconds, and only 1 alert after the full minute.
score: 0
type: Comment

http://stackoverflow.com/comment/43290627
score: 0
type: Comment
has text: Thanks sumit. Do you know how I can get the value of the a tag that I have clicked?
comment on: http://stackoverflow.com/a/27424198
type: AnswerComment

jquery-events
tag name: jquery-events
tags question: http://stackoverflow.com/q/27428594
tags question: http://stackoverflow.com/q/27316509
tags question: http://stackoverflow.com/q/27418145
tags question: http://stackoverflow.com/q/27386704
tags question: http://stackoverflow.com/q/27426398
tags question: http://stackoverflow.com/q/27453314
tags question: http://stackoverflow.com/q/27381644
tags question: http://stackoverflow.com/q/27457892
type: Tag
tags question: http://stackoverflow.com/q/27321859
tags question: http://stackoverflow.com/q/27410188
tags question: http://stackoverflow.com/q/27404223
tags question: http://stackoverflow.com/q/27345986
tags question: http://stackoverflow.com/q/27315064
tags question: http://stackoverflow.com/q/27410113

http://stackoverflow.com/a/27424101
type: Answer
score: 0
answers question: http://stackoverflow.com/q/27396791
has body: If you are really just looking to protect the data and integrity of your server: Just escape the files, so that these are only treated as strings and can't be executed. Later you use the string and just write it plain back into a file. Make sure that the server, which serves the files later (e.g. from the assets folder) has really limited rights (just what you need to serve these). I would recommend that you split your node.js server into two. One which is serving the files (very limited functionality) and the other which escapes the uploaded files and puts them to e.g. your assets folder. However be aware that other's could use your service for CSRF and some other malicious stuff.

http://stackoverflow.com/comment/43207367
type: AnswerComment
comment on: http://stackoverflow.com/a/27377952
score: 0
type: Comment
has text: Edited the answer for clarity, you were right that it would have been confusing without reading the whole comment thread.

http://stackoverflow.com/q/27427597
score: 1
linked to: http://stackoverflow.com/q/10203777
has answer: http://stackoverflow.com/a/27427787
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/27427787
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have 3 divs, the first is fixed, the second on scroll changes opacity until it's at the same posisiton and then fixes itself. the third waits until the second is positioned then changes it's opacity until it's at the same position and also fixes itself. The problem is the third div starts always with 50% opacity. Here is a JSfiddle - http://jsfiddle.net/topaz85/aeemdptb/4/embedded/result/ Here is the script and offending line of code. $("document").ready(function (e) { var bluetop = $(".pink-bg").outerHeight(); var greentop = $(".pink-bg").outerHeight() + $(".blue-bg").outerHeight(); var footertop = $(".pink-bg").outerHeight() + $(".blue-bg").outerHeight() + $(".green-bg").outerHeight(); var headerHeight = $(".header-container").outerHeight() $(".blue-bg").css("top", bluetop); $(".green-bg").css("top", greentop); $(".approach-section").height(footertop); $(".pink-bg").css("position", "fixed"); $(".blue-bg, .green-bg").append("&lt;div class='color-bg'&gt;&lt;/div&gt;"); var bluedistance = $('.blue-bg').offset().top, greendistance = $('.green-bg').offset().top; $(window).scroll(function () { var st = $(this).scrollTop(); if (st + headerHeight &gt;= bluedistance) { $(".blue-bg").css({ "position": "fixed", "top": headerHeight }) } else { $(".blue-bg").css({ "position": "absolute", "top": bluetop }) } if (st + headerHeight &gt;= greendistance) { $(".green-bg").css({ "position": "fixed", "top": headerHeight }) } else { $(".green-bg").css({ "position": "absolute", "top": greentop }) } /* avoid unnecessary call to jQuery function */ if (st + headerHeight &lt;= bluetop) { $(".blue-bg .color-bg").css({ 'opacity': (1 - st / bluetop) }); } if (st + headerHeight &gt;= bluetop) { var halfScroll = st / 2; $(".green-bg .color-bg").css({ 'opacity': (1 - halfScroll / bluetop) }); } }); }); I've looked at this stackoverflow question and have had no luck -Div opacity based on scrollbar position Any suggestions?
tagged with: scroll
upvote count: 1
tagged with: opacity
type: Question
type: AnsweredQuestion
has title: Attach scroll position to opacity of a div

http://stackoverflow.com/comment/43220284
comment on: http://stackoverflow.com/a/27385943
score: 1
type: AnswerComment
type: Comment
has text: The explanation of the first part is good, your example to solve the current problem is wrong. You need to better understand the character class notion and why writing `[^HOHO]` has no sense.

http://stackoverflow.com/q/27442671
has body: I have intergrated a third party code into my website, and suddenly the setTimeout and setInterval stopped working: Before the third party is loaded, everything works fine. setTimeout and setInterval that were scheduled to run after the third party is loaded, do not dun at all. After removing the 3rd party code snippet they supplied, everything work. My question is - how can it be? what can the third pary do that can stop my schedules? I renamed any pointers to the returned value of the setTimeout function; I tried to play with the place where I put the snippet and / or the setTimeout code. Nothing work. It doesn't make any sense. and I don't know how to start debugging it. Here is a simplified html: My Demo Any help & guideness is appriciated!
has answer: http://stackoverflow.com/a/27447473
has comment: http://stackoverflow.com/comment/43324977
has comment: http://stackoverflow.com/comment/43324904
type: Question
linked to: http://stackoverflow.com/q/20180251
has comment: http://stackoverflow.com/comment/43324957
has comment: http://stackoverflow.com/comment/43324501
has comment: http://stackoverflow.com/comment/43324663
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43324602
has comment: http://stackoverflow.com/comment/43324845
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/43333626
answer count: 4
has title: Javascript: My setTimeout function not working because of 3rd party
has answer: http://stackoverflow.com/a/27472690
has answer: http://stackoverflow.com/a/27442806
has answer: http://stackoverflow.com/a/27442770
type: UnansweredQuestion

http://stackoverflow.com/a/28210364
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/73712350
answers question: http://stackoverflow.com/q/27334365
upvote count: 61
has body: There is a way to check whether an element was registered. Registered elements have their own constructors, while unregistered ones would use plain HTMLElement() for constructor (or HTMLUnknownElement() whether the name is not valid, but this is out of scope of the question): document.registerElement('x-my-element'); document.createElement('x-my-element').constructor //⇒ function x-my-element() { [native code] } document.createElement('x-my-element-not-registered').constructor //⇒ function HTMLElement() { [native code] } That said, the checker might look like: var isRegistered = function(name) { return document.createElement(name).constructor !== HTMLElement; } Or, with syntactic sugar: String.prototype.isRegistered = function() { return document.createElement(this).constructor !== HTMLElement; } 'x-my-element'.isRegistered() //⇒ true 'xx-my-element'.isRegistered() //⇒ false The mostly careful version: String.prototype.wasRegistered = function() { switch(document.createElement(this).constructor) { case HTMLElement: return false; case HTMLUnknownElement: return undefined; } return true; } 'x-my-element'.wasRegistered() //⇒ true 'xx-my-element'.wasRegistered() //⇒ false 'xx'.wasRegistered() //⇒ undefined There is no way to access a list of registered elements, AFAIK. BTW, I still think that the try-catched registration (as proposed by @stephan-muller) suits your needs better.
type: Answer
has comment: http://stackoverflow.com/comment/68863869
has comment: http://stackoverflow.com/comment/44904580
score: 58
downvote count: 3
has comment: http://stackoverflow.com/comment/44885863
accepted answer of: http://stackoverflow.com/q/27334365

http://stackoverflow.com/q/27360513
downvote count: 5
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43178734
has comment: http://stackoverflow.com/comment/43173482
has title: JavaScript: how this number came as output
has comment: http://stackoverflow.com/comment/43173025
has comment: http://stackoverflow.com/comment/43178699
has comment: http://stackoverflow.com/comment/43173188
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/43173315
has comment: http://stackoverflow.com/comment/43173122
type: Question
has comment: http://stackoverflow.com/comment/43173515
has comment: http://stackoverflow.com/comment/43178949
has body: This code works fine, but, this results "1number". My doubt is how this 'number'is coming? Any help? var x = 1; if (function f(){}) { x += typeof f; } x; alert(x);
has comment: http://stackoverflow.com/comment/43173080
has comment: http://stackoverflow.com/comment/43173252
answer count: 1
has comment: http://stackoverflow.com/comment/43173195
has comment: http://stackoverflow.com/comment/43173046
has comment: http://stackoverflow.com/comment/43173242
has comment: http://stackoverflow.com/comment/43173245
has comment: http://stackoverflow.com/comment/43173059
has comment: http://stackoverflow.com/comment/43173093
upvote count: 4
has comment: http://stackoverflow.com/comment/43173353
has comment: http://stackoverflow.com/comment/43173210
has answer: http://stackoverflow.com/a/27360576
tagged with: function
has comment: http://stackoverflow.com/comment/43173356

http://stackoverflow.com/comment/43221527
type: QuestionComment
comment on: http://stackoverflow.com/q/27386493
has text: Thanks guys! I've accepted an answer but you were all right!
score: 0
type: Comment

http://stackoverflow.com/comment/43133628
comment on: http://stackoverflow.com/q/27338465
type: Comment
type: QuestionComment
has text: You have not mentioned what webserver you are using -- however every webserver have security holes and zero-day exploits are always possible -- so assume that the file can always be accessed by somebody sufficiently clever if it exist on the machine
score: 0

http://stackoverflow.com/q/27405279
has answer: http://stackoverflow.com/a/27405362
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/27405631
possible better answer: http://stackoverflow.com/a/27405362
has title: I would like to remove form entry with something like this. Is there other nicer way to do it?
has comment: http://stackoverflow.com/comment/43255536
type: AnsweredQuestion
has body: I have some code and it is working but, i am looking for a nicer and cleaner way to do this. I like to remove entered text from my form inputs. I have done the same thing for each entry of my forms, can anyone help me find a better way to tho this? Thanks. // clear text user email if($('.user_email').val() === '') { $("#clear_user_email").hide(); } $("#clear_user_email .clear_text").click(function(e) { e.preventDefault(); $('.user_email').val(''); if($("#clear_user_email").is(":visible")) { $("#clear_user_email").hide(); } }); $( ".user_email" ).keyup(function(){ $("#clear_user_email").show(); }); I could do as Wolff suggested with: but I have to many form inputs on my form. the form submit with ajax
has comment: http://stackoverflow.com/comment/43255929
has answer: http://stackoverflow.com/a/27405476
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/27405631
tagged with: javascript
score: -1
answer count: 3
upvote count: 0

http://stackoverflow.com/comment/43378034
comment on: http://stackoverflow.com/q/27467951
score: 0
type: Comment
type: QuestionComment
has text: I chose do like you said! Thanks!

http://stackoverflow.com/comment/43280255
score: 0
comment on: http://stackoverflow.com/a/27415495
type: AnswerComment
type: Comment
has text: Thank you very much. It's working fine. I'll be pleased if you forward a message to me from your email. Thanks.

http://stackoverflow.com/comment/43538577
score: 0
has text: @AdamRobertson: what do you mean by "specify your dependencies correctly"? Also, I see your point about the template, but if I'm editing I don't want the `{{question}}` template to be rendered, so I have to check `isEditing` before. Or am I missing something?
comment on: http://stackoverflow.com/q/27468684
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27466393
score: 0
answers question: http://stackoverflow.com/q/27466364
type: Answer
has comment: http://stackoverflow.com/comment/43415596
has comment: http://stackoverflow.com/comment/43426408
has body: The problem is with your newI.setAttribute('class', it is overwriting the previously added class. You will notice the same thing when you do console.log(newI). So, set all the classes for it in one go, like this: newI.setAttribute('class', 'fa fa-twitter fa-2x'); Here is the working code snippet: var newLi = document.createElement('li'); var newA = document.createElement('a'); var newI = document.createElement('i'); newA.setAttribute('id', 'twitter'); newA.setAttribute('target', '_blank'); newI.setAttribute('class', 'fa fa-twitter fa-2x'); // set all classes in one go! newLi.appendChild(newA); console.log(newLi); // check it here newA.appendChild(newI); var position = document.getElementById('social'); position.appendChild(newLi); EDIT: Also add the href attribute as pointed by @Kierkegaurd EDIT2: If you mean to refer the code that you posted as a comment to @epascarello's answer, here is my take: Your code looks correct to me, its just that you havent set the href attribute for newA. Here is the updated working code snippet: //Add Twitter var newLi = document.createElement('li'); var newA = document.createElement('a'); var newI = document.createElement('i'); newA.setAttribute('id', 'twitter'); newA.setAttribute('target', '_blank'); newA.setAttribute('href', '#'); // set href here newI.classList.add('fa'); newI.classList.add('fa-twitter'); newI.classList.add('fa-2x'); newLi.appendChild(newA); newA.appendChild(newI); var position = document.getElementById('social'); position.appendChild(newLi);

http://stackoverflow.com/a/27396985
has comment: http://stackoverflow.com/comment/43240559
has body: Are you sure the script runs?If yes you have to change some thinks: in the while loop leave out the 'var' in 'var x &lt; 1' at the moment you create a new variable. in the if statements use '==' instead. '=' changes the value '==' compares. instead of 'var z= var y + 1' use 'var z = y +1'
has comment: http://stackoverflow.com/comment/43240283
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/43240500
answers question: http://stackoverflow.com/q/27396784

http://stackoverflow.com/comment/43289622
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27422171
has text: That is the whole function; I haven't got round to coding it because of this problem i ran in to. Anyway, I fixed it now by changing the function declaration to window.functionname = function(). Thanks for help anyway!

http://stackoverflow.com/a/27390839
has comment: http://stackoverflow.com/comment/43269687
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27384672
has comment: http://stackoverflow.com/comment/43235012
has body: am not sure if this is different but previously I was working on a Typescript application in Visual Studio and I don't recall any reference links being needed at the top of each of the files that contained my classes. You can use the good old reference file trick : https://github.com/TypeStrong/grunt-ts#reference
accepted answer of: http://stackoverflow.com/q/27384672
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/27410188
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43265310
score: 0
tagged with: jquery-events
tagged with: bookmarklet
has title: Javascript link when clicked loads jQuery menu. Everything loads but doesn't execute
tagged with: jquery-load
has comment: http://stackoverflow.com/comment/43265162
type: UnansweredQuestion
answer count: 0
has body: I am trying to create a bookmarklet Javascript link that when clicked it will load up a menu over the current page. So far when I click the link, all the markup html, CSS, and jQuery code loads up, however, it does not execute. In other words, the menu open button does not open the menu... I noticed that when the code is loaded normally on a page not using the link bookmarklet, classes are dynamically added to the nav and ul li tags. This doesn't happen when the scripts and markup are loaded through the bookmarklet. Below is my code. Bookmarklet Javascript link: Run Bookmarklet Script that creates the markup and adds the necessary jQuery for the menu: (function(){ // the minimum version of jQuery we want var v = "1.7.2"; // check prior inclusion and version if (window.jQuery === undefined || window.jQuery.fn.jquery < v) { var done = false; var script = document.createElement("script"); script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js"; script.onload = script.onreadystatechange = function(){ if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { done = true; initMyBookmarklet(); } }; document.getElementsByTagName("head")[0].appendChild(script); } else { initMyBookmarklet(); } function initMyBookmarklet() { (window.myBookmarklet = function() { // JavaScript code goes here! var j = ' '; var k = ' ' var y = 'X Home About us History The team Management Sales Development Our address Contact '; var b = document.createElement("div"); b.innerHTML = j + k + y; document.body.appendChild(b); // STOP JAVASCRIPT BEFORE HERER })(); } })(); Startpool.js trigger $(function() { $('nav#poolmenu').mmenu(); }); Could not fit the jQuery for the menu since it was to long but you can find it here. It has not been changed. http://mmenu.frebsite.nl/download.html
has comment: http://stackoverflow.com/comment/43264965
type: Question

http://stackoverflow.com/q/27357120
type: Question
score: 0
has answer: http://stackoverflow.com/a/27357595
accepted answer: http://stackoverflow.com/a/27357595
has body: I am trying to parse a documentation text, which is formatted like this : className : String A text colHeaders : Boolean (default false) colHeaders : Array [A, B, C, ...] colHeaders : Function function(index) { return ... } Another text (Full documentation here) So every option in the documentation can be of multiple types, and I want to programatically recover them. I created a JavaScript regex : ^(\w+) : (\w+)[^\n]*(?:\n\1 : (\w+)[^\n]*)* (Regex101 demo page here) I successfully retrieve the first option type ('String' and 'Boolean' in the example above), but as far as the second part of the regex is concerned I can only retrieve the last group ('Function', where I would like both 'Array' and 'Function'). If I remove the '*' quantifier at the end of the regex, I only retrieve 'Array' (same thing if I add the non-greedy symbol '?' after it), but once again I would like both. Is there a way to do that in a JS regex ?
has comment: http://stackoverflow.com/comment/43169570
has comment: http://stackoverflow.com/comment/43169611
answer count: 1
has comment: http://stackoverflow.com/comment/43167376
tagged with: javascript
tagged with: regex
has comment: http://stackoverflow.com/comment/43168543
has title: JavaScript regex captures only the last group occurrence
type: AnsweredQuestion

http://stackoverflow.com/comment/43458427
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27321774
has text: @beiller: Choosing `y = 0` is cheating. ;-) As the y axis of HTML space decreases, the y axis of 3D space increases. Anyway, sure: I can convert coordinates from one to the other in every place I need to specify coordinates, but that's exactly what I'm trying to avoid. I'd like to transform one of the coordinate systems to correspond 1-to-1 with the other, in a single location, so that the many modules of the app can assume there is only one system. This is not a math problem, but a JavaScript problem.

http://stackoverflow.com/a/27446606
accepted answer of: http://stackoverflow.com/q/27445513
has body: You're almost there, you just need to do a couple things. In the apiFactory.call method, you should return $http.get(). This will return a promise to the caller. You need to add some sort of check to verify that the result was returned from the apiFactory.call method. I modified your test to look as follows: it('should return "I visited Google!', function(){ var deferred = $q.defer(); var result; spyOn($http, 'get').and.returnValue(deferred.promise); deferred.resolve(); apiFactory.call().then(function(resolved) { result = resolved; }); expect($http.get).toHaveBeenCalledWith('http://www.google.com'); expect(result).toBeUndefined(); rootScope.$apply(); expect(result).toBe('I visited Google!'); }); To clarify, your apiFactory.call method should look like the following: return $http.get('http://www.google.com').then(function(){ return 'I visited Google!'; }); This should work for you!
upvote count: 1
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/43350851
score: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/27445513

http://stackoverflow.com/a/27434891
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/27432045
type: Answer
accepted answer of: http://stackoverflow.com/q/27432045
score: 1
has body: Your data structure doesn't really represents your expected output. The structure should be something like this: data (object) categories (array) category (object) category name subcategories (array) subcategory (object) subcategory name items (array) item (object) item name item description Note: I called the innermost array items instead of games/movies/etc, so it's easier to use it in the template. You can see my implementation in this jsfiddle.

http://stackoverflow.com/comment/43298070
comment on: http://stackoverflow.com/a/27427678
type: AnswerComment
score: 0
has text: Thank you for Suggestion @Shomz. I did figured another way. Posted an answer below.
type: Comment

http://stackoverflow.com/q/27452934
has comment: http://stackoverflow.com/comment/43344332
favorite count: 0
has body: So I know that setTimeout() function can trigger the function passed in after a certain period of time, but it seems behaving differently in a loop. For example: for (var i = 0; i &lt; 5; i++) { setTimeout(console.log(i + ', time is: ' + new Date()), 1000); } The console.log() seems printing out the numbers all at the same time. I do not understand why. Could some of you explain why setTimeout() does not work in this loop?
answer count: 5
has title: setTimeout in a loop, it behaves different than expected
possible better answer: http://stackoverflow.com/a/27453008
has answer: http://stackoverflow.com/a/27453008
has answer: http://stackoverflow.com/a/27452975
type: AnsweredQuestion
tagged with: settimeout
upvote count: 1
downvote count: 1
linked to: http://stackoverflow.com/q/750486
type: Question
has answer: http://stackoverflow.com/a/27453323
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27452975
score: 0
has comment: http://stackoverflow.com/comment/43344298
has answer: http://stackoverflow.com/a/27453249
has answer: http://stackoverflow.com/a/27453160

http://stackoverflow.com/a/27449602
type: Answer
has body: add an to your form, instead of the 'a' tag so that event handler for 'submit' gets executed. You could use a button to include your icon: 0
answers question: http://stackoverflow.com/q/27449349
upvote count: 1
downvote count: 1
accepted answer of: http://stackoverflow.com/q/27449349
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/27345528
type: AcceptedAnswer
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/27345437
score: 3
accepted answer of: http://stackoverflow.com/q/27345437
has body: $.ajax({ url:'http://myapi.com?api=1&amp;test=test', dataType: 'json', type: 'get', cache: false, success:function(data){ for (var i in data.Results) { var count = data.TotalResults; var name = data.Results[i].UserName; var text = data.Results[i].RText; console.log(name); console.log(text); } } }); Your iteration was a bit dodgy, this should work now. Here is a JSFiddle to show it works: http://jsfiddle.net/n7afxhed/
has comment: http://stackoverflow.com/comment/43146460
upvote count: 3

http://stackoverflow.com/q/27413661
score: 0
has answer: http://stackoverflow.com/a/27413737
answer count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27413737
has title: Pre-rendering a canvas rectangle with text, is this bad performance?
has body: It is taking up to 0.300ms to complete which is at least 2X slower than just caling the function straight without pre-rendering, I think thats quite a lot... What do you guys think? Is this normal? Am I doing this right? Something must be wrong. function complexDraw(ctx){ ctx.fillStyle = "Black"; ctx.fillRect(90 * Xf, 380 * Yf, 200 * Xf, 30 * Yf);//k10 ctx.fillStyle = "White"; ctx.font = pixels + "px monospace"; ctx.textAlign = "center"; ctx.fillText("Left: " + currentremain, 185 * Xf, 400 * Yf); } function cloneCanvas(oldCanvas) { //create a new canvas var newCanvas = document.createElement('canvas'); var context = newCanvas.getContext('2d'); //set dimensions newCanvas.width = oldCanvas.width; newCanvas.height = oldCanvas.height; //apply the old canvas to the new one context.drawImage(oldCanvas, 0, 0); //return the new canvas return newCanvas; } var cacheCanvas = cloneCanvas(a_canvas); // newCanvas var cacheCtx = cacheCanvas.getContext('2d'); // context var draw = function draw(){ complexDraw(cacheCtx); //updates text each time ctx.drawImage(cacheCanvas,0,0); } console.time("new"); draw(); console.timeEnd("new")// 0.300ms
type: Question
tagged with: canvas
tagged with: javascript

http://stackoverflow.com/comment/43301491
type: Comment
has text: What does that mean a single listener for all checkboxes?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27430036

http://stackoverflow.com/a/27467060
answers question: http://stackoverflow.com/q/27467009
type: Answer
has comment: http://stackoverflow.com/comment/43390518
has comment: http://stackoverflow.com/comment/43369881
has body: Add Access-Control-Allow-Origin: * header to your response. It's depends on what backend or server side you are using. There are some reference: HTTP Access Control Enable CORS in Apache Website about "enable cross-origin resource sharing"
score: 0
has comment: http://stackoverflow.com/comment/43389924

http://stackoverflow.com/comment/47033947
type: Comment
comment on: http://stackoverflow.com/a/29391403
has text: @sMr yes, I put an arbitrary delay of 3s before resuming normal scrolling behavior; it can be shortened as you wish, though; please specify what exact behavior you are expecting: right now vertical scrolling is prevented after a swipe has been triggered: isn't it what was required?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43165674
has text: I'm very grateful for you answer. I just make this Scroll Override approach short time ago . It's not bad, but it use big perfomance. Because on every page i must to hide that elements would not completely fit. But all works correctly and good perfomance, until i want to make two columnsm ,then i must make two elements with `overflow:hidden;` and now it's bad performance. But thank you for your approach)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27355738

http://stackoverflow.com/comment/43342058
has text: Correct, I'm not sure what I need to do in order to get this to work. I just need to display what is already on the PHP page. I'm trying to get this to work with the setInterval function. How do I go about this? I honestly don't know anything about ajax requests.
comment on: http://stackoverflow.com/q/27451723
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/27328225
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27328250
tagged with: javascript
has comment: http://stackoverflow.com/comment/43115219
type: AnsweredQuestion
has body: I need to write a constructor for an object that gives a random value to the object's color property. This is what I wrote var Ghost = function() { // your code goes here var num = Math.floor(Math.rand()*4); if(num === 0){ this.color = "white"; } else if(num === 1){ this.color = "yellow"; } else if(num === 2){ this.color = "purple"; } else if(num === 3){ this.color = "red"; } }; I get an error message from the test suite on code wars TypeError: Object #&lt;Object&gt; has no method 'rand' at new Ghost at Test.describe Am I not allowed to use functions inside a constructor or is there something about the test suite I don't understand?
type: Question
has title: using functions inside javascript constructors
tagged with: oop
accepted answer: http://stackoverflow.com/a/27328250

http://stackoverflow.com/comment/43310090
has text: The only things I would change about this answer would be to write it functionally and write `data.contextids[i].name !== nameToKeep` in the if statement, because `!==` is best practice
comment on: http://stackoverflow.com/a/27432894
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/43171898
has text: actually, your code works, but since this is a click event, it temporarily adds the second class but when page is reloaded , it has disappeared. I need to implement it via a click event. How do I do it?
type: Comment
comment on: http://stackoverflow.com/a/27359543
score: 0
type: AnswerComment

http://stackoverflow.com/q/27360672
tagged with: arrays
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/27360714
favorite count: 0
type: Question
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/43173390
score: -2
has title: Repeated index is not storing in associated array in Javascript
has comment: http://stackoverflow.com/comment/43173391
accepted answer: http://stackoverflow.com/a/27360714
possible better answer: http://stackoverflow.com/a/27360706
has body: I am trying to store the array with the index and its value in associated array, But it is not storing repeated index with different value. When I alert this json value only unique value is displaying .Here is my code : arr[1]="AAA"; arr[2]="BBB" arr[3]="CCC" arr[2]="DDD" arr[2]="HHH" var jsonString = JSON.stringify(arr); alert(jsonString);
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/27360706
has comment: http://stackoverflow.com/comment/43173446
upvote count: 0

http://stackoverflow.com/a/27343839
type: Answer
has body: Assuming that what you are trying to do is derive the maximum value of the p1 values and present it without using scientific notation, this should work for you. // Parse data var data2_JSON = document.getElementById('JSON3').value; var obj2 = JSON.parse(data2_JSON); // Find maximum p1 function getMaxY() { return obj2.dataset2.reduce(function(p, c, i){ // Ignore missing values - Could use (i % 2) here if the order was known to be consistent. return (typeof(c.p1) === 'undefined') ? p : Math.max(p, parseFloat(c.p1, 10)); }, 0); } // var sNum = "1.23e-2"; // alert(parseFloat(sNum)); // alert(parseFloat(obj2.dataset2[4].p1)); // Use toFixed() to ensure the value is not presented with scientific notation alert(getMaxY().toFixed(20)); &lt;textarea id="JSON3"&gt; {"dataset2": [ {"p1" : "2.097E-15 "} ,{"sumps2" :" 12"}, {"p1" : "3.6039E-13 "} ,{"sumps2" :" 5"}, {"p1" : "5.6446E-16 "} ,{"sumps2" :" 14"}, {"p1" : "-4.9850E-20 "} ,{"sumps2" :" 7"}, {"p1" : "4.878E-15 "} ,{"sumps2" :" 2"}, {"p1" : "2.50E-16 "} ,{"sumps2" :" 15"}, {"p1" : "8.37E-15 "} ,{"sumps2" :" 8"} ]} &lt;/textarea&gt;
score: 0
has comment: http://stackoverflow.com/comment/43266316
answers question: http://stackoverflow.com/q/27343173

http://stackoverflow.com/a/27405224
upvote count: 1
has body: I think you can simple get away by chaining the promises. var client = this.modelFor('workspace.client'); return client.get('sessions').then(function(sessions) { return Ember.RSVP.all(sessions.getEach('exercises')); }).then(function(exercises) { return Ember.RSVP.all(exercises.getEach('exercise')); }).then(function(allExercises) { console.log("RESOLVED"); return allExercises; }); note: not sure what you are trying to do when resolving with sessions, and not doing anything with the exercises
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27377478

http://stackoverflow.com/q/27404234
has answer: http://stackoverflow.com/a/27405206
type: Question
has comment: http://stackoverflow.com/comment/43255271
accepted answer: http://stackoverflow.com/a/27405206
has comment: http://stackoverflow.com/comment/43255108
answer count: 1
has body: default-functions.js function width(){ console.log($(window).width()); } If I have a function - like the one above. I don't want to add it into each controller in an AngularJS application but because I'm using RequireJS too I want the function to flow through the app without having to repeatedly add that snippet of code or any reference to that snippet on each controller. Would there be a way to add it into the application when bootstrapped? At the moment I have the following layout. main.js requirejs([ 'vendors/jquery.min', 'angular', 'app', 'routes', 'ui-bootstrap', 'default-functions', 'services/services', 'directives/directives', 'filters/filters', 'controllers/controllers' ], function ($, angular, app, _) { angular.element(document).ready(function () { angular.bootstrap(document, ['App']); document.getElementsByTagName('html')[0].dataset.ngApp = 'App'; }); }); controller.js define([], function() { var Ctrl = function( $scope, $timeout, $http, $routeParams, $rootScope) { width(); } return Ctrl }); At the moment the application returns width is not defined - is there anyway I can get each function I may add into default-functions.js to get defined without adding each into each controller like you would with a Service.
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43254654
has title: AngularJS, RequireJS and Vanilla Javascript Functions
tagged with: angularjs
tagged with: requirejs
has comment: http://stackoverflow.com/comment/43255062
type: AnsweredQuestion

http://stackoverflow.com/q/27360134
has comment: http://stackoverflow.com/comment/43175772
score: 0
has body: I am trying store gmaps polyline into a string. https://developers.google.com/maps/documentation/utilities/polylinealgorithm The algorithm spits encoded data as ascii starting from ascii 63. Is there a efficient method in javascript that can handle general ascii data unaltered and unescaped For Eg: A typical encoded polyline looks like this s}`nA{agyMF_CLAFC\{KJ?@_CuDNuCXUDaD|B_DxBaAp@KlCCp@Cr@EnBEdAG`BOvCEv@Ar@HpBZzCfAnKj@pGtAzMbBzO|@lKpBra@JpGErAKz@eEjLg
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43172707
has comment: http://stackoverflow.com/comment/43174587
has comment: http://stackoverflow.com/comment/43175518
has title: What is correct way to store ASCII string in Javascript without escaping?
answer count: 0
tagged with: underscore.js
type: Question
tagged with: javascript

http://stackoverflow.com/a/27428130
type: Answer
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43320464
answers question: http://stackoverflow.com/q/27428000
has comment: http://stackoverflow.com/comment/43319410
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/27428000
has body: x.src = is a sort of shorthand for x.setAttribute('src', ..., and setting attributes does not trigger Object.observe--this is the DOM world, not the JS object world. Attributes on HTMLElements are not JS object properties (although sometimes they pretend to be; actually they lurk within the attributes property as a NamedNodeMap), and JS object properties are what Object.observe observes. You can verify this by setting a non-attribute property on your image, and see the observer function firing. Setting src on XMLHttpRequest works because XMLHttpRequest is just a plain old JS object and src is just a plain old property on it. If you want to observe attribute changes, you can use mutation observers.

http://stackoverflow.com/a/27404781
upvote count: 3
type: Answer
score: 3
has body: You should use model associations. Salis docs about associations In the example of the movies you are asking, a many to many association will do. Sails will create the pivot table for you. It will also create a REST like url for that association. i.e person/:personId/likedMovies
downvote count: 0
answers question: http://stackoverflow.com/q/27375071

http://stackoverflow.com/q/27352222
has title: Post to Web Service using Javascript (from C#)
has answer: http://stackoverflow.com/a/27360517
has comment: http://stackoverflow.com/comment/43158469
type: Question
tagged with: c#
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/43161203
has comment: http://stackoverflow.com/comment/43164800
answer count: 1
tagged with: cordova
has comment: http://stackoverflow.com/comment/43158401
type: UnansweredQuestion
has body: Good day everyone, I am facing a slight problem. Up until last week our mobile application connected to an in-house Web Api, which in turn connected to web services run and maintained by our partners. Problem is, we would like the remove our Web Api as the middle man, and connect directly from our Cordova app (Javascript) to the Restful service. Below is the C# code I am trying to emulate, any and all help would be appreciated: (At this point I'm sure everything is right, except the authentication but I might be wrong) QUESTION: How can I achieve this in Javascript (If it is at all possible) public static AuthenticateResult CheckLogin(LoginModel login) { var serviceClient = new WebClient(); var proxy = serviceClient.Proxy; proxy.Credentials = new NetworkCredential("username_goes_here", "password_goes_here"); serviceClient.Headers["Content-type"] = "application/json"; try { var requestHeader = new UnauthenticatedRequestHeader { Code = ConstantModel.PartnerCode, Partner = ConstantModel.PartnerName }; var authenticateRequest = new AuthenticateRequest { Username = login.Username, Password = login.Password, Handset = "iPhone Emulator" }; var serviceRequest = new { header = requestHeader, request = authenticateRequest }; var jsonizedServiceRequest = JsonConvert.SerializeObject(serviceRequest); var requestBytes = Encoding.UTF8.GetBytes(jsonizedServiceRequest); var requestStream = new MemoryStream(requestBytes); var ms = requestStream.ToArray(); var responseBytes = serviceClient.UploadData("Url_goes_here", "POST", ms); var jsonizedServiceResponse = Encoding.UTF8.GetString(responseBytes); var authResult = JsonConvert.DeserializeObject&lt;AuthenticateResponse&gt;(jsonizedServiceResponse); return authResult.AuthenticateResult; } catch (Exception ex) { return null; } } What I have so far in Javascript is (this returns a Bad Request error): btnTestClick: function () { var header = { Code: 'guid_goes_here', Partner: 'partnerid_goes_here' }; var request = { Username: 'username_goe…

http://stackoverflow.com/a/27322541
accepted answer of: http://stackoverflow.com/q/27321512
has comment: http://stackoverflow.com/comment/43104632
type: Answer
answers question: http://stackoverflow.com/q/27321512
score: 0
has body: The code you are using wont work, because you use the same ID for each timer. On a document they need to be unique name when using ID's. A workaround is to have 2 classes (timer and timera) and uppon click you replace the list item with the timer animation and start it. Demo http://jsfiddle.net/furhpjah/ New code $(document).on("click", "li", function () { $(".timer").replaceWith(" 0 "); $(this).replaceWith(" Timer Running "); $("#list").listview("refresh"); runTimer() });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43104827

http://stackoverflow.com/a/27343514
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/27342595
accepted answer of: http://stackoverflow.com/q/27342595
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43142715
type: Answer
has comment: http://stackoverflow.com/comment/43142760
has body: You said : the div surrounding the comments has no styles on it at the moment... That being said, it's obvious why the overlap is occurring, you have not set a width, height and position for the div containing the comments section. In order for that to be fixed, you must define those. That will fix your problem.

http://stackoverflow.com/a/27378196
score: 0
has body: Try the window.onresize event. window.onresize = function ResizeApp() { if(window.innerWidth &lt; 768) { //execute some code } else { //execute some code } }
answers question: http://stackoverflow.com/q/27378103
type: Answer

http://stackoverflow.com/comment/93208496
type: AnswerComment
has text: You'll probably want to modify this, as `$(slider.$slides.get(index))` will return the DOM node of the Slick slide wrapper. Using current doc variables names (for `afterChange` event), I came to this : `jQuery(slick.$slides.get(currentSlide)).find('.your-slide-selector').data('your-data-attr')`.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/27319714

http://stackoverflow.com/comment/43331782
comment on: http://stackoverflow.com/a/27446175
type: Comment
score: 1
has text: @Cerbrus I think it's *micro-optimization*. I've not heard it before. Would love to see links stating so. Honestly
type: AnswerComment

http://stackoverflow.com/comment/43117251
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/27329383
has text: Where your code ??? you should be give a snapshot of your code.

http://stackoverflow.com/comment/43346058
has text: Your requirements are unclear, please add concret examples of original strings and expected results.
comment on: http://stackoverflow.com/q/27453622
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/a/27471926
has comment: http://stackoverflow.com/comment/43378541
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27471734
score: 0
answers question: http://stackoverflow.com/q/27471734
has body: I think what you are looking for is: ^[^,]+(?:,[^,]+)+$
type: Answer
has comment: http://stackoverflow.com/comment/43378504

http://stackoverflow.com/comment/43410723
type: Comment
score: 0
comment on: http://stackoverflow.com/a/27473671
type: AnswerComment
has text: Yeah I am going to go with zepto since it is lighter than jQuery and has the same interface. I am trying to reduce the number of surfaces as much as possible and where I can so I drop the complexity.

http://stackoverflow.com/a/27439811
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/27439608
has body: use something like this :- $(function() { function clickEvent(){ $(".box:not(:first-child)").off("click"); $(".box:not(:first-child)").on("click",function() { console.log('here') $(this).addClass("fade-out"); $(".primary").removeClass("primary"); setTimeout(function() { $("body").addClass("allmove"); }, 1000); setTimeout(function() { $("body").prepend(" new "); clickEvent(); }, 1500); setTimeout(function() { $("div[class*='fade-out']").remove(); }, 1500); setTimeout(function() { $("body").removeClass("allmove"); }, 1500); setTimeout(function() { $("[class*='primaryfade']").removeClass("primaryfade") }, 2000); }); } clickEvent() }); here is the link http://jsfiddle.net/q6rtgh79/5/
upvote count: 1
type: Answer

http://stackoverflow.com/comment/43278090
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27416932
has text: have you check if the name of the tag p is name1 after rendering
score: 0

http://stackoverflow.com/comment/43135657
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27330512
score: 0
has text: i want to sum derp´s inputs automatically after cantidad and promedio procedure

http://stackoverflow.com/a/27418852
type: Answer
has body: If you made any effort like doing a Google search, you should have found this: &lt;?php /* start the output buffer */ ob_start('compress_page'); /* xhtml code below */ ?&gt; &lt;!-- all xhtml content here --&gt; &lt;?php /* end the buffer, echo the page content */ ob_end_flush(); /* function that gets rid of tabs, line breaks, and extra spaces */ function compress_page($buffer) { $search = array('/&gt;[^S ]+/s', '/[^S ]+&lt;/s', '/(s)+/s'); $replace = array('&gt;', '&lt;', '1'); return preg_replace($search, $replace, $buffer); } ?&gt; As others have pointed out, you may use a task runner to minify your CSS and JS. Meanwhile, your question is wrongly tagged as it has no relations with JavaScript.
has comment: http://stackoverflow.com/comment/43298205
answers question: http://stackoverflow.com/q/27418647
score: 0
has comment: http://stackoverflow.com/comment/43281885

http://stackoverflow.com/comment/43368208
comment on: http://stackoverflow.com/q/27465490
has text: In that case, you should probably provide an image of the Request data instead of one of the Response preview.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27391343
has title: Kendo Grid filtering using 2 decimal places when DataSource data uses 4 decimals
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27391952
linked to: http://stackoverflow.com/q/30631294
type: Question
tagged with: kendo-datasource
has body: I have a Kendo Grid displaying dollar amounts but the data in the DataSource returns 4 decimal places. The DataSource data looks something like this: { totalDollars: 1513.1548 }, { totalDollars: 158.2903 }, { ... } So to display the number correctly I use the column format... columns: [ { field: 'totalDollars', format: '{0:c2}' }, { ... } ] But now I want to filter this column. If I filter with "Is Equal To" 159.29 it fails. I've made it work using 4 decimals and using column.filterable.ui: columns: [ { field: 'totalDollars', format: '{0:c2}', filterable: { ui: function(e) { element.kendoNumericTextBox({ format: "n4", decimals: 4 }); } } } ] But this doesn't help because the user doesn't know the last 2 decimals. So I need it to only use up to 2 decimals when filtering. Is this possible? JSFiddle here - note that filtering by "Mono Cost" using 7133.03 doesn't work but 7133.0332 does. I'm looking to make 7133.03 work.
tagged with: kendo-grid
tagged with: javascript
tagged with: kendo-ui
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/27391952

http://stackoverflow.com/a/27469251
answers question: http://stackoverflow.com/q/27469192
upvote count: 0
type: Answer
has body: There isn't a canonical definition of the word 'sandbox' in this context which is why you couldn't find one by searching. In this case a sandbox probably means setting up a local webserver on your laptop/desktop so you can start playing with building your own sites; plenty of tutorials on this process exist. It can also in the context of javascript refer to the mediator/facade pattern in the three-tier architecture popularized by Nicholas Zakas.
downvote count: 1
score: -1

http://stackoverflow.com/q/27406763
tagged with: css
has comment: http://stackoverflow.com/comment/43260350
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43258242
downvote count: 0
has title: Apply same id on different objects and animate them separately (jQuery)
has answer: http://stackoverflow.com/a/27406865
accepted answer: http://stackoverflow.com/a/27406865
type: Question
has body: Let's say I have a row of divs like here: jsfiddle.net/AlphaCrack/veuc80he/1/ I wan't to animate them separately but keeping the same id because I may have to create tons of divs like those and I don't wan't to create tons of css ids. As you can see applying the same id on multiple elements will affect only the first one. Why? What can I do to animate them separately with the same id. The HTML: &lt;div id="TEST"&gt; &lt;/div&gt; &lt;div id="TEST"&gt; &lt;/div&gt; &lt;div id="TEST"&gt; &lt;/div&gt; &lt;div id="TEST"&gt; &lt;/div&gt; The CSS: #TEST { width: 100px; height: 100px; background-color: #252525; border: 1px solid #AAFF00; float: left; } The jQuery: $("#TEST").mouseenter(function(){ $("#TEST").stop(); $("#TEST").animate({"height":"200px"},200); }); $("#TEST").mouseleave(function(){ $("#TEST").stop(); $("#TEST").animate({"height":"100px"},200); }); Actually I have tons of animating frames (with same id) holding each of my images from my database. And I need to animate each frame separately when I hover the picture.
tagged with: jquery-animate
has comment: http://stackoverflow.com/comment/43258152
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 3
possible better answer: http://stackoverflow.com/a/27406878
has answer: http://stackoverflow.com/a/27406878
favorite count: 0
has answer: http://stackoverflow.com/a/27406886
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/27386735
has body: Are you trying to get promise data?, I don't know much about firebase, let's try this. You have $q but not being used. If this throw error, it has to do with the service provider. function providerReference(){ var deferred = $q.defer(), providerRef = new Firebase(FBURL).child('providers'); providerRef.then(function(d) { var fireProvider = $firebase(d).$asArray(); deferred.resolve(fireProvider); }, function(err) { console.log('error') }); return deferred.promise } return { childAdded: function() { return providerReference(); } } In main.js $scope.providers = []; ProviderService.childAdded().then(function(addedChild) { $scope.providers.push(addedChild); })
type: Answer
answers question: http://stackoverflow.com/q/27383940
score: 0

http://stackoverflow.com/comment/43384148
comment on: http://stackoverflow.com/q/27469726
score: 0
type: Comment
type: QuestionComment
has text: Aw, the code should have had idx for phone number, that was a mistake. But that does not solve the problem. I can get the idx for phone number, but then I can't get the idx for contact was well. If you look at the removePhone function and assume I return idx for phone then you can see that there is no way to also get the idx for contact at the same time.

http://stackoverflow.com/comment/43153484
comment on: http://stackoverflow.com/q/27349460
score: 0
type: Comment
type: QuestionComment
has text: try to add # to your selector `$("#account_year_Of_Birth")`

http://stackoverflow.com/q/27432271
accepted answer: http://stackoverflow.com/a/27432481
tagged with: controller
has comment: http://stackoverflow.com/comment/43305802
answer count: 1
tagged with: angularjs
tagged with: factory
tagged with: dynamic
score: 0
has comment: http://stackoverflow.com/comment/43305998
type: Question
type: AnsweredQuestion
has title: How to dynamically change data between controllers in AngularJS
has answer: http://stackoverflow.com/a/27432481
tagged with: javascript
has body: I have a factory on my script which returns an empty array. I want to be able to access this array from two different controllers and modify its data, like insert an object or a string. 'use strict'; var app = angular.module('invoiceApp'); app.factory('InvoiceFactory',[function() { return { invoices: [] }; }]); app.controller('MainCtrl',['$scope','InvoiceFactory', function ($scope, $http, socket, InvoiceFactory) { $scope.applyUnpaidFilter = function() { //filter invoices by unpaid } $scope.applyAllFilter = function() { //filter invoices by all } }]) .controller('InsertInvoiceController', function($scope, $modal) { var modalInstance; $scope.insertInvoice = function() { modalInstance = $modal.open({ templateUrl: 'modals/InsertInvoice.html', controller: 'InvoiceModalController' }); }; }) .controller('InvoiceModalController', ['$scope','$modalInstance','InvoiceFactory', function($scope, $modalInstance, InvoiceFactory) { $scope.ok = function() { InvoiceFactory.invoices = $scope.loadInvoices(); $modalInstance.close('closing dialog'); }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; $scope.loadInvoices = function() { var xlf = document.getElementById('xlf'); handleSpreadsheet(xlf); var results = []; function handleSpreadsheet(e) { var files = e.files; var i, f; for(i = 0, f=files[i]; i != files.length; i++) { var reader = new FileReader(); reader.onload = function(e) { var data = e.target.result; var wb; wb = XLSX.read(data, {type:'binary'}); to_json(wb); }; reader.readAsArrayBuffer(f); } } function to_json(workbook) { var result = {}; workbook.SheetNames.forEach(function(sheetName) { var roa = XLSX.utils.sheet_to_row_object_array(workbook.Sheets[sheetName]); if(roa.length &gt; 0) { result = roa; } }); results = result; } function fixdata(data) { var o="", l=0, w=10240; for(; l&lt;data.byteLength/w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l*w, l*w+w))); o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l*w))); re…

http://stackoverflow.com/comment/43294980
comment on: http://stackoverflow.com/a/27426292
type: AnswerComment
type: Comment
has text: Happens to the best. I make Paddy's words my own ... not sure what you mean with that new request ... can you rephrase?
score: 0

http://stackoverflow.com/q/27344626
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43144522
downvote count: 1
accepted answer: http://stackoverflow.com/a/27344651
type: Question
has title: How to prevent people from sharing your images once downloaded?
has body: Me and a friends are going to start up a website where we sell images for educational purposes. However, as being the website designer and coder, one of the things that bother me is that once a person buy a copy, they can simply upload it for free or give it to their friends once downloaded. Therefore completely shutting down the business and making it pointless to sell in the first place. I was wondering if there was a way to protect these images from being shared or simply being "given out" for free. Of course we could make account from which people could access the images from but that would make one of our feature "offline usage" completely pointless. Is there any other better way to do this? Thanks.
has comment: http://stackoverflow.com/comment/43144628
tagged with: javascript
score: -1
tagged with: image
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/43144937
tagged with: web
linked to: http://stackoverflow.com/q/6926774
favorite count: 0
has answer: http://stackoverflow.com/a/27344651
duplicate of: http://stackoverflow.com/q/6926774
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/43161694
score: 0
type: Comment
has text: If you don't have posisbility to define object before API call, then you should use $watch, because there is not way to have reference to initial array. http://jsfiddle.net/btfu30k2/2/ smth like this.
comment on: http://stackoverflow.com/a/27354163
type: AnswerComment

http://stackoverflow.com/q/27394701
has answer: http://stackoverflow.com/a/27394821
score: 0
answer count: 2
tagged with: javascript
has title: Webpage resets and stops applying CSS
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27394864
tagged with: css
type: UnansweredQuestion
has body: I am producing a webpage for class featuring a build your own story using JavaScript. At the beginning, the user inputs their name and picks their gender (clicks on image representing gender), then I use removeChild to make the gender images disappear and start the story with a fresh page excluding the title. But once the user selects a gender, the CSS I've applied seems to be ignored by the webpage - black background turns white, text centering is ignored. Why is this, and how can I have CSS consistent through the webpage while still doing what I want to do? HTML: var name = prompt("Welcome! To begin, please tell me your name:"); var gender = 0; var maleImage = 0; var femaleImage = 0; var genderPrompt = 0; document.writeln(" Hello " + name + "! Welcome to Design Your Own Story! " + "In this game, you pick how the story goes! Let's begin. Click which gender you are. "); document.writeln(" "); document.writeln(" "); function genderChoice(genderImage) { if (genderImage === 1) { gender = "male"; } else { gender = "female"; } setTimeout(genderReset,250); } function genderReset() { if (gender === "female") { maleImage = document.getElementById("maleImage"); maleImage.parentNode.removeChild(maleImage); } if (gender === "male") { femaleImage = document.getElementById("femaleImage"); femaleImage.parentNode.removeChild(femaleImage); } genderPrompt = document.getElementById("genderPrompt"); genderPrompt.parentNode.removeChild(genderPrompt); document.writeln(" Design Your Own Story "); document.writeln(" Ok, " + name + ", so you're " + gender + "! Let's start our journey... "); setTimeout(leavesHome,1500); } CSS: * { background-color:black; color:white; text-align:center; } img { width:30%; }
type: Question

oauth-2.0
tag name: oauth-2.0
tags question: http://stackoverflow.com/q/27370919
type: Tag
tags question: http://stackoverflow.com/q/27424886

http://stackoverflow.com/q/27400188
has title: Failing conversion of string to int in JavaScript
has comment: http://stackoverflow.com/comment/43249561
has comment: http://stackoverflow.com/comment/43246344
has comment: http://stackoverflow.com/comment/43253755
has comment: http://stackoverflow.com/comment/43246143
has answer: http://stackoverflow.com/a/27419968
tagged with: php
has comment: http://stackoverflow.com/comment/43252811
has body: I am trying to get the input from a 2d php string array and convert the values in arr[i][1] (where i can be treated as a row and 1 as column in matrix) to integer as follows: JavaScript function: var _input = &lt;? php echo json_encode($output); ?&gt; ; //2D String var _sro = []; //string var _src = []; //string var _sru = []; //string var aL = _input.length; for (var i = 0; i &lt; aL; i++) { _sro.push(_input[i][0]); //string _src.push(_input[i][1]); //string _sru.push(_input[i][2]); //string } alert(_src.toString()); //result = 1,1,2,9,6,1,24... alert(typeof(_src).toString()); //res = string var _lb = new Array(); //empty var _dt = new Array(); //empty for (var i = 0; i &lt; aL; i++) { _dt.push(parseInt(_src[i])); //convert to int and push to arr } alert(_dt.toString()); //result = NaN,NaN,NaN,NaN..... alert(typeof(_dt).toString()); //res = string _lb = _sro; The problem I am experiencing is that the end output for each value of _dt is NaN which means that it does not get converted appropriately. To resolve this I have tried following: using parseInt using Number() using the "+" operator using both parseInt and Number() For example: for (var i = 0; i &lt; aL; i++) { _dt.push(Number(parseInt(_src[i]))); //convert to int and push to arr } and all these have failed. I am really lost and I have ran out of ideas after 2 days of googling and maybe someone in their wisdom will be able to help for which thank you in advance. EDIT: PHP Function: the below function generates the PHP array passed through to JS: //set error reporting error_reporting(E_ALL &amp; ~E_NOTICE); //set variables $result = array(); $output = array(); //read in csv file foreach(file("1OnScreen.csv") as $key =&gt; $str) { if ($key == 0) continue; // skip first line $values = str_getcsv($str, "\t", '', ''); $result[] = $values; } $output = $result; CSV DATA The CSV File contains following data and the delimiter is \t: Owner Count Unassigned Other AA1 1 0 1 AD 1 0 1 AR 2 0 2 BW 9 0 9 CM 6 0 6 CT 1 0 1 DB …
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43251745
has comment: http://stackoverflow.com/comment/43246091
score: 0
type: Question
linked to: http://stackoverflow.com/q/6555182
accepted answer: http://stackoverflow.com/a/27419968
linked to: http://stackoverflow.com/q/1667921
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/43246022
tagged with: type-conversion
linked to: http://stackoverflow.com/q/4090518
tagged with: http://stackoverflow.com/tag/csv
linked to: http://stackoverflow.com/q/15914282
answer count: 1

http://stackoverflow.com/q/27393198
type: Question
accepted answer: http://stackoverflow.com/a/27393432
score: 3
has body: I'm going to create an adserver by myself like google adsense. But I need to know few things to plan my project. I searched in many ways with google but I couldn't find clearly explained things that I need to know. I search in Stackoverflow but the results didn't explained me a much. So don't misunderstand this as a duplicate and don't misunderstand about me as I may not researched much(Because I tried it before post this). This is a sample google ad code &lt;– Begin Google Adsense code –&gt; &lt;script type=”text/javascript”&gt; google_ad_client = “ad-client-code-goes-here”; google_ad_slot = “ad-slot-code-goes-here”; google_ad_width = 300; google_ad_height = 250; &lt;/script&gt; &lt;script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”&gt; &lt;/script&gt; &lt;– End Google Adsense code –&gt; How do I generate ad codes like above, like google do ? (I mean just simple javascript codes to implement) How do I use javascript to serve ads when users use codes like above ? How do I connect php with javascript on this scenario ? I mean the source of the above code is just show_ads.js a javascript file. But I have to serve ads using php. (Because I don't think java will get ad details from database and create the ad content and send it without using php.) So how do I deal with that ? (If anyone can provide simple javascript and php codes to explain this case I would be thankful. Because I need to know how these things done with codes in php and javascript)
tagged with: advertisement-server
upvote count: 4
answer count: 1
tagged with: javascript
has title: How do I generate Ad blocks with Javascript and PHP for my own Ad Network
favorite count: 0
has answer: http://stackoverflow.com/a/27393432
tagged with: ads
type: AnsweredQuestion
tagged with: php
downvote count: 1

http://stackoverflow.com/a/27465073
score: 2
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27465054
type: Answer
answers question: http://stackoverflow.com/q/27465054
has comment: http://stackoverflow.com/comment/43367174
has comment: http://stackoverflow.com/comment/43366670
downvote count: 0
has body: Well, Dr. Google can give you lots of links for more information on regular expressions, but in this case you're just replacing either a colon (:) or a slash (/), so you could combine them using the OR (|) grouping: /(:|\/)/

http://stackoverflow.com/q/27428726
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/43299044
tagged with: image
answer count: 1
tagged with: paperjs
favorite count: 0
has body: I am playing around with the nice code from http://paperjs.org/examples/candy-crash/. I want to replace the colors with an image so that instead of showing say a red circle, it should show a circle with an image inside. Here is the snippet I think I need to modify: function Ball(r, p, v) { this.radius = r; this.point = p; this.vector = v; this.maxVec = 15; this.numSegment = Math.floor(r / 3 + 2); this.boundOffset = []; this.boundOffsetBuff = []; this.sidePoints = []; this.path = new Path({ fillColor: { hue: Math.random() * 360, saturation: 1, brightness: 1 }, blendMode: 'screen' }); for (var i = 0; i &lt; this.numSegment; i ++) { this.boundOffset.push(this.radius); this.boundOffsetBuff.push(this.radius); this.path.add(new Point()); this.sidePoints.push(new Point({ angle: 360 / this.numSegment * i, length: 1 })); } } I am reading up on raster as well. But I don't see how to get this code to work with the image. Thanks for any help. If I simply do this.path = new Path(raster) it does not work. It only shows one static image as opposed to all the circles moving around. UPDATE Here is a raster to use var imgUrl ="http://upload.wikimedia.org/wikipedia/commons/1/15/Red_Apple.jpg"; var raster = new Raster(); raster.scale(0.2)
has title: How to add image to Path in PaperJS
upvote count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/27511227
score: 1
tagged with: vector-graphics
has comment: http://stackoverflow.com/comment/43299157
downvote count: 1

http://stackoverflow.com/q/27462245
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43360853
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/27462385
has body: I have a form element like this: &lt;form enctype="multipart/form-data" id="uploadform" method="post" action="upload.php" target="upload_target" onsubmit="startUpload();"&gt; &lt;input id="file" name="file" type="file" class="target"/&gt; The user inputs a file-name - let's say it's "The Beatles - Revolution.mp3". Is there a way I can grab that from the input form element file after they select a file and display it in a DIV?
upvote count: 1
tagged with: css
downvote count: 1
type: AnsweredQuestion
tagged with: forms
type: Question
has title: Retrieve file name from a html file form element using javascript
has answer: http://stackoverflow.com/a/27462385

http://stackoverflow.com/comment/43297629
comment on: http://stackoverflow.com/a/27403180
type: Comment
score: 0
type: AnswerComment
has text: @MathieuLabrieParent You can browse the web without JavaScript. It breaks a lot of functionality, but for anyone attempting to obtain sensitive data that's not really an issue. Since the purpose of this question was to protect sensitive data, and your answer is really not secure at all, I have to downvote. And sidenote, jQuery is not synonymous with JavaScript.

http://stackoverflow.com/a/27368272
has comment: http://stackoverflow.com/comment/43193762
answers question: http://stackoverflow.com/q/27368184
has comment: http://stackoverflow.com/comment/43192488
score: -1
downvote count: 2
upvote count: 1
type: Answer
has body: You can use the same code as in the periodic table of elements. The rectangles there do not touch, so you can get the same effect with circles, virtually by using the same code. Here is the code they have: var vector = new THREE.Vector3(); for ( var i = 0, l = objects.length; i &lt; l; i ++ ) { var phi = Math.acos( -1 + ( 2 * i ) / l ); var theta = Math.sqrt( l * Math.PI ) * phi; var object = new THREE.Object3D(); object.position.x = 800 * Math.cos( theta ) * Math.sin( phi ); object.position.y = 800 * Math.sin( theta ) * Math.sin( phi ); object.position.z = 800 * Math.cos( phi ); vector.copy( object.position ).multiplyScalar( 2 ); object.lookAt( vector ); targets.sphere.push( object ); }

http://stackoverflow.com/comment/43299191
type: Comment
type: QuestionComment
has text: did you want to match this `123453` ? What do you mean by group of repeated characters? How many charcaters are allowed in that group?
comment on: http://stackoverflow.com/q/27428720
score: 0

http://stackoverflow.com/q/27348669
has body: I'm trying to port the following code to use JSON files http://malamas.com/jsuc/jsuc.html Currently i have managed to take the 'unit' and 'factor' parts of this: property[0] = "Acceleration"; unit[0] = new Array("Meter/sq.sec (m/sec^2)", "Foot/sq.sec (ft/sec^2)", "G (g)", "Galileo (gal)", "Inch/sq.sec (in/sec^2)"); factor[0] = new Array(1, .3048, 9.806650, .01, 2.54E-02); and put them into a JSON line: var text = '{"Accelleration": { "unit":"\\"Meter/sq.sec (m/sec^2)\\", \\"Foot/sq.sec (ft/sec^2)\\", \\"G (g)\\", \\"Galileo (gal)\\", \\"Inch/sq.sec (in/sec^2)\\"", "factor":"1, .3048, 9.806650, .01, 2.54E-02"}}' var obj = JSON.parse(text); Which i can have output as a string like this "Meter/sq.sec (m/sec^2)", "Foot/sq.sec (ft/sec^2)", "G (g)", "Galileo (gal)", "Inch/sq.sec (in/sec^2)" but i want to be able to feed it into the top code by doing this: property[0] = "Acceleration"; unit[0] = new Array(obj.Accelleration.unit); factor[0] = new Array(obj.Accelleration.factor); Unfortunately, when i do that, unit[0][0] brings up the same thing; "Meter/sq.sec (m/sec^2)", "Foot/sq.sec (ft/sec^2)", "G (g)", "Galileo (gal)", "Inch/sq.sec (in/sec^2)" How can i make it so it works as an array? Thanks!
has comment: http://stackoverflow.com/comment/43152101
favorite count: 0
has comment: http://stackoverflow.com/comment/43152008
score: -3
has comment: http://stackoverflow.com/comment/43151951
has comment: http://stackoverflow.com/comment/43152029
type: AnsweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/27348735
accepted answer: http://stackoverflow.com/a/27348735
type: Question
has title: Turn string from JSON array into another array in javascript
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/43152051
tagged with: javascript
has comment: http://stackoverflow.com/comment/43151968
upvote count: 0
tagged with: arrays
answer count: 1

http://stackoverflow.com/comment/43302072
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27428552
has text: Thankyou! This saved me much time digging through documentation.
score: 0

http://stackoverflow.com/comment/43298347
score: 0
type: QuestionComment
has text: Someone will ask you a typical question "what have your tried"
type: Comment
comment on: http://stackoverflow.com/q/27428448

http://stackoverflow.com/comment/126073543
has text: still works great in 2022
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/46357985
type: Comment

http://stackoverflow.com/a/27325948
type: Answer
has body: 10k lines of javascript is quite modest considering it must include the functional equivalent to system libraries (libc, etc...) which live as separate files when you execute c++ compiled source - when browsers execute javascript its sandboxed and cannot access such system libs on the target computer (due to security, OS neutrality ...) for instance just do a ldd command on some dynamically linked c/c++ executable to gain an appreciation of what the bulk of those 10k lines of javascript are replacing: ldd /bin/ls linux-vdso.so.1 =&gt; (0x00007fff8c865000) libselinux.so.1 =&gt; /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f7b82854000) libacl.so.1 =&gt; /lib/x86_64-linux-gnu/libacl.so.1 (0x00007f7b8264b000) libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b82285000) libpcre.so.3 =&gt; /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f7b82018000) libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7b81e14000) /lib64/ld-linux-x86-64.so.2 (0x00007f7b82aba000) libattr.so.1 =&gt; /lib/x86_64-linux-gnu/libattr.so.1 (0x00007f7b81c0e000) libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7b819f0000) this might give you more tips on using asm.js and emscripten: https://hacks.mozilla.org/2014/11/porting-to-emscripten/
upvote count: 1
answers question: http://stackoverflow.com/q/27316456
score: 1
downvote count: 0

http://stackoverflow.com/q/27377507
tagged with: jquery-ui
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Blob constructor Safari issue
score: 0
has answer: http://stackoverflow.com/a/27378217
type: UnansweredQuestion
tagged with: css
tagged with: safari
has body: I am using JQuery blob to export the JQuery array to CSV. It is working on every browser except on Safari 5.1.7. Safari browser on Windows 7. I came to Know Blob has compatibility issues with Safari. please let me know if there is any work around to achieve it. Below is the code: var usersCSVData = []; usersCSVData.push('LastName ','FirstName ', 'Login ','City ','State','Location '); var fileName = "UserCSVdata.csv"; var buffer = usersCSVData.join("\n"); var blob = new Blob([buffer], { "type": "text/csv;charset=utf8;" }); if (navigator.msSaveBlob) { // IE 10+ navigator.msSaveBlob(blob, fileName); } else { var link = document.createElement("a"); if (link.download !== undefined) { var url = URL.createObjectURL(blob); link.setAttribute("href", url); link.setAttribute("download", fileName); link.style = "visibility:hidden"; document.body.appendChild(link); link.click(); document.body.removeChild(link); } } I am getting error: "'[object BlobConstructor]' is not a constructor (evaluating 'new Blob([buffer], { "type": "text/csv;charset=utf8;" })')"
type: Question

http://stackoverflow.com/q/27412113
has answer: http://stackoverflow.com/a/27428552
has body: I am using d3.nest to create Hierarchical data from json of the following format: [ { 'account_name':'abc123', 'fiscal_quarter':'q1', 'fiscal_period':'q1p1', 'fiscal_week_period':'q1p1w1', 'total':50.0 }, ...... ] What I need to do is create nested data that has rollups at each level e.g { key:'account_name', total:sum of all values in tree, values:array of children } Is it possible to have non-leaf nodes with values,instead of just child nodes, or as an equivalent case, walk a nested data set and calculate values at each node?
tagged with: d3.js
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/27428552
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has title: How to walk a tree in d3.js
type: Question

http://stackoverflow.com/comment/51612341
comment on: http://stackoverflow.com/q/27326937
score: 0
has text: @donal JavaScript does not support operator overloading, and so relational operators like <, <=, > and >= are actually doing reference comparison. So, if it "works", it is a complete accident and due to the fact its comparing primitive values for these complex objects.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/27345685
has answer: http://stackoverflow.com/a/37412150
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/57800224
score: 2
tagged with: chart.js
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: Force ChartJS to show Doughnut chart with null values
has body: I have a grid with 4 doughtnut charts on each column for different periods of time: last 90 days, last 60 days, last 7 days and today. The problem with today is that it doesn't always show data, especially in the morning. Is there a way to force ChartJS to show the chart even if it doesn't have any data? Here's an example: http://jsfiddle.net/6xV78/219/ var pieData = [ { value: 0, color:"#3F9F3F" }, { value : 0, color : "#222" } ];
favorite count: 0

http://stackoverflow.com/comment/43352372
comment on: http://stackoverflow.com/a/27432559
score: 0
type: Comment
has text: Mac OS X version 10.9.4, but tried it on 10.9.5 as well with the same effects. I guess neither are the latest versions though.
type: AnswerComment

http://stackoverflow.com/comment/43210066
comment on: http://stackoverflow.com/q/27380469
score: 0
type: QuestionComment
type: Comment
has text: Any function with the first character as upper case when invoked is considered to be a new instance. you can just do var noop = function(){} which will give you the same result. Plus, it is considered a bad practice to use Function() directly.

http://stackoverflow.com/comment/43216724
has text: @jabbink I completely forgot about classes so instead of giving the block an id I gave it a classname. This makes every block drop, but I think it might still be better to give them an unique id because later on I'll have trouble with unit collision I guess ( figuring out with what block the ball is colliding ).
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27383696

http://stackoverflow.com/a/27785476
downvote count: 0
type: Answer
has body: The problem is that webDriver is finding more than one element that matches. You have element for finding just one, and element.all for taking an array of elements, then you can use .get() and the index of the element, or first() or last(). You can do, element(by.css('[data-ng-bind-html="feedback.html"]') .element(by.cssContainingText('.btn', 'My account')); If it doesn't work then you might have more than one, if so, you can use, element(by.css('[data-ng-bind-html="feedback.html"]') .all(by.cssContainingText('.btn', 'My account')).first(); But there you will have more than one button in your HTML, webDriver will get only one, another thing, is to use the count() that gives you the length of the array of elements, and you can know how much you have.
upvote count: 9
answers question: http://stackoverflow.com/q/27422295
score: 9

http://stackoverflow.com/comment/43101853
comment on: http://stackoverflow.com/a/27321035
has text: I agree with you, but let's say this were PHP and I had `<?php echo "02021993"; ?>.replace(...)` - even though I have a string in PHP, the rendered JavaScript doesn't get the quotes.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43144328
comment on: http://stackoverflow.com/q/27333745
has text: Another plugin with the option to share on multiple social media, like the "More Options" in Shareholic ,would also be welcome, if the generated code would be easier to align with the other elements. I'm using the Email and G+ share icons too from Shareaholic, but I believe I can use both without the plugin, it's just the other one to share on multiple social networks that it's a must have.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43141865
has text: just saw you use setInterval(); disregard the previous comment
comment on: http://stackoverflow.com/q/27343133
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/27418307
has body: It looks like Firefox holds a reference to the object and when you inspect it you see its modified state in both cases. Next time you can set a breakpoint on that line and watch the variables there. In my experience that is more reliable. When you change the log statements into logging the value instead of the object it will work always like expected. console.log(MyModule.currentPosition.x); MyModule.changePosition(); console.log(MyModule.currentPosition.x); About the module pattern. You implemented it like it should :) This is my no.1 source of javascript patterns. -> Module pattern
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/27418196
downvote count: 0

http://stackoverflow.com/q/27437748
answer count: 1
has body: I am creating a rails application for a taxi booking platform that requires entering a pickup point and a drop point. I have included the following script in my application.html.erb for this purpose within the header tags: &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&amp;libraries=places"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var placeSearch,autocomplete; function initialize() { autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: [ 'geocode' ] }); google.maps.event.addListener(autocomplete, 'place_changed', function() { fillInAddress(); }); autocomplete2 = new google.maps.places.Autocomplete(document.getElementById('autocomplete2'), { types: [ 'geocode' ] }); google.maps.event.addListener(autocomplete2, 'place_changed', function() { fillInAddress(); }); } function fillInAddress() { var place = autocomplete.getPlace(); for (var component in component_form) { document.getElementById(component).value = ""; document.getElementById(component).disabled = false; } for (var j = 0; j &lt; place.address_components.length; j++) { var att = place.address_components[j].types[0]; if (component_form[att]) { var val = place.address_components[j][component_form[att]]; document.getElementById(att).value = val; } } } &lt;/script&gt; I have then used this js as follows in my tag: &lt;div class="field"&gt; &lt;%= label_tag ("Pickup Location: ") %&gt;&lt;br&gt; &lt;%= text_field_tag :pickup_loc, nil, :id =&gt; "autocomplete", :placeholder =&gt; "Enter your pickup location" %&gt; &lt;/div&gt; &lt;div class="field"&gt; &lt;%= label_tag ("Drop Location: ") %&gt;&lt;br&gt; &lt;%= text_field_tag :drop_loc, nil, :id =&gt; "autocomplete2", :placeholder =&gt; "Enter your dropoff location" %&gt; &lt;/div&gt; While the autocomplete feature seems to work, the result of the autocomplete feature seems to be a subset of the results that google maps gives. For ex, when I put "Asian GPR..." as my…
has title: How do I resolve this issue in Google Maps Autocomplete in my Rails app?
type: AnsweredQuestion
tagged with: ruby-on-rails
type: Question
tagged with: autocomplete
has answer: http://stackoverflow.com/a/27515410
accepted answer: http://stackoverflow.com/a/27515410
tagged with: javascript
score: 0
tagged with: ruby-on-rails-4

http://stackoverflow.com/q/27331758
has title: Linux NodeJS global NPM package ":No such file or directory"
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/27332494
favorite count: 0
tagged with: linux
accepted answer: http://stackoverflow.com/a/27332494
has comment: http://stackoverflow.com/comment/43122643
tagged with: node.js
has body: I am using Ubuntu 14.04 and have installed nodejs and npm with: sudo apt-get install nodejs npm Then I made a symlink to enable packages to use the node interpreter (instead of nodejs): sudo ln -s /usr/bin/nodejs /usr/local/bin/node I installed coffee-script (for testing purposes) and my own package, mangarack, with: sudo npm -g install coffee-script mangarack When I run coffee (part of coffee-script), that package will run fine. If I run mangarack, I will get: : No such file or directory. I have the following in my package.json: "bin": { "mangarack": "./bin/mangarack" }, And that file contains: #!/usr/bin/env node require('../lib/cli/index'); I looked at how coffee-script did it and it seems like my require statement is absolutely wrong, so I replaced that with a console.log statement to see if the file would actually run in node. It doesn't. What did I miss or miss-configure to enable Linux-based machines to run this package? Full source code references: npm: https://www.npmjs.org/package/mangarack git: https://github.com/Deathspike/mangarack.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43126015
tagged with: npm
type: Question
upvote count: 5
tagged with: javascript
score: 5

http://stackoverflow.com/comment/43158223
score: 0
type: AnswerComment
has text: Yes you can do it like that as well, in fact it's easier to test that way.
type: Comment
comment on: http://stackoverflow.com/a/27351446

http://stackoverflow.com/comment/43120110
has text: Sir I have tried using javascript but it doesnt work
comment on: http://stackoverflow.com/q/27329536
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43369299
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27466310
has text: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video

http://stackoverflow.com/comment/43316751
comment on: http://stackoverflow.com/a/27438326
type: AnswerComment
type: Comment
has text: Actually, this answer is a perfect example of why it's a bad idea - it could be misinterpreted as unintentional.
score: 3

http://stackoverflow.com/comment/43650501
has text: For those who want to know I use as a scheduler [Hangfire](http://hangfire.io/) which is very easy to implement and very well documented.
comment on: http://stackoverflow.com/a/27415369
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/27473578
tagged with: javascript
has answer: http://stackoverflow.com/a/27492679
accepted answer: http://stackoverflow.com/a/27492679
score: 0
answer count: 1
tagged with: jsp
type: AnsweredQuestion
has body: my graph didn't load up. I try to parse JSON from an JSP page to HTML page with javascript. I don't know what is the problem. This is the details : My HTML Page : Google Chart with jsp Mysql Json My generate JSON from JSP page : [{"glucose":5.5,"xValue":0}, {"glucose":6.2,"xValue":1}, {"glucose":5.8,"xValue":2}, {"glucose":7,"xValue":3}, {"glucose":6,"xValue":4}, {"glucose":7.5,"xValue":5}, {"glucose":6,"xValue":6}, {"glucose":5.5,"xValue":7}, {"glucose":6,"xValue":8}, {"glucose":5.8,"xValue":9}]
has title: JSP JSON with Google Charts - Line Charts
type: Question
tagged with: google-visualization
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/43258061
score: 0
has text: yeah itemNumber is used to get the number of .item elements.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27406239

http://stackoverflow.com/comment/109028109
type: Comment
has text: Embedded JavaScript templating [https://ejs.co](https://ejs.co)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/61627460

http://stackoverflow.com/comment/45347494
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27766104
has text: Thanks. This one has been driving me nuts for hours.

http://stackoverflow.com/q/27410631
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27410938
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27411177
has comment: http://stackoverflow.com/comment/43266196
has comment: http://stackoverflow.com/comment/43266259
tagged with: jquery
has answer: http://stackoverflow.com/a/27411177
has comment: http://stackoverflow.com/comment/43265716
has comment: http://stackoverflow.com/comment/43266377
has comment: http://stackoverflow.com/comment/43265742
has comment: http://stackoverflow.com/comment/43265887
has body: EDIT: Jfiddle: http://jsfiddle.net/d21jgqba/1/ I have some code where I am trying to link a different location but the links do not redirect me but have the correct webpage in the bottom left of the page when I hover over them. All help will be greatly appreciated! I am using a expandable list code I found online but have edited to my own needs, both dont work for linking. The original code is given here: http://jasalguero.com/ledld/development/web/expandable-list/ Here are my edits: The actual link is in the second while loop. php: Courses Expand All Collapse All <?php while($dept = mysqli_fetch_array($result)) { echo" ".$dept['dname']." "; $coursequery = "SELECT * FROM courses WHERE dname='".$dept['dname']."'"; $resultc = mysqli_query($mysqli, $coursequery) or die(mysql_error()); while($course = mysqli_fetch_array($resultc)) { echo " ".$dept['dname']." ".$course['courseNO']." "; } echo " "; } //echo " ".$dept['dname']." ".$course['courseNO']." "; ?> css: /********************/ /* GENERAL SETTINGS */ /********************/ body { background-color: #AAAAAA; font-size: 16px; } #menu { list-style: none; padding: 0; margin: 0; } .clear { clear: both; } /********************/ /* EXPANDABLE LIST */ /********************/ #listContainer { margin-top: 15px; } #expList ul, li { list-style: none; margin: 0; padding: 0; cursor: pointer; pointer-events: none; } #expList p { margin: 0; display: block; } #expList p:hover { background-color: #121212; } #expList li { line-height: 140%; text-indent: 0px; background-position: 1px 8px; padding-left: 20px; background-repeat: no-repeat; } /* Collapsed state for list element */ #expList .collapsed { background-image: url(../img/collapsed.png); } /* Expanded state for list element /* NOTE: This class must be located UNDER the collapsed one */ #expList .expanded { background-image: url(../img/expanded.png); } #expList { clear: both; } .listControl { margin-bottom: 15px; } .listControl a { border: 1px solid #555555; color: #555555; cursor:…
has comment: http://stackoverflow.com/comment/43265764
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
has comment: http://stackoverflow.com/comment/43266032
has comment: http://stackoverflow.com/comment/43266131
has answer: http://stackoverflow.com/a/27410938
score: 0
has answer: http://stackoverflow.com/a/64079809
answer count: 3
has comment: http://stackoverflow.com/comment/43265929
has comment: http://stackoverflow.com/comment/43266015
has title: Php/HTML/css: links not clickable

http://stackoverflow.com/comment/43273147
comment on: http://stackoverflow.com/q/27395741
score: 0
type: QuestionComment
type: Comment
has text: at using hideCol method. I control hide or shoe colums by kind of search. I replace to jqGrid 4.7.0. but still error is occuered in IE8. anyway because IE8 user gettimg smaller, It's little problem.

http://stackoverflow.com/comment/43308747
score: 0
has text: @AndrewDunai I just tried adding `display:table` to the parent, and `display:table-cell` to the items, but that didn't seem to work, can you demonstrate?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/27433746

http://stackoverflow.com/comment/43253986
type: QuestionComment
has text: Can you control the HTML output at beta.sportsdirect.bg? If you can, than you can output different HTML for some GET parameter, for example: `http://beta.sportsdirect.bg/checkout/onepage/?iframed=1`
score: 1
comment on: http://stackoverflow.com/q/27404578
type: Comment

http://stackoverflow.com/a/27326657
score: -1
has comment: http://stackoverflow.com/comment/43113049
has comment: http://stackoverflow.com/comment/43113652
answers question: http://stackoverflow.com/q/27326633
type: Answer
has comment: http://stackoverflow.com/comment/43113431
has body: When you call this.a you are looking for a property in the foo functions prototype. Defining var a = 2 is simply just making a new var called a. What you want to do is inside foo put this.a = 2 and then your console will output properly. Alternativly, if you want to assign the value of a outside the function var foo = new foo(); foo.a = 2; console.log(foo.a); Feel free to ask me questions!
downvote count: 2
upvote count: 1

http://stackoverflow.com/a/27368817
has comment: http://stackoverflow.com/comment/43189840
type: Answer
downvote count: 0
score: 1
has body: Your question does not have an unique solution. Assume line A and B are not parallel, then you can extend them in one direction so that they intersect and you shall find an angle defined by the intersecting point and two end points from line A and B. Find the bisecting line of this angle and every point on this bisecting line will satisfy your criteria. If line A and B are parallel, it will be easy to find another line parallel to line A and B and lie mid-way between them. Every point on this line will meet your criteria as well. If by "meet earliest", you mean the distance from (x5,y5) to lines A and B is minimized, then you can come up an unique solution when lines A and B are not parallel. The unique location for (x5, y5) can be decided in the following ways: 1) find the end point of line A and line B that is closer to the intersecting point. In your example, it will be point (x2,y2) and point (x4,y4) 2) project these two points along the direction perpendicular to the line itself and onto the bisecting line. In your example, project (x2, y2) along the yellow line direction onto the bisecting line. Do the same for point (x4,y4) but along the red line direction. 3) You shall find two projection points from step (2) and whichever point is away from the intersection point of line A and B is the location for (x5, y5). 4) From point (x5, y5), it should be easy for you to compute the perpendicular point on line A and B and compute the distance. When lines A and B are parallel, the solution is still not unique even with the "minimum distance" criterion.
upvote count: 1
answers question: http://stackoverflow.com/q/27357991

http://stackoverflow.com/comment/43337223
type: QuestionComment
type: Comment
has text: Maybe try `req.setAttribute("myArray", Arrays.toString(array));` the last one is using the `String` value of your array, but Java array doesn't override `toString()` from `Object`.
comment on: http://stackoverflow.com/q/27449140
score: 0

http://stackoverflow.com/comment/43251149
comment on: http://stackoverflow.com/q/27403020
type: QuestionComment
type: Comment
score: 0
has text: but i need it fixed, it is some kind of a game width a fixed element on top

http://stackoverflow.com/comment/43393181
type: QuestionComment
comment on: http://stackoverflow.com/q/27443350
has text: It crashes both on WebView and WebView+. Creating a custom launcher to run it solves my problem, the main CocoonJS launcher fails. I've already filed an issue with a simple test case: http://support.ludei.com/hc/communities/public/questions/201555305-Bug-File-input-crashes-on-iPhone-5-iOS8
score: 0
type: Comment

http://stackoverflow.com/comment/43276932
type: Comment
comment on: http://stackoverflow.com/a/27416670
has text: thanks i solved the problem i forgot something very important: $(document).ready(function(){ });
score: 0
type: AnswerComment

http://stackoverflow.com/comment/43286384
comment on: http://stackoverflow.com/a/27421894
score: 0
type: Comment
has text: What are you trying to convey ??
type: AnswerComment

http://stackoverflow.com/comment/43202381
type: QuestionComment
comment on: http://stackoverflow.com/q/27375928
score: 0
has text: Go in view page source and press `ctrl + f` to find out `toggle-view`.You will find that it is in hidden div.So you might not able to see on front end.
type: Comment

http://stackoverflow.com/q/27329403
has comment: http://stackoverflow.com/comment/43117181
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/43117395
has comment: http://stackoverflow.com/comment/43117209
tagged with: angularjs
answer count: 0
has body: $(window).scroll(function() { if($(window).scrollTop() == $(document).height() - $(window).height()) { alert('d'); } }); Is there any wrong with above code? I wish to do an infinite scrolling but stuck in the early phase. No error in my console I wonder why. It's working in pure js, but not in my Angularjs's controller.
type: UnansweredQuestion
has title: scrolling event not triggering Javascript
score: 0
type: Question

http://stackoverflow.com/a/27326005
has comment: http://stackoverflow.com/comment/106490053
type: Answer
has body: It's not clear from your question which part of the code is throwing the error, but the likely culprit is that Moment.js simply delegates to Date.parse for non-ISO-8601 strings: https://github.com/moment/moment/issues/1407 So assuming that you're using Moment to parse user input or another field in an unknown format, or to parse a format that's not ISO-8601, you're going to have to specify the format explicitly to get guaranteed cross-browser behavior. Otherwise you're diving into the vaguaries of cross-browser Date.parse - the only format that works consistently there is ISO-8601.
upvote count: 12
accepted answer of: http://stackoverflow.com/q/27325750
downvote count: 0
answers question: http://stackoverflow.com/q/27325750
score: 12
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/43111742

http://stackoverflow.com/a/27508926
answers question: http://stackoverflow.com/q/27323474
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/27323474
score: 0
upvote count: 1
downvote count: 1
type: Answer
has body: I have the same problem remove legend in your code legend: "Vendas Mensais" Flw manolo

http://stackoverflow.com/a/27383421
has body: If you don't want to use that jquery snippet, and you can't add a class. The only option I can think of is by overriding the styling for :focus. .btn-default:focus { background-color: #fff; border-color: #ccc; } Ideally you would want to use your own class, but that depends on if you are able to add a class to the asp:Button.
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43216410
type: Answer
answers question: http://stackoverflow.com/q/27382950
accepted answer of: http://stackoverflow.com/q/27382950

http://stackoverflow.com/comment/43412625
type: Comment
comment on: http://stackoverflow.com/a/27489153
has text: That looks like it's working in my test area. haha now to see if I can get a GPS signal that's accurate enough to be useful! Thanks!
type: AnswerComment
score: 0

jsp
tags question: http://stackoverflow.com/q/27472292
tags question: http://stackoverflow.com/q/27360407
tags question: http://stackoverflow.com/q/27344005
tags question: http://stackoverflow.com/q/27411645
tags question: http://stackoverflow.com/q/27399612
tags question: http://stackoverflow.com/q/27397326
tags question: http://stackoverflow.com/q/27361907
tags question: http://stackoverflow.com/q/27362489
tags question: http://stackoverflow.com/q/27366011
tags question: http://stackoverflow.com/q/27408906
tags question: http://stackoverflow.com/q/27395598
tags question: http://stackoverflow.com/q/27322250
tags question: http://stackoverflow.com/q/27376681
type: Tag
tags question: http://stackoverflow.com/q/27423605
tags question: http://stackoverflow.com/q/27351628
tags question: http://stackoverflow.com/q/27354167
tags question: http://stackoverflow.com/q/27418140
tags question: http://stackoverflow.com/q/27469179
tags question: http://stackoverflow.com/q/27445258
tags question: http://stackoverflow.com/q/27375102
tags question: http://stackoverflow.com/q/27457663
tags question: http://stackoverflow.com/q/27427981
tags question: http://stackoverflow.com/q/27353001
tags question: http://stackoverflow.com/q/27329536
tags question: http://stackoverflow.com/q/27450924
tags question: http://stackoverflow.com/q/27351205
tag name: jsp
tags question: http://stackoverflow.com/q/27376289
tags question: http://stackoverflow.com/q/27395493
tags question: http://stackoverflow.com/q/27470242
tags question: http://stackoverflow.com/q/27447430
tags question: http://stackoverflow.com/q/27326681
tags question: http://stackoverflow.com/q/27318336
tags question: http://stackoverflow.com/q/27363544
tags question: http://stackoverflow.com/q/27465552
tags question: http://stackoverflow.com/q/27357429
tags question: http://stackoverflow.com/q/27407212
tags question: http://stackoverflow.com/q/27335522
tags question: http://stackoverflow.com/q/27406427
tags question: http://stackoverflow.com/q/27469683
tags question: http://stackoverflow.com/q/27473578
tags question: http://stackoverflow.com/q/27328788
tags question: http://stackoverflow.com/q/27418353
tags question: http://stackoverflow.com/q/27415994
tags question: http://stackoverflow.com/q/27423353

http://stackoverflow.com/comment/43128956
comment on: http://stackoverflow.com/q/27335774
has text: Just to clarify, your requirement is to highlist the link till user navigates. So you want to see the on which he is actually. Case 1 :- user clicks link test.html , it is highligted and then user reachs to test.html. it is back to oridinary. Case 2 :- Once user on page test.html , he wants it to be highligted till he is on test.html
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43138462
type: Comment
comment on: http://stackoverflow.com/a/27338555
has text: The .click is not doing anything for me any ideas? the data is there as I can see it when I take out the .hidden CSS class. Your help is greatly appreciated BTW.
type: AnswerComment
score: 0

http://stackoverflow.com/q/27407645
has comment: http://stackoverflow.com/comment/43260202
tagged with: position
has title: How to remember a position in a texarea?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27408112
type: Question
has comment: http://stackoverflow.com/comment/43260301
has body: I just want to remember always the last position in a textarea, but I fail always. I've got this code: //This function catch the position (function ($, undefined) { $.fn.getCursorPosition = function() { var el = $(this).get(0); var pos = 0; if('selectionStart' in el) { pos = el.selectionStart; } else if('selection' in document) { el.focus(); var Sel = document.selection.createRange(); var SelLength = document.selection.createRange().text.length; Sel.moveStart('character', -el.value.length); pos = Sel.text.length - SelLength; } return pos; } })(jQuery); //Insert the text by clicking an icon function insertar(texto) { var div = $('textarea'); var text = div.val(); var pos = div.getCursorPosition(); text = text.substring(0,pos) + " " + texto + text.substring(pos); div.val(text); } $('#icon').click(function(evt){ insertar(':icon:'); }); Well, if I write this: "hello hello" And I want to add this with the function: "hi hi hello hello" It give me this: "hi hello hello hi." I think the second time I execute the function, this forget the position and add the text at the end of the text. PD: I'm adding text clicking on an image. I'm trying to do a quick reply fieldset for a forum. Anyone knows where the problem is? Here is my demo where you can see it: http://jsfiddle.net/ko295zpw/6/
tagged with: textarea
tagged with: javascript
has comment: http://stackoverflow.com/comment/43260118
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/27408112
answer count: 1

callback
tags question: http://stackoverflow.com/q/27337485
tags question: http://stackoverflow.com/q/27392079
tag name: callback
tags question: http://stackoverflow.com/q/27391442
tags question: http://stackoverflow.com/q/27333122
tags question: http://stackoverflow.com/q/27369453
tags question: http://stackoverflow.com/q/27373771
tags question: http://stackoverflow.com/q/27393206
tags question: http://stackoverflow.com/q/27376166
tags question: http://stackoverflow.com/q/27440437
tags question: http://stackoverflow.com/q/27425003
tags question: http://stackoverflow.com/q/27432517
tags question: http://stackoverflow.com/q/27391682
tags question: http://stackoverflow.com/q/27386900
tags question: http://stackoverflow.com/q/27451196
tags question: http://stackoverflow.com/q/27331308
type: Tag
tags question: http://stackoverflow.com/q/27364891
tags question: http://stackoverflow.com/q/27340843

http://stackoverflow.com/q/27410372
type: AnsweredQuestion
has body: I'm working on an application that authenticates users using 3rd party services (Facebook, Google, etc.). I give each user an internal id (uuid v4) which is associated with their 3rd party ids. Right now, my (mongoose) user document model looks something like this: var user = new mongoose.Schema({ uuid: {type: String, required: true, unique: true, index: true, alias: 'userId'}, fbid: {type: String, required: false, index: true, alias: 'facebookId'}, gid: {type: String, required: false, index: true, alias: 'googleId'} }); Because I can query on any IDs, I need indexes on all of them. I'm thinking that this can become an issue with a large amount of users (or if I add more 3rd party logins (Twitter, LinkedIn, etc.). Now, my question is whether this is the correct way to do this, or if there is a better solution. One idea I had is having multiple collections, one per ID type. Something like this: var user = new mongoose.Schema({ uuid: {type: String, required: true, unique: true, index: true, alias: 'userId'}, }); var facebookUser = new mongoose.Schema({ fbid: {type: String, required: false, index: true, alias: 'facebookId'}, userId: {type: Schema.Types.ObjectId, ref: 'user'} }); This has the advantage of not cluttering the user model and easier sharding, however it means more queries to retrieve a user and even more to create a new user (1. check in facebookUser collection if a user exists, if not, create a new user, save it, then create a new facebookUser with a link towards that new user and then save that). Which way is "better" (scales well, handles load, etc.)?
type: Question
tagged with: mongodb
answer count: 1
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/27410652
score: 0
has title: Which is better in MongoDB: multiple indexes or multiple collections
accepted answer: http://stackoverflow.com/a/27410652
tagged with: node.js

http://stackoverflow.com/comment/49458183
comment on: http://stackoverflow.com/a/27431853
type: AnswerComment
has text: A good follow up on what your options are: http://stackoverflow.com/questions/30603872/how-can-i-avoid-cors-restriction-for-web-audio-api
score: 0
type: Comment

http://stackoverflow.com/q/27377356
has comment: http://stackoverflow.com/comment/43205016
has answer: http://stackoverflow.com/a/27377401
has title: Show alert when I get null record using if/else statement
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43207818
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27377494
has body: If record has null value then it must show alert message, code not working. Please consider the following code: function DiseasesByName() { var dsName = $('#dsName').val(); $.getJSON('http://54.148.253.123/edoctor/HHS_Service/HealthService.svc/DiseasesByName', { diseaseName: dsName }, function(data) { var tasks = $.parseJSON(data.d); $("#DiseasesList").empty(); $.each(tasks, function(key, value) { if (data.d != 'null') { $(' ' + value.diseaseName + ' Detail:' + value.description + ' ').appendTo('#DiseasesList'); // refreshing collapsible created dynamically "its necessary to refresh for a jQuery look and feel" $('div[data-role=collapsible]').collapsible({ theme: 'b', refresh: true }); } else { alert('No record Found'); } $("#clear").click(function() { $("#DiseasesList").empty(); $("#dsName").val(''); }); }); }); }
accepted answer: http://stackoverflow.com/a/27377494
possible better answer: http://stackoverflow.com/a/27377401

http://stackoverflow.com/comment/43183711
type: AnswerComment
has text: this als works, thanks for your effort!
comment on: http://stackoverflow.com/a/27365717
type: Comment
score: 0

http://stackoverflow.com/a/27416737
answers question: http://stackoverflow.com/q/27411022
type: Answer
has body: You forgot to isset your $_POST['activity'].
score: 0

http://stackoverflow.com/comment/43377428
comment on: http://stackoverflow.com/a/27471337
score: 0
type: AnswerComment
has text: can I use an attribute instead of a class ?
type: Comment

drop-down-menu
tags question: http://stackoverflow.com/q/27353463
tags question: http://stackoverflow.com/q/27397295
tags question: http://stackoverflow.com/q/27439421
tags question: http://stackoverflow.com/q/27415228
tags question: http://stackoverflow.com/q/27441135
tags question: http://stackoverflow.com/q/27319574
tags question: http://stackoverflow.com/q/27453722
type: Tag
tags question: http://stackoverflow.com/q/27472753
tags question: http://stackoverflow.com/q/27453768
tag name: drop-down-menu
tags question: http://stackoverflow.com/q/27387222
tags question: http://stackoverflow.com/q/27386840
tags question: http://stackoverflow.com/q/27321527
tags question: http://stackoverflow.com/q/27447430
tags question: http://stackoverflow.com/q/27376918
tags question: http://stackoverflow.com/q/27384851
tags question: http://stackoverflow.com/q/27322008
tags question: http://stackoverflow.com/q/27416744
tags question: http://stackoverflow.com/q/27333587
tags question: http://stackoverflow.com/q/27395663
tags question: http://stackoverflow.com/q/27379388
tags question: http://stackoverflow.com/q/27377969

http://stackoverflow.com/comment/43304980
comment on: http://stackoverflow.com/q/27429909
has text: @TimothyStrimple As you expect, the build is run as `bamboo` and owner:group are `bamboo:bamboo`. `nodejs` was installed using `apt-get`, but using the chris-lea ppa. I will try re-installing node and see how it goes. Thanks for taking the time to test in a VM!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/43320800
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27440568
has text: Please use `===` instead of `==`. Better yet, `if(!levels[value])`

http://stackoverflow.com/comment/43350537
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27456524
has text: i need to change it on either in the keypress or in text change event. is it possible?
type: Comment

http://stackoverflow.com/comment/51410874
type: AnswerComment
comment on: http://stackoverflow.com/a/27317324
type: Comment
has text: how do you look up these names?
score: 1

http://stackoverflow.com/q/27319781
score: 2
accepted answer: http://stackoverflow.com/a/27320009
upvote count: 2
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/44861173
answer count: 2
has answer: http://stackoverflow.com/a/27320009
downvote count: 0
has answer: http://stackoverflow.com/a/27326617
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/28250680
has body: return makeFirstPromise() .then(function(res1) { (...) }) .then(function(res2) { (...) }) .then(function(res3) { // **here I need to access res1** }); I would like to know if there is a best practice when I need to access to a previous promise result in a subsequent function of my promise chain. I see two possible solutions: var r1; return makeFirstPromise() .then(function(res1) { r1 = res1; (...) }) .then(function(res2) { (...) }) .then(function(res3) { console.log(r1); }); or to nest the promises following the first but it visually breaks the chain sequence: return makeFirstPromise() .then(function(res1) { (...) return secondPromise(res2) .then(function(res3) { console.log(res1); }); }); Any idea?
possible better answer: http://stackoverflow.com/a/27326617
has title: Best practice about JavaScript Promise

http://stackoverflow.com/a/27504400
upvote count: 2
type: Answer
has body: Try to remove this line inside datasets: legend: "Vendas Mensais",
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/27323474

http://stackoverflow.com/a/27447119
downvote count: 2
answers question: http://stackoverflow.com/q/27446936
has comment: http://stackoverflow.com/comment/43334441
upvote count: 0
score: -2
has body: To add more divs, you can use .append, for example: $('#container').append(' This is page 3 contents ');
type: Answer
has comment: http://stackoverflow.com/comment/43333696

http://stackoverflow.com/comment/43378721
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27459142
has text: got it! this is absolutely helpful!! so && is the best (or the shortest code) we can do with javascript right?

http://stackoverflow.com/comment/43115395
type: QuestionComment
has text: @MarkReed Do you mean when creating the event storing the timezone offset with the event and using that value when converting it to different timezones?
comment on: http://stackoverflow.com/q/27328233
score: 0
type: Comment

http://stackoverflow.com/a/38746391
has comment: http://stackoverflow.com/comment/115834239
score: 12
upvote count: 12
has body: I had varied success with defining ideal dimensions and trying to force the 'back' camera. $video = document.getElementById('video') //declare ideal values var constraints = { audio: false, video: { width: { ideal: 1280 }, height: { ideal: 1024 }, facingMode: "environment" } }; // enumerate devices and select the first camera (mostly the back one) navigator.mediaDevices.enumerateDevices().then(function(devices) { for (var i = 0; i !== devices.length; ++i) { if (devices[i].kind === 'videoinput') { console.log('Camera found: ', devices[i].label || 'label not found', devices[i].deviceId || 'id no found'); videoConstraints.deviceId = { exact: devices[i].deviceId } } } }); //first up the stream navigator.mediaDevices.getUserMedia(constraints).then(function(stream) { $video.srcObject = stream; // log the real size console.log($video.videoWidth, $video.videoHeight); }).catch(function(err) { console.log(err.name + ': ' + err.message); });
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/27420581

http://stackoverflow.com/comment/43278382
comment on: http://stackoverflow.com/q/27416253
type: Comment
type: QuestionComment
score: 1
has text: You are asking to nest a svg element `<text>` inside another svg element `<path>`. That's not actually possible — only `<g>` tags support that. ` ` is a special case, which enables the tool tip, but nothing actually gets rendered in the SVG. Your other approach is the way to do it. So yes, you'll need to move the labels to where you want them to be. [Here's an example](http://bl.ocks.org/dwtkns/raw/4686432/).

http://stackoverflow.com/comment/43309187
score: 0
type: Comment
type: QuestionComment
has text: Yeah. Use json and give some id key for what you want.
comment on: http://stackoverflow.com/q/27434031

http://stackoverflow.com/q/27358695
has answer: http://stackoverflow.com/a/27378391
type: AnsweredQuestion
tagged with: prototypejs
has title: Observing event after stopObserving
tagged with: internet-explorer-8
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27378391
favorite count: 0
has body: I'm working on a pop-up calendar to enter dates in a form field. This works fine in Firefox, Chrome and Safari, but not in IE8. The code included is the minimum where the problem occurs. Desired functionality is: Clicking on the image, create and display the calendar. Clicking again, remove the calendar. What happens: IE8 shows and removes the div $('calendari') only the first time; after that nothing happens and no error is displayed. HTML &lt;form id="form1" name="form1" method="post" action=""&gt; &lt;div class="refCal"&gt; &lt;input type="text" name="data" id="data" /&gt; &lt;img class="unCal" src="gestio/imatges/16/calendari.png" width="16" height="16" /&gt; &lt;/div&gt; &lt;/form&gt; CSS .refCal {position:relative; display:inline;} /*Container for calendar*/ .unCal {cursor:pointer;} .calendari {position:absolute;width:200px;height:200px;border:1px solid #999;z-index:1000;background-color:#FFC;} JavaScript (with Prototype 1.7.2) window.onload = iniciar; function iniciar() { $$('div.unCal').each(function(el) { Event.observe(el,'click',obreCalendari); }); } function obreCalendari(evt) { calendar = new Calendari(evt); } var Calendari = Class.create({ initialize: function(evt) { obj = Event.element(evt); Event.stopObserving(obj,'click',obreCalendari); Event.observe(obj, 'click', function() { $$('.calendari').invoke('remove'); Event.observe(obj,'click',obreCalendari); }); cnt = new Element('div',{'class':'calendari','id':'calendari'}); // the calendar obj.up('div').insert(cnt); // inserts calendar in container } }) Thank you for your help. Please, don't recommend me JQuery.
upvote count: 1

http://stackoverflow.com/comment/43329654
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27445351
has text: setTimeout is not an appropriate solution for this problem
score: 0

http://stackoverflow.com/a/27457854
accepted answer of: http://stackoverflow.com/q/27457649
type: Answer
answers question: http://stackoverflow.com/q/27457649
type: AcceptedAnswer
score: 0
has body: Took me waaaaaaaay too long to figure out that if you have an ng-if on a div and then have some ng-models (and I'm assuming other directives) the scope changes under that if statement. What does that scope change to? That I don't know. All I know is that I can access my stuff with a $parent call.

http://stackoverflow.com/comment/43381773
type: QuestionComment
has text: Freez, both fiddle and original page.
comment on: http://stackoverflow.com/q/27470217
score: 0
type: Comment

google-app-engine
tag name: google-app-engine
type: Tag
tags question: http://stackoverflow.com/q/27430250
tags question: http://stackoverflow.com/q/27382492
tags question: http://stackoverflow.com/q/27417184
tags question: http://stackoverflow.com/q/27419210
tags question: http://stackoverflow.com/q/27350110

http://stackoverflow.com/q/27471325
tagged with: javascript
linked to: http://stackoverflow.com/q/9796248
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has title: How to find a total sum of radio button values using jQuery/JavaScript?
score: 2
has comment: http://stackoverflow.com/comment/43377427
has answer: http://stackoverflow.com/a/27471869
upvote count: 2
type: Question
has body: I have found following tutorial and applied it to my code How to sum radio button values using either Javascript or jQuery? but it didn't work for me. A user has a choice of a plan and upon his/her wish can download a personalized logo for $49.99. I wanted the price for a logo either $49.99 if yes, or $0.00 if no, to add to the choice of a plan, and have an output of a total price. However, the code in the previous tutorial that I have posted link to had worked, but what am I doing wrong in my code? Fiddle http://jsfiddle.net/1s4gzbys/4/ Would you like to download your company logo? Yes No Checkout Silver Plan $699 Gold Plan $999 Personalized Logo Total .js $(document).ready(function(){ $('input').iCheck({ checkboxClass: 'icheckbox_square-blue', radioClass: 'iradio_square-blue', increaseArea: '20%' // optional }); // $('input').on('ifChecked', function(event){}); function calcprice() { var sum = 0; if(($(".btn-checkbox-choice").is(':checked')) && ($(".btn-checkbox- plan").is(':checked'))).each(function(){ sum += parseInt($(this).val(),10); }); $("output[name=price]").val(sum); } $().ready(function(){ $("#output").change(function(){ calcprice() }); }); });

http://stackoverflow.com/q/27335444
type: Question
has body: Given this JavaScript array: var list = [1,1,1,2,2,2,2] I want to know how I can produce an HTML list below that has each unique item in the array and number of times that they appear in the array. I just want to know the JavaScript to produce the data, I can generate the HTML. 1 is x3 2 is x4 I'm confused about how to achieve this. Basically, similar to shopping cart quantity functionality, but using the array. http://jsfiddle.net/37ab3k00/
has answer: http://stackoverflow.com/a/27335506
has answer: http://stackoverflow.com/a/27335645
has title: JavaScript: Is this possible? using array value to display the quantity
score: 0
upvote count: 1
downvote count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/43127784
has answer: http://stackoverflow.com/a/27335486
linked to: http://stackoverflow.com/q/5667888
answer count: 3
tagged with: arrays
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/27315248
accepted answer of: http://stackoverflow.com/q/27315193
upvote count: 1
answers question: http://stackoverflow.com/q/27315193
has comment: http://stackoverflow.com/comment/43092267
has body: the problem is unactive is a jQuery object not a dom element reference $("img.menu_btn").hover(function() { if ($(this).hasClass('active')) { return; } this.src = this.src.replace('normal', 'hover'); $(this).addClass('hovered'); }, function() { if ($(this).hasClass('active')) { return; } this.src = this.src.replace('hover', 'normal'); $(this).removeClass('hovered'); }); $('img.menu_btn').click(function() { var unactive = $('img.menu_btn').not(this); unactive.attr('src', function(i, src) { return src.replace('active', 'normal') }); unactive.removeClass("active"); $(this).addClass('active'); this.src = this.src.replace('hover', 'active'); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;img class="menu_btn" src="//placehold.it/64X32&amp;text=normal" /&gt; &lt;br/&gt; &lt;img class="menu_btn" src="//placehold.it/64X32&amp;text=normal" /&gt; &lt;br/&gt; &lt;img class="menu_btn" src="//placehold.it/64X32&amp;text=normal" /&gt; &lt;br/&gt; &lt;img class="menu_btn" src="//placehold.it/64X32&amp;text=normal" /&gt; &lt;br/&gt;
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/43096869
comment on: http://stackoverflow.com/a/27318006
has text: No problem at all. Give a shout if you need any more help.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/27362769
has comment: http://stackoverflow.com/comment/43177626
has title: Change the text of textbox through javascript/jquery
type: UnansweredQuestion
downvote count: 3
upvote count: 1
type: Question
tagged with: c#
answer count: 2
score: -2
has answer: http://stackoverflow.com/a/27363036
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/27363187
has body: I want to change the value of textbox through javascript. I have a user control from which I call a js file. There is a textbox in the usercontrol and then in the js file i pass that textbox value. After the button(it is in user control) is clicked, the js file does some operations. After the button is clicked and operations are over, i want to change the value of the textbox. User control a textbox and a button string submitArgs = String.Format("'{0}',tboxTimeMeasured.ClientID); JsSubmitValues.Value = "javascript:SubmitMeasure(" + submitArgs + ");"; Js File: function SubmitMeasure(control_TimeMeasured) { //some operations //and success= true if (success) { alert("Your changes have been saved successfully!"); var datetimeNow = new Date(); control_TimeMeasured.value = datetimeNow.getHours() + ":" + datetimeNow.getMinutes(); } } Here, it goes in the success loop, the control_TimeMeasured is the value of textbox which is passed from a user control to a 'js' file. How can I change the value of control_TimeMeasured ??
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/q/27449067
has answer: http://stackoverflow.com/a/27483989
answer count: 1
has comment: http://stackoverflow.com/comment/43345638
tagged with: jquery
type: UnansweredQuestion
tagged with: css
has body: I'm using highcharts bar chart.The Series is dynamically loaded so there can be sometime only one value and some times 10 values.I can't give a set width.I m having an issue where The datalabels on the top of bar chart is overlapping with each other when there are lot of values. After doing research on internet the closest thing I could find for this issue is on stackflow which is for two or more series Overlap datalabels line chart highcharts Is there any way we can detect the overlap for a single series and adjust the datalabel so it is not overlapping with each other. Thanks for any kind of help
linked to: http://stackoverflow.com/q/22671871
has title: Highcharts bar chart datalabels overlap
type: Question
tagged with: charts
tagged with: highcharts
tagged with: javascript
score: 0

http://stackoverflow.com/comment/131002278
has text: Just one thing: at @fullcalendar/core@^5.6.0 the event is called fc-bg-event.
score: 0
comment on: http://stackoverflow.com/a/28142421
type: AnswerComment
type: Comment

http://stackoverflow.com/q/27336909
score: 1
upvote count: 1
type: AnsweredQuestion
tagged with: javascript
tagged with: google-maps-api-3
type: Question
tagged with: google-maps
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27337027
has comment: http://stackoverflow.com/comment/43130511
has body: So I have a google map with a number of different marker icons available for a user to select via a drop down menu: Select a Country Item I Item II Item III Right now, when the drop down menu is selected, it changes the text of the button via this bit of jquery: $(window).load(function () { $("#location-type-menu li a").click(function () { $("#location-type-menu-button:first-child").text($(this).text()); $("#location-type-menu-button:first-child").val($(this).text()); }); }); but I would also like it to instantly change the icon on the google map. The google map marker is created by, and is initially set as a question mark icon. var customIcons = { ItemI: { icon: 'http://...' }, ItemII: { icon: 'http://...' }, ItemIII: { icon: 'https:...' }, question: { icon: 'https:...' } }; var icon = customIcons['question'] || {}; var marker = new google.maps.Marker({ position: location, icon: icon.icon, map: map, draggable: true }); As the icon variable is only called in when creating a new marker, I suspect changing the icon variable is not the way to do this. I have tried a couple of different things, but have opted not to include them here as I don't think they are along the right path to a solution. I sincerely thank you for any help. It is greatly appreciated!
accepted answer: http://stackoverflow.com/a/27337027
has title: Change google map icon with jQuery drop down menu
has comment: http://stackoverflow.com/comment/43130544

http://stackoverflow.com/q/27343331
has body: Im trying to do two things that i read, but its not working. The statics files dont found. This not working: process.env.PWD = process.cwd() app.set('views', path.join(process.env.PWD, 'public')); And this not working: enter code hereapp.set('views', path.join(__dirname, 'public'));
has answer: http://stackoverflow.com/a/27343366
tagged with: node.js
accepted answer: http://stackoverflow.com/a/27343639
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/27343366
type: Question
tagged with: heroku
tagged with: javascript
score: 4
has title: Deploy Nodejs on Heroku fails serving static files
tagged with: express
upvote count: 4
has answer: http://stackoverflow.com/a/27343639
answer count: 2
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/52271621
type: AnswerComment
has text: A $firebaseArray is an array that has all of the appropriate (child_added, child_changed, child_removed, child_removed) listeners attached to it. You simply bind it to scope and call it a day. AngularFire will handle the rest.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/27391346

http://stackoverflow.com/comment/43199448
score: 0
has text: There is function relative http://nodejs.org/api/path.html#path_path_relative_from_to
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/27373415

http://stackoverflow.com/comment/43237757
type: Comment
has text: Aside: I still think that not making promises the primary async interaction paradigm in node.js was easily the worst design decision they have made. Look at all the boilerplate you need to get that event-based system running... I'm sure it's partly a matter of acclimatization, but I find this kind of approach much less discoverable - everything is disjoint and I can't easily see what results and side-effects emitting an event will have.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/27391740

http://stackoverflow.com/comment/43220946
type: Comment
comment on: http://stackoverflow.com/a/27386212
score: 0
has text: Well I can't help you from here. I can tell you that when a browser loads a DOM tree, simple CSS selectors like the one you are using will work (as evident in my fiddle). If it's not working, you have another issue going on and the DOM tree is not getting parsed properly. Can you right click and "inspect element", copy it's ID, and select it using `document.getElementById("ID_HERE");`
type: AnswerComment

http://stackoverflow.com/a/66483084
type: Answer
answers question: http://stackoverflow.com/q/27415145
score: 4
has body: Even though I joined the party late but I think this will do! var cssRule = "color: rgb(249, 162, 34);" + "font-size: 30px;" + "font-weight: bold;" + "text-shadow: 1px 1px 5px rgb(249, 162, 34);" + "filter: dropshadow(color=rgb(249, 162, 34), offx=1, offy=1);" setTimeout(console.log.bind(console, "%cHello World", cssRule), 0);
upvote count: 4
downvote count: 0

http://stackoverflow.com/a/27396431
has comment: http://stackoverflow.com/comment/43239323
answers question: http://stackoverflow.com/q/27396281
has body: Regex101 [!"#$%&amp;'()*+,\-.\/:;&lt;=&gt;?@[\\\]^_`{|}~ ]+ Description [!"#$%&amp;'()*+,\-.\/:;&lt;=&gt;?@[\\\]^_`{|}~ ]+ match a single character present in the list below Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] !"#$%&amp;'()*+, a single character in the list !"#$%&amp;'()*+, literally (case sensitive) \- matches the character - literally . the literal character . \/ matches the character / literally :;&lt;=&gt;?@[ a single character in the list :;&lt;=&gt;?@[ literally (case sensitive) \\ matches the character \ literally \] matches the character ] literally ^_`{|}~ a single character in the list ^_`{|}~ literally g modifier: global. All matches (don't return on first match) JS alert("h....e l___l^^0".replace(/[!"#$%&amp;'()*+,\-.\/ :;&lt;=&gt;?@[\\\]^_`{|}~]+/g, "-")); Result: h-e-l-l-0
type: Answer
upvote count: 1
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/43239203

http://stackoverflow.com/q/27402095
has body: hi I am working on a tutorial project, for the first part I am trying to make a form that will accept a book ISBN number and then query it's price on the internet. As a starter I made an array of books as sample data, a table to display them and a form to accept the ISBN. At this stage I would just like the form to add the ISBN to the existing array but this is not working. When I submit the form the data is not added to the table but an empty table row is added. So something is happening but somehow not correctly My appfile (function() { var app = angular.module('booksApp', []); app.controller('BooksController', function() { this.queryResults = results; }); app.controller('QueryController', function() { this.queryBook = function(){ this.val = this.isbn; results.push([{ISBN: }]); this.isbn = ''; }; }); var results = [ { name: 'book 1', ISBN: 1234, price: 13.4 }, { name: 'book 2', ISBN: 1234234, price: 32.8 } ]; })(); My html file Please enter ISBN number to be queried: The queried value is {{qry.val}} ISBN Book Name Shop Stock Price {{result.ISBN}} {{result.name}} {{result.shop}} {{result.stock}}
type: Question
has title: Angular array.push() returns empty object
possible better answer: http://stackoverflow.com/a/27403614
has answer: http://stackoverflow.com/a/27403614
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/27402139
accepted answer: http://stackoverflow.com/a/27402139
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/comment/43314058
comment on: http://stackoverflow.com/q/27435891
score: 0
type: Comment
type: QuestionComment
has text: Problem is when you do the document.write after the page load it blows away the data that is there. That means any JS that was on the page is now gone. It is like walking up to a whiteboard and deleting everything. Second what is ".sort()" that is not part of the DOM as you have it.

submit
tags question: http://stackoverflow.com/q/27331993
tags question: http://stackoverflow.com/q/27421105
tags question: http://stackoverflow.com/q/27400870
tag name: submit
tags question: http://stackoverflow.com/q/27360407
type: Tag

http://stackoverflow.com/q/27375125
upvote count: 9
tagged with: pusher
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: websocket
has answer: http://stackoverflow.com/a/27391447
has body: I'm a bit confused on the presence-channels in Pusher's platform, as I'm building a chat application from scratch. Now, I know some of you guys have seen tons of "realtime chat app" topics around, but, I'm looking for a peer-to-peer chat and not the site-wide global thingy. More like a facebook chat, where you can go one-to-one. Now, I've seen an example in PubNub's demos (named Babel) but, that thing is far from what I'm looking for because I've checked the requests in the console and even if it's not shown, the sent messages between other users are shown in my network request logs too because it's being filtered in JS and not server-side and thats not something I want for sure. So, coming back to the subject, I'm aware of the channel / private-channel / presence channel functionality, and I decided to do this: When opening the app, every user subcribes to his private-user_id channel ( creates, if it doesn't exist already ). At the same time ( while opening the app ) user1 subscribes to a presence-global channel where others keep track if friends are online. When others want to send him a message, e.g. user2 to user1, he subscribes to private-1 thereafter javascript will process the events. Now, I know something's wrong with this because.. if user3 would send a message to user1 he'd subscribe to private-user1 so I guess he'll see the events that user2 is triggering when sending messages to user1 too, right ? Or did I get this wrong ? I've read in their docs that presence channel is actually a private channel extension, so I'm thinking now.. why using private channels anymore, and then, how can I notify all my friends I'm online. But then, something else comes up in their docs , telling me that channels provide two important things (among others), from which, first is a way of filtering data and second is a way of controlling access. How am I supposed to "filter data" since there's no link in their docs, or better, what do you have in mind for a one-to-one chat. I'm…
favorite count: 0
has title: Pusher one to one chat structure
score: 9
tagged with: facebook-chat
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27391447
type: Question

http://stackoverflow.com/comment/43209576
has text: im loooking for ajax xcall
type: QuestionComment
comment on: http://stackoverflow.com/q/27379060
type: Comment
score: 0

http://stackoverflow.com/a/27447008
upvote count: 2
has comment: http://stackoverflow.com/comment/43333345
has comment: http://stackoverflow.com/comment/43333278
has comment: http://stackoverflow.com/comment/43333670
downvote count: 0
has comment: http://stackoverflow.com/comment/43333471
has comment: http://stackoverflow.com/comment/43333412
has comment: http://stackoverflow.com/comment/43333061
type: Answer
answers question: http://stackoverflow.com/q/27446936
has body: .toggle() means the div's are toggled between hidden and displayed. I would suggest using .hide() and .show() instead, as this gives you more control about what content you want to display or not. However, the downside is you would need a code that has much more lines to it. Give me a second while I try to make such a thing for you. Currently you can only have 2 divs, because the .toggle() function can only have 2 values, which means a third div will have the same value as another div, causing it to be either visible or hidden while another div is as well. The code provided in this answer by @Rory McCrossan is already working, so I'll stop trying to program it myself: https://stackoverflow.com/a/27447139/4274852
score: 2

http://stackoverflow.com/comment/43352554
score: 0
type: QuestionComment
has text: removing allows for those ng-models to update...whut
type: Comment
comment on: http://stackoverflow.com/q/27457649

http://stackoverflow.com/comment/43238742
has text: And what is the problem?
comment on: http://stackoverflow.com/q/27395573
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/43314283
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/27436274
has text: its not throwing anything back
type: Comment

http://stackoverflow.com/comment/43314015
type: QuestionComment
comment on: http://stackoverflow.com/q/27436680
score: 5
has text: If there is, the original obfuscator isn't very good.
type: Comment

http://stackoverflow.com/q/27419833
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/27420076
tagged with: javascript
has answer: http://stackoverflow.com/a/27420076
has answer: http://stackoverflow.com/a/27420264
tagged with: regex
tagged with: parsing
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/27420264
type: Question
has title: Hashtag RegExp in Javascript breaks links with anchors and HTML entities
tagged with: hashtag
has body: I'm trying to parse hashtags in Javascript (node.js). I have some requirements for these hashtags: they can be written using cyrillic symbols, should not break HTML entities like &amp;#039; and links (https://example.com/hacking#stage3). I've read many examples on this site, but none worked for me: if one feature appears then other breaks. Now I'm stuck with URL filtering: negative lookahead doesn't work as I wish and links are still broken. This is my current regex: (?!#[0-9])#([^#][a-zA-Z\d\u0400-\u04ff]+) I'm testing it here: https://regex101.com/r/gN9fT3/4. It works partially: link is broken. How to fix it? What regex or JS feature I should use?

http://stackoverflow.com/comment/43214611
comment on: http://stackoverflow.com/q/27382686
type: Comment
has text: Can you clarify a little more? A digest processes asyncQueue on scopes and traverses scope to iterate watches. What do you mean by one will trigger a digest and one will not? I set up a fiddle that uses both of these lines within ng-click and both trigger a digest and update property2. http://jsfiddle.net/11j8vpL8/
score: 1
type: QuestionComment

http://stackoverflow.com/comment/43393985
type: Comment
comment on: http://stackoverflow.com/a/27401893
type: AnswerComment
score: 0
has text: Sorry - I don't understand your explanation. If the "end" even isn't emitted then how do I know its done ?

http://stackoverflow.com/q/27347095
score: 0
has title: Angular Js stuck in inserting the array values after sorting
tagged with: angularjs
has body: Hello guys i am stuck in angular js. What i have to do is to show the steps of selectionSort and the code i made is var myApp = angular.module('myApp',[]); var arraymain = []; myApp.controller('myController',function($scope) { $scope.array2 = []; $scope.selectionSort = function(list) { n=list.length; temp2 = list; for(i=0; i&lt;n-1; i++) { //need to do n-2 passes i_min=i; //finding mining index for(j=i+1;j&lt;n;j++){//ith position: elements from i till n-1 candidates if(temp2[j]&lt;temp2[i_min]) i_min=j; //update the index of minimim element } temp=temp2[i]; temp2[i]=temp2[i_min]; temp2[i_min]=temp; alert(temp); //It shows as needed $scope.array2.push(temp2); //Here i am having problem it saves the sorted final array i.e the last every time of loop but i want to save current array on every outer loop execution } return list; $scope.selectionSort([3,2,3,4,5,1,2]); console.log($scope.array2[0]); console.log($scope.array2[1]); console.log($scope.array2[2]); }); Sorry for my bad English.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27347439
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/27433269
downvote count: 0
has answer: http://stackoverflow.com/a/27433315
tagged with: javascript
has answer: http://stackoverflow.com/a/27433526
has comment: http://stackoverflow.com/comment/43308192
has body: I want to be able to get POST form request information that would return the name of corporations that begin with a certain text field. The site I want to do this from is below: http://corp.sec.state.ma.us/corpweb/CorpSearch/CorpSearch.aspx I want to get results for the "Begins with" query. Instead getting back results I get back junk and something that says "Please enable JavaScript to view the page content." from my results. From what I see believe there is possibly one of two problems. 1) I need to enable javascript(if possible) through java 2) I didn't send the request properly and need to change my submit variables If number 1 is the problem what is the best approach for me to take to accomplish my goal?(another language like php, etc). I have been unable to find an easy solution to this problem. If number 2 is the problem what variables do I need to change? The following java code and html below: HttpClient client = new DefaultHttpClient(); HttpPost httpPost = new HttpPost( "http://corp.sec.state.ma.us/corpweb/CorpSearch/CorpSearch.aspx"); httpPost.setHeader("Connection", "keep-alive"); httpPost.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"); httpPost.setHeader("Accept", " text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); httpPost.setHeader("Accept-Language", "en-us,en;q=0.5"); httpPost.setHeader("Host", "mysite.com"); ArrayList<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(); nameValuePair.add(new BasicNameValuePair("ctl00$MainContent$btnSearch" , "")); nameValuePair.add(new BasicNameValuePair("ctl00$MainContent$ddBeginsWithEntityName" , "B")); nameValuePair.add(new BasicNameValuePair("ctl00$MainContent$CorpSearch" , "rdoByEntityName")); nameValuePair.add(new BasicNameValuePair( "ctl00$MainContent$txtEntityName", "google")); httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); HttpResponse response = client.execut…
has title: Running Javascript Form Request within Java
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/27433526
type: AnsweredQuestion
score: 2
tagged with: java
tagged with: post
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/27433315

http://stackoverflow.com/q/27470954
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43376902
score: 1
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/1056728
has comment: http://stackoverflow.com/comment/43376965
upvote count: 1
has title: convert date string to JSON date format
type: Question
accepted answer: http://stackoverflow.com/a/27471124
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/43376825
has body: In my javascript i enter date in below format as string 12.12.2014 I want to convert to JSON date format like below /Date(1358866800000)/ How could i achieve this. I tried below code which converts to JSON format but doesnt work. function convertToJSONDate(strDate){ var dt = new Date(strDate); var newDate = new Date(Date.UTC(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds())); return '/Date(' + newDate.getTime() + ')/'; } When i try to use above function like convertToJSONDate("12.12.2014"), i get date like this '/Date(NaN)/ How could i achieve this?
answer count: 3
possible better answer: http://stackoverflow.com/a/49047819
has comment: http://stackoverflow.com/comment/43376733
has comment: http://stackoverflow.com/comment/43376870
downvote count: 0
has answer: http://stackoverflow.com/a/49047819
has answer: http://stackoverflow.com/a/47052296
favorite count: 0
has answer: http://stackoverflow.com/a/27471124
linked to: http://stackoverflow.com/q/10286204

http://stackoverflow.com/comment/43091336
score: 0
type: AnswerComment
has text: So please specify your problem. Seems you're the only one who understands, what you want.
comment on: http://stackoverflow.com/a/27315615
type: Comment

http://stackoverflow.com/comment/43264263
comment on: http://stackoverflow.com/q/27409812
type: Comment
has text: Thanks, I'll have a look
score: 0
type: QuestionComment

http://stackoverflow.com/q/27460264
has body: I have a geo-location checking mobile application (for route tracking) and I need to be able to specify a custom temporal interval for location updates that can be modified by the user. I am using the watchPosition() function as accuracy is important and getCurrentPosition() does not seem to work very well. However, I still want the user to be able to customize the update interval depending on their preferences. Here is a rough representation of my code so far: http://jsfiddle.net/ppyordanov/taz4g5t0/5/ . html: &lt;div id="result"&gt;&lt;/div&gt; JS: var latitude, longitude, accuracy; function setGeolocation() { var geolocation = window.navigator.geolocation.watchPosition( function ( position ) { latitude = position.coords.latitude; longitude = position.coords.longitude; accuracy = position.coords.accuracy; document.getElementById( 'result' ).innerHTML += 'lat: ' + latitude + ', ' + 'lng: ' + longitude + ', ' + 'accuracy: ' + accuracy + '&lt;br /&gt;'; }, function () { /*error*/ }, { maximumAge: 250, enableHighAccuracy: true } ); }; setGeolocation(); window.setTimeout( function () { setGeolocation(); }, 30000 //check every 30 seconds ); I can use setTimeout() to manipulate the time interval, but it does not seem to have any effect on the output. It keeps updating about once every second. How can I increase that to 30 seconds?
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28002119
has title: Geo-Location Custom Update Interval (30 seconds)
answer count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28002119
tagged with: geolocation
type: Question
tagged with: navigator
tagged with: javascript

http://stackoverflow.com/q/27356299
tagged with: mediator
has comment: http://stackoverflow.com/comment/43165981
answer count: 3
has answer: http://stackoverflow.com/a/27410307
downvote count: 1
has answer: http://stackoverflow.com/a/27481857
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/43165307
has body: So far I have seen many solutions of the problem. The simplest one is, of course, to $emit an event in $rootScope as an event bus e.g. ( https://github.com/btilford/anti-patterns/blob/master/angular/Angular.md ) angular.module('myModule').directive('directiveA', function($rootScope) { return { link : function($scope, $element) { $element.on('click', function(event) { $rootScope.$emit('directiveA:clicked', event); }); } } }); angular.module('myModule').directive('directiveB', function() { return { link : function($scope, $element) { $rootScope.on('directiveA:clicked', function(event) { console.log('received click event from directiveA'); }); } } }); and another one is to declare a service with a mediator or pubsub functionality / an enclosed scope e.g. ( Communicating between a Multiple Controllers and a directive. ) module.factory('MessageService', function() { var MessageService = {}; var listeners = {}; var count = 0; MessageService.registerListener = function(listener) { listeners[count] = listener; count++; return (function(currentCount) { return function() { delete listeners[currentCount]; } })(count); } MessageService.broadcastMessage = function(message) { var keys = Object.keys(listeners); for (var i = 0; i &lt; keys.length; i++) { listeners[keys[i]](message); } } return MessageService; } ); The question are: is there point to use the second one in an angular application? and what are pros and cons of each of those in comparison to each other?
tagged with: publish-subscribe
tagged with: design-patterns
has comment: http://stackoverflow.com/comment/43165275
linked to: http://stackoverflow.com/q/24540039
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28113188
linked to: http://stackoverflow.com/q/22550079
possible better answer: http://stackoverflow.com/a/27410307
type: Question
has comment: http://stackoverflow.com/comment/66887929
has title: global communication in angular module: event bus or mediator pattern/service
score: 10
tagged with: javascript
accepted answer: http://stackoverflow.com/a/27481857
upvote count: 11

http://stackoverflow.com/q/27358371
favorite count: 0
has answer: http://stackoverflow.com/a/27358484
has body: I am using gulp. I want to run 'connect task after the 'build-dev' task has done. Here is what I wrote: gulp.task('dev', [ 'build-dev' ], function() { return gulp.run([ 'connect' ]); }); This causes a warning: gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead. How can I fix it?
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31420081
upvote count: 3
has title: gulp.run() has been deprecated
accepted answer: http://stackoverflow.com/a/27358484
type: Question
score: 3
linked to: http://stackoverflow.com/q/22824546
tagged with: gruntjs
answer count: 3
possible better answer: http://stackoverflow.com/a/35075823
downvote count: 0
has answer: http://stackoverflow.com/a/35075823
tagged with: javascript
tagged with: gulp

http://stackoverflow.com/comment/43230746
has text: http://www.tutorialspark.com/twitterBootstrap/TwitterBootstrap_Collapsible_Accordion.php
type: Comment
comment on: http://stackoverflow.com/q/27391384
score: 0
type: QuestionComment

http://stackoverflow.com/q/27359154
has answer: http://stackoverflow.com/a/27363431
upvote count: 1
type: Question
tagged with: javascript
tagged with: fullcalendar
tagged with: jquery
has title: FullCalendar Dragging Multiple Events
answer count: 1
downvote count: 0
favorite count: 0
has body: I would like to select (via check box) multiple events on the FullCalendar and then move all selected events together to a different date/time. I have gotten as far as placing check boxes inside events. But not sure how to go further. Note that I know about using the id variable which is used for recurring events. I would like to avoid using the id variable if possible and go down the check box route of selecting and moving multiple events. Can someone help me get started on moving the selected events? Thanks EDIT: I've added a non-standard field to the event object called selected which defaults to 0. When the event's checkbox is checked, the selected variable for that event is set to 1.
type: UnansweredQuestion
score: 1

http://stackoverflow.com/comment/43372237
type: QuestionComment
has text: postition isn't a valid css attribute, please add your real code, better if you can provide a JSFiddle, or a SO code snippet
score: 0
type: Comment
comment on: http://stackoverflow.com/q/27468414

http://stackoverflow.com/q/27448926
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/43337055
tagged with: google-chrome
type: Question
has body: I've created a fiddle here: http://jsfiddle.net/2hzd555w/1/ var canvas = $("#container"); canvas.on('click', '.element-buttons button', function(e) { e.preventDefault(); var element = $(this).closest('.element'); var element_order = element.find('input.order'); if ($(this).hasClass("move-element-up")) { var prev = element.prev('.element'); if (prev.length &gt; 0) { var prev_order = prev.find('input.order'); prev_order.val(element_order.val()); element_order.val(parseInt(element_order.val()) - 1); } } else { var next = element.next('.element'); if (next.length &gt; 0) { var next_order = next.find('input.order'); next_order.val(element_order.val()); element_order.val(parseInt(element_order.val()) + 1); } } moveElements(); }); var moveElements = function() { $('.element').sort(function(a, b) { return parseInt($(a).find('input.order').val()) - parseInt($(b).find('input.order').val()); }).detach().appendTo(canvas); } So after you press a couple of up/down buttons to move the divs around, you'll notice the result section will scroll unexpectedly to the top or to another part of the area. Now this only happens on Chrome, it works as it should in Firefox. Any help would be much appreciated, I've been banging my head against the wall for weeks. Note: You may need to click up and down quite a bit (2 minutes in some cases), make sure your scrolled down in the result window as well.
score: 3
has comment: http://stackoverflow.com/comment/43337079
possible better answer: http://stackoverflow.com/a/27449479
has title: Chrome Randomly Scrolls on Javascript Events
tagged with: javascript
upvote count: 3
answer count: 2
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/27449479
has answer: http://stackoverflow.com/a/27449353
accepted answer: http://stackoverflow.com/a/27449353

http://stackoverflow.com/q/27335297
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has body: Here is my page "exchange converter" when I want to change my course from the sale to purchase then click button to buy or sell, the rate of change but of the field where output but the result does not change UAH I want USD EUR RUB UAH Result USD RUB EUR Pleas help me with this trouble,show me where the bug and how to fix it!
has answer: http://stackoverflow.com/a/27335657
accepted answer: http://stackoverflow.com/a/27335657
type: AnsweredQuestion
type: Question
tagged with: javascript
score: -1
has title: why my values are updated after the second click
downvote count: 2

http://stackoverflow.com/q/27374627
tagged with: jsmin
tagged with: javascript
has answer: http://stackoverflow.com/a/27378784
has title: JSMin Errors Out
answer count: 1
tagged with: gulp
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
tagged with: laravel
has body: When running a gulp task below I get the following error message from JSmin: /var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:40 stream.write(str); ^ TypeError: Object function (err) { // Add the error to output options.error += err; } has no method 'write' at fputs (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:40:18) at error (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:89:9) at action (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:218:25) at jsmin (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:352:21) at main (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:368:9) at jsminFn (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.c.index.js:373:12) at jsmin (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/node_modules/jsmin2/lib/jsmin.js:82:3) at Object.Collector.addFile (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/lib/jsmin.sourcemap.js:24:19) at Array.forEach (native) at module.exports (/var/www/html/a/node_modules/gulp-jsmin/node_modules/jsmin-sourcemap/lib/jsmin.sourcemap.js:136:9) /** Gulp Task **/ gulp.task('js', function() { gulp.src('app/assets/javascripts/**/*.js') .pipe(changed('public/assets/javascripts/min')) .pipe(jsmin()) .pipe(rename({suffix: '.min'})) .pipe(gulp.dest('public/assets/javascripts/min')); gulp.src([ 'public/assets/javascripts/min/bootstrap.min.js','public/assets/javascripts/min/jquery.flexslider.min.js','public/assets/javascripts/min/waypoints.min.min.js', 'public/assets/javascripts/min/modernizr.custom.min.js','public/assets/javascripts/min/jquery.stapel.min.js', 'public/…
score: 1
type: Question
downvote count: 0

http://stackoverflow.com/q/27445907
has body: I have a jQuery UI accordion of which I need to urgently change the speed/duration of the animation before the site goes live. $(".faq-accordion &gt; div").accordion({ header: "h4", collapsible: true, active: false, speed: "fast", }); Editing the speed in this line doesn't affect anything. See JSFiddle for full code. The show all/hide all buttons open the accordion at a much faster speed than when they are individually clicked. I need to speed up the animation of the accordion so both are the same speed if possible.
tagged with: jquery-ui
tagged with: jquery-ui-accordion
tagged with: javascript
score: -1
has title: Adjust speed on jQuery UI accordion
has answer: http://stackoverflow.com/a/27445969
answer count: 2
upvote count: 0
tagged with: jquery
favorite count: 0
tagged with: accordion
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27446033
downvote count: 1
type: Question

http://stackoverflow.com/comment/63696395
score: 1
comment on: http://stackoverflow.com/a/29641375
has text: Edited to make explicit the assumption that the short form has no leading/trailing separator, and pointed out this case where it fails. Thanks!
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/43282909
comment on: http://stackoverflow.com/q/27419607
has text: is Angular done with its work when this is called? maybe try something like `settimeout(function () { $(element).selectric(); }, 500);`? The link is the last method for that directive, but you've got the other ng-* attributes to contend with and I'm not sure how that impacts the lifecycle of your directive.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/27424890
has comment: http://stackoverflow.com/comment/43292993
type: Answer
upvote count: 4
has body: It does work, you just don't see it because: Your div doesn't cause anything to reflow It doesn't have a background color or border I've added a border to #burger so you can see it grow and shrink. I've also closed your tag for tidiness. function myBurger() { document.getElementById("burger").classList.toggle('expand'); } #burger { height: 10px; width: 10px; background-color: #fff; top: 10%; left: 10%; position: absolute; transition: height 2s ease, width 2s ease; border: 1px red solid; } #burger.expand { height: 200px; width: 200px; } prova
has comment: http://stackoverflow.com/comment/43292721
accepted answer of: http://stackoverflow.com/q/27424675
answers question: http://stackoverflow.com/q/27424675
downvote count: 0
type: AcceptedAnswer
score: 4

package
tag name: package
type: Tag
tags question: http://stackoverflow.com/q/27425117

http://stackoverflow.com/a/27453050
upvote count: 2
has comment: http://stackoverflow.com/comment/43393213
accepted answer of: http://stackoverflow.com/q/27449724
has body: I was bored so I decided to try to answer this even though I'm not totally sure it's what you're asking. If you mean you just need to run a node script from a node web app and you normally run that script from the terminal, just require your script and run it programmatically. Let's pretend this script you run looks like this: // myscript.js var task = process.argv[2]; if (!task) { console.log('Please provide a task.'); return; } switch (task.toLowerCase()) { case 'task1': console.log('Performed Task 1'); break; case 'task2': console.log('Performed Task 2'); break; default: console.log('Unrecognized task.'); break; } With that you'd normally do something like: $ node myscript task1 Instead you could modify the script to look like this: // Define our task logic as functions attached to exports. // This allows our script to be required by other node apps. exports.task1 = function () { console.log('Performed Task 1'); }; exports.task2 = function () { console.log('Performed Task 2'); }; // If process.argv has more than 2 items then we know // this is running from the terminal and the third item // is the task we want to run :) if (process.argv.length &gt; 2) { var task = process.argv[2]; if (!task) { console.error('Please provide a task.'); return; } // Check the 3rd command line argument. If it matches a // task name, invoke the related task function. if (exports.hasOwnProperty(task)) { exports[task](); } else { console.error('Unrecognized task.'); } } Now you can run it from the terminal the same way: $ node myscript task1 Or you can require it from an application, including a web application: // app.js var taskScript = require('./myscript.js'); taskScript.task1(); taskScript.task2(); Click the animated gif for a larger smoother version. Just remember that if a user invokes your task script from your web app via a button or something, the script will be running on the web server and not the user's local machine. That should be obvious but I thought I'd remind you anyw…
has comment: http://stackoverflow.com/comment/43426889
answers question: http://stackoverflow.com/q/27449724
has comment: http://stackoverflow.com/comment/43393394
has comment: http://stackoverflow.com/comment/43412680
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/43452448
type: Answer
score: 2

http://stackoverflow.com/q/27353700
has comment: http://stackoverflow.com/comment/43160890
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/39001691
tagged with: wysiwyg
type: Question
score: 3
has answer: http://stackoverflow.com/a/27353841
accepted answer: http://stackoverflow.com/a/27353841
upvote count: 3
answer count: 2
tagged with: api
has answer: http://stackoverflow.com/a/39001691
tagged with: textarea
tagged with: javascript
has title: Can we add advanced text editors to a textarea in html page
favorite count: 0
tagged with: tinymce
has body: Advanced text editors seems to provide text editing buttons within a textarea field, which can be similar to the bold, italics, quote and add picture buttons. I'm well aware of how to add text-editors (like wysiwig, tinymce etc.,) within a Content management systems(drupal, joomla), but I'm not sure whether we can add those APIs to our simple html pages that contains a textarea field. Does any one have any clue on how to add those APIs??

http://stackoverflow.com/q/27315224
tagged with: angularjs
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Button functioning properly on Chrome but not on IE
score: -1
downvote count: 1
answer count: 1
tagged with: angularjs-directive
tagged with: internet-explorer
tagged with: javascript
type: UnansweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/27315342
favorite count: 0
has body: I am currently doing a web interface. I am using the Angular framework I have this add file button. Its supposed to only allow one file to be added. This works great on Chrome but not on IE 11. Does anyone knows what might be creating this issue? Code: = 1"> Add file...

http://stackoverflow.com/q/27472625
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/27472733
has comment: http://stackoverflow.com/comment/43379958
possible better answer: http://stackoverflow.com/a/27472726
has answer: http://stackoverflow.com/a/27472726
has comment: http://stackoverflow.com/comment/43380021
has comment: http://stackoverflow.com/comment/43379904
has title: Jquery on mouseenter and onclick
downvote count: 1
has comment: http://stackoverflow.com/comment/43379947
type: AnsweredQuestion
has body: I want to add a class on hover and remove the class from when clicked on a cancel button which is located in submenu Link Submenu Content Cancel
score: -1
has answer: http://stackoverflow.com/a/27472733
type: Question
has answer: http://stackoverflow.com/a/27472810

http://stackoverflow.com/comment/43129534
score: 0
type: Comment
has text: Hey ethan,thanks for answerng!I used your suggestion before the one I use now and it didn't work either.Let me try again and I will tell you!
type: AnswerComment
comment on: http://stackoverflow.com/a/27335978

http://stackoverflow.com/comment/43318879
comment on: http://stackoverflow.com/q/27439384
score: 0
type: Comment
type: QuestionComment
has text: Why not using the example you gave us? You really think it's a waste of time?

http://stackoverflow.com/comment/43302625
type: Comment
has text: @tymeJV Resolved it now. It needed a different attribute call eg: $(obj).buttonMarkup({ icon: "delete" });
comment on: http://stackoverflow.com/a/27410332
type: AnswerComment
score: 0

http://stackoverflow.com/comment/43156657
type: Comment
comment on: http://stackoverflow.com/a/27351153
score: 0
type: AnswerComment
has text: Thanks. Good to know that GAS supports jquery. As I am new to JS ( and affiliates ) a starting point would be great ( my gpogle-fu has yielded no helpful results )

http://stackoverflow.com/comment/43168765
comment on: http://stackoverflow.com/q/27358065
type: Comment
has text: try this `$( "#dashboard_preview" ).html( "<%= j escape_javascript( render "map/map" ) %>" );` just add a `j` in before escape js
score: 0
type: QuestionComment